From a6cdae262df868ff79c32dca3b61686ef5c8e433 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Thu, 12 Sep 2019 19:44:24 +0200 Subject: Improved Java support & minor fixes --- .gitmodules | 3 +++ ftplugin/java.vim | 2 ++ init.vim | 13 +++++++++++++ pack/vim/opt/vimtex | 1 + plugin/statusline.vim | 18 ++++++++---------- vimrc | 2 ++ vimrc-common | 7 ++++--- 7 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 ftplugin/java.vim create mode 160000 pack/vim/opt/vimtex diff --git a/.gitmodules b/.gitmodules index c2ca5df..4759f0d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,3 +58,6 @@ [submodule "pack/vim/opt/YouCompleteMe.git"] path = pack/vim/opt/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git +[submodule "pack/vim/opt/vimtex"] + path = pack/vim/opt/vimtex + url = https://github.com/lervag/vimtex diff --git a/ftplugin/java.vim b/ftplugin/java.vim new file mode 100644 index 0000000..7da3e00 --- /dev/null +++ b/ftplugin/java.vim @@ -0,0 +1,2 @@ +set makeprg=javac\ -Xdiags:verbose\ % +set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%# diff --git a/init.vim b/init.vim index 590f12b..402f7a6 100644 --- a/init.vim +++ b/init.vim @@ -44,6 +44,19 @@ augroup DEOPLETE packadd deoplete.nvim packadd LanguageClient-neovim packadd echodoc.vim + + let g:deoplete#sources#clang#include_default_arguments=1 + " suggestions in alphabetic order + call deoplete#custom#source('_', 'sorters', ['sorter_word']) + call deoplete#custom#filter('converter_reorder_attr', + \ 'attrs_order', { + \ '_': { + \ 'kind': [ + \ 'Function', + \ 'Property' + \ ] + \ }, + \}) augroup END "======================================================================================================================= diff --git a/pack/vim/opt/vimtex b/pack/vim/opt/vimtex new file mode 160000 index 0000000..ae42020 --- /dev/null +++ b/pack/vim/opt/vimtex @@ -0,0 +1 @@ +Subproject commit ae420204f1632db7c7b93007fb2e193d44061f0a diff --git a/plugin/statusline.vim b/plugin/statusline.vim index e3c03ed..20d6b7e 100644 --- a/plugin/statusline.vim +++ b/plugin/statusline.vim @@ -2,19 +2,14 @@ augroup MAX_FANCYLINE set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split - let g:status_sym_start = '' - let g:status_sym_end = '' + let g:status_sym_start = '' + let g:status_sym_end = '' let g:status_sym_sep_start = '' let g:status_sym_sep_end = '' let g:symbol_branch = '' + let g:symbol_screen_edge = '░' if &term == "linux" - let g:status_sym_start = '' - let g:status_sym_end = '' - let g:status_sym_sep_start = '' - let g:status_sym_sep_end = '' - let g:symbol_branch = '' - let g:group_active = "StatusLineTerm" let g:group_inactive = "StatusLineTermNC" let g:group_tabline = "StatusLineTerm" @@ -62,6 +57,7 @@ augroup MAX_FANCYLINE return '' \ ."%#StatusLineHighlight#" \ ."%#".a:highlight_group."#" + \ .g:symbol_screen_edge.' ' \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}" \ ."%{(&modified\ ?\ '\ \ 💾'\ :\ '')}" \ ."%(%w%h%q%)".' '.l:mode.' '.g:status_sym_sep_start @@ -83,9 +79,9 @@ augroup MAX_FANCYLINE \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}" \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}" - \ ."%l:%-3c" - \ .g:status_sym_sep_end.' ' + \ ."%cx%-l: " \ ."%p%% " + \ .g:symbol_screen_edge endfunction function! UpdateTabline(highlight_group) @@ -94,6 +90,7 @@ augroup MAX_FANCYLINE "  return '' \ ."%#".a:highlight_group."#" + \ .g:symbol_screen_edge \ ."%3( \ %)\ " \ ."%{getcwd(-1)}\ " \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead().' '}" @@ -109,6 +106,7 @@ augroup MAX_FANCYLINE \ ."%(%{v:servername}\ %{v:this_session}%)" \ .g:status_sym_sep_end.' ' \ ."%(\ \ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" + \ .g:symbol_screen_edge \ ."%##" \ ."" " end endfunction diff --git a/vimrc b/vimrc index cc4cae8..6f80d2f 100644 --- a/vimrc +++ b/vimrc @@ -12,6 +12,8 @@ set restorescreen | " restores the console after exiting vim (intentionally no autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") +xnoremap "+y y:call system("wl-copy", @") + " scripts from the default vim installation, which do not get loaded by default, but are useful. if filereadable($VIMRUNTIME.'/macros/editexisting.vim') packadd! editexisting diff --git a/vimrc-common b/vimrc-common index 21df101..b8900c4 100644 --- a/vimrc-common +++ b/vimrc-common @@ -141,12 +141,13 @@ set wildmode=longest:full | " do not preselect any entry and show all possib " code completion " set dictionary=/usr/share/dict/cracklib-small -" set complete+=k " make default completer respect the dictionary +set complete+=d | " scan current and included files for defined name or macro +set complete+=i | " scan current and included files for completions +set complete+=k " make default completer respect the dictionary set complete-=u " scan current and included files set complete+=i " scan current and included files set complete+=d " scan current and included files for defined name or macro -set complete+=d | " scan current and included files for defined name or macro -set complete+=i | " scan current and included files for completions +" set complete=d " scan current and included files for defined name or macro set completeopt+=noinsert | " Do not insert any text for a match until the user selects one set completeopt+=noselect | " Do not select a completion from the menu, let the user do that set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] -- cgit v1.2.3