Light background and preview config

This commit is contained in:
Vladan Popovic 2020-12-24 17:25:37 +01:00
parent 8f8b3507e2
commit 4c95924618

View file

@ -3,32 +3,34 @@ call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim' Plug 'davidhalter/jedi-vim'
Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'} Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}
Plug 'zchee/deoplete-jedi' Plug 'zchee/deoplete-jedi'
Plug 'sbdchd/neoformat' Plug 'ncm2/float-preview.nvim'
Plug 'dense-analysis/ale' Plug 'dense-analysis/ale'
Plug 'jacoborus/tender.vim' Plug 'jacoborus/tender.vim'
Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'gleam-lang/gleam.vim'
call plug#end() call plug#end()
let g:deoplete#enable_at_startup=1 let g:airline_theme='base16_atelierlakeside'
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif let g:airline#extensions#ale#enabled=1
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" Enable alignment let g:deoplete#enable_at_startup=1
let g:neoformat_basic_format_align=1 " autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
" Enable tab to spaces conversion inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
let g:neoformat_basic_format_retab=1
" Enable trimmming of trailing whitespace
let g:neoformat_basic_format_trim=1
let g:neoformat_try_formatprg=0
" disable autocompletion, cause we use deoplete for completion " disable autocompletion, cause we use deoplete for completion
let g:jedi#completions_enabled=0 let g:jedi#completions_enabled=0
" open the go-to function in split, not another buffer " open the go-to function in split, not another buffer
let g:jedi#use_splits_not_buffers="right" let g:jedi#use_splits_not_buffers="right"
" Preview window is floating
let g:float_preview#docked=0
let g:float_preview#max_width=100
let g:float_preview#max_height=150
let g:float_preview#auto_close=0
set tabstop=4 set tabstop=4
set softtabstop=4 set softtabstop=4
@ -38,35 +40,46 @@ set expandtab
set autoindent set autoindent
set fileformat=unix set fileformat=unix
set number set number
" Hide top preview window, use float_preview instead
set completeopt-=preview
" Enable folding on indent " Enable folding on indent
set foldmethod=indent set foldmethod=indent
set foldlevel=79 set foldlevel=79
" Lint and check types " Lint and check types
let b:ale_linters=['mypy', 'pyls', 'pylint'] let b:ale_linters={
\ 'python': ['mypy', 'pyls', 'pylint'],
\ 'ocaml': ['merlin'],
\ 'rust': ['rls']
\ }
let b:ale_fixers = {
\ 'rust': ['rustfmt'],
\ 'python': ['autopep8'],
\ 'ocaml': ['ocamlformat']
\}
let g:ale_rust_rls_executable = 'rust-analyzer'
let g:ale_fix_on_save=1
let g:ale_lint_on_save=1 let g:ale_lint_on_save=1
let g:ale_list_window_size=20 let g:ale_list_window_size=20
" Fix syntax with autopep8.
" let b:ale_fixers=['autopep8']
" let g:ale_fix_on_save=1
" Use .venv as a global default " Use .venv as a global default
let g:ale_virtualenv_dir_names=['.venv'] let g:ale_virtualenv_dir_names=['.venv']
let g:ale_completion_enabled=1 let g:ale_completion_enabled=1
let g:ale_sign_error="✗" let g:ale_sign_error="✗"
let g:ale_sign_warning="⚠" let g:ale_sign_warning="⚠"
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
" Enable warnings about trailing whitespace for all files. " Enable warnings about trailing whitespace for all files.
let b:ale_warn_about_trailing_whitespace=1 let b:ale_warn_about_trailing_whitespace=1
nmap <leader>e: ALEDetail<CR> nmap <leader>e :ALEDetail<CR>
noremap <leader>d :ALEGoToDefinition<CR>
" ALE colors " ALE colors
highlight ALEWarning ctermbg=Yellow highlight ALEError ctermbg=DarkRed ctermfg=Black
highlight ALEWarning ctermfg=Black highlight ALEWarning ctermbg=Yellow ctermfg=White
highlight ALEError ctermbg=DarkRed
highlight ALEError ctermfg=White
" Use TAB to switch between buffers " Use TAB to switch between buffers
noremap <tab> :bn<CR> noremap <tab> :bn<CR>
@ -78,24 +91,23 @@ match WhitespaceEOL /\s\+\%#\@<!$/
nnoremap <C-k> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR> nnoremap <C-k> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
" Much better with Tomorrow Night Bright color theme set in alacritty " Much better with Tomorrow Night Bright color theme set in alacritty
set background=dark " set background=dark
highlight Search ctermfg=Black highlight Search ctermfg=Black
highlight Comment ctermfg=Grey highlight Comment ctermfg=Grey
highlight SignColumn ctermbg=236 highlight SignColumn ctermbg=0
highlight LineNr ctermfg=244 highlight LineNr ctermbg=0 ctermfg=248
highlight LineNr ctermbg=232 highlight Folded ctermbg=Green ctermfg=Black
highlight Folded ctermbg=DarkGreen highlight Pmenu ctermbg=gray guibg=gray
highlight Folded ctermfg=Black
highlight GitGutterAdd guibg=#22ff22 guifg=#000000 ctermfg=Green highlight GitGutterAdd ctermfg=Green
highlight GitGutterChange guibg=#bbbb00 guifg=#000000 ctermfg=Yellow highlight GitGutterChange ctermfg=Yellow
highlight GitGutterDelete guibg=#ff2222 guifg=#000000 ctermfg=DarkRed highlight GitGutterDelete ctermfg=DarkRed
let g:gitgutter_sign_added='+' let g:gitgutter_sign_added='+'
let g:gitgutter_sign_modified='-+' let g:gitgutter_sign_modified='±'
let g:gitgutter_sign_removed='-' let g:gitgutter_sign_removed='-'
let g:gitgutter_sign_removed_first_line='^^' let g:gitgutter_sign_removed_first_line='^'
let g:gitgutter_sign_modified_removed='--' let g:gitgutter_sign_modified_removed='-'
let g:gitgutter_map_keys=0 let g:gitgutter_map_keys=0
" Toggles on different plugins/modes " Toggles on different plugins/modes
@ -106,9 +118,15 @@ nmap <F4> :GitGutterBufferToggle<CR>
nmap <F5> :NERDTreeToggle<CR> nmap <F5> :NERDTreeToggle<CR>
set pastetoggle=<F2> set pastetoggle=<F2>
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" Maintain undo history between sessions " Maintain undo history between sessions
if !isdirectory("/tmp/.vim-undo-dir") if !isdirectory("/tmp/.vim-undo-dir-vladan")
call mkdir("/tmp/.vim-undo-dir", "", 0700) call mkdir("/tmp/.vim-undo-dir-vladan", "", 0700)
endif endif
set undodir=/tmp/.vim-undo-dir set undodir=/tmp/.vim-undo-dir-vladan
set undofile set undofile
" Enable vimrc files per project
set exrc
" Disable unsafe commands in project vimrc
set secure