···11+" Some servers have issues with backup files, see #649.
22+set nobackup
33+set nowritebackup
44+55+" Give more space for displaying messages.
66+set cmdheight=2
77+88+" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
99+" delays and poor user experience.
1010+set updatetime=300
1111+1212+" Don't pass messages to |ins-completion-menu|.
1313+set shortmess+=c
1414+1515+" Always show the signcolumn, otherwise it would shift the text each time
1616+" diagnostics appear/become resolved.
1717+if has("nvim-0.5.0") || has("patch-8.1.1564")
1818+ " Recently vim can merge signcolumn and number column into one
1919+ set signcolumn=number
2020+else
2121+ set signcolumn=yes
2222+endif
2323+2424+" Use tab for trigger completion with characters ahead and navigate.
2525+" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
2626+" other plugin before putting this into your config.
2727+inoremap <silent><expr> <TAB>
2828+ \ pumvisible() ? "\<C-n>" :
2929+ \ <SID>check_back_space() ? "\<TAB>" :
3030+ \ coc#refresh()
3131+inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
3232+3333+function! s:check_back_space() abort
3434+ let col = col('.') - 1
3535+ return !col || getline('.')[col - 1] =~# '\s'
3636+endfunction
3737+3838+" Use <c-space> to trigger completion.
3939+if has('nvim')
4040+ inoremap <silent><expr> <c-space> coc#refresh()
4141+else
4242+ inoremap <silent><expr> <c-@> coc#refresh()
4343+endif
4444+4545+" Make <CR> auto-select the first completion item and notify coc.nvim to
4646+" format on enter, <cr> could be remapped by other vim plugin
4747+inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
4848+ \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
4949+5050+" Use `[g` and `]g` to navigate diagnostics
5151+" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
5252+nmap <silent> [g <Plug>(coc-diagnostic-prev)
5353+nmap <silent> ]g <Plug>(coc-diagnostic-next)
5454+5555+" GoTo code navigation.
5656+nmap <silent> gd <Plug>(coc-definition)
5757+nmap <silent> gy <Plug>(coc-type-definition)
5858+nmap <silent> gi <Plug>(coc-implementation)
5959+nmap <silent> gr <Plug>(coc-references)
6060+6161+" Use K to show documentation in preview window.
6262+nnoremap <silent> K :call <SID>show_documentation()<CR>
6363+6464+function! s:show_documentation()
6565+ if CocAction('hasProvider', 'hover')
6666+ call CocActionAsync('doHover')
6767+ else
6868+ call feedkeys('K', 'in')
6969+ endif
7070+endfunction
7171+7272+" Highlight the symbol and its references when holding the cursor.
7373+autocmd CursorHold * silent call CocActionAsync('highlight')
7474+7575+" Symbol renaming.
7676+nmap <leader>rn <Plug>(coc-rename)
7777+7878+" Formatting selected code.
7979+xmap <leader>f <Plug>(coc-format-selected)
8080+nmap <leader>f <Plug>(coc-format-selected)
8181+8282+augroup mygroup
8383+ autocmd!
8484+ " Setup formatexpr specified filetype(s).
8585+ autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
8686+ " Update signature help on jump placeholder.
8787+ autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
8888+augroup end
8989+9090+" Applying codeAction to the selected region.
9191+" Example: `<leader>aap` for current paragraph
9292+xmap <leader>a <Plug>(coc-codeaction-selected)
9393+nmap <leader>a <Plug>(coc-codeaction-selected)
9494+9595+" Remap keys for applying codeAction to the current buffer.
9696+nmap <leader>ac <Plug>(coc-codeaction)
9797+" Apply AutoFix to problem on the current line.
9898+nmap <leader>qf <Plug>(coc-fix-current)
9999+100100+" Run the Code Lens action on the current line.
101101+nmap <leader>cl <Plug>(coc-codelens-action)
102102+103103+" Map function and class text objects
104104+" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
105105+xmap if <Plug>(coc-funcobj-i)
106106+omap if <Plug>(coc-funcobj-i)
107107+xmap af <Plug>(coc-funcobj-a)
108108+omap af <Plug>(coc-funcobj-a)
109109+xmap ic <Plug>(coc-classobj-i)
110110+omap ic <Plug>(coc-classobj-i)
111111+xmap ac <Plug>(coc-classobj-a)
112112+omap ac <Plug>(coc-classobj-a)
113113+114114+" Remap <C-f> and <C-b> for scroll float windows/popups.
115115+if has('nvim-0.4.0') || has('patch-8.2.0750')
116116+ nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
117117+ nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
118118+ inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
119119+ inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
120120+ vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
121121+ vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
122122+endif
123123+124124+" Use CTRL-S for selections ranges.
125125+" Requires 'textDocument/selectionRange' support of language server.
126126+nmap <silent> <C-s> <Plug>(coc-range-select)
127127+xmap <silent> <C-s> <Plug>(coc-range-select)
128128+129129+" Add `:Format` command to format current buffer.
130130+command! -nargs=0 Format :call CocActionAsync('format')
131131+132132+" Add `:Fold` command to fold current buffer.
133133+command! -nargs=? Fold :call CocAction('fold', <f-args>)
134134+135135+" Add `:OR` command for organize imports of the current buffer.
136136+command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
137137+138138+" Add (Neo)Vim's native statusline support.
139139+" NOTE: Please see `:h coc-status` for integrations with external plugins that
140140+" provide custom statusline: lightline.vim, vim-airline.
141141+set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
142142+143143+" Mappings for CoCList
144144+" Show all diagnostics.
145145+nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
146146+" Manage extensions.
147147+nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
148148+" Show commands.
149149+nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
150150+" Find symbol of current document.
151151+nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
152152+" Search workspace symbols.
153153+nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
154154+" Do default action for next item.
155155+nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
156156+" Do default action for previous item.
157157+nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
158158+" Resume latest coc list.
159159+nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
+46-7
nvim/init.vim
···5151Plug 'sbdchd/neoformat'
52525353"support for go to defintion and autocompletion
5454-Plug 'davidhalter/jedi-vim'
5454+"Plug 'davidhalter/jedi-vim'
5555+Plug 'neoclide/coc.nvim', {'branch': 'release'}
5556Plug 'jmcantrell/vim-virtualenv'
56575758Plug 'liuchengxu/vim-which-key'
···8485set splitright " Vertical splits will automatically be to the right
8586set t_Co=256 " Support 256 colors
8687set cmdheight=2 " More space for displaying messages
8888+set updatetime=300 " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable delays and poor user experience.
8789set pumheight=10 " Makes popup menu smaller
8890set hidden " Required to keep multiple buffers open multiple buffers
8991set timeoutlen=500 " By default timeoutlen is 1000 ms
···112114"switch between two buffers -> C-^ does not work with current swiss layout
113115nnoremap <C-6> <C-^><cr>
114116117117+" PYTHON
115118119119+"auto format on save with Black
120120+autocmd BufWritePre *.py execute ':Black'
121121+122122+" let g:python3_host_prog = "$venvs/banking/bin/python3"
123123+124124+" coc
125125+"let g:coc_node_path = "/opt/homebrew/bin/node"
126126+let g:coc_global_extensions = ['coc-json', 'coc-git']
127127+nnoremap <Leader>tg :CocCommand git.toggleGutters<CR> " toggle coc-git gutter
128128+129129+" jedi - shortcuts -> replced with coc
130130+" let g:jedi#goto_command = "<leader>d"
131131+" let g:jedi#goto_assignments_command = "<leader>g"
132132+" let g:jedi#goto_stubs_command = "<leader>s"
133133+" let g:jedi#goto_definitions_command = ""
134134+" let g:jedi#documentation_command = "K"
135135+" let g:jedi#usages_command = "<leader>n"
136136+" let g:jedi#completions_command = "<C-Space>"
137137+" let g:jedi#rename_command = "<leader>r"
138138+139139+" PEP 8 indentation
140140+au BufNewFile,BufRead *.py
141141+ \ set tabstop=4
142142+ \ set softtabstop=4
143143+ \ set shiftwidth=4
144144+ \ set textwidth=79
145145+ \ set expandtab
146146+ \ set autoindent
147147+ \ set fileformat=unix
148148+149149+" Other Languages and indentaion
150150+au BufNewFile,BufRead *.js, *.html, *.css
151151+ \ set tabstop=2
152152+ \ set softtabstop=2
153153+ \ set shiftwidth=2
116154117155" Others
118156"
···206244nmap <leader>8 :bfirst<CR>:7bn<CR>
207245208246"NerdTree
209209-nnoremap <leader>n :NERDTreeFocus<CR>
210210-nnoremap <C-n> :NERDTree<CR>
211211-nnoremap <C-t> :NERDTreeToggle<CR>
247247+"nnoremap <leader>n :NERDTreeFocus<CR>
248248+"nnoremap <C-n> :NERDTree<CR>
249249+nnoremap <C-l> :NERDTreeToggle<CR>
212250" nnoremap <C-f> :NERDTreeFind<CR>
213251214252" fzf: ctrl f for find files
···275313noremap <silent> <Leader>cu :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>
276314277315278278-"auto format on save with Black
279279-autocmd BufWritePre *.py execute ':Black'
280280-281316" Custom surrounds
282317let w:surround_{char2nr('w')} = "```\r```"
283318let b:surround_{char2nr('b')} = "**\r**"
···286321"cusotm stuff just for neovim
287322source $HOME/.config/nvim/themes/airline.vim
288323source $HOME/.config/nvim/themes/onedark.vim
324324+source $HOME/.config/nvim/coc.vim
289325"syntax on
290326291327""Gruvbox:
···296332297333"set bg=dark
298334"let g:gruvbox_contrast_dark = 'hard'
335335+336336+337337+299338300339301340au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC
+16
obsidian/.vimrc
···11+22+33+" remap esc key
44+imap kj <Esc>
55+imap jk <Esc>
66+imap jj <Esc>
77+88+" map to visual line instead of full line as in obsidian line are always
99+" wraped
1010+nmap <C-j> gj
1111+nmap <C-k> gk
1212+" nmap j gj
1313+" nmap k gk
1414+" nmap $ g$
1515+" nmap ^ g^
1616+" nmap 0 g^