diff --git a/.vim/startup/map_vimrc b/.vim/startup/map_vimrc new file mode 100644 index 0000000..7bfc3fd --- /dev/null +++ b/.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 w :w! + +" smart way to move between windows +map j +map k +map h +map l + +" Useful mappings for managin tabs +map tn :tabnew +map to :tabonly +map tc :tabclose + +" visual mode copy and paste to system clipboard +vmap "+y +vmap "+c +vmap "+p + +function! Xml() + set filetype=xml + :%s/>\r<替换成>回车< + :normal gg=G +endfunction +map xml :call Xml() + +" plugin map setting + +" Normal mode F2 to call NERDTree +nmap :NERDTreeToggle diff --git a/.vim/startup/plugin_vimrc b/.vim/startup/plugin_vimrc new file mode 100644 index 0000000..4a3f6be --- /dev/null +++ b/.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 = "" +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 + diff --git a/.vimrc b/.vimrc index 2bc230b..0e0465d 100644 --- a/.vimrc +++ b/.vimrc @@ -25,6 +25,8 @@ if g:iswindows else source ~/.vim/startup/vundle_vimrc source ~/.vim/startup/python_vimrc + source ~/.vim/startup/map_vimrc + source ~/.vim/startup/plugin_vimrc endif source $VIMRUNTIME/vimrc_example.vim @@ -44,9 +46,6 @@ set autoread let mapleader = "," let g:mapleader = "," -" fast saving -nmap w :w! - "编辑vimrc之后,重新加载 if g:iswindows autocmd! bufwritepost _vimrc source $VIM/_vimrc @@ -202,9 +201,6 @@ autocmd Filetype css setlocal tabstop=2 shiftwidth=2 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => 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 :NERDTreeToggle - -" 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 = "" -let g:jedi#popup_on_dot = 0 " powerline " hide the default mode text (e.g. -- INSERT -- below the statusline) @@ -271,11 +251,6 @@ endfunc autocmd BufWrite *.py :call DeleteTrailingWS() autocmd BufWrite *.coffee :call DeleteTrailingWS() -" smart way to move between windows -map j -map k -map h -map l set diffexpr=MyDiff() function! MyDiff() @@ -301,10 +276,3 @@ function! MyDiff() endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction - -function! Xml() - set filetype=xml - :%s/>\r<替换成>回车< - :normal gg=G -endfunction -map xml :call Xml()