UNMO22GQRCYHMIXPFTZTQVVPCOFSBVU2YV5CKLO72ZRDZ2AJ46WQC
{
"languageserver": {
"clangd": {
"command": "clangd",
"rootPatterns": ["compile_flags.txt", "compile_commands.json", ".vim/", ".git/", ".hg/"],
"filetypes": ["c", "cpp", "objc", "objcpp"]
},
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"]
}
}
}
" Required for operations modifying multiple buffers like rename.
set hidden
" Highlight the line your cursor is on
set cursorline
" Prevent the window from resizing due to the gitgutter being added
set signcolumn=yes
" use normal regex when searching in normal/visual mode
nnoremap / /\v
vnoremap / /\v
" ignore casing when searching w/ all lower-case letters
set ignorecase
set smartcase
" showmode hides the echodoc function signatures,
" and airline already shows the mode
set noshowmode
\ 'c': ['clangd']
\ 'python': ['python3', '-m', 'pyls'],
\ 'rust': ['~/.cargo/bin/rls'],
\ 'typescript': ['typescript-language-server', '--stdio'],
\ 'javascript': ['typescript-language-server', '--stdio'],
\ 'cs': [expand('~/bin/omnisharp/logged-runner.sh'), '--languageserver']
" Prefer vimtex to latex-box
let g:polyglot_disabled = ['latex']
" filetype detection for arm assembly files to enable syntax highlighting
au BufNewFile,BufRead *_armv8.s,*_armv8.S set filetype=arm
" store language server logs
let g:LanguageClient_loggingFile = expand('~/.local/share/nvim/language-client.log')
" enable ncm2 for all buffers
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect
let g:ncm2#popup_limit = 20 " display 20 items at most
" show function signatures in the command line
let g:echodoc#enable_at_startup = 1
" Highlight the line your cursor is on
set cursorline
" Prevent the window from resizing due to the gitgutter being added
set signcolumn=yes
" create a homerow shortcut for escape
inoremap <silent> <c-j> <esc>
vnoremap <silent> <c-j> <esc>
nnoremap <silent> <c-j> <esc>
snoremap <silent> <c-j> <esc>
tnoremap <silent> <c-j> <c-\><c-n>
" easier horizontal window navigation
vmap <silent> <c-l> <c-j><c-w>l
imap <silent> <c-l> <c-j><c-w>l
nmap <silent> <c-l> <c-j><c-w>l
vmap <silent> <c-h> <c-j><c-w>h
imap <silent> <c-h> <c-j><c-w>h
nmap <silent> <c-h> <c-j><c-w>h
nnoremap <leader>f :FZF<cr>
" nnoremap <leader>s :ToggleWorkspace<cr>
" Searching with fzf
nnoremap <leader>f :Files<cr>
nnoremap <leader>b :Buffers<cr>
nnoremap <leader>g :Rg<cr>
nnoremap <leader>c :Commands<cr>
nnoremap <leader>h :Helptags<cr>
" Session management
" LanguageClient integration
nnoremap <silent> K :call LanguageClient_textDocument_hover()<cr>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<cr>
nnoremap <silent> <leader>r :call LanguageClient_textDocument_rename()<cr>
nnoremap <silent> <leader>u :call LanguageClient_textDocument_references()<cr>
" Tabularize shortcuts
nnoremap <silent> <leader>a= :Tabularize /=<cr>
vnoremap <silent> <leader>a= :Tabularize /=<cr>
nnoremap <silent> <leader>a: :Tabularize /:\zs<cr>
vnoremap <silent> <leader>a: :Tabularize /:\zs<cr>