You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
3.7 KiB
149 lines
3.7 KiB
|
|
|
|
syntax on |
|
" stolen from andy |
|
set undofile |
|
set colorcolumn=80 |
|
|
|
"set formatoptions=tc |
|
"set fo+=a |
|
"set textwidth=80 |
|
|
|
set scrolloff=6 |
|
set number |
|
" set relativenumber |
|
set tabstop=4 softtabstop=4 expandtab shiftwidth=4 smarttab |
|
"set nofoldenable |
|
"set foldmethod=syntax |
|
set foldlevelstart=2 |
|
"set foldnestmax=10 " 10 nested fold max |
|
set laststatus=2 |
|
set noshowmode |
|
set cursorline |
|
|
|
" Some servers have issues with backup files, see #649. |
|
set nobackup |
|
set nowritebackup |
|
|
|
nnoremap j gj |
|
nnoremap k gk |
|
|
|
"""""""""""""""""""""""""""""""""""""" |
|
" clipboard stuff |
|
"""""""""""""""""""""""""""""""""""""" |
|
|
|
" Copy to clipboard |
|
vnoremap <C-c> "+y |
|
vnoremap <C-v> "+p |
|
vnoremap <leader>y "+y |
|
nnoremap <leader>Y "+yg_ |
|
nnoremap <leader>y "+y |
|
nnoremap <leader>yy "+yy |
|
|
|
|
|
" Copy to clipboard |
|
vnoremap <leader>d "+d |
|
nnoremap <leader>D "+Dg_ |
|
nnoremap <leader>d "+d |
|
nnoremap <leader>dd "+dd |
|
|
|
" Paste from clipboard |
|
nnoremap <leader>p "+p |
|
nnoremap <leader>P "+P |
|
vnoremap <leader>p "+p |
|
vnoremap <leader>P "+P |
|
|
|
" invert parenth highlighting |
|
hi MatchParen ctermfg=208 ctermbg=233 cterm=bold" Fuzzy File Opening with :find |
|
|
|
set path+=** |
|
set wildmenu |
|
|
|
" Search |
|
set ignorecase smartcase incsearch hlsearch |
|
|
|
nnoremap <F5> :call LanguageClient_contextMenu()<CR> |
|
" Or map each action separately |
|
nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR> |
|
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR> |
|
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR> |
|
|
|
function SetLSPShortcuts() |
|
nnoremap <leader>ld :call LanguageClient#textDocument_definition()<CR> |
|
nnoremap <leader>lr :call LanguageClient#textDocument_rename()<CR> |
|
nnoremap <leader>lf :call LanguageClient#textDocument_formatting()<CR> |
|
nnoremap <leader>lt :call LanguageClient#textDocument_typeDefinition()<CR> |
|
nnoremap <leader>lx :call LanguageClient#textDocument_references()<CR> |
|
nnoremap <leader>la :call LanguageClient_workspace_applyEdit()<CR> |
|
nnoremap <leader>lc :call LanguageClient#textDocument_completion()<CR> |
|
nnoremap <leader>lh :call LanguageClient#textDocument_hover()<CR> |
|
nnoremap <leader>ls :call LanguageClient_textDocument_documentSymbol()<CR> |
|
nnoremap <leader>lm :call LanguageClient_contextMenu()<CR> |
|
endfunction() |
|
|
|
"augroup LSP |
|
" autocmd! |
|
" autocmd FileType cpp,c call SetLSPShortcuts() |
|
"augroup END |
|
|
|
"set hlsearch |
|
""let g:incsearch#auto_nohlsearch = 1 |
|
"map n <Plug>(incsearch-nohl-n) |
|
"map N <Plug>(incsearch-nohl-N) |
|
"map * <Plug>(incsearch-nohl-*) |
|
"map # <Plug>(incsearch-nohl-#) |
|
"map g* <Plug>(incsearch-nohl-g*) |
|
"map g# <Plug>(incsearch-nohl-g#) |
|
|
|
"nmap <F3> i<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc> |
|
"imap <F3> <C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR> |
|
|
|
"REMAPS |
|
|
|
nnoremap <silent><esc> :nohlsearch<CR> |
|
|
|
" vertical resize shortcuts |
|
nnoremap <M-=> :res +1<CR> |
|
nnoremap <M--> :res -1<CR> |
|
|
|
" horizontal resize shortcuts |
|
nnoremap <M-+> :res +1<CR> |
|
nnoremap <M-_> :res -1<CR> |
|
|
|
" quick terminal open |
|
nnoremap <leader>t :12sp<CR>:term<CR>i |
|
|
|
" better pane switching |
|
set splitbelow |
|
set splitright |
|
set hlsearch |
|
|
|
"let g:vimtex_view_method = 'zathura' |
|
"let g:vimtex_latexmk_progname= '/usr/bin/nvr' |
|
|
|
tnoremap <C-h> <C-\><C-N><C-w>h |
|
tnoremap <C-j> <C-\><C-N><C-w>j |
|
tnoremap <C-k> <C-\><C-N><C-w>k |
|
tnoremap <C-l> <C-\><C-N><C-w>l |
|
inoremap <C-h> <C-\><C-N><C-w>h |
|
inoremap <C-j> <C-\><C-N><C-w>j |
|
inoremap <C-k> <C-\><C-N><C-w>k |
|
inoremap <C-l> <C-\><C-N><C-w>l |
|
nnoremap <C-h> <C-w>h |
|
nnoremap <C-j> <C-w>j |
|
nnoremap <C-k> <C-w>k |
|
nnoremap <C-l> <C-w>l |
|
|
|
tnoremap <Esc> <C-\><C-n> |
|
tnoremap <C-w> <C-\><C-n><C-w> |
|
|
|
" Highight Keywords in code comments and notes |
|
"match Todo /TODO:\|DEFN:\|REF:\|Q:/ |
|
|
|
" means you can just start writing shit at some random point on the page which |
|
" is quite nice |
|
set virtualedit=all |
|
|
|
map <C-enter> :VimtexView<cr> |
|
|
|
|
|
|