From f80e7cbe828d23f87013f937870f095e6d641cb3 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Thu, 3 May 2018 08:26:23 +0200 Subject: Started a custom statusline and automated ycm installation --- vimrc-full | 62 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/vimrc-full b/vimrc-full index acb4f0d..3b9cdd6 100644 --- a/vimrc-full +++ b/vimrc-full @@ -80,11 +80,6 @@ set spelllang=en,de | " languages for the spell checker set spellsuggest=10 | " how many words will z= suggest? set thesaurus+=~/.vim/thesaurus/php.txt -set dictionary=/usr/share/dict/cracklib-small -set complete+=k " make default completer respect the dictionary -set complete+=i " scan current and included files -set complete+=d " scan current and included files for defined name or macro - "======================================================================================================================= " cscope "======================================================================================================================= @@ -224,6 +219,11 @@ set wildmenu | " use a menu in the command line set wildmode=longest:full | " do not preselect any entry and show all possible " code completion +" set dictionary=/usr/share/dict/cracklib-small +" 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 tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] @@ -742,10 +742,26 @@ nnoremap :TagbarToggle| " bind TagBar to hotkey F9 " LIGHTLINE: a fancy status line ======================================================================================= +" +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 +set statusline= +set statusline+=%{(&modified?nr2char(0xF0C7):'')} +set statusline+=%{(&readonly\ ?\ ''\ :\ '')} +set statusline+=%{fnamemodify(getcwd(),':~')} +set statusline+=%{nr2char(0x20)} +set statusline+=%{nr2char(0xE0B1)} +set statusline+=%{nr2char(0x20)} +set statusline+=%f +set statusline+=%*%= +set statusline+=%l:%c(%p%%) +" set statusline+=%t%m +" set statusline+=%{TagInStatusLine()} +" set statusline+=%#warningmsg# +" set statusline+=%{SyntasticStatuslineFlag()} + Plug 'itchyny/lightline.vim' -" Plug 'taohex/lightline-buffer' " lightline-buffer ui settings " replace these symbols with ASCII characters if your environment does not support unicode @@ -776,7 +792,7 @@ let g:lightline = { \ 'left': [ [ 'servername', 'sessionname' ] ], \ 'right': [ [], ['gitbranch', 'tabnumber'] ], \ }, - \ 'colorscheme': 'Tomorrow', + \ 'colorscheme': 'Tomorrow_Night', \ 'separator': { 'left': "\uE0B4", 'right': "\uE0B6" }, \ 'subseparator': { 'left': "\uE0b1", 'right': "\uE0b3" }, \ 'inactive': { @@ -784,7 +800,7 @@ let g:lightline = { \ 'right': [] \ }, \ 'active': { - \ 'left': [ [ 'mode', 'register', 'paste' ], [ 'pwd', 'relativepath', 'title' ] , ['tagbar']], + \ 'left': [ [ 'mode', 'register', 'paste' ], [ 'pwd', 'relativepath' ] , ['tagbar']], \ 'right': [ [ 'lineinfo', 'percent' ], [ 'filetype', 'readonly', 'spell', 'fileencoding', 'fileformat' ] ] \ }, \ 'component': { @@ -799,7 +815,7 @@ let g:lightline = { \ 'readonly': '%{&readonly ? "" : ""}', \ 'register': '%{v:register}', \ 'title': '%{getwinvar(0, "quickfix_title")}', - \ 'pwd': '%{getcwd()}', + \ 'pwd': '%{fnamemodify(getcwd(), ":~")}', \ 'relativepath': '%{fnamemodify(expand("%"), ":.")}' \ }, \ 'component_expand': { @@ -813,14 +829,6 @@ let g:lightline = { \ }, \ } -set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one -" set statusline= -" set statusline+=%t%m -" set statusline+=%{TagInStatusLine()} -" set statusline+=%#warningmsg# -" set statusline+=%{SyntasticStatuslineFlag()} -" set statusline+=%*%= -" set statusline+=%l:%c(%p%%) " Autocompleter: ===================================== if has("python") @@ -855,20 +863,30 @@ if has("python") " Plug 'Rip-Rip/clang_complete' " Plug 'tweekmonster/deoplete-clang2' - Plug 'zchee/deoplete-clang' - let g:deoplete#sources#clang#libclang_path = "/usr/lib/libclang.so" - let g:deoplete#sources#clang#clang_header = "/usr/lib/clang/6.0.0/" + " Plug 'zchee/deoplete-clang' + " let g:deoplete#sources#clang#libclang_path = "/usr/lib/libclang.so" + " let g:deoplete#sources#clang#clang_header = "/usr/lib/clang/6.0.0" + " let g:deoplete#sources#clang#std#cpp = 'c++1z' " let g:deoplete#sources#clang#clang_complete_database = "/home/max/src" " Plug 'Shougo/neoinclude.vim' " makes vim slow - unfortunatelly + Plug 'autozimu/LanguageClient-neovim', { + \ 'branch': 'next', + \ 'do': 'bash install.sh', + \ } + let g:LanguageClient_serverCommands = { + \ 'cpp': ['clangd'] + \ } " Plug 'roxma/nvim-completion-manager' unmaintained python version else Plug 'idanarye/vim-vebugger' " YouCompleteMe: ===================================================================================================== " Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... - Plug 'Valloric/YouCompleteMe' + Plug 'Valloric/YouCompleteMe', { + \ 'do' : 'python install.py --clang-completer', + \ } let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar/sign column let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar/sign coloumn @@ -969,6 +987,7 @@ command BufToArg :argadd %:. "======================================================================================================================= call plug#end() | " all plugins are getting loaded on this line, don't remove! + " ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ " END: LOADING PLUGINS " ====================================================================================================================== @@ -1095,6 +1114,7 @@ endif " CONVENIENCE: " ====================================================================================================================== if empty(argv()) + " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val})) " from the list of recent files: make absolute paths, filter out files not -- cgit v1.2.3