/vimrc-basic

Basic vimrc file to get going.

BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

####################### vimrc-basic #######################

Description: Project contains a basic .vimrc file. A basic .vimrc file to kick start your vim usage.

Settings assume you are using Tim Pope's vim-pathogen. Install pathogen: https://github.com/tpope/vim-pathogen


Commands to Install

mv basic_vimrc_template     ~/.vimrc mkdir ~/.vim-bkup mkdir ~/.vim-tmp


Save shortcuts

C-s will save document (normal, insert, or visual modes)

  • when selecting documents (visual mode), selection is kept.
  • stty -ixon
    • put 'stty -ixon' into appropriate file In keyboard settings make capslock equal control.
    • OSX ~/.profile needs 'stty -ixon' added to turn off blocking
    • Linux ~/.bashrc may need 'stty -ixon' added.

Esc shortcut

C-L avoid ESC key.


Tab navigation shortcuts

short cut    vim command    description
tj :tabn -- go to tab at right of current window.
tk :tabp -- go to tab at left of current window.
th :tabfirst -- go to first tab in tab list.
tl :tablast -- go to last tab in tab list.
F4 :w -- save document
F5 :tabp -- previous tab same as tk shortcut
F6 :tabn -- next tab same as tj shortcut
-- move tabs around
:Ztleft -- move current window left in tab list.
:Ztright -- move current window right in tab list.

Split window shortcuts and commands

:vsvertical split of current document (left right) split.
:splitsplit current document in middle (top bottom)
-- Short cuts to navigate split windows.
ctrl+h :wincmd h -- move to view on left
ctrl+j :wincmd j -- move to view below
ctrl+k :wincmd k -- move to view above
ctrl+p :wincmd l --move to view on right. changed to `p` b/c `C-l` is now escape.

Essential Buffers Commands

command description
:ls List the current buffers (including their numbers).
:b <number> Display the buffer with the given number.
:b <partial> Display the first buffer matching the partial name (or press Tab for name completion).
:bd Delete the current buffer; will fail if unsaved (nothing is deleted).
:bd! Delete the current buffer; will discard any changes (changes are lost).

Resize split windows

command description
:Zwshrink shrink width by 15 spaces.
:Zwexpand expand width by 15 spaces
:Zhshrink shrink height by 8 spaces
:Zhexpand expand height by 8

remove whitespace from end of lines

  • F7
  • :Trim

spellcheck

  • :set spell spelllang=en_us
  • :set nospell
  • ]s [s navigates to misspelled words

modes

modes notes

docs

table of contents
vim script
alphabetical function-list
categorized function-list