vim 環境參數配置 DIY

來源:互聯網
上載者:User

標籤: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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.