×
Inicio Aleatorio

vim shortcuts

Sección: Administración de sistemas

Creado: 29-04-24 (Actualizado: 23-02-24)

.vimrc

:echo $MYVIMRC

:e $MYVIMRC

:so % "Recarga el fichero actual

Personalización

:colorscheme

:set statusline format

:set cursorline
:set cursorcolumn

:set number

:set spell

:set spelllang=es
z + =
:set spellsuggest=X "limita el número de sugerencias

Highlighting

:match Group /pattern/

:match NONE

:2match

:3match

Buffers

:bd buffer delete

Edición básica

h j k l

3j baja 3 líneas

dw borra hasta el final de la palabra incluyendo espacio

de borra hasta el final de la palabra sin incluir el espacio

d$ borra hasta el final de la línea

dd

2dd

u deshacer un cambio

U deshacer una linea

C-R

y (yank)

p (put)

r (replace) R para reemplazo continuo

c (change)

cw, ce, c$

3cw

http://stackoverflow.com/questions/235839/indent-multiple-lines-quickly-in-vi

GOTO AND SEARCH

Ctrl-G  show file name

1 Ctrl-G

Shift-G final documento

# Shift-G ir a línea número

/frase búsqueda

n siguiente hacia abajo

Shift-N siguiente hacia arriba

:set ic

:set is insearch

:set hls hlsearch

% en un paréntesis nos sitúa en su pareja

http://vim.wikia.com/wiki/Search_and_replace

:s/foo/bar

:#,#/foo/bar/g cambia todo entre línea 3 y 9

:%s/foo/bar/g Search and replace

:%s/fo/bar/gc Search and replace (confirmation)

:!command

:w TEST

:#,#w TEST

:r file (inserta fichero)

o inserta línea debajo

O inserta línea encima

a añade después del cursor

A = $ a

:help w

:help c_<T

:help insert-index

----------------------------------------------------------

:set compatible

:e :edit reload

:e! reload always

----------------------------------------------------------

:enew

:bnext

Duplicate selection

After you y to yank, you '> to move to after the selection block, and then p to paste.

C-] seguir enlace

C-T volver

set mouse=a

5>> indenta 5 líneas

Vjj> indenta 3 líneas

>% indenta el bloque con los paréntesis o llaves

gf goto file under cursor

Siguiente Publicación