Difference between revisions of "VIM"

From John Freier
Jump to: navigation, search
Line 48: Line 48:
 
You can also show only select char.
 
You can also show only select char.
 
   :set listchars=eol:$,tab:>-,trail:~
 
   :set listchars=eol:$,tab:>-,trail:~
 +
 +
== Spelling ==
 +
To turn spell checker on.
 +
  :set spell spelllang=en_us
 +
 +
To turn spell checker off.
 +
  :set nospell
 +
 +
To move between misspelled words.
 +
  ]s and [s
 +
 +
To get misspelled recommendations, move in misspelled word and press.
 +
  z=
 +
 +
To add word to dictionary.
 +
  zg
 +
 +
To mark a word as incorrect
 +
  zw
 +
 +
 +
== Autocomplete ==
 +
This autocomplete tries to match word already in the document.
 +
  ctl+n or ctl+p

Revision as of 09:23, 9 September 2022

Syntax Highlighting

Inside VI type the command below.

:syntax on

Maybe

:syn on

Bottom Page

This goes to the bottom of the page.

G

Bookmarks

To bookmark a position press m and then a letter. Use capital letter for Global or multiple files.

 ma

To go to the bookmark press ` and then letter marking you want to go to.

 `a

To see all your bookmarks.

 :marks

To to last edit location.

 `.



Record

To record a set of keys press q and then a letter to record to.

 qa

To play back the recording press @ and then letter marking you want to play back.

 @a


Windows

Switch between windows. The arrow key or direction key you want to go to.

 ctrl+w {arrow key} or {h,j,k,l}

Show Whitespace

This will show all whitespace char

 set list

You can also show only select char.

 :set listchars=eol:$,tab:>-,trail:~

Spelling

To turn spell checker on.

 :set spell spelllang=en_us

To turn spell checker off.

 :set nospell

To move between misspelled words.

 ]s and [s

To get misspelled recommendations, move in misspelled word and press.

 z=

To add word to dictionary.

 zg

To mark a word as incorrect

 zw


Autocomplete

This autocomplete tries to match word already in the document.

 ctl+n or ctl+p