updated .vimrc with better keybindings

This commit is contained in:
2024-02-08 14:50:32 -05:00
parent 6d72737816
commit be3400c9f4

41
.vimrc
View File

@@ -138,7 +138,7 @@ set statusline+=\ %P " percent through file
" => Keymaps: Doing more things at once
" turn off search highlight
nnoremap <leader><space> :nohls <enter>
nnoremap <leader><C-_> :nohls <enter>
" toggle row/column cursor
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
@@ -197,16 +197,32 @@ imap <F4> <C-R>=strftime("%H:%M")<CR>
" ---------------------------------------------------------------------------------------------------------------------
" ---------------------------------------------------------------------------------------------------------------------
" ==> Spellcheck: only certain file types https://robots.thoughtbot.com/vim-spell-checking
" turn off for files with no extension
autocmd BufRead,BufNewFile * setlocal nospell
" turn off for files with any extension
autocmd BufRead,BufNewFile *.* setlocal nospell
" turn on for markdown files
autocmd BufRead,BufNewFile *.md setlocal spell
" turn on for text files
autocmd BufRead,BufNewFile *.txt setlocal spell
" ==> Spellcheck
" Horrible colors! I hate spellchecker's red highlight, so I changed it
" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck)
" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax)
set spell spelllang=en_us
" Toggle spell check with F10
nnoremap <F10> :setlocal spell! spelllang=en_us<CR>
set spell spelllang=en_us
" Save custom dictionary in nextcloud so it's available on all machines
" set spellfile=/home/chawley/nextcloud-overlook/notes/system/en.utf-8.add
" auto-complete spelling suggestions with <ctrl-p>
set complete+=kspell
" Horrible colors! I hate spellchecker's red highlight, so I changed it
" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck)
" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax)
hi clear SpellBad
hi clear SpellCap
hi clear SpellErrors
@@ -215,17 +231,6 @@ hi clear SpellRare
hi SpellBad cterm=underline ctermbg=black ctermfg=red
hi SpellCap cterm=underline ctermbg=black ctermfg=red
" ---------------------------------------------------------------------------------------------------------------------
" ==> Spellcheck: only certain file types https://robots.thoughtbot.com/vim-spell-checking
" turn off for files with no extension
autocmd BufRead,BufNewFile * setlocal nospell
" turn off for files with any extension
autocmd BufRead,BufNewFile *.* setlocal nospell
" turn on for markdown files
autocmd BufRead,BufNewFile *.md setlocal spell
" turn on for text files
autocmd BufRead,BufNewFile *.txt setlocal spell
" ---------------------------------------------------------------------------------------------------------------------
" ==> Snippets