DIY vim编辑神器

1.安装nerd tree
1)安装pathogen
step 1: cd mkdir ~/.vim
step 2: mkdir -p autoload bundle
step 3: 从 https://github.com/tpope/vim-pathogen中下载vim-pathogen
step 4: cd vim-pathogen目录,cp autoload/pathogen.vim ~/.vim/autoload
step 5: 编辑~/.vimrc文件,输入:execute pathogen#infect().然后保存


2)安装nerdtree
step 1: git clone https:github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
step 2: 编辑~/.vimrc文件,添加切换方式:map<F7> :NERDTreeToggle<CR>
step 3: 设置nerdtree窗口大小:在~/.vimrc文件中添加:let g:NERDTreeWinSize=25


2.自动补全
step1:从https://bitbucket.org/ns9tks/vim-autocomplpop/get/tip.zip下载vim_autocomplpop.zip文件,讲其解压在autocomplpop文件中
step2:从http://www.vim.org/scripts/script.php?script_id=3252 下载vim-l9.zip文件,将其解压在l9文件中
step3:讲autocomplpop,l9复制到~/.vim/bundle中


3.python的代码补全&语法提示功能
参考:https://github.com/rkulla/pydiction
step1: cd ~/.vim/bundle
step2: git clone https:// github.com/rkulla/pydiction.git
step3:配置~/.vimrc:
filetype plugin on

let g:pydiction_location = '/home/user/.vim/bundle/pydiction/complete-dict

let g:pydiction_menu_height = 3


4.搜索结果高亮显示
配置vimrc:
set hlsearch
:nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>


5.taglist安装

step1:安装用于支持taglist的ctags: apt-get install ctags
step2:安装vim插件管理器vim-addon-manager:apt-apt install vim-scripts
step3: vim-addons install taglist


6.代码折叠
step1:cp python_fold.vim ~/.vim/plugin
step2:vimrc配置:set nofoldenable


vimrc文件:

"setting pathogen-vim 
execute pathogen#infect()
filetype plugin indent on

"setting nerdtree
map <F7> :NERDTreeToggle<CR>
let g:NERDTreeWinPos="left"
let g:NERDTreeWinSize=18
let g:NERDTreeShowLineNumbers=1

"setting pydiction
filetype plugin on
let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
let g:pydiction_menu_height = 3

"setting highlight
set hlsearch
:nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>

"setting taglist
let Tlist_Auto_Highlight_Tag=1  
let Tlist_Auto_Open=0 
let Tlist_Auto_Update=1  
let Tlist_Display_Tag_Scope=1  
let Tlist_Exit_OnlyWindow=1  
let Tlist_Enable_Dold_Column=1  
let Tlist_File_Fold_Auto_Close=1  
let Tlist_Show_One_File=0  
let Tlist_Use_Right_Window=1  
let Tlist_Use_SingleClick=1  
:nnoremap <silent> <F8> :TlistToggle<CR>

"setting python code folding
set nofoldenable

"setting bufferexploer
let g:miniBufExplMaxSize = 2

"basic setting
syntax on
filetype indent on
set autoindent
set smartindent
set tabstop=4  
set sw=4   
set number

set nowrap
set cursorline
set ruler


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值