亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

VIM命令集

系統 1851 0
Command Action Notes
vim file +54 open file and go to line 54 any : command can be run using + on command line
vim -O file1 file2 open file1 and file2 side by side ?
Insert enter insert mode so you can start typing. Alternatively one can use? i ?or a .
Esc leave insert mode so you can issue commands. Note in VIM the cursor keys & {Home, End, Page{up,down}} and Delete and Backspace work as expected in any mode, so you don't need to go back to command mode nearly as much as the origonal vi. Note even Ctrl+{left,right} jumps words like most other editors. Note also Ctrl+[ and? Ctrl+c ?are equivalent to Esc and may be easier to type. Also Ctrl+o in insert mode will switch to normal mode for one command only and automatically switch back.
:command runs named command ?
:help word shows help on word Typing Ctrl+d after word shows all entries containing word
:echo &word shows value of word ?
windows
: e set buffer for current window you can optionally specify a new file or existing buffer number (#3 for e.g.). Note if you specify a directory a file browser is started. E.g. :e? . ?will start the browser in the current directory (which can be changed with the :cd command).
: sp new window above ditto
: vs new window to left ditto
: q close current window ?
: qa close all windows add trailing ! to force
Ctrl+w {left,right,up,down} move to window ?
Ctrl+w Ctrl+w toggle window focus ?
Ctrl+w = autosize windows to new terminal size for e.g.
: ba new window for all buffers ":vert ba" tiles windows vertically
buffers
:ls list buffers ?
gf open file under cursor ?
: bd delete buffer and any associated windows
: w save file Note :up[date] only writes file if changes made, but it's more awkward to type
: sav ?filename save file as filename Note :w filename doesn't switch to new file. Subsequent edits/saves happen to existing file
undo/redo
u undo ?
Ctrl+r redo ?
. repeat ?
navigation
gg Goto start of file ?
G Goto end of file ?
:54 Goto line 54 ?
80| Goto column 80 ?
Ctrl+g Show file info including your position in the file
ga Show character info g8 shows UTF8 encoding
Ctrl+e scroll up Ctrl+x needed first for insert mode
Ctrl+y scroll down Ctrl+x needed first for insert mode
zt scroll current line to top of window ?
w Goto next word Note Ctrl+{right} in newer vims (which work also in insert mode)
b Goto previous word Note Ctrl+{left} in newer vims
[{ Goto previous { of current scope ?
% Goto matching #if #else,{},(),[],/* */ must be one on line
zi toggle folds on/off ?
bookmarks
m {a-z} mark position as {a-z} E.g. m a
' {a-z} move to position {a-z} E.g. ' a
' ' move to previous position ?
'0 open previous file handy after starting vim
selection/whitespace
v select visually use cursor keys, home, end etc.
Shift+v line select CTRL+v = column select
Delete cut selection ?
"_x delete selection without updating the clipboard or yank buffer. I remap x to this in my? .vimrc
y copy selection ?
p paste (after cursor) P is paste before cursor
"Ay append selected lines to register a use lowercase a to initialise register
"ap paste contents of a ?
gq reformat selection justifies text and is useful with :set textwidth=70 (80 is default)
= reindent selection very useful to fix indentation for c code
> indent section useful with Shift+v%
< unindent section remember . to repeat and u to undo
:set list! toggle visible whitespace See also listchars in my? .vimrc
clipboard shortcuts
dd cut current line ?
yy copy current line ?
D cut to end of line ?
y$ copy to end of line ?
search/replace
/regexp searches forwards for regexp ? reverses direction
n repeat previous search N reverses direction
* searches forward for word under cursor # reverses direction
:%s/1/2/gc search for regexp 1 and replace with 2 in file c = confirm change
:s/1/2/g search for regexp 1 and replace with 2 in (visual) selection ?
programming
K lookup word under cursor in man pages 2K means lookup in section 2
:make run make in current directory ?
Ctrl+] jump to tag Ctrl+t to jump back levels. I map these to Alt+?? in my? .vimrc
vim -t name Start editing where name is defined ?
Ctrl+{n,p} scroll forward,back through autocompletions for word before cursor uses words in current file (and included files) by default. You can change to a dictionary for e.g: set complete=k/usr/share/dicts/words Note only works in insert mode
Ctrl+x Ctrl+o scroll through language specific completions for text before cursor "Intellisense" for vim (7 & later). :help compl-omni for more info. Useful for python, css, javascript, ctags, ... Note only works in insert mode
external filters
:%!filter put whole file through filter ?
:!filter put (visual) selection through filter ?
:,!command replace current line with command output ?
map <f9> :w<CR>:!python %<CR> run current file with external program ?


(來源: http://www.pixelbeat.org/vim.tips.html

VIM命令集


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日本中文字幕在线观看视频 | 亚洲精品色一区色二区色三区 | 99久久精品免费观看区一 | 国产对白有声小说 | 国偷盗摄自产福利一区在线 | 国产一区二区三区影院 | 亚洲精品乱码国产精品乱码 | 视频一区二区国产无限在线观看 | 日本高清中文字幕一区二区三区 | 一区二区美女视频 | 擼擼色在线看观看免费 | 亚洲精品一区二区三区网址 | julia中文字幕久久亚洲 | 天天拍天天干天天操 | 欧美色大成网站www永久男同 | 欧美视频在线观看 | 欧美成人免费tv在线播放 | 久久中文字幕一区二区 | 亚洲成在人线中文字幕 | 亚洲国产精选 | 日韩欧美视频一区 | 99久久综合狠狠综合久久一区 | 亚洲精品久久久久久久久久久网站 | 久99久精品免费视频热77 | 97在线视频免费公开观看 | 亚洲精品一区二区深夜福利 | 天天操天天插天天干 | 久久亚洲在线 | 国产一区曰韩二区欧美三区 | 亚洲国产品综合人成综合网站 | 黄色成人毛片 | 香蕉视频国产在线观看 | 久久99精品福利久久久 | 国产原创中文字幕 | 91精品国产91久久久久 | 成人牲交一极毛片 | 欧美日韩视频在线播放 | 女bbbbxxxx毛片视频0 | 高清性色生活片久久久 | 在线视频久草 | 老子影院午夜伦手机在线看 |