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