Linux 板


不曉得各位使用vi 上手的情形如何呢 ? 習不習慣在visual;c mode;alphabetical這幾種模式下轉來轉去呢? 下面是一些有用的參數...還不是很完整啦!! 不過弟覺得有些蠻管用的, 只是沒時間去整理... <這是偷懶的藉口> ^_^"" Vi 文字模式下的使用參考資料 [將它列出來 擺在廁所的牆壁上;當您大不出來的時候;看看它 或許就不用蹲很久了] ... means that something needs to be specified before or after the command, as appropriate. This is normally a cursor movement keys (h,j,k,l,w,b, etc.) or a line number. # (where # is a number) following command n times... : go to ex-mode ) next sentence ( previous sentence } next paragraph { previous paragraph ]] next section [[ previous section 0 beginning of line $ end of line ^ first non-whitespace character + first character of next line - first character of previous line (spacebar) next character (return) next line / search forward ? search backward % find match of current parenthesis, brace, or bracket , reverse direction of last f, F, t, or T ; repeat last f, F, t, or T . repeat last command ` goto mark ' goto beginning of line with mark `` return to previous mark or location before a search '' go to start of line of previous mark or location before search ~ switch case of current character " store in register @ execute command in register ! send next to command, replace output (eg !}fmt passes the current paragraph to the command fmt, and replaces the output with whatever fmt returns.) !! send line to command >> shift paragraph one shiftwidth to the right << shift paragraph one shiftwidth to the left >% shift until matching (, [, or { to the right <% shift until matching (, [, or { to the left a append after the current location A append at the end of the line ^a unused b beginning of previous word B beginning of previous word, ignore punctuation ^b scroll back one screen c change until... C change to end of line ^c ends insert mode, unused in command mode d delete until... D delete to end of line ^d scroll down half a window, moves to previous shiftwidth in insert mode e end of word E end of word, ignore punctuation ^e scroll screen down one line f find... F find backward... ^f scroll forward one screen g unused G ...Goto [defaults to end of file] ^g show status line h left H first line on screen ^h backspace in insert mode, left in command mode i insert before current location I insert before first non-whitespace character on line ^i tab in insert, unused in command j down J join next line with current line ^j down in command, create newline in insert k up K unused ^k unused l right L last line on screen ^l redraw screen m mark position into register M middle of screen ^m carriage return n repeat last search N repeat last search, reverse direction ^n down in command o open line below current O open line above current ^o unused p put below current line P put above current line ^p up in command q unused Q quit and run ex ^q unused r replace current character R replace characters until insert mode is left ^r redraw screen in command mode s substitute S substitute entire line ^s unused t to... T backward to... ^t moves to next shiftwidth. u undo last change U undo changes to current line ^u scroll up half a window v unused V unused ^v unused in command, quotes next character in insert w beginning of next word W beginning of next word, ignore punctuation ^w unused in command, in insert move back to beginning of previous word x delete current character X delete previous character ^x unused y yank... Y yank current line ^y scroll screen up one line z reposition screen around line (Return to top of screen, . to middle, - to bottom) ZZ write and quit ^z unused Command mode input options ( : commands) (Note: 這不是一個正式的使用列表,僅列出常用的) ^_^ :r <file> read <file> into current text :r !<command> read output from command <command> into current text :nr <file> read in at line number :!<file> run command, return :sh goto shell :so <file> read and execute commands from <file> :x write and quit :wq write and quit :l1,l2w <file> write between lines l1 and l2 to <file>. If <file> is not specified, assume current. If l1,l2 not specified, assume entire file (making it :w) :w >> <file> append to <file>. May use line numbers :w! overwrite current file :q quit :q! quit, forget changes :e <file> edit <file> without leaving vi :e! forget changes since last write :n edit next file :e +n <file> edit <file> at line n, if no end, assume end of file :n <files> specify <files> as new list of files to edit :e# edit alternate file (if :e <file> is used, alternate is the original file) :args show files to be edited :rew rewind life of files to top :map m n create a macro (make m do n) :map! m n create an insert mode macro (make m do n) :unmap m destroy macro m :unmap! m destroy insert mode macro m :ab <1> <2> abbreviate - replace <1> with <2> whenever typed as a word :unab <1> unabbreviate <1> :cd <directory> cd to <directory> :set <option> set <option>... set options [設定vi 的環境] The abbreviations in parenthesis may be used. Syntax: :set <option> <param> (If <param> is expected) Multiple options may be specified on one line. :set <option>? displays the value of the <option> :set all displays the value of all the options. For options without a value, set no<option> turns it off. Option: Default: What it does: autoindent (ai) noai Makes new lines automatically indent to the position as the line above or below ai是文字縮排… <back-place>disable autoprint (ap) ap Display changes after each command autowrite (aw) noaw Automatically save file before :n, :! beautify (bf) nobf Ignore all control characters during input (except tab, newline, formfeed) directory= (dir=) /tmp Name of the directory to store buffer edcompatible noedcompatible Use ed-like features on substitute errorbells (eb) errorbells Sound bell on error exrc (ex) noexrc Allow .exrc files outside home dir hardtabs= (ht=) 8 Set boundary for hardware tabs ignore case (ic) noic Ignore case in regex expressions lisp nolisp Turn on lisp mode list nolist Display all tabs, end of lines magic magic Enable more regex expressions mesg mesg Allows mesgs to be sent to terminal number (nu) nonumber Displays line numbers in file open open Allows open and visual optimize (opt) optimize Optimizes throughput of text by not sending carriage returns when printing text paragraphs= (para=) IPLPPPQPPLIbp Sets the delimiters for { & } prompt prompt Command mode input gives : prompt readonly (ro) noro Cannot write unless ! is given redraw noredraw Redraw screen when edits are made remap remap Allows macros that point to other macros report= 5 Report changes if they effect > x lines scroll 1/2 window Amount of screen to scroll when scroll down is received in command mode. Also, number of lines printer by z. (z prints 2*scroll) sections= SHNHH HU Defines end of section for [[ and ]] shell= (sh=) /bin/sh Default shell. Uses SHELL environment, if set shiftwidth= (sw=) 8 Characters to shift when using shift commands showmatch (sm) nosm Show matching {, }, (, ), [, or ] showmode noshowmode Shows which mode you are in. slowopen (slow) Do not update display immediately after insert tabstop= (ts=) 8 Sets tabstop length taglength= (tl=) 0 Number of characters significant for tags (0 means all characters) tags= tag, /usr/lib/tags Define pathname of files containing tags. term= Set the terminal type terse noterse Display shorter error messages timeout (to) timeout Keyboard maps timeout after one second ttytype= Set the terminal type warn warn Display "No write since last change" messages window= (w=) Number of lines in window in visual mode wrapmargin= (wm=) 0 Set the right margin. Greater than 0 will word wrap n spaces from the edge of the screen wrapscan (ws) ws Searches wrap around end of file writeany (wa) nowa Allow saving to any file 先補充一下營養 再奮鬥吧!! RedHat USR  心的存在,只在於人與人的溝通!! Perfect2000.Org -- ☆ [Origin:椰林風情] [From: dns.perfect2000.org] [Login: **] [Post: **]







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草
伺服器連線錯誤,造成您的不便還請多多包涵!
「贊助商連結」






like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:iOS站內搜尋

TOP