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 set completeopt=menu,menuone,preview,noselect,noinsert colorscheme nord let g:lightline = { \ 'colorscheme': 'nord', \ 'active': { \ 'left': [ \ [ 'mode', 'paste' ], \ [ 'lsp_info', 'lsp_hints', 'lsp_errors', 'lsp_warnings', 'lsp_ok' ], \ [ 'lsp_status' ], \ [ 'readonly', 'filename', 'modified' ], \ ] \ }, \ 'component': { \ 'lineinfo': ' %3l:%-2v', \ }, \ 'component_function': { \ 'readonly': 'LightlineReadonly', \ }, \ 'separator': { 'left': '', 'right': '' }, \ 'subseparator': { 'left': '', 'right': '' } \ } function! LightlineReadonly() return &readonly ? '' : '' endfunction call lightline#lsp#register() set laststatus=2 set noshowmode set number set colorcolumn=80 set textwidth=80 nmap :noh " 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 " Format nmap f :lua require("conform").format() " 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='|' " 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='' " Telescope nnoremap :Telescope buffers nnoremap :call TelescopeFiles() nnoremap :Telescope lsp_document_symbols nmap ] :Telescope lsp_definitions nmap ] :Telescope lsp_type_definitions nmap [ :Telescope lsp_implementations nmap [ :Telescope lsp_references nmap :Telescope diagnostics bufnr=0 function TelescopeFiles() if stridx(system('git rev-parse --is-inside-work-tree 2>/dev/null || true'), 'true') != -1 lua require('telescope.builtin').git_files{use_file_path=true,git_command={"sh","-c","git ls-files -c --recurse-submodules && git ls-files -o --exclude-standard"}} else lua require('telescope.builtin').find_files{} endif endfunction " Copy line location nmap c :let @+=expand("%:p") . ":" . line(".")