2020-05-18 19:08:46 +02:00
|
|
|
|
" Basic display
|
|
|
|
|
set number
|
|
|
|
|
set colorcolumn=80
|
|
|
|
|
|
|
|
|
|
" Persistent undo
|
|
|
|
|
set undofile
|
|
|
|
|
set undolevels=4096
|
|
|
|
|
set undoreload=16384
|
|
|
|
|
|
|
|
|
|
" Search
|
|
|
|
|
set ignorecase
|
|
|
|
|
|
|
|
|
|
" Autoload settings from file
|
|
|
|
|
set modeline
|
|
|
|
|
|
|
|
|
|
" Use system clipboard
|
|
|
|
|
set clipboard=unnamedplus
|
|
|
|
|
|
2020-07-18 10:04:17 +02:00
|
|
|
|
" Support more file encodings
|
|
|
|
|
set fileencodings=ucs-bom,utf-8,default,sjis,latin1
|
|
|
|
|
|
|
|
|
|
" Scroll before reaching top/bottom
|
|
|
|
|
set scrolloff=5
|
|
|
|
|
|
|
|
|
|
" Conceal when line is not active
|
|
|
|
|
set conceallevel=1
|
|
|
|
|
|
|
|
|
|
" Just hide buffer instead of unloading
|
|
|
|
|
set hidden
|
|
|
|
|
|
2020-05-21 01:53:22 +02:00
|
|
|
|
" Remap leader key
|
|
|
|
|
let mapleader = ","
|
|
|
|
|
|
2020-05-18 19:08:46 +02:00
|
|
|
|
" Jump to the last position
|
|
|
|
|
if has("autocmd")
|
|
|
|
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
|
|
|
|
|
\| exe "normal! g`\"" | endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
call plug#begin('~/.local/share/nvim/plugged')
|
|
|
|
|
|
2020-07-18 10:04:17 +02:00
|
|
|
|
" Multi-entry selection UI
|
|
|
|
|
Plug 'junegunn/fzf'
|
|
|
|
|
Plug 'junegunn/fzf.vim'
|
|
|
|
|
|
2020-05-18 19:08:46 +02:00
|
|
|
|
" Per-project vim settings
|
|
|
|
|
Plug 'MarcWeber/vim-addon-local-vimrc'
|
|
|
|
|
|
|
|
|
|
" Tagbar
|
|
|
|
|
Plug 'majutsushi/tagbar'
|
|
|
|
|
nmap <F8> :TagbarToggle<CR>
|
|
|
|
|
|
|
|
|
|
" Snippets
|
2020-06-02 17:20:50 +02:00
|
|
|
|
if has('python3')
|
|
|
|
|
Plug 'SirVer/ultisnips'
|
|
|
|
|
let g:UltiSnipsExpandTrigger = '<tab>'
|
|
|
|
|
let g:UltiSnipsJumpForwardTrigger = '<tab>'
|
|
|
|
|
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
|
|
|
|
|
Plug 'honza/vim-snippets'
|
|
|
|
|
endif
|
2020-05-18 19:08:46 +02:00
|
|
|
|
|
2020-07-03 19:13:59 +02:00
|
|
|
|
" Deoplete
|
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
|
|
|
|
let g:deoplete#enable_at_startup = 1
|
|
|
|
|
|
2020-05-18 19:08:46 +02:00
|
|
|
|
" Airline
|
|
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
|
let g:airline_solarized_bg='dark'
|
|
|
|
|
let g:airline_theme='solarized'
|
|
|
|
|
|
2020-05-24 15:39:18 +02:00
|
|
|
|
" Airline for tmux
|
|
|
|
|
Plug 'edkolev/tmuxline.vim'
|
|
|
|
|
|
2020-07-04 11:45:24 +02:00
|
|
|
|
" NERDTree
|
|
|
|
|
Plug 'preservim/nerdtree'
|
|
|
|
|
Plug 'jistr/vim-nerdtree-tabs'
|
|
|
|
|
map <Leader>N <plug>NERDTreeTabsToggle<CR>
|
|
|
|
|
map <Leader>n <plug>NERDTreeFocusToggle<CR>
|
|
|
|
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
2020-07-18 10:04:17 +02:00
|
|
|
|
|
|
|
|
|
" Icons for NERDTree and airline
|
2020-07-04 11:45:24 +02:00
|
|
|
|
Plug 'ryanoasis/vim-devicons'
|
|
|
|
|
|
2020-07-18 10:04:17 +02:00
|
|
|
|
" Intra word motion
|
2020-05-19 16:21:31 +02:00
|
|
|
|
Plug 'chaoren/vim-wordmotion'
|
|
|
|
|
|
2020-05-18 19:08:46 +02:00
|
|
|
|
" Trailing whitespace highlighting
|
|
|
|
|
Plug 'ntpeters/vim-better-whitespace'
|
|
|
|
|
|
|
|
|
|
" Syntax highlighting/Language support
|
|
|
|
|
Plug 'Glench/Vim-Jinja2-Syntax', { 'for': 'jinja' }
|
|
|
|
|
Plug 'cespare/vim-toml', { 'for': 'toml' }
|
|
|
|
|
Plug 'mechatroner/rainbow_csv'
|
|
|
|
|
Plug 'posva/vim-vue', { 'for': 'vue' }
|
|
|
|
|
Plug 'sirtaj/vim-openscad', { 'for': 'openscad' }
|
|
|
|
|
|
2020-05-31 20:04:16 +02:00
|
|
|
|
" Language Client
|
|
|
|
|
Plug 'autozimu/LanguageClient-neovim', {
|
|
|
|
|
\ 'branch': 'next',
|
|
|
|
|
\ 'do': 'bash install.sh',
|
|
|
|
|
\ }
|
|
|
|
|
|
|
|
|
|
let g:LanguageClient_serverCommands = {
|
|
|
|
|
\ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
|
2020-07-04 12:05:38 +02:00
|
|
|
|
\ 'go': ['gopls'],
|
2020-07-04 14:00:43 +02:00
|
|
|
|
\ 'python': ['pyls'],
|
2020-07-11 09:41:45 +02:00
|
|
|
|
\ 'typescript': ['docker', 'run', '--rm', '--init', '-i', '-v', '$HOME:$HOME:ro', '--network=none', 'r.sbruder.de/javascript-typescript-langserver'],
|
|
|
|
|
\ 'javascript': ['docker', 'run', '--rm', '--init', '-i', '-v', '$HOME:$HOME:ro', '--network=none', 'r.sbruder.de/javascript-typescript-langserver'],
|
2020-05-31 20:04:16 +02:00
|
|
|
|
\ }
|
|
|
|
|
|
2020-07-04 17:54:33 +02:00
|
|
|
|
let g:LanguageClient_loggingFile = '~/.local/share/nvim/LanguageClient.log'
|
2020-06-17 16:16:00 +02:00
|
|
|
|
let g:LanguageClient_settingsPath = '~/.config/nvim/LanguageClient.json'
|
|
|
|
|
|
2020-05-31 20:22:55 +02:00
|
|
|
|
function LC_maps()
|
|
|
|
|
if has_key(g:LanguageClient_serverCommands, &filetype)
|
|
|
|
|
nnoremap <buffer> <silent> <F5> :call LanguageClient_contextMenu()<CR>
|
|
|
|
|
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<CR>
|
|
|
|
|
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
|
|
|
|
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
|
|
|
|
set formatexpr=LanguageClient#textDocument_rangeFormatting_sync()
|
|
|
|
|
endif
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
autocmd FileType * call LC_maps()
|
2020-05-31 20:04:16 +02:00
|
|
|
|
|
2020-06-20 13:15:16 +02:00
|
|
|
|
" Rust
|
|
|
|
|
Plug 'rust-lang/rust.vim'
|
|
|
|
|
let g:rustfmt_autosave = 1
|
2020-07-08 22:40:50 +02:00
|
|
|
|
let g:rust_fold = 1
|
|
|
|
|
map <Leader>rt :RustTest<CR>
|
2020-06-20 13:15:16 +02:00
|
|
|
|
|
2020-06-23 23:39:39 +02:00
|
|
|
|
" Black (python formatter)
|
2020-07-30 10:19:50 +02:00
|
|
|
|
Plug 'psf/black', { 'branch': 'stable', 'for': 'python' }
|
2020-06-23 23:39:39 +02:00
|
|
|
|
|
2020-05-18 19:08:46 +02:00
|
|
|
|
" LaTeX helpers
|
|
|
|
|
Plug 'lervag/vimtex'
|
|
|
|
|
let g:tex_flavor='latex'
|
|
|
|
|
let g:vimtex_view_method='zathura'
|
|
|
|
|
let g:tex_conceal='abdmg'
|
2020-05-25 04:19:01 +02:00
|
|
|
|
" nvr is (currently) not in debian repos and therefore installed with pip (in
|
|
|
|
|
" local directory that is not in zathura’s PATH)
|
|
|
|
|
let g:vimtex_compiler_progname='$HOME/.local/bin/nvr'
|
2020-07-08 13:47:25 +02:00
|
|
|
|
let g:vimtex_syntax_autoload_packages = [
|
|
|
|
|
\'amsmath',
|
|
|
|
|
\'luacode',
|
|
|
|
|
\]
|
2020-05-18 19:08:46 +02:00
|
|
|
|
" this disables some helful warnings that often have a reason why I ignore them
|
|
|
|
|
let g:vimtex_quickfix_ignore_filters = [
|
2020-05-27 02:13:58 +02:00
|
|
|
|
\'Underfull \\hbox (badness [0-9]*) in ',
|
|
|
|
|
\'Overfull \\hbox ([0-9]*.[0-9]*pt too wide) in ',
|
2020-05-18 19:08:46 +02:00
|
|
|
|
\'Package hyperref Warning: Token not allowed in a PDF string',
|
|
|
|
|
\'Package typearea Warning: Bad type area settings!',
|
|
|
|
|
\]
|
2020-05-25 16:07:48 +02:00
|
|
|
|
" When using math environments vim does not know if if it currently is in one
|
|
|
|
|
" or outside of one unless it parses the file from the start. Parsing the
|
|
|
|
|
" file from the start each time fixes this but leads to a performance drop
|
|
|
|
|
" (depending on the number of lines).
|
|
|
|
|
" Also, somehow using FileType tex does not work, so this will enable slow
|
|
|
|
|
" syntax highlighting everywhere once a *.tex file is opened.
|
|
|
|
|
autocmd BufEnter *.tex syntax sync fromstart
|
2020-05-18 19:08:46 +02:00
|
|
|
|
|
|
|
|
|
" Color schemes
|
|
|
|
|
Plug 'altercation/vim-colors-solarized'
|
2020-07-18 10:04:17 +02:00
|
|
|
|
|
2020-05-18 19:08:46 +02:00
|
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
|
|
set background=dark
|
|
|
|
|
silent! colorscheme solarized
|