当前位置:首页 > 开发 > 开源软件 > 正文

my vimrc

发表于: 2011-10-27   作者:coolesting   来源:转载   浏览:
摘要: "basic operation set autoindent set ts=4 cmap Q q cmap W w cmap WQ wq cmap Wq wq cmap tn tabnew map <C-h> ^ map <C-l> $ map <C-k> { map <C-j> } &qu

"basic operation
set autoindent
set ts=4

cmap Q q
cmap W w
cmap WQ wq
cmap Wq wq
cmap tn tabnew

map <C-h> ^
map <C-l> $
map <C-k> {
map <C-j> }


"search, and replace the string or text
vnoremap ,s y/<C-R>"<CR>
vnoremap ,r y:%s/<C-R>"//g<left><left>

"save the file with root permission
cmap w!! w !sudo tee >/dev/null %

"NERD_tree plugin
"git clone git@github.com:scrooloose/nerdtree
noremap <F4> :NERDTreeToggle<CR>
                            
"save and reload the folders, the path of folder is ~/.vim/view
au BufWinLeave * mkview
au BufWinEnter * silent loadview

"comment/uncomment
autocmd FileType c,cpp,java,scala,php let b:comment_leader = '// '
autocmd FileType sh,ruby,python   let b:comment_leader = '# '
autocmd FileType conf,fstab       let b:comment_leader = '# '
autocmd FileType tex              let b:comment_leader = '% '
autocmd FileType mail             let b:comment_leader = '> '
autocmd FileType vim              let b:comment_leader = '" '

noremap <silent> ,cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> ,cu :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>


my vimrc

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号