顯示具有 vim 標籤的文章。 顯示所有文章
顯示具有 vim 標籤的文章。 顯示所有文章

2015年4月21日 星期二

2015年2月14日 星期六

2014年10月23日 星期四

2014年5月24日 星期六

vim show error in quickfix windows

:cope[n] [height] Open a window to show the current list of errors. 
:cw[indow] [height] Open the quickfix window 
:ccl[ose]  Close the quickfix window 
  
 
 
 
References : 
Vim documentation: quickfix

2013年8月13日 星期二

vim spell check

:set spell
]s 跳到下個錯字
[s 跳到前個錯字
z= 顯示建議字詞
zg 新增正確拼字
zug 刪除正確拼字
zw 新增錯誤拼字
zuw  刪除錯誤拼字

2013年5月14日 星期二

# vi /etc/passwd
:%s/\(\(:.\{-}\)\{4}\)/\1 /

在第四個 : 後面加上空格




Reference :
Vim中的非贪婪匹配 | 湖间小筑

2013年3月28日 星期四

vim 使用 tabular 對齊內容

安裝:

如果已經安裝過 pathogen,則直接下載 tabular 到 ~/.vim/bundle 資料夾就可以嘍

$ mkdir -p ~/.vim/bundle
$ cd ~/.vim/bundle
$ git clone git://github.com/godlygeek/tabular.git


使用 :
|start|eat|left|
|12|5|7|
|20|5|15|

要將此資料整理的話,則在編輯器輸入
:Tab/|

 | start | eat | left |
 | 12    | 5    | 7   |
 | 20    | 5    | 15 |




Reference :
godlygeek/tabular · GitHub
Vim 程式撰寫排版用 Plugin - Tabular | Tsung's Blog

vim 安裝 pathogen 套件管理工具

下載 pathogen 到 ~/.vim/autoload/pathogen.vim
$ mkdir -p ~/.vim/autoload ~/.vim/bundle
$ curl -Sso ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim


在 ~/.vimrc 最前面加入這一行
$ vi ~/.vimrc
execute pathogen#infect() 




Reference :
tpope/vim-pathogen · GitHub 
Vim 插件管理工具 pathogen - DaNmarner的中文博客

2012年9月18日 星期二

vim NERDtree

.vimrc
nnoremap :NERDTree 
map e :NERDTreeToggle  " \e 來開啟 / 關閉 NERDTree
let NERDChristmasTree=1
let NERDTreeAutoCenter=1
let NERDTreeMouseMode=2
let NERDTreeShowBookmarks=1
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=1
let NERDTreeWinPos='left'
let NERDTreeWinSize=31

let NERDTreeIgnore=['\.o$', '\~$', '\.a$', '\.bak$', '\.d$']  " 忽略檔案


快捷鍵
 ? 開啟或關閉說明
:Bookmark 將游標當前檔案或目錄加到書籤
D 刪除當前游標書籤項目




Reference :
Vim之NerdTree的帮助 - 漠北风 - 博客园
無障礙 VIM on WIN32 - NERDTree - 大象先生 - 無名小站

2012年6月18日 星期一

vim + pylint

Drop pylint.vim in ~/.vim/compiler directory. Ensure that your PATH environment variable includes the path to 'pylint' executable.


"   Above is realized with :Pylint command. To disable calling Pylint every
"   time a buffer is saved put into .vimrc file
"
"       let g:pylint_onwrite = 0
"
"   Displaying code rate calculated by Pylint can be avoided by setting
"
"       let g:pylint_show_rate = 0
"
"   Openning of QuickFix window can be disabled with
"
"       let g:pylint_cwindow = 0
"
"   Of course, standard :make command can be used as in case of every
"   other compiler.




Reference :
pylint.vim - compiler plugin for python style checking tool : vim online

2011年10月25日 星期二

vim regex valid IP address

\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)