Topic: VI and VIM

Just had a good read of some documentation and made a list of useful vi/m commands for all those who want/need them:



#Notes - ^ generall means control key

" - cursor position when last editing file
$ - end of line
% - move to matching bracket
'' - cursor position before jump
, - repeat latest f,t,F,T (count) times in opposite direction
/ -search
0 - ZERO moves to first char of a line
; - repeat latest f,t,F,T (count) times
? - search
F - find character on single line - LEFT FIND
G - go to line # or go to last line of file  eg: 6G - 6th line or G -last line of file
H - go to first line of current screen
L - go to last line of current screen
M - go to middle line of current screen
N - repeat the last search in opposite direction
T - find character on single line - LEFT FIND       
[ - start at last change
] - end of last change
^ - first non-blank char of a line
^D - scroll half the screen
^E - scroll up one line
^U - scroll  half the screen
^Y - scroll down one line
^g -  print current location in file 
` - this is used to jump to a mark - marks are labeled with letters ie: `a will go to the first mark made
`` - jump back
b - move back word
e - move to end of next word
f - find character on single line
ge - move to end of previous word
gg - go to start of file
ma - make a mark
n - next occurance of searched text
t - find character on single line - stops before char
w - move word * w will be first word of next line if you are at the end of a line
zb - make the line the cursor is on, the bottom line
zt - make the line the cursor is on, the top line
zz - view context of line

#Searching text

\ - search for string that starts with given chars  ie /\op - search for words that start with 'op'
\> - search for string that ends with given chars. ie /ing\> - search for words that end in 'ing'

#These are some handy customisations

set hlsearch - highlight search
set ignorecase - ignore case of text
set noignorecase - turn ignore case off
set nonumber - turn off line numbers
set number - turn on line numbers
set ruler - show cursor position 




feel free to add/correct anything here

Re: VI and VIM

I find VIM Quick Reference Card pretty useful. smile

| There's no place like /home | There's no place like /home | There's no place like /home |

Re: VI and VIM

bmk1st wrote:

I find VIM Quick Reference Card pretty useful. smile

Excellent link!

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: VI and VIM

Yeah !

<wintellect> NetBSD users are smart enough to accept that there's no 3D support tongue

Re: VI and VIM

With the release of VIM 7 it has a new `feature' to automatically highlight matching braces. Does anyone know the command to disable this?

Re: VI and VIM

larz smells poor syntax...

Re: VI and VIM

What?

lucas
The Larzest
From: bzmt
Registered: 2005-04-25
Posts: 666

Evil man.

Re: VI and VIM

It's a plugin: /usr/local/share/vim/vim70/plugin/matchparen.vim

Re: VI and VIM

OMG!!!! It's Russell!!!!!

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: VI and VIM

Hello. smile

Re: VI and VIM

Russell ? I dont even remember you.. Just the name ... hmm

<wintellect> NetBSD users are smart enough to accept that there's no 3D support tongue