码迷,mamicode.com
首页 > 系统相关 > 详细

vim 环境参数配置 DIY

时间:2014-11-17 14:01:37      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:style   http   ar   os   sp   for   文件   on   bs   

  • 参考《笨方法学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>
"}}}

vim 环境参数配置 DIY

标签:style   http   ar   os   sp   for   文件   on   bs   

原文地址:http://www.cnblogs.com/ltfbk/p/4103402.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!