feat: vimrc enhancements

* feat: added latex compilation nmap
* feat: set scrolloff=5
* feat: set noerrorbells (silence)
* feat: set conceallevel=0 - esp. noticeable in json files
* feat: set termguicolors
* fix: vim in tmux mouse fix (in qterminal)
* refactor: use palenight.vim as palenight
* refactor: move stuff around
This commit is contained in:
surtur 2020-05-27 10:25:31 +02:00
parent 28459507ed
commit aa3dff77a4
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -5,15 +5,6 @@ filetype off "required
filetype plugin on " required
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
@ -27,17 +18,14 @@ if empty(glob('~/.vim/autoload/plug.vim'))
endif
call plug#begin()
Plug 'drewtempelmeyer/palenight.vim'
Plug 'drewtempelmeyer/palenight.vim', { 'as': 'palenight' }
Plug 'jacoborus/tender.vim'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'jaredgorski/SpaceCamp', { 'as': 'spacecamp' }
Plug 'lervag/vimtex', { 'for': 'tex' }
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'justmao945/vim-clang'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
@ -59,14 +47,10 @@ call plug#end()
let g:airline_powerline_fonts = 1
let g:Powerline_symbols = "fancy" " sth like this probably set as a default but won't hurt here
let g:airline_highlighting_cache = 1
let g:airline_section_z = airline#section#create(['windowswap', '%3p%% ', 'linenr', ' :%3v'])
" let g:airline_theme = 'dracula'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
let g:gitgutter_terminal_reports_focus=0
let g:gitgutter_async = 1
let g:gitgutter_sign_allow_clobber=0
@ -75,9 +59,9 @@ let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_ignore_case = 1
let g:livepreview_cursorhold_recompile = 0
let g:livepreview_previewer = 'xreader'
let g:livepreview_engine = 'pdflatex'
let g:vimtex_compiler_progname = 'pdflatex'
let g:livepreview_previewer = 'evince'
let g:livepreview_engine = 'pdflatex -shell-escape -interaction=nonstopmode'
let g:vimtex_compiler_progname = 'pdflatex -shell-escape --interaction=nonstopmode'
let g:tex_flavor = 'latex'
" Add spaces after comment delimiters by default
@ -91,7 +75,7 @@ let g:NERDTrimTrailingWhitespace = 1
" Add your own custom formats or override the defaults
let g:NERDCustomDelimiters = { 'vim': { 'left': '"','right': '' }, 'c': { 'left': '/**','right': '*/' } }
"let g:indentLine_setColors = 0
let g:indentLine_setColors = 1
let g:indentLine_char_list = ['|', '¦', '┆', '┊', ':']
@ -149,6 +133,7 @@ nmap <Leader>nt :NERDTreeToggle<CR>
vmap gb :<C-U>!git blame % -L<C-R>=line("'<") <CR>,<C-R>=line("'>") <CR><CR>
nmap gb :!git blame %<CR>
nmap <silent> <Leader>ll w! !pdflatex -shell-escape -interaction=nonstopmode $PWD/*.tex
" ------ wayland copy
@ -156,8 +141,17 @@ xnoremap "+y y:call system("wl-copy", @")<cr>
nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" ------ autocmd ------
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" automatically open NERDTree if vim is open on it's own (argc() ==0 )
" autocmd StdinReadPre * let s:std_in=1
" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
@ -214,16 +208,16 @@ augroup END
au BufWinLeave ?* mkview
au BufWinEnter ?* silent loadview
au FileType xml setlocal shiftwidth=2 tabstop=2
au FileType html setlocal shiftwidth=2 tabstop=2
au FileType xml setlocal shiftwidth=4 tabstop=4
au FileType html setlocal shiftwidth=4 tabstop=4
au BufNewFile,BufRead *.js
\ setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab autoindent fileformat=unix
\ setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent fileformat=unix
au FileType c setl ofu=ccomplete#CompleteCpp
au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil*
\ setlocal tabstop=4 shiftwidth=4 noexpandtab autoindent
\ textwidth=79 fileformat=unix
\ fileformat=unix
" Linux kernel style tabs
au BufNewFile,BufRead *.c,*.h,*.cpp
\ setlocal tabstop=8 shiftwidth=8 softtabstop=8 noexpandtab autoindent
@ -254,7 +248,6 @@ set smarttab
set errorformat+=%.%#PHP:\ %m\ \(in\ %f\ on\ line\ %l\)%.%#,
\%E%[0-9]%#.%m:%f?rev=%.%##L%l\ %.%#,%C%.%#
autocmd BufNewFile,BufRead svn-commit.*tmp :0r $SVN_COMMIT_TEMPLATE
set tags=.tags;
@ -272,7 +265,7 @@ set listchars=trail:•,tab:>-
set list " show/hide tabs and EOL chars (hidden characters)
set confirm " ask confirmation like save before quit.
set wildmenu " Tab completion menu when using command mode
set scrolloff=3 " scroll offset, min lines above/below cursor
set scrolloff=5 " scroll offset, min lines above/below cursor
"set scrolljump=5 " jump 5 lines when running out of the screen - NO
set sidescroll=10 " minimum columns to scroll horizontally
set showcmd " show command status
@ -280,7 +273,7 @@ set showmatch " flashes matching parenthese when cursor over the
set mat=2 " how many tenths of a second to blink when matching brackets
set noshowmode " show editing mode in status (-- INSERT --)
set ruler " show cursor position
set errorbells " bells in terminal
set noerrorbells " bells in vim
set undolevels=1000 " number of undos stored
set viminfo='50,"50 " '=marks for x files, "=registers for x files
@ -295,8 +288,10 @@ set updatetime=1000
syntax enable
colo palenight " new fav highlighting
set conceallevel=0 " for jsons
set ttymouse= " tmux mouse behaviour
set mouse=a " enable mouse in n,v,i,c,h modes
set ttymouse=sgr
set laststatus=2 " show powerline status bar
set t_Co=256
set termguicolors