Entendible
http://bencrowder.net/files/vim-fu/
*******************
http://visualstudiomagazine.com/articles/2012/04/09/write-faster-code-by-adding-vim-to-visual-studio.aspx
Simpler Searching
Everything flows from these conventions. VsVim also includes part of VIM search capabilities. When in normal mode, type '/' followed by what you're looking for and press Enter.
Everything flows from these conventions. VsVim also includes part of VIM search capabilities. When in normal mode, type '/' followed by what you're looking for and press Enter.
A simple example of relocating a method:
- Start with your cursor at or before the current method
- Press 'v' to enter visual mode (used for selected ranges of text)
- Press '}' to move past this block of text (end of the method)
- Press 'd' to delete (cut)
- Press '{' twice to move up two methods
- Press 'p' to paste the method
To start learning VsVim (and VIM), don't start with empty documents. Print off a cheat sheet with commands and read a couple of articles on VIM. Then start programming with VIM. If you don't know how to do something, look it up, execute the command, and try to use it again.
***********
http://en.kioskea.net/faq/982-vi-vim-finding-a-word
[VI/VIM] Finding a word
To find a word in VI / Vim, just type "/" or "?", followed by the word you're searching for.
Pressing the n key, will allow you to go directly to the next occurrence of the word.
Another feature is to launch a search on the word where the cursor is positioned. Place the cursor over the word to search for, then press * or # to to look it up.
Pressing the n key, will allow you to go directly to the next occurrence of the word.
Another feature is to launch a search on the word where the cursor is positioned. Place the cursor over the word to search for, then press * or # to to look it up.
http://nickmeldrum.com/blog/vsvim-plugin-for-visual-studio
http://www.viemu.com/vi-vim-cheat-sheet.gif
**************
Could I live without it? Easily.
Is it useful? Yes.
Reasons for Learning
- vi is guaranteed to exist on all Unix systems and exists on most Linux ones as well. That kind of broad coverage makes learning it worth it.
- It's much quicker to use vi for a
sudo
edit:$ sudo vi - Also, GMail uses vi-ish commands for selecting & moving emails around!
You don't have to be a master.
Just learn
The basics:
- How to switch from command mode to insert mode i
- How to switch from insert mode to command mode Esc
- How to navigate up a line in command mode k
- How to navigate down a line in command mode j
- How to navigate left a character in command mode h
- How to navigate right a character l
- How to save a file
:w
Enter (write) - How to exit without saving (in command mode)
:q!
Enter - How to Undo u
- How to Redo Ctrl+r
- You can combine writing and quitting (in command mode):
:wq
Enter
From there the rest will just make you faster.
--------------
|
This is how I learnt it. Start with the minimum and build a little on it each day. Take the time to learn a slightly better way of achieveing a task. See the "7 habits of highly text editing" for inspiration. – Ben Mar 1 '09 at 12:42
| ||
|
Comandos "vi" ("vim") de uso frecuente
ESC | Abandonar el modo de inclusión de texto para volver |
al modo de comandos; también se usa para cancelar | |
comandos. (Usarlo en caso de duda) | |
Cntl-F | Avanzar una pagina hacia adelante |
Cntl-B | Avanzar una pagina hacia atrás |
Cntl-L | Refrescar la pantalla |
G | Cursor al final del fichero |
1G | Cursor al principio del fichero |
$ | Cursor al final de la linea |
0 (cero) | Cursor al principio de la linea |
a | Añadir texto a continuacion del cursor [TEXTO] |
i | Insertar texto en la posicion del cursor [TEXTO] |
A | Añadir texto al final de la linea [TEXTO] |
I | Insertar texto al principio de la linea [TEXTO] |
o | Añadir una linea debajo de la del cursor [TEXTO] |
O | Añadir una linea encima de la del cursor [TEXTO] |
u | Deshacer el último cambio realizado |
:red | Rehace los cambios deshechos con ''u'' o '':u'' |
x | Borrar un caracter (y ponerlo automaticamente en el ALMACEN) |
D | Borrar el resto de la linea (a la derecha del cursor) |
dw | Borrar una palabra (hasta el primer blanco a la dcha. del cursor) |
dd | Borrar la linea entera |
8x | Borrar 8 caracteres |
2dw | Borrar 2 palabras |
7dd | Borrar 7 lineas |
p | Poner el contenido del ALMACEN temporal a continuacion del cursor |
P | Poner el contenido del ALMACEN temporal antes del cursor |
s | Substituir un caracter por texto [TEXTO] |
15s | Substituir 15 caracteres por texto [TEXTO] |
r | Substituir un solo caracter por otro nuevo, sin entar |
en modo de TEXTO | |
R | Sobreescribir [TEXTO] |
J | Unir la linea del cursor y la siguiente |
i[ENTER] | Romper una linea en dos |
. | Repetir el último cambio realizado |
yy | Poner la linea presente en el almacen temporal |
5yy | Poner cinco lineas en el almacen |
:w | Guardar en el fichero que se esta editando los cambios realizados |
(Aconsejable ejecuarlo de vez en cuando) | |
:w! | Idem, forzandolo si fuese necesario. |
:w Fichero | Guardar en el fichero "Fichero" |
:wq | Guardar y salir de "vi". |
:wq! | Idem, forzandolo si fuese necesario. |