linux:vim:comandos

Diferències

Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.

Enllaç a la visualització de la comparació

Ambdós costats versió prèvia Revisió prèvia
Següent revisió
Revisió prèvia
linux:vim:comandos [14/10/2018 03:23] – [Basics] matelinux:vim:comandos [07/11/2020 14:25] (actual) – [Basics] admin
Línia 7: Línia 7:
 == info == info
   * [[linux:vim:vimrc]]   * [[linux:vim:vimrc]]
 +  * [[linux:vim:mlechon1aldia]]
  
  
Línia 25: Línia 26:
 </code> </code>
  
-==Basics+== Basics 
 +  * **[N] acción moción** 
 +  * acciones: 
 +    * d - delete 
 +    * c - caracter sustitución 
 +    * >,< - indentación, desindentación 
 +    * gU,u - uppercase 
 +    * y - copiar 
 +  * moción 
 +    * w - palabra 
 +    * e - final de palabra 
 +    * b - palabra anterior 
 +    * ^ - principio de línea 
 +    * $ - final de linea 
 +    * gg - principio documento 
 +    * G - final de documento 
 +    * iw - inside word 
 +    * aw - arorund word 
 +  * . - repite última edición 
 + 
 +== more Basics
   * '':e'' filename : Open filename for edition   * '':e'' filename : Open filename for edition
   * '':w'' : Save file   * '':w'' : Save file
Línia 40: Línia 61:
   * ''gg'' : move the cursor to the begining of the file   * ''gg'' : move the cursor to the begining of the file
   * '':59'' : move cursor to line 59. Replace 59 by the desired line number.   * '':59'' : move cursor to line 59. Replace 59 by the desired line number.
- 
   * ''k or Up Arrow'' : move the cursor up one line   * ''k or Up Arrow'' : move the cursor up one line
   * ''j or Down Arrow'' : move the cursor down one line   * ''j or Down Arrow'' : move the cursor down one line
Línia 110: Línia 130:
     * '':%s/^\(.*\)\n\1$/\1/'' : Delete lines which appears twice     * '':%s/^\(.*\)\n\1$/\1/'' : Delete lines which appears twice
     * '':g/string/d'' : Delete all lines containing string     * '':g/string/d'' : Delete all lines containing string
 +      * ''g/^$/d'' : borra líneas en blanco -> ''v/./d''
 +      * ''g/^\s*$/d'' : borra líneas en blanco o con espacios/tabuladores
 +      * más ejemplos: [[https://vim.fandom.com/wiki/Power_of_g]]
     * '':v/string/d'' : Delete all lines containing which didn’t contain string     * '':v/string/d'' : Delete all lines containing which didn’t contain string
  
Línia 116: Línia 139:
   * ''Ctrl+x'' : Decrement number under cursor   * ''Ctrl+x'' : Decrement number under cursor
   * ''ggVGg?'' : Change text to Rot13   * ''ggVGg?'' : Change text to Rot13
 +
  
 ==Case ==Case
Línia 237: Línia 261:
  
 == cifrado == cifrado
-  * '':X'' : pregunta por contraseña para cifrar el fichero a la hora de guardar+  * ''%%:X%%'' : pregunta por contraseña para cifrar el fichero a la hora de guardar
   * '':setlocal cm?'' : show encryption method for the current file (cm abreviación de cryptmethod   * '':setlocal cm?'' : show encryption method for the current file (cm abreviación de cryptmethod
   * '':setlocal cm=zip'' : weak (default for backwards-compatibility)   * '':setlocal cm=zip'' : weak (default for backwards-compatibility)
  • linux/vim/comandos.1539512591.txt.gz
  • Darrera modificació: 14/10/2018 03:23
  • per mate