X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=init.vim;h=61806e6cd52c48015658fde838301a871b15f2a3;hp=aa86714d76c608905b253a37d67c73fc0717a9aa;hb=048e37869fcafbf2ab196ce013a9e158b6a3f988;hpb=a6f5b4dbb1b87a7a39b922a1a725a1706bff9c95 diff --git a/init.vim b/init.vim index aa86714..61806e6 100644 --- a/init.vim +++ b/init.vim @@ -6,6 +6,8 @@ " Some global settings set nocompatible +" Breaks colors for some versions of mosh, but not if tmux is used on top of +" mosh. See https://github.com/mobile-shell/mosh/issues/928 set termguicolors set number set cursorline @@ -31,17 +33,11 @@ set hlsearch set colorcolumn=+1 set mouse=a +set wildmenu set wildmode=longest,list:full set tabpagemax=100 -" Some terminals cause weired symbols due to broken cursor-shape termcodes. -if has('nvim') - "set guicursor= - " Workaround some broken plugins which set guicursor indiscriminately. - "au OptionSet guicursor noautocmd set guicursor= -end - syntax on " Load some macros @@ -60,6 +56,8 @@ endif runtime plugsetup.vim +let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] + " Some preferences for indent detection let g:detectindent_min_indent = 2 let g:detectindent_max_indent = 4 @@ -112,7 +110,6 @@ else call neomake#configure#automake('nw', 1000) endif - let g:clang_compilation_database = '.' " Speedup deoplete startup time, see deoplete FAQ @@ -140,6 +137,9 @@ let g:vim_markdown_math=1 au FileType text,markdown,mail,tex,gitcommit,mediawiki,vimwiki setlocal spell au FileType text,markdown,mail,gitcommit,mediawiki,vimwiki setlocal fo+=n +au Filetype mail setlocal formatoptions+=o +" Add | for block quotation, such that gq respects it +au Filetype mail setlocal comments+=n:\| au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab au Filetype tex setlocal shiftwidth=2 tabstop=2 @@ -153,40 +153,27 @@ au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/ " Line wrap crippled with numbers shown au Filetype man setlocal nonumber -" Java completion -au FileType java setlocal omnifunc=javacomplete#Complete -au FileType java JCEnable -" See https://github.com/artur-shaik/vim-Javacomplete2 -" ji ji -nmap (JavaComplete-Imports-AddSmart) -imap (JavaComplete-Imports-AddSmart) -" ii jii -nmap (JavaComplete-Imports-Add) -imap (JavaComplete-Imports-Add) -" I jI -nmap (JavaComplete-Imports-AddMissing) -imap (JavaComplete-Imports-AddMissing) -" R jR -nmap (JavaComplete-Imports-RemoveUnused) -imap (JavaComplete-Imports-RemoveUnused) - " Minimum indenting for source code au FileType java,cpp,c,cs let g:detectindent_min_indent = 4 +" Consider using localvimrc config file or editorconfig instead +"au BufReadPost *.java :DetectIndent + +au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.' +au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.' + +au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh' +au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp' +au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards() """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some plugin-specific settings +let g:localvimrc_persistent = 1 + au FileType markdown call RagtagInit() let g:detectspelllang_langs = {} let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT'] -au BufReadPost *.java :DetectIndent - -au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.' -au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.' - -au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh' -au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp' :let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'], \ ['|', 'OBSOLETE(o)', 'WONT(n)'], @@ -197,6 +184,23 @@ let g:vimwiki_list = [{'path': '~/.vimwiki/', \ 'template_default': 'default', \ 'template_ext': '.html'}] +" Java completion +au FileType java setlocal omnifunc=javacomplete#Complete +au FileType java JCEnable +" See https://github.com/artur-shaik/vim-Javacomplete2 +" ji ji +au FileType java nmap (JavaComplete-Imports-AddSmart) +au FileType java imap (JavaComplete-Imports-AddSmart) +" ii jii +au FileType java nmap (JavaComplete-Imports-Add) +au FileType java imap (JavaComplete-Imports-Add) +" I jI +au FileType java nmap (JavaComplete-Imports-AddMissing) +au FileType java imap (JavaComplete-Imports-AddMissing) +" R jR +au FileType java nmap (JavaComplete-Imports-RemoveUnused) +au FileType java imap (JavaComplete-Imports-RemoveUnused) + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""