augroup user_config autocmd! autocmd BufWritePost init.vim source augroup end lua require('plugins') augroup packer_user_config autocmd! autocmd BufWritePost plugins.lua source | PackerCompile augroup end set exrc set secure set title set hidden set undofile set undodir=~/.cache/nvim-undo// set directory=$HOME/.cache/nvim// set hlsearch set wildmode=longest:full,full set wildmenu set modeline set encoding=utf-8 set backspace=indent,eol,start colorscheme nord let g:lightline = { 'colorscheme': 'nord' } set number set colorcolumn=80 set textwidth=80 " Tabs setting. In default we want 4 spaces tab, but allows also 8 spaced tabs set noexpandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 function TabToogle() if &tabstop != 4 set tabstop=4 set shiftwidth=4 set softtabstop=4 echom 'Tab stop set to 4' else set tabstop=8 set shiftwidth=8 set softtabstop=8 echom 'Tab stop set to 8' endif " Soft tab stop is here only for possibility of expandtab endfunction command TabToogle call TabToogle() " Translate word under cursor nnoremap d :! sdcv -n " netrw configuration cabbrev E Explore let g:netrw_banner=0 let g:netrw_liststyle=1 let g:netrw_list_hide='\(^\|\s\s\)\zs\.\S\+,' function GitIgnore() " Possibly find and include all lower .gitignore files? let g:netrw_list_hide='\(^\|\s\s\)\zs\.\S\+,' . netrw_gitignore#Hide() endfunction command GitIgnore call GitIgnore() " Some fast buffer switching and opening of new files nnoremap :Explore nnoremap l :bnext nnoremap h :bprev " Setup gitgutter set updatetime=100 highlight GitGutterAdd ctermfg=2 highlight GitGutterChange ctermfg=3 highlight GitGutterDelete ctermfg=1 " Setup table-mode to markdown compliant " Note: to start use "\ t m" let g:table_mode_corner='|' " Open tagbar with nmap :TagbarOpen fc " Spell checking map :setlocal spell! function LangToggle() if &spelllang !=? 'en_us' setlocal spelllang=en_us echo 'spelllang=en_us' else setlocal spelllang=cs echo 'spelllang=cs' endif endfunction setlocal spelllang=en_us map :call LangToggle() " NERDCommenter let g:NERDCreateDefaultMappings = 1 " UltiSnips triggers let g:UltiSnipsExpandTrigger='' let g:UltiSnipsJumpForwardTrigger='' let g:UltiSnipsJumpBackwardTrigger='' " ALE let g:ale_set_baloons = 1 let g:ale_floating_preview = 1 let g:ale_use_neovim_diagnostics_api = 1 nmap f (ale_fix) " Telescope nnoremap :Telescope buffers nnoremap ":lua require'telescope.builtin'.git_files{}".expand('%:h')."/" nnoremap :Telescope lsp_document_symbols nmap ] :Telescope lsp_definitions nmap ] :Telescope lsp_type_definitions nmap [ :Telescope lsp_implementations nmap [ :Telescope lsp_references " Copy line location " TODO this should work but it doesn't for some reason " nmap c :let @+=expand("%:p") . ":" . line(".") nmap c :exec "!wl-copy '" . expand("%:p") . ":" . line(".") . "'"