Home»Programs»Vim

VIM commands

VIM spelling

Created Wednesday 27 June 2012


vim has built-in spell checking functionality. I add this to ~/.vimrc

These options are a little more than just spell checking mind you:

" Show line numbers
set number

" Prevent vim from emulating vi
set nocompatible

" Syntax highlighting
syntax on

" Set automatic indentation
set autoindent
set smartindent

" Set tabs at 4 spaces
set tabstop=4
set shiftwidth=4

" Show matching [] and {}
set showmatch

" Spell check on
set spell spelllang=en_us
setlocal spell spelllang=en_us

" Toggle spelling with the F7 key
nn  :setlocal spell! spelllang=en_us
imap  :setlocal spell! spelllang=en_us

" Spelling
highlight clear SpellBad
highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline
highlight clear SpellCap
highlight SpellCap term=underline cterm=underline
highlight clear SpellRare
highlight SpellRare term=underline cterm=underline
highlight clear SpellLocal
highlight SpellLocal term=underline cterm=underline

" where it should get the dictionary files
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'

Those options highlight and underline misspelled or unrecognized words.
Some keyboard shortcuts to navigate and correct words

]s – move to next misppelled word
[s - move to previous misspelled word
z= - show list of correction options

4]s skip to 4th mispelled word, etc.
  • Boot Linux from USB. part I

    Multiple boot using GRUB2 from live ISO files located on USB
    Read more ...

  • Boot Linux from USB. part II

    Multiple boot using SYSLINUX from live ISO files located on USB
    Read more ...

  • Tweet update.

    Added tweet on @lloadm
    Read

Responsive image