archlinux下启用virtualbox service

安装好 virtualbox-guest-utils 之后,没有并没有启用 vboxservice, 这个时候如果windows休眠,则archlinux的时间将不会跟host同步,需要启动vboxservice才行。

1
systemctl enable vboxservice.service

重启之后生效,当然也可以直接启动

1
systemctl start vboxservice.service

virtualbox也提供了参数来控制同步,详情见这里

1
VBoxManage guestproperty set “the name of your guest VM” “/VirtualBox/GuestAdd/VBoxService/–timesync-set-threshold” 15000

删除git submodule

git并没有提供删除submodule的方法,只有手动删除。

  1. 删除.gitmodules下submodule的信息
  2. 删除.git/config下submodule的信息
  3. git rm –cache <submodule/path>

archlinux下修改默认中文字体

archlinux中的字体看起来真的很搓,试过ubuntu patch过的版本,还是不尽如人意。后来发现了fontconfig-infinality, 整个世界突然美好了。跟windows下的MacType差不多。

当我将ibus换成fcitx之后,问题又出现了,3.6版本之后的fcitx竟然没有字体设置了,对于字体的控制必须使用fontconfig。这必须的修改默认的中文字体。

让emacs具有mac下的按键绑定

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(setq *true-mac-cut-buffer* "")
(setq *true-mac-cut-buffer2* t)

(setq interprogram-cut-function
      '(lambda (str push)
         (setq *true-mac-cut-buffer* str)
         (setq *true-mac-cut-buffer2* push)))

(setq interprogram-paste-function
      '(lambda () nil))

(defun true-mac-cut-function () (interactive)
  (if mark-active
      (progn 
        (true-mac-copy-function)
        (kill-region (point) (mark)))
    (beep)))
        
(defun true-mac-copy-function () (interactive)
  (if mark-active
      (mac-cut-function 
       *true-mac-cut-buffer*
       *true-mac-cut-buffer2*)
    (beep)))

(defun true-mac-paste-function () (interactive)
  (if mark-active
      (kill-region (point) (mark)))
  (insert (mac-paste-function)))

(global-set-key [?\A-x] 'true-mac-cut-function)
(global-set-key "\S-c" 'true-mac-copy-function)
(global-set-key [?\A-v] 'true-mac-paste-function)

(global-set-key [?\A-a] 'mark-whole-buffer)
(global-set-key [?\A-s] 'save-buffer)
(global-set-key [?\A-S] 'write-file)
(global-set-key [?\A-p] 'ps-print-buffer)
(global-set-key [?\A-o] 'find-file)
(global-set-key [?\A-q] 'save-buffers-kill-emacs)
(global-set-key [?\A-w] 'kill-buffer-and-window)
(global-set-key [?\A-z] 'undo)
(global-set-key [?\A-f] 'isearch-forward)
(global-set-key [?\A-g] 'query-replace)
(global-set-key [?\A-l] 'goto-line)
(global-set-key [?\A-m] 'iconify-frame)
(global-set-key [?\A-n] 'new-frame)