diff --git a/.vim/startup/map_vimrc b/.vim/startup/map_vimrc index 1a0ed41..1848574 100644 --- a/.vim/startup/map_vimrc +++ b/.vim/startup/map_vimrc @@ -7,6 +7,10 @@ map k gk " fast saving nmap w :w! +" use tab as % +nmap % +vmap % + " smart way to move between windows map j map k @@ -26,8 +30,19 @@ map tc :tabclose " 将VIM中将内容复制到系统粘贴板,或者从系统粘贴板粘贴到VIM nnoremap "+y vnoremap "+y -nnoremap "+gP vnoremap "+gP +nnoremap "+gP + +" 快速移动当前行 +nnoremap :m .+1== +nnoremap :m .-2== +inoremap :m .+1==gi +inoremap :m .-2==gi +vnoremap :m '>+1gv=gv +vnoremap :m '<-2gv=gv + +" 空格关闭高亮,清空所有已经显示 +nnoremap :set hlsearch! hlsearch? function! Xml() set filetype=xml diff --git a/.vim/startup/plugin_vimrc b/.vim/startup/plugin_vimrc index 4a3f6be..04ff144 100644 --- a/.vim/startup/plugin_vimrc +++ b/.vim/startup/plugin_vimrc @@ -21,3 +21,47 @@ let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 +" nerd comment +" Add spaces after comment delimiters by default +let g:NERDSpaceDelims = 1 + +" Use compact syntax for prettified multi-line comments +let g:NERDCompactSexyComs = 1 + +" Align line-wise comment delimiters flush left instead of following code indentation +let g:NERDDefaultAlign = 'left' + +" Set a language to use its alternate delimiters by default +let g:NERDAltDelims_java = 1 + +" Add your own custom formats or override the defaults +let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } } + +" Allow commenting and inverting empty lines (useful when commenting a region) +let g:NERDCommentEmptyLines = 1 + +" Enable trimming of trailing whitespace when uncommenting +let g:NERDTrimTrailingWhitespace = 1 + + + +"" airline settings. +let g:airline_theme = 'luna' +let g:airline_powerline_fonts = 1 + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif + +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols.branch = '' +let g:airline_symbols.readonly = '' +let g:airline_symbols.linenr = '' +let g:airline#extensions#tabline#enabled = 1 +" show absolute file path in status line +let g:airline_section_c = '%<%F%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#' +" show tab number in tab line +let g:airline#extensions#tabline#tab_nr_type = 1 diff --git a/.vim/startup/vundle_vimrc b/.vim/startup/vundle_vimrc index 4260301..ef3b2c1 100644 --- a/.vim/startup/vundle_vimrc +++ b/.vim/startup/vundle_vimrc @@ -23,6 +23,7 @@ Plugin 'tpope/vim-fugitive' Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown' Plugin 'scrooloose/nerdtree' +Plugin 'scrooloose/nerdcommenter' Plugin 'davidhalter/jedi-vim' Plugin 'ervandew/supertab' Plugin 'Raimondi/delimitMate' @@ -40,6 +41,8 @@ Plugin 'L9' Plugin 'perl-support.vim' Plugin 'christoomey/vim-tmux-navigator' Plugin 'tpope/vim-surround' +Plugin 'vim-airline/vim-airline' +Plugin 'vim-airline/vim-airline-themes' " Git plugin not hosted on GitHub Plugin 'git://git.wincent.com/command-t.git' diff --git a/.vimrc b/.vimrc index d84c41e..b498766 100644 --- a/.vimrc +++ b/.vimrc @@ -105,7 +105,7 @@ set encoding=utf-8 " set current file encoding set fileencoding=utf-8 "按照utf-8 without bom,utf-8,顺序识别打开文件 -set fileencodings=ucs-bom,utf-8,gbk,gb2312,cp936,big5,gb18030,shift-jis,latin1 +set fileencodings=ucs-bom,utf-8,gbk,gb2312,cp936,gb18030,big5,shift-jis,euc-jp,enc-kr,latin1 "防止菜单乱码 if(g:iswindows && g:isGUI) @@ -157,6 +157,9 @@ set tabstop=4 " 设置">"操作符 缩进,增加的缩进量是使用'shiftwidth'指定,默认是8 set shiftwidth=4 +" 将tab自动转为空格 +set expandtab + "显示行号 set nu @@ -179,7 +182,8 @@ autocmd Filetype css setlocal tabstop=2 shiftwidth=2 " => Moving around, tabs, windows and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - +" 左下角显示当前vim模式 +set showmode """""""""""""""""""""""""""""" " => Status line @@ -205,39 +209,35 @@ set statusline+=\ %P " 在普通模式下用块状光标,在插入模式下用条状光标(形状类似英文 "I" " 的样子),然后在替换模式中使用下划线形状的光标。 -if empty($TMUX) - let &t_SI = "\]50;CursorShape=1\x7" - let &t_EI = "\]50;CursorShape=0\x7" - if v:version >= 800 - let &t_SR = "\]50;CursorShape=2\x7" - endif -else - let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" - let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" - if v:version >= 800 - let &t_SR = "\Ptmux;\\]50;CursorShape=2\x7\\\" - endif -endif - -if &term =~ "xterm\\|rxvt" - " use an orange cursor in insert mode - let &t_SI = "\]12;orange\x7" - " use a red cursor otherwise - let &t_EI = "\]12;gray\x7" - silent !echo -ne "\033]12;gray\007" - " reset cursor when vim exits - autocmd VimLeave * silent !echo -ne "\033]112\007" - " use \003]12;gray\007 for gnome-terminal and rxvt up to version 9.21 -endif - -autocmd InsertLeave,WinEnter * set cursorline -autocmd InsertEnter,WinLeave * set nocursorline - +" if has("autocmd") +" au VimEnter,InsertLeave * silent execute '!echo -ne "\e[2 q"' | redraw! +" au InsertEnter,InsertChange * +" \ if v:insertmode == 'i' | +" \ silent execute '!echo -ne "\e[6 q"' | redraw! | +" \ elseif v:insertmode == 'r' | +" \ silent execute '!echo -ne "\e[4 q"' | redraw! | +" \ endif +" au VimLeave * silent execute '!echo -ne "\e[ q"' | redraw! +" endif +" +" if &term =~ "xterm\\|rxvt" +" " use an orange cursor in insert mode +" let &t_SI = "\]12;orange\x7" +" " use a red cursor otherwise +" let &t_EI = "\]12;gray\x7" +" silent !echo -ne "\033]12;gray\007" +" " reset cursor when vim exits +" autocmd VimLeave * silent !echo -ne "\033]112\007" +" " use \003]12;gray\007 for gnome-terminal and rxvt up to version 9.21 +" endif +" +" autocmd InsertLeave,WinEnter * set cursorline +" autocmd InsertEnter,WinLeave * set nocursorline " powerline " hide the default mode text (e.g. -- INSERT -- below the statusline) -" set t_Co=256 +set t_Co=256 " let g:Powerline_symbols='fancy' @@ -257,6 +257,10 @@ endfunc autocmd BufWrite *.py :call DeleteTrailingWS() autocmd BufWrite *.coffee :call DeleteTrailingWS() +autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif set diffexpr=MyDiff() function! MyDiff() diff --git a/intellij-java-google-style.xml b/intellij-java-google-style.xml new file mode 100644 index 0000000..f3a6743 --- /dev/null +++ b/intellij-java-google-style.xml @@ -0,0 +1,598 @@ + + + + + +