From 2f41dc02c106314e5e09d66d030ee91a04a9cfe4 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Tue, 11 Aug 2020 13:46:13 +0300 Subject: General changes to vim rice * removed all configuration related to airline and other old plugins that I don't use anymore * configured custom statusline * other minor changes --- dotfiles/.config/nvim/init.vim | 43 ++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'dotfiles/.config/nvim') diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim index 15a60e1..41f2cb8 100644 --- a/dotfiles/.config/nvim/init.vim +++ b/dotfiles/.config/nvim/init.vim @@ -15,6 +15,7 @@ Plug 'jreybert/vimagit' Plug 'tpope/vim-commentary' Plug 'neomake/neomake' Plug 'jamessan/vim-gnupg' +Plug 'racer-rust/vim-racer' call plug#end() " Some basics: @@ -26,17 +27,35 @@ call plug#end() set guicursor=n-v-c-sm:hor20,i-ci-ve:ver25,r-cr-o:block set cursorline let g:ultramar_italic=1 - "let g:airline_theme='ultramar' - "let g:airline#extensions#tabline#enabled = 1 colorscheme ultramar -" set encoding=utf-8 set number set relativenumber - -" airline - "let g:airline_left_sep='' - "let g:airline_right_sep='' - "let g:airline_inactive_collapse=1 + set scrolloff=5 + +" Functions for git branch name on statusline + function! GitBranch() + return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") + endfunction + function! StatuslineGit() + let l:branchname = GitBranch() + return strlen(l:branchname) > 0?'  '.l:branchname.' ':'' + endfunction + +" Statusline + let laststatus=2 + set statusline= + set statusline+=%#CursorLineNR# + set statusline+=%{StatuslineGit()} + set statusline+=%#StatusLine# + set statusline+=\ %f%r%m + set statusline+=%= + set statusline+=\ %l:%c/%L + set statusline+=\ + set statusline+=%#StatusLineNC# + set statusline+=\ %Y + set statusline+=\ %{&fileencoding?&fileencoding:&encoding} + set statusline+=\[%{&fileformat}\] + set statusline+=\ " default indentation filetype plugin indent on @@ -75,9 +94,6 @@ call plug#end() " with russian layout map с :!doccompiler % -" View live preview of document - map v :LLPStartPreview - " Spell-check set to F2: map :setlocal spell! spelllang=en_us,es,ru @@ -109,12 +125,11 @@ call plug#end() vnoremap З "+P " Enable autocompletion: - set wildmode=longest,list,full + set wildmode=list:longest,full set wildmenu - imap " Automatically deletes all tralling whitespace on save. - autocmd BufWritePre * %s/\s\+$//e + "autocmd BufWritePre * %s/\s\+$//e " Runs a script that cleans out tex build files whenever I close out of a .tex file. autocmd VimLeave *.tex !texclear % -- cgit v1.2.3