目前最流行的方法是用linum.el文件,
在网上下载linum.el后将linum.el拷贝到emacs的site-lisp目录下,完成后在用户主目录里新建一个文件,文件名为: .emacs,在.emacs文件里添加如下内容:
(add-to-list 'load-path "/usr/share/emacs/site-lisp") --移动要是共享目录下。
(require 'linum)
(global-linum-mode t)
要下载color-theme6.6.0 增加语法高亮
(add-to-list 'load-path "/usr/share/emacs/site-lisp/color-theme-6.6.0") --移动要是共享目录下。
(require 'color-theme)
emacs窗口命令(emacs真是键盘杀手)
键盘动作 |
命令名称 |
动作 |
C-x 2 files->Split Window |
split-window-verticaly |
上下分隔窗口 |
C-x 3
|
split-window-horitonally |
水平风隔窗口 |
C-x > |
scroll-window-right |
窗口内容右卷 |
C-x < |
scroll-window-left |
窗口内容左卷 |
C-x o |
other-window |
移动到其他窗口(顺时针方向) |
C-x 0 |
delete-window |
删除当前窗口 |
C-x 1 files->One Window |
delete-other-window |
关闭其他所有窗口,只保留当前窗口 |
(无) |
delete-window-on |
删除给定缓冲区的所有窗口 |
C-x ^ |
enlage-window |
加高当前窗口 |
(无) |
shrink-window |
压低当前窗口 |
C-x { |
enlarge-window-horizontally |
加宽当前窗口i |
C-x } |
shrink-window-horizontally |
压窄当前窗口 |
C-x - |
shrink-window-if-larger-than-windows |
如果编辑缓冲区比窗口小,就压缩窗口面积 |
C-x + |
blance-windows |
把所有窗口调整为相同大小 |
ESC C-v |
scroll-other-window |
对其他窗口进行卷屏操作 |
C-x 4 f |
find-file-other-window |
在其他窗口查找并打开文件 |
C-x 4 b |
switch-to-buffer-other-window |
在其他窗口查找编辑缓冲区 |
(无) Tools->Compare->This Window And Next Window |
compare-windows |
对2个编辑缓冲区进行比较,并显示2个缓冲区中第一个不同的地方。 |
键盘动作 |
命令名称 |
动作 |
C-x 2 files->Split Window |
split-window-verticaly |
上下分隔窗口 |
C-x 3
|
split-window-horitonally |
水平风隔窗口 |
C-x > |
scroll-window-right |
窗口内容右卷 |
C-x < |
scroll-window-left |
窗口内容左卷 |
C-x o |
other-window |
移动到其他窗口(顺时针方向) |
C-x 0 |
delete-window |
删除当前窗口 |
C-x 1 files->One Window |
delete-other-window |
关闭其他所有窗口,只保留当前窗口 |
(无) |
delete-window-on |
删除给定缓冲区的所有窗口 |
C-x ^ |
enlage-window |
加高当前窗口 |
(无) |
shrink-window |
压低当前窗口 |
C-x { |
enlarge-window-horizontally |
加宽当前窗口i |
C-x } |
shrink-window-horizontally |
压窄当前窗口 |
C-x - |
shrink-window-if-larger-than-windows |
如果编辑缓冲区比窗口小,就压缩窗口面积 |
C-x + |
blance-windows |
把所有窗口调整为相同大小 |
ESC C-v |
scroll-other-window |
对其他窗口进行卷屏操作 |
C-x 4 f |
find-file-other-window |
在其他窗口查找并打开文件 |
C-x 4 b |
switch-to-buffer-other-window |
在其他窗口查找编辑缓冲区 |
(无) Tools->Compare->This Window And Next Window |
compare-windows |
对2个编辑缓冲区进行比较,并显示2个缓冲区中第一个不同的地方。 |