?? 11.htm
字號:
goto mark in current file: '{a-z}
goto mark in any file: '{A-Z}
copy region: M-w {visual}y
kill region: C-w {visual}d
Yank and keep buffer: C-y
Yank from kill buffer: M-y p
convert region to Upper: C-x C-u {visual}U
convert region to Lower: C-x C-l {visual}u
Insert special char: C-q octalnum/keystroke
^V decimal/keystroke
replace: M-x replace-string :%s/aaa/bbb/g
replace regexp: M-x replace-regexp :%s/aaa/bbb/g
query replace: M-% :%s/aaa/bbb/gc
query replace: M-x query-replace
query replace regexp: M-x query-replace-regexp
Open file: C-x C-f :r file
Save file: C-x C-s :w
Save all buffers: C-x s :wa
Save as: C-x C-w file :w file
Prompt for buffer: C-x b
List buffers: C-x C-b :buffers
Toggle read-only: C-x C-q :set ro
Prompt and kill buffer: C-x k
Split vertical: C-x 2 :split
Split horizontal: C-x 3 :vsplit (ver. 6)
Move to other window: C-x o ^Wp
Delete this window: C-x 0 :q
Delete other window(s): C-x 1 ^Wo
run shell in bg: M-x compile
kill shell run in bg: M-x kill-compilation
run make: :make Makefile
check error message: C-x` :echo errmsg
run shell and record: M-x shell :!script -a tmp
...clean BS, ... :!col -b <tmp >record
...save/recall shell record: C-x C-w record :r record
run shell: M-! sh :sh
run command: M-! cmd :!cmd
run command and insert: C-u M-! cmd :r!cmd
run filter: M-| file {visual}:w file
run filter and insert: C-u M-| filter {visual}:!filter
show option :se[t] {option}?
reset option to default :se[t] {option}&
reset boolean option :se[t] no{option}
toggle boolean option :se[t] inv{option}
wrap text at column 72 :se tw=72
do not wrap :se tw=0
autoindent :se ai
expand tab :se et
specify comment (mail) :se comments=n:>,n:\|
run GDB M-x gdb
describe GDB mode C-h m
step one line M-s
next line M-n
step one instruction (stepi) M-i
finish current stack frame C-c C-f
continue M-c
up arg frames M-u
down arg frames M-d
copy number from point, insert at the end
C-x &
set break point C-x SPC
</PRE>
<HR>
<A name=s11.3.5></A>
<H3>11.3.5 Vim設置</H3>
<P>要使用Vim的全部功能和關鍵字高亮顯示,請在<CODE>~/.vimrc</CODE>或<CODE>/etc/vimrc</CODE>中添加如下內容: <PRE> set nocompatible
set nopaste
set pastetoggle=<f11>
syn on
</PRE>
<P>粘貼模式能避免自動縮進功能影響在控制臺終端下的剪切-粘貼操作,它更象是“:set noai”。
<P>有關GnuPG整合的信息參閱<A
href="http://qref.sourceforge.net/Debian/reference/ch-gnupg.zh-cn.html#s-vimgpg">在Vim中使用GnuPG,
第 14.4.2 節</A>。
<HR>
<A name=s11.3.6></A>
<H3>11.3.6 Ctags</H3>
<P>執行<SAMP>apt-get install
exuberant-ctags</SAMP>,接著就可以在源代碼文件中運行ctags了。在Vim中輸入<SAMP>:tag
<VAR>function_name</VAR></SAMP>可直接跳到function_name的開始行。它適用于C、C++、Java、Python、和其它許多編輯語言。
<P>Emacs有相同的ctags功能。
<HR>
<A name=s11.3.7></A>
<H3>11.3.7 將高亮顯示的屏顯內容轉化為HTML文件</H3>
<P>在Vim命令模式下輸入<SAMP>so
\$VIMRUNTIME/syntax/2html.vim</SAMP>可以將屏幕上高亮顯示的文本轉化為HTML代碼,然后<SAMP>:w
file.html</SAMP>存盤,<SAMP>:q</SAMP>退出。對C等源代碼特別適用。
<HR>
<A name=s11.3.8></A>
<H3>11.3.8 用<CODE>vim</CODE>分割屏顯</H3>
<P><CODE>vim</CODE>可以在多分割窗口(multi-split-screen )環境下編輯多個文件。想了解有關詳情可輸入<SAMP>:help
usr_08.txt</SAMP>。
<P>要分割屏幕顯示多個不同文件,在vi命令提示符后輸入: <PRE> :split <VAR>another-file</VAR>
:vsplit <VAR>another-file</VAR>
</PRE>
<P>或者在shell提示符后輸入: <PRE> $ vi -o file1.txt file2.txt # 水平分割
$ vi -O file1.txt file2.txt # 垂直分割
</PRE>
<P>就可以打開多窗口vi。 <PRE> $ vimdiff file.txt~ file.txt # 檢查file.txt最近的修改情況
$ vimdiff file.en.sgml file.fr.sgml # 檢查翻譯情況
$ gvimdiff file.txt~ file.txt # 在X下
</PRE>
<P>上述操作可以明確地顯示源始文件與備份文件的差別。對SGML文件,它進行標簽匹配檢查,所以用它來檢查翻譯結果十分有效。
<P>用CTRL-W命令指定光標移動: <PRE> CTRL-W + 擴大窗口
CTRL-W - 縮小窗口
CTRL-W h 移動到窗口左邊
CTRL-W j 移動到窗口下邊
CTRL-W k 移動到窗口上邊
CTRL-W l 移動到窗口右邊
...
</PRE>
<P>下列命令用于滾屏控制: <PRE> :set scrollbind
:set noscrollbind
</PRE>
<HR>
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-gateway.zh-cn.html">上一頁</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/reference.zh-cn.html#contents">目錄</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-preface.zh-cn.html">1</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-system.zh-cn.html">2</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-install.zh-cn.html">3</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-tutorial.zh-cn.html">4</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-woody.zh-cn.html">5</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-package.zh-cn.html">6</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-kernel.zh-cn.html">7</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-tips.zh-cn.html">8</A> ] [
<A href="http://qref.sourceforge.net/Debian/reference/ch-tune.zh-cn.html">9</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-gateway.zh-cn.html">10</A>
] [ 11 ] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-vcs.zh-cn.html">12</A> ] [
<A
href="http://qref.sourceforge.net/Debian/reference/ch-program.zh-cn.html">13</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-gnupg.zh-cn.html">14</A> ]
[ <A
href="http://qref.sourceforge.net/Debian/reference/ch-support.zh-cn.html">15</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ap-appendix.zh-cn.html">A</A>
] [ <A
href="http://qref.sourceforge.net/Debian/reference/ch-vcs.zh-cn.html">下一頁</A> ]
<HR>
<P>Debian 參考手冊
<ADDRESS>CVS, 星期三 四月 28 19:36:38 UTC 2004<BR><BR>Osamu Aoki <CODE><A
href="mailto:osamu@debian.org">osamu@debian.org</A></CODE><BR>Translator: Hao
"Lyoo" Liu <CODE><A
href="mailto:iamlyoo@163.net">iamlyoo@163.net</A></CODE><BR><A
href="http://qref.sourceforge.net/Debian/reference/ap-appendix.zh-cn.html#s-authors">作者,
第 A.1 節</A><BR><BR></ADDRESS>
<HR>
</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -