~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ VIm ;) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Comandos básicos: ---------------- Borrar una linea -> dd Copiar una linea -> yy Borrar 2 lineas -> 2dd Copiar 2 lineas -> 2yy Pegar -> p Buscar "texto" -> /texto ( Se resaltarán todas las palabras "texto". Desactivas el resaltado con -> :nohl ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mover el cursor: ---------------- Ir al inicio del documento -> gg Ir al final del documento -> G Ir al inicio de la linea -> 0 Ir al final de la linea -> $ Ir a la linea "n" ->nG Darle formato UNIX ------------------ :e file :set fileformat=unix :w Darle formato DOS ----------------- :e file :set fileformat=dos :w ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCRIPTACION ------------ Encriptar un texto : ":X" Desencriptar un texto : ":set key=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dar formato ----------- Establecer el ancho del texto : ":set textwidth=30" Moverse al final del párrafo : "}" "gq}" -> Da formato desde el cursor hasta el final del párrafo gqap -> Da formato al texto de un párrafo (separado por lineas vacías) También la parte antes del cursor. gggqG -> Dar formato a TODO el documento. ("gg" para ir a la primera linea, "gqG" para dar formato hasta la última linea. Advertencia : Si tus párrafos no están separados apropiadamente, se unirán.) :{rango}center[area]" -> Centrar Ejem:1,3center40 (centra las lineas 1,2,3 en un area de 40 columnas) :set autoindent -> Inserta identificación automáticamente :set shiftwidth=4 :set tabstop=3 :retab 8 :g/./,/^$/join -> Convertir un párrafo en una linea :g/\S/,/^\s*$/join ( también con lineas en blanco) :s/texto1/reemplazo/g -> Reemplazar Usa "gv" para reseleccionar el mismotexto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOLDING (Juntar varias lineas en una sola temporalmente para visualizar mejor) ------- zfap -> "Folds" un párrafo zo -> Restaura un párrafo "Folded" zr -> Reducir el FOLD zm -> Aumentar el FOLD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AYUDA ----- Para ver la documentación de ayuda usa esto : ":help" Al usar la ayuda, cada titulo que este asi |tema.txt| puede accederse rapidamente tipeando "gf" sobre él. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MINIMALIST MANUAL FOR VI (inglés) ------------------------ http://www.it.usyd.edu.au/~kap/General/vi.html VIM COMMANDS CHEAT SHEET (inglés) ------------------------ http://www.fprintf.net/vimCheatSheet.html TUTORIAL DE VIM (en inglés) --------------- http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hugo Martín www.hackcraft.com (2003)