vim 环境参数配置 DIY

  • 参考《笨方法学Vimscript》   http://learnvimscriptthehardway.onefloweroneworld.com/
  • 系统环境    

    ubantu 12.04 

  • 从ubantu系统自带的vim例子开始。/usr/share/vim/vim**/vimrc_example.vim,将该文件复制到~/.vimrc
  • 添加DIY的配置选项

augroup filetype_vim
  autocmd!
  autocmd FileType vim setlocal foldmethod=marker
  "use the marker method of folding for any Vimscript files
  "for instance : z-a open and close maker
augroup END
"Basic setting--------{{{
  let mapleader = ","
  let maplocalleader = "."
  "<LocalLeader> is to be used for mappings which are local to a buffer.
"}}}
"FileType-specific settings ----{{{
  autocmd FileType vim nnoremap <buffer> <localleader>c I"<esc>
"}}}
"mappings setting---------{{{
  echo ">^.^<"
  noremap - ddp
  "move a row down
  noremap _ ddkkp
  "move a row up
  nnoremap <leader>u viwU
  "lowercase -> uppercase
  inoremap <leader>u <esc>viwUi
  nnoremap <leader>d dd
  nnoremap <leader>ev :vsplit $MYVIMRC<cr>
  nnoremap <leader>sv :source $MYVIMRC<cr>
  inoremap jk <esc>
  inoremap <esc> <nop>
  noremap <left> <nop>
  noremap <right> <nop>
  noremap <up> <nop>
  noremap <down> <nop>
  noremap ak <c-u>
  noremap aj <c-d>
"}}}

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。