Skip to content

Commit

Permalink
Fix spelling issues in solarized theme.
Browse files Browse the repository at this point in the history
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:

- altercation/vim-colors-solarized#195
- vim/vim#2424
  • Loading branch information
morazow committed Jun 17, 2020
1 parent 1bd946b commit 86a97fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
22 changes: 14 additions & 8 deletions configs/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -50,9 +51,9 @@ set cpoptions=B$ "ces$ --conflicts with snipmate, wtf?!
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" 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
Expand All @@ -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> <leader>= :silent :nohlsearch<cr>
nmap <silent> <leader>= :silent :nohlsearch<cr>
" toggle paste mode
nmap <Leader>pp :set paste!<cr>
Expand Down Expand Up @@ -202,16 +207,17 @@ endfunction

autocmd FileType java setlocal shiftwidth=4 tabstop=4
autocmd FileType scala,java,ruby autocmd BufWritePre <buffer> :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
Expand All @@ -237,8 +243,8 @@ nmap <left> :call <SID>punish_me()<cr>
nmap <up> :call <SID>punish_me()<cr>
nmap <down> :call <SID>punish_me()<cr>
" 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
Expand Down
8 changes: 7 additions & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ 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}"
done
}

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
Expand Down

0 comments on commit 86a97fa

Please sign in to comment.