Some VIM Commands

Every once in a while I try to review some vim information to get additional practice with the editor. Today I reviewed file buffers, visual mode and markers. All very useful in editing files with vim.

File buffers are great when editing more than file.
:buffers
:b1 :b2 :b3
:bn :bp
:sbn :sbp

Visual Mode
In normal mode use v, shift-v or ctl-v (block edit)
Use >, <, r, c, d, etc.

Markers
In normal mode use ma, mb, mc, etc
Then use ‘a, ‘b, ‘c etc.

Windows
:sp, :open, ctl-Wn, etc.
ctl-w, ctl-w to switch windows
Buffer commands above come in useful here

Completion, Omni-completion
ctl-p, ctl-n to complete with words from file
ctl-x, ctl-o to use syntax completion
Very useful things in a text editor!

Perl Tidy and Vim

Perl Tidy and Vim Options I find useful. Mostly so I have it conveniently located for future machines.

Perl Tidy Options

-l=78     # max line width
-i=4       # Indent level 4 cols
-ci=4     # Continuation Indent 4 cols
-st         # Output to STDOUT
-se        # Errors to STDERR
-vt=2     # Maximal vertical tightness
-cti=0    # No extra indention for closing brackets
-pt=1     # Medium parenthesis tightness
-bt=1     # Medium brace tightness
-sbt=1    # Medium square bracket tightness
-bbt=1    # Medium block brace tightness
-nsfs     # No space before semicolons
-nolq     # Don't outdent long quoted string
-wbb="%  + - * / x != == &gt;= &lt;= =~ !~ &lt; &gt; | &amp;  &gt;= &lt; = **= += *= &amp;= &lt;&lt;=  &amp;&amp;= -= /= |= &gt;&gt;= ||= .= %= ^= x="  # Break before all operators

Standard VIM options

set nocompatible     " We're running Vim, not Vi!
filetype on              " Enable filetype detection
filetype indent on    " Enable filetype-specific indenting
filetype plugin on    " Enable filetype-specific plugins

set display+=lastline
set statusline=%&lt;%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
set laststatus=2
set ruler
syntax on
set tabstop=2
set paste