Browse Source

split vimrc into map_vimrc & plugin_vimrc

pull/4/head
Ein Verne 9 years ago
parent
commit
46c8845cd3
  1. 36
      .vim/startup/map_vimrc
  2. 23
      .vim/startup/plugin_vimrc
  3. 36
      .vimrc

36
.vim/startup/map_vimrc

@ -0,0 +1,36 @@
" vim map setting
" Treat long lines as break lines (useful when moving around in them)
map j gj
map k gk
" fast saving
nmap <leader>w :w!<cr>
" smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Useful mappings for managin tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
" visual mode copy and paste to system clipboard
vmap <C-c> "+y
vmap <C-x> "+c
vmap <C-v> "+p
function! Xml()
set filetype=xml
:%s/></>\r</g "把><替换成>回车<
:normal gg=G<cr>
endfunction
map <leader>xml :call Xml()
" plugin map setting
" Normal mode F2 to call NERDTree
nmap <F2> :NERDTreeToggle<cr>

23
.vim/startup/plugin_vimrc

@ -0,0 +1,23 @@
" Plugin settings
" plasticboy/vim-markdown
" disable folding
let g:vim_markdown_folding_disabled=1
" Highlight YAML frontmatter as used by Jekyll
let g:vim_markdown_frontmatter=1
" intend guides
let g:indent_guides_enable_on_vim_startup = 1
" jedi-vim plugin config
let g:jedi#completions_command = "<C-N>"
let g:jedi#popup_on_dot = 0
" syntastic setting
set statusline+=%#warningmsg#
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

36
.vimrc

@ -25,6 +25,8 @@ if g:iswindows
else else
source ~/.vim/startup/vundle_vimrc source ~/.vim/startup/vundle_vimrc
source ~/.vim/startup/python_vimrc source ~/.vim/startup/python_vimrc
source ~/.vim/startup/map_vimrc
source ~/.vim/startup/plugin_vimrc
endif endif
source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/vimrc_example.vim
@ -44,9 +46,6 @@ set autoread
let mapleader = "," let mapleader = ","
let g:mapleader = "," let g:mapleader = ","
" fast saving
nmap <leader>w :w!<cr>
"编辑vimrc之后,重新加载 "编辑vimrc之后,重新加载
if g:iswindows if g:iswindows
autocmd! bufwritepost _vimrc source $VIM/_vimrc autocmd! bufwritepost _vimrc source $VIM/_vimrc
@ -202,9 +201,6 @@ autocmd Filetype css setlocal tabstop=2 shiftwidth=2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs, windows and buffers " => Moving around, tabs, windows and buffers
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Treat long lines as break lines (useful when moving around in them)
map j gj
map k gk
@ -232,22 +228,6 @@ set statusline+=\ %P
" Plugin settings
" Normal mode F2 to call NERDTree
nmap <F2> :NERDTreeToggle<cr>
" plasticboy/vim-markdown
" disable folding
let g:vim_markdown_folding_disabled=1
" Highlight YAML frontmatter as used by Jekyll
let g:vim_markdown_frontmatter=1
" intend guides
let g:indent_guides_enable_on_vim_startup = 1
" jedi-vim plugin config
let g:jedi#completions_command = "<C-N>"
let g:jedi#popup_on_dot = 0
" powerline " powerline
" hide the default mode text (e.g. -- INSERT -- below the statusline) " hide the default mode text (e.g. -- INSERT -- below the statusline)
@ -271,11 +251,6 @@ endfunc
autocmd BufWrite *.py :call DeleteTrailingWS() autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.coffee :call DeleteTrailingWS() autocmd BufWrite *.coffee :call DeleteTrailingWS()
" smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
set diffexpr=MyDiff() set diffexpr=MyDiff()
function! MyDiff() function! MyDiff()
@ -301,10 +276,3 @@ function! MyDiff()
endif endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction endfunction
function! Xml()
set filetype=xml
:%s/></>\r</g "把><替换成>回车<
:normal gg=G<cr>
endfunction
map <leader>xml :call Xml()

Loading…
Cancel
Save