nvim/init.vim

188 lines
3.6 KiB
VimL
Raw Normal View History

if exists("$VIRTUAL_ENV")
let g:python3_host_prog=substitute(system("which -a python3 | head -n2 | tail -n1"), "\n", '', 'g')
else
let g:python3_host_prog=substitute(system("which python3"), "\n", '', 'g')
endif
runtime packages.vim
let $MYVIMDIR=split(&rtp, ',')[0]
set exrc
set background=dark
2019-05-09 09:18:03 +00:00
let g:chroma_italic_style="bold"
let g:chroma_nontext_dark=1
colo chroma
if exists("&cc")
set cc=+1
endif
set number
set textwidth=80
2017-07-13 12:03:43 +00:00
set tabstop=2
set shiftwidth=2
set whichwrap+=<,>,h,l
set notimeout
set ttimeout
2019-05-09 09:18:03 +00:00
set ttimeoutlen=50
set foldmethod=syntax
2021-08-11 10:25:50 +00:00
set foldlevelstart=99
" disables visualbell
set vb t_vb=
set shellcmdflag=-c
set shell=/bin/zsh
set modeline
set showcmd
set ignorecase smartcase
2019-11-13 13:57:44 +00:00
set inccommand=split
set wildmode=list:longest,list:full
set wildignore+=*.so,*.swp,*.zip,*.o
set suffixes=.bak,~,.h,.info,.swp,.obj,.info,.aux,.dvi,.bbl,.out,.o,.lo,\.class
set suffixes+=.pdf
set wildmenu
set hidden
2022-02-07 10:52:43 +00:00
"set completeopt=menu,noinsert,preview
"set completeopt=menuone,noinsert,noselect
set completeopt=menu,menuone,noselect
2021-08-11 10:25:50 +00:00
set shortmess+=c
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
2021-01-19 23:14:25 +00:00
set mouse=
set cursorline
set guicursor=
set undofile
set undodir=~/.local/share/nvim/undo
set spelllang=de
set termguicolors
set pumblend=20
2021-08-11 10:25:50 +00:00
set updatetime=300
" custom commands
command! RC edit $MYVIMRC
command! SRC source $MYVIMRC
command! CD :cd %:h
command! PlugEdit edit $MYVIMDIR/packages.vim
command! PlugReload source $MYVIMDIR/packages.vim | PlugInstall
2022-02-07 10:56:27 +00:00
command! TrailingSpace %s/\s*$//g
"{{{ latex
" controls filetype setting, therefore not possible to move to ftplugin
let g:tex_flavor = "latex"
"}}}
" {{{ misc Autocommands
augroup Misc
au FileType mail setlocal spell
au FileType man setlocal nonu
augroup END
augroup Cache
autocmd!
autocmd BufRead,BufNewFile ~/Private/* setlocal directory=.
augroup END
"{{{ binary editing
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
"}}}
"}}}
" common mappings {{{
nnoremap <space> za
2021-08-11 10:25:50 +00:00
vnoremap <silent> . <cmd>normal .<CR>
2021-05-20 15:58:56 +00:00
tnoremap <C-q> <C-\><C-n>
map <Left> <C-w>h
map <Down> <C-w>j
map <Up> <C-w>k
map <Right> <C-w>l
map <S-Left> <C-w><
map <S-Right> <C-w>>
map <S-Down> <C-w>-
map <S-Up> <C-w>+
" navigate windows with alt+[hjkl]
tnoremap <A-h> <C-\><C-N><C-w>h
tnoremap <A-j> <C-\><C-N><C-w>j
tnoremap <A-k> <C-\><C-N><C-w>k
tnoremap <A-l> <C-\><C-N><C-w>l
inoremap <A-h> <C-\><C-N><C-w>h
inoremap <A-j> <C-\><C-N><C-w>j
inoremap <A-k> <C-\><C-N><C-w>k
inoremap <A-l> <C-\><C-N><C-w>l
nnoremap <A-h> <C-w>h
nnoremap <A-j> <C-w>j
nnoremap <A-k> <C-w>k
nnoremap <A-l> <C-w>l
nnoremap <M-[> :call search('^[^[:space:])\]}]', 'be')<cr>
nnoremap <M-]> :call search('^[^[:space:])\]}]', 'e')<cr>
inoremap <C-U> <C-G>u<C-U>
nnoremap & :&&<CR>
xnoremap & :&&<CR>
nnoremap Y y$
inoremap <C-Space> <C-x><C-o>
2021-08-11 10:25:50 +00:00
nmap <C-L> <cmd>noh<cr><cmd>redraw!<cr>
nmap <C-Tab> <C-w><C-w>
imap <C-Tab> <esc><C-w><C-w>
2021-08-11 10:25:50 +00:00
vmap <silent> gs <cmd>'<,'>sort<cr>
"}}}
"Git {{{
2021-08-11 10:25:50 +00:00
nmap <Leader>gu <cmd>Gina push<CR>
nmap <Leader>gvc <cmd>!git svn dcommit<CR>
nmap <Leader>gvf <cmd>!git svn fetch<CR>
" Git }}}
let g:signify_vcs_list = [ 'git', 'hg' ]
2021-08-11 10:25:50 +00:00
"let g:signify_disable_by_default = 1
2021-08-11 10:25:50 +00:00
let g:localvimrc_whitelist='/home/crater2150/work/.*'
let g:localvimrc_sandbox=0
2021-08-11 10:25:50 +00:00
lua require("my-lsp")
lua require("lsputils")
lua require("conf.cmp")
2021-08-11 10:25:50 +00:00
lua require("conf.trouble")
" vi:foldmethod=marker sw=2