国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 操作系統 > 正文

高效vim插件

2024-06-28 13:22:15
字體:
來源:轉載
供稿:網友
高效vim插件

目錄[-]

  • 高效vim插件
  • 插件管理利器
  • 高效插件集
  • NerdTree
  • snipMate
  • tagbar
  • jedi-vim
  • eclim
  • c.vim
  • vim-colorschemes
  • vim配置
  • 一個實例
高效vim插件

如果不熟悉vim的,請在使用vim插件之前,請先閱讀Vim學習指南, 建議通過前3個層次。以及有一個有趣的vim練習游戲http://vim-adventures.com/。

插件管理利器

vim的插件原始安裝容易混亂,而且管理起來,不方便。那么就渴望一個插件管理工具:pathogen

簡單安裝:

?
123mkdir -p ~/.vim/autoload ~/.vim/bundle; /curl -Sso ~/.vim/autoload/pathogen.vim /https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

詳細請查看:https://github.com/tpope/vim-pathogen

配置:

在vimrc文件的filetype plugin之前·「沒有的就在最前面」添加:

?
12call pathogen#infect()filetype plugin indent on
,記住,一定是vimrc,而不是gvimrc。可以參考我的vimrc配置高效插件集
  • nerdtree
  • snipMate
  • tagbar
  • vim-multiple-cursors
  • jedi-vim[python]
  • eclim[java]
  • c.vim[C/C++]
  • vim-colorschemes
請將這插件安裝在$HOME/.vim/bundle目錄下:

NerdTree
The NERD tree allows you to explore your filesystem and to open files and directories. It PResents the filesystem to you in the form of a tree which you manipulate with the keyboard and/or mouse. It also allows you to perform simple filesystem Operations.

你可以使用Git這樣安裝:

?
12cd $HOME/.vim/bundlegit clone https://github.com/scrooloose/nerdtree.git
snipMate

這個可以有。想快速寫或者減少重復寫代碼,那么code snippets就是必須的,而對于vim來說,snipMate,你值得擁有。[ps:你可以在其snippets目錄下找到對應語言的snippets,可以修改相應的snippets]。請到vim官網下載http://www.vim.org/scripts/script.php?script_id=2540。

tagbar

如果你使用過eclipse,那么它右邊有個叫做Outline函數列表,對,tagbar就是這個效果。

你可以使用Git這樣安裝:

?
12cd $HOME/.vim/bundlegit clone https://github.com/majutsushi/tagbar.git

vim-multiple-cursors

這個插件具有Sublime Text的多光標編輯功能喲。

你可以使用Git這樣安裝:

?
12cd $HOME/.vim/bundlegit clone https://github.com/terryma/vim-multiple-cursors.git
jedi-vim

如果使用python的,有了它,爽歪歪。它擁有強大的提示能力。

注意,剛開始我安裝這個插件,總是報錯,主要是vim沒有--enable-pythoninterp 和沒有安裝jedi·「pip install jedi」,而且后來在jedi-vim開發者David Halter提示下,在.bashrc中設置·「export PYTHONSTARTUP="$(python -m jedi repl)"」就可以讓python具有ipython的功能。很強大!

你可以使用Git這樣安裝:

?
12cd $HOME/.vim/bundlegit clone https://github.com/davidhalter/jedi-vim.git
eclim

eclim 就是 eclipse 和 vim的有機結合。它充分利用了eclipse強大的提示功能,快捷鍵<c-x><c-u>

按照官網安裝之后,它會在.vim目錄下生成eclim和plugin目錄,請在bundle目錄新建一個目錄eclim,然后將這兩個目錄剪切到bundle/eclim目錄中.這時它沒有啟動,還需要執行ECLIPSE目錄中的eclimd。這個并沒有列舉出來。

其實還可以加一個supertab插件,但是我習慣使用tab來代替空格,實際上一個tab是4個空格。所以并沒有列舉出來。

你可以使用git這樣安裝:

?
12cd $HOME/.vim/bundlegit clone https://github.com/ervandew/supertab.git
c.vim

請到這里去下載,這個不解釋,很強大,官網有很詳細的解釋和幫助文檔,對于c/c++來說不可缺少。

vim-colorschemes

保護視力,請從一個好的主題開始。那么vim-colorschemes中集成了很多的主題,個人比較愛好cobalt,不過有些主題只能在gvim中才能顯示效果,而在vim中沒有背景顏色等等問題。github去下載

?
12cd $HOME/.vim/bundlegit clone https://github.com/upsuper/vim-colorschemes.git

vim配置

?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118" Uncomment the next line to make Vim more Vi-compatible" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous" options, so any other options should be set AFTER setting 'compatible'."set compatibleset nocompatible" Vim5 and later versions support syntax highlighting. Uncommenting the next" line enables syntax highlighting by default.if has("syntax")syntax onendif" If using a dark background within the editing area and syntax highlighting" turn on this option as well"set background=dark" Uncomment the following to have Vim jump to the last position when" reopening a file"if has("autocmd")" au BufReadPost * if line("'/"") > 1 && line("'/"") <= line("$") | exe "normal! g'/"" | endif"endif" Uncomment the following to have Vim load indentation rules and plugins" according to the detected filetype."if has("autocmd")" filetype plugin indent on"endifcall pathogen#infect()filetype plugin indent on" The following are commented out as they cause vim to behave a lot" differently from regular Vi. They are highly recommended though.set showcmd " Show (partial) command in status line."set showmatch " Show matching brackets."set ignorecase " Do case insensitive matchingset smartcase " Do smart case matching"set incsearch " Incremental search"set autowrite " Automatically save before commands like :next and :make"set hidden " Hide buffers when they are abandonedset mouse=a " Enable mouse usage (all modes)set nuset tabstop=4set softtabstop=4" set shiftwidth=4set expandtab " use whitespace instead of tabset autoindentset smartindentset cindent shiftwidth=4" set autoindent shiftwidth=4set foldmethod=indentset backspace=indent,eol,startset colorcolumn=80" === tagbar setting =======nmap <F4> :TagbarToggle<CR> " shortcutlet g:tagbar_width = 20 " tagbar's width, default 20autocmd VimEnter * nested :call tagbar#autoopen(1) "automate to open tagbarlet g:tagbar_left = 1 " on the left side"let g:tagbar_right = 1 " on the right sidelet NERDTreeIgnore=['/.pyc', '/.pyo', '/.swp', '/~'] " ignore *.py[co], *.swp and *~" =======end==================" switch windownnoremap <c-h> <c-w>hnnoremap <c-j> <c-w>jnnoremap <c-k> <c-w>knnoremap <c-l> <c-w>l" ===== brace autocompletion =========inoremap ( ()<Esc>iinoremap [ []<Esc>iinoremap { {<CR>}<Esc>Oautocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR>inoremap ) <c-r>=ClosePair(')')<CR>inoremap ] <c-r>=ClosePair(']')<CR>inoremap } <c-r>=CloseBracket()<CR>inoremap " <c-r>=QuoteDelim('"')<CR>inoremap ' <c-r>=QuoteDelim("'")<CR>function ClosePair(char)if getline('.')[col('.') - 1] == a:charreturn "/<Right>"elsereturn a:charendifendffunction CloseBracket()if match(getline(line('.') + 1), '/s*}') < 0return "/<CR>}"elsereturn "/<Esc>j0f}a"endifendffunction QuoteDelim(char)let line = getline('.')let col = col('.')if line[col - 2] == "http://""Inserting a quoted quotation mark into the stringreturn a:charelseif line[col - 1] == a:char"Escaping out of the stringreturn "/<Right>"else"Starting a stringreturn a:char.a:char."/<Esc>i"endifendf" Source a global configuration file if availableif filereadable("/etc/vim/vimrc.local")source /etc/vim/vimrc.localendif

?
1234567891011121314<span></span><div></div>
一個實例

這是我在寫python nose插件nose-colorxunit時截圖:

http://my.oschina.net/swuly302/blog/156784


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 启东市| 利辛县| 庐江县| 诸城市| 博白县| 天气| 麻城市| 西宁市| 巴彦淖尔市| 大冶市| 福安市| 赤峰市| 五常市| 洪洞县| 阿拉善右旗| 姜堰市| 旬阳县| 同心县| 昆明市| 东阳市| 镇巴县| 吴江市| 江西省| 浠水县| 江口县| 珲春市| 刚察县| 沁源县| 绩溪县| 调兵山市| 宣恩县| 望城县| 绥德县| 南靖县| 周宁县| 资中县| 甘孜| 绍兴县| 永嘉县| 红安县| 绍兴县|