User talk:Andy: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
No edit summary |
(VIM is a great editor) |
||
Line 1: | Line 1: | ||
Nothing here for now... | Nothing here for now... | ||
== VIM is a great editor == | |||
Ok, so I use VIM. I used to use Emacs, but I guess the starting time was | |||
bothering me. Also, for small sysadmin edits I used VIM already and I | |||
was mixing key strokes from Emacs and VIM. | |||
Here is a list of some usefull commands and settings from VIM: | |||
{| border="1" cellpadding="2" cellspacing="0" width="60%" | |||
|- bgcolor="#abcdef" | |||
!Key !! Value | |||
|- | |||
| v || Visual mode | |||
|- | |||
| gq || Word wrap - make text, comments look nicer | |||
|- | |||
| CTRL-ww || Switch window | |||
|- | |||
| :bd || Close buffer | |||
|- | |||
| :ls || List buffers | |||
|- | |||
| :b1 - :bn || Switch to buffer n - :b5 - switch to buffer 5 | |||
|- | |||
| :sbn || Same as :b1 - :bn, but split | |||
|- | |||
| :CTRL-w q || Close current buffer/window | |||
|- | |||
| :on || Show only current buffer | |||
|- | |||
| :mkvimrc file || Save VIM settings | |||
|- | |||
| :new file || Open file in new window | |||
|- | |||
| :split || Split current window | |||
|- | |||
| set wildmode=longest || Tab clompletion behaves more like in emacs or zsh. To get the full list, press CTRL-D | |||
|- | |||
| set hlsearch || Hilight the search results | |||
|- | |||
| set incsearch || Incrementally search (like emacs) | |||
|- | |||
| set guioptions-=T || Remove toolbar | |||
|- | |||
| set guioptions-=m || Remove menu | |||
|- | |||
| set guioptions+=f || When running gvim, it will stay in foreground. | |||
|- | |||
| colorscheme darkblue || Select "darkblue" as color scheme | |||
|- | |||
| set selection=exclusive || Only select up to (not including) the character where cursor is | |||
|- | |||
| CTRL-^ || Switch buffer | |||
|- | |||
| CTRL-w CTRL-^ || Split and switch | |||
|- | |||
| set path=/some/path/** || Set internal find path to /some/path and all subdirectories | |||
|- | |||
| :find file || Search for file in the path | |||
|- | |||
| set smartcase || Search with regards to case like in emacs (type small case will search case independent, type mixed case will search exact case) - Has to be used with :set ignorecase | |||
|- | |||
| CTRL-a || Increment number under the cursor | |||
|- | |||
| CTRL-x || Decrement number under the cursor | |||
|- | |||
| CTRL-] || Jump to label | |||
|- | |||
| CTRL-T || Go back | |||
|- | |||
| ] CTRL-i || Jump to file under cursor | |||
|- | |||
| % || Jump to matching {}, (), [], ... | |||
|- | |||
| :make || Compile project | |||
|- | |||
| :make -C directorye || Compile project in specific directory (Only gmake) | |||
|- | |||
| :cc || Show current error (after :make) | |||
|- | |||
| :cn || Go to next error (after :make) | |||
|- | |||
| :cp || Go to previous error (after :make) | |||
|- | |||
| * || Search for word under the cursor | |||
|- | |||
| [ SHIFT-i || Display all occurances of the word under the cursor in the file | |||
|} |
Revision as of 15:30, 13 July 2004
Nothing here for now...
VIM is a great editor
Ok, so I use VIM. I used to use Emacs, but I guess the starting time was bothering me. Also, for small sysadmin edits I used VIM already and I was mixing key strokes from Emacs and VIM.
Here is a list of some usefull commands and settings from VIM:
Key | Value |
---|---|
v | Visual mode |
gq | Word wrap - make text, comments look nicer |
CTRL-ww | Switch window |
:bd | Close buffer |
:ls | List buffers |
:b1 - :bn | Switch to buffer n - :b5 - switch to buffer 5 |
:sbn | Same as :b1 - :bn, but split |
:CTRL-w q | Close current buffer/window |
:on | Show only current buffer |
:mkvimrc file | Save VIM settings |
:new file | Open file in new window |
:split | Split current window |
set wildmode=longest | Tab clompletion behaves more like in emacs or zsh. To get the full list, press CTRL-D |
set hlsearch | Hilight the search results |
set incsearch | Incrementally search (like emacs) |
set guioptions-=T | Remove toolbar |
set guioptions-=m | Remove menu |
set guioptions+=f | When running gvim, it will stay in foreground. |
colorscheme darkblue | Select "darkblue" as color scheme |
set selection=exclusive | Only select up to (not including) the character where cursor is |
CTRL-^ | Switch buffer |
CTRL-w CTRL-^ | Split and switch |
set path=/some/path/** | Set internal find path to /some/path and all subdirectories |
:find file | Search for file in the path |
set smartcase | Search with regards to case like in emacs (type small case will search case independent, type mixed case will search exact case) - Has to be used with :set ignorecase |
CTRL-a | Increment number under the cursor |
CTRL-x | Decrement number under the cursor |
CTRL-] | Jump to label |
CTRL-T | Go back |
] CTRL-i | Jump to file under cursor |
% | Jump to matching {}, (), [], ... |
:make | Compile project |
:make -C directorye | Compile project in specific directory (Only gmake) |
:cc | Show current error (after :make) |
:cn | Go to next error (after :make) |
:cp | Go to previous error (after :make) |
* | Search for word under the cursor |
[ SHIFT-i | Display all occurances of the word under the cursor in the file |