From 86a97fa4f915bbce7f94203f430e46b3f386a184 Mon Sep 17 00:00:00 2001 From: morazow Date: Wed, 17 Jun 2020 06:46:39 +0200 Subject: [PATCH] Fix spelling issues in solarized theme. The bad spelling words were not shown using different colors, I realized this when my colleagues suggested corrections on my pull requests. They were bragging that their IDE fixes them :) This is solution to these spelling issues. Spelling commands: For vim spell check help: ``` :help spell-quickstart ``` On top of a spelling word: ``` z= : get a spelling suggestion zg : add good word to spell file zw : add wrong word to spell file zug : remove good word from spell file zuw : remove wrong word from spell file ``` References: - https://github.com/altercation/vim-colors-solarized/issues/195 - https://github.com/vim/vim/issues/2424 --- configs/vimrc | 22 ++++++++++++++-------- run | 8 +++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/configs/vimrc b/configs/vimrc index 14c316d..b1007fb 100644 --- a/configs/vimrc +++ b/configs/vimrc @@ -31,6 +31,7 @@ syntax on " color scheme set background=dark set t_Co=256 +set t_Cs="Fix bad spell issue in solarized theme" let g:solarized_termcolors=256 colorscheme solarized @@ -50,9 +51,9 @@ set cpoptions=B$ "ces$ --conflicts with snipmate, wtf?! nmap ev :e $MYVIMRC nmap sv :so $MYVIMRC -" set the status line (taken from Derek Wyatt's .vimrc :) +" set the status line (taken from Derek Wyatt's .vimrc :) " the better one -set stl=%f\ %m\ %r\ Line:%l/%L[%p%%]\ Col:%c\ Buf:%n\ [%b][0x%B]\ +set stl=%f\ %m\ %r\ Line:%l/%L[%p%%]\ Col:%c\ Buf:%n\ [%b][0x%B]\ set stl+=%{fugitive#statusline()} " put status line in, even if there is only one window @@ -75,13 +76,17 @@ set mousehide " keeps some history set history=100 - + " always set autoindenting on set autoindent set smartindent +" Set spelling settings. +set spelllang=en_us +set spellfile=~/.vim/spell/en.utf-8.add + " switch off the search term highlighting -nmap = :silent :nohlsearch +nmap = :silent :nohlsearch " toggle paste mode nmap pp :set paste! @@ -202,16 +207,17 @@ endfunction autocmd FileType java setlocal shiftwidth=4 tabstop=4 autocmd FileType scala,java,ruby autocmd BufWritePre :call TrimWhiteSpace() +autocmd FileType java,scala,ruby setlocal spell " better git messages -autocmd Filetype gitcommit setlocal spell spelllang=en_us textwidth=72 +autocmd Filetype gitcommit setlocal spell textwidth=72 " markdown autocmd Filetype markdown setlocal textwidth=80 au Bufread,BufNewFile *.md set filetype=markdown " spell check in markdown files -autocmd Filetype markdown setlocal spell spelllang=en_us +autocmd Filetype markdown setlocal spell " " to dicipline me against using arrow keys @@ -237,8 +243,8 @@ nmap :call punish_me() nmap :call punish_me() nmap :call punish_me() -" taken from -" http://www.reddit.com/r/programming/comments/2ljlv/emacs_bondage_and_disciplinke +" taken from +" http://www.reddit.com/r/programming/comments/2ljlv/emacs_bondage_and_disciplinke " " keep all backup files in one place diff --git a/run b/run index d979afc..83a038c 100755 --- a/run +++ b/run @@ -37,6 +37,9 @@ create_symlinks () { cd "${CWD}"/configs/ for dot in * do + if [ $dot = "vim" ]; then + continue + fi echo "Linking ${dot} file." rm -f "$HOME/.${dot}" ln -sf "${CWD}/configs/${dot}" "$HOME/.${dot}" @@ -44,7 +47,10 @@ create_symlinks () { } setup_vim () { - mkdir -p ~/.vim/{tmp,undo,backup,bundle,autoload}/ + mkdir -p ~/.vim/{autoload,backup,bundle,spell,tmp,undo}/ + ln -sf "${CWD}/configs/vim/updatePlugins.sh" "$HOME/.vim/updatePlugins.sh" + ln -sf "${CWD}/configs/vim/spell/en.utf-8.add" "$HOME/.vim/spell/en.utf-8.add" + cd ~/.vim wget "https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim" -O "autoload/pathogen.vim" ./updatePlugins.sh