g + Ctrl-G -- 計算檔案內文字(與byte)數
ggvG -- 全選
/\s -- 代表空白
/\s* -- 代表很多(multiple)空白
:s/{search_for}/{replace_with} -- single search & replace
:%s/{search_for}/{replace_with}/g -- multiple search & replace, "g" for global
:browse confirm saveas ++enc={encode碼} -- save file時指定encode格式
:1,$retab -- 將所有空格盡可能轉換成tab
:1,$retab! -- 將所有tab轉換成space
2007-12-13的vimrc (搭配TabBar plug-in):
set nu
syntax on
set spell
"color koehler " for latex
color evening " else
set cul
set shiftwidth=4
set softtabstop=4
set tabstop=4
set smartindent
set foldcolumn=4
set foldmethod=syntax
set foldenable
set backspace=indent,eol,start
set hlsearch
set lbr
map \ \(\<\w\+\>\) \1
"set wm=4 "wrapmargin
"set tw=72 "textwidth
"set expandtab
set shiftwidth=4
"set cscopetag
"cscope add cscope.out
set lines=30
set columns=110
"PS1. {小於符號}整個replace掉,因為blogspot不能打小/大於符號,只好這麼表示了!
set statusline=%{小於符號}%f%h%m%r%=%b\ 0x%B\ \ %l,%v\ %P
set laststatus=2
set lsp=0 "line space = 0
set hid "允許在save之前switch buffer
"PS2. 以下三行的作用是讓vim開啟檔案之後將utf-8的檔案以big5顯示(就中文字而言)
set encoding=big5
set fileencodings=ascii,ucs-bom,utf-8,ucs-2,ucs-le,sjis,big5,latin1
set termencoding=utf-8
set wrap!
"PS3. 設定存檔格式(utf8 & big5)的熱鍵
map
map
Search Google
Monday, December 10, 2007
vim兩三招
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment