From 5ede1870f166cd2aad3f4ec3755eff71be60dc29 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Wed, 10 Jan 2024 08:20:32 -0600 Subject: [PATCH] Updates to .vimrc from usage in Arch. --- .vimrc | 66 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/.vimrc b/.vimrc index 05f356d..79304ba 100644 --- a/.vimrc +++ b/.vimrc @@ -1,4 +1,4 @@ -execute pathogen#infect() +"execute pathogen#infect() set autochdir set autoindent set expandtab @@ -8,21 +8,30 @@ set number set ruler set shiftwidth=2 set tabstop=2 +set softtabstop=0 set textwidth=79 +set signcolumn=yes set cursorline syntax enable +packadd matchit + filetype plugin on filetype indent on let mapleader=" " -autocmd BufRead,BufNewFile *.md setlocal filetype=markdown +let g:markdown_recommended_style=0 +autocmd BufRead,BufNewFile *.md setlocal filetype=markdown fo-=l fo+=ro +autocmd BufRead,BufNewFile *.pco setlocal filetype=chordpro +autocmd BufRead,BufNewFile *.yaml setlocal fo=croqt +autocmd BufRead,BufNewFile *.nim setlocal fo=croqt +autocmd BufRead,BufNewFile *.ts setlocal fo=croqt " Set/load the view when switching buffers. Used to use to preserve folding. " Stopped because weirder things were happening. -"autocmd BufEnter *.* silent loadview -"autocmd BufLeave *.* mkview! +" autocmd BufEnter *.* silent loadview +" autocmd BufLeave *.* mkview! autocmd BufRead *.java set foldnestmax=2 autocmd BufRead *.java set foldmethod=syntax @@ -42,15 +51,39 @@ vnoremap # : \gV:call setreg('"', old_reg, old_regtype) let g:solarized_contrast="high" +let g:ale_fixers = { + \ '*': ['remove_trailing_lines', 'trim_whitespace'], + \ 'javascript': ['deno', 'eslint'], + \ 'typescript': ['deno', 'eslint', 'prettier'], + \ 'vue': ['prettier'], + \} + +" Disable linters on markdown. I personally don't find any of these useful +" enough to includ in my general authorship. However, ALE performs the check +" for the presence of the executables every time vim enters normal mode. This +" can introduce a noticeable (>1s) lag when running in balanced power mode. So +" I manually disable all of them. +let g:ale_linters = { + \ 'markdown': [], + \ 'html': ['HTMLHint', 'proselint', 'write-good'], + \ 'rst': [], + \ 'python': ['pylint'], + \ 'typescript': ['deno', 'eslint'], + \} +" default (as of time of writing) was: +" \ 'markdown': ['alex', 'cspell', 'languagetool', 'markdownlint', 'mdl', 'proselint', 'redpen', 'remark_lint', 'textlint', 'vale', 'writegood'], + +", +let g:ale_fix_on_save = 1 +"let g:ale_linters_explicit = 1 + let g:ctrlp_max_files = 0 let g:ctrlp_custom_ignore = { \ 'dir': '\v\.git$|\.hg$|\.svn$|\.worktrees$|build$|target$|node_modules$|nimcache$|dist$', \ 'file': '\v\.(class|exe|so|dll|sw.)$' \ } -let g:ale_linters = { - \ 'html': ['HTMLHint', 'proselint', 'write-good'] - \ } +let g:ale_virtualtext_cursor = 0 let groovy_space_errors = 1 let groovy_allow_cpp_keywords = 1 @@ -82,25 +115,32 @@ nmap ws :w:silent !git add %:!git commit nmap b :CtrlPBuffer +" Format Biblical quotations in Markdown +vmap qb :s/\v\s+(\d+)(\s+\|$)/ **\1**\2/g + " remove trailing whitespace from all lines nmap ss :%s/\s\+$// +" check spelling +nmap sp :!aspell -c % + " Execute the current line (stripping leading `$`s) -nmap r :.w !sed s/^\\s*\\$\\s*//\|bash +nmap r :.w !sed s/^\\s*[\\$\\#]\\s*//\|bash " Execute the current line (stripping leading `$`s) and paste the output into " the buffer underneath. -nmap R yyp!!sed s/^\\s*\\$\\s*//\|bash +nmap R yyp!!sed s/^\\s*[\\$\\#]\\s*//\|bash -vmap qb :s/\v\s+(\d+)\s+/ **\1** /g +" Execute the selected text as a vim command. +vmap e "zy@z highlight Folded term=standout ctermfg=3 ctermbg=256 " Use a dark gray for highlighting 'spelling' errors (ALE uses this class for " highlighting linting errors). Original value was 224 -"highlight SpellBad ctermbg=236 +"highlight SpellBad ctermbg=236 " " Actually, just diable ALE in-line error highlighting and just rely on the " markers in the gutter. -highlight clear ALEError -highlight link ALEError NONE +" highlight clear ALEError +" highlight link ALEError NONE