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 [13/08/2018 02:43] – [Plugins/extensiones/personalización] matelinux:vim:comandos [07/11/2020 14:25] (actual) – [Basics] admin
Línia 2: Línia 2:
 ~~NOTOC~~ ~~NOTOC~~
 {{tag>linux}} {{tag>linux}}
-/vía: [[https://www.catswhocode.com/blog/vim-cheat-sheet-for-2016]]+/vía: [[https://www.catswhocode.com/blog/vim-cheat-sheet-for-2016]]\\
 <del>/vía:[[http://www.catswhocode.com/blog/130-essential-vim-commands]]</del> <del>/vía:[[http://www.catswhocode.com/blog/130-essential-vim-commands]]</del>
  
-[[linux:vim:vimrc]]+== info 
 +  * [[linux:vim:vimrc]] 
 +  * [[linux:vim:mlechon1aldia]] 
 + 
 + 
 +==Plugins/extensiones/personalización 
 +<callout type="warning" title="Pendiente: modificación status line" icon="true">https://kadekillary.work/post/statusline/</callout> 
 +<callout type="warning" title="Pendiente: modificación status line" icon="true">[[https://gist.github.com/millermedeiros/1262085]]</callout> 
 + 
 +  * gestión/instalación plugins en sus propios directorios (runtimepath): [[https://github.com/tpope/vim-pathogen]] 
 +    * crear dos directorios: ''~/.vim/autoload'' (ubicación vim-pathogen.vim) y ''~/.vim/bundle'' (home_directory de los plugins) 
 +    * modificar **.vimrc** añadiendo ''execute pathogen#infect()'' 
 +  * stateline.vim (requiere pathogen.vim):<code bash>cd ~/.vim/bundle 
 +git clone https://github.com/millermedeiros/vim-statline.git</code>
  
 == config == config
Línia 13: Línia 26:
 </code> </code>
  
 +== 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
  
-==Basics+== more Basics
   * '':e'' filename : Open filename for edition   * '':e'' filename : Open filename for edition
   * '':w'' : Save file   * '':w'' : Save file
   * '':q'' : Exit Vim   * '':q'' : Exit Vim
   * '':q!'' : Quit without saving   * '':q!'' : Quit without saving
-  * '':x'' : Write file (if changes has been made) and exit+  * ''%%:x%%'' : Write file (if changes has been made) and exit
   * '':sav'' filename : Saves file as filename   * '':sav'' filename : Saves file as filename
   * ''.'' : Repeats the last change made in normal mode   * ''.'' : Repeats the last change made in normal mode
   * ''5.'' : Repeats 5 times the last change made in normal mode   * ''5.'' : Repeats 5 times the last change made in normal mode
  
-==Plugins/extensiones/personalización 
-<callout type="warning" title="Pendiente: modificación status line" icon="true">https://kadekillary.work/post/statusline/</callout> 
-  * gestión/instalación plugins en sus propios directorios (runtimepath): [[https://github.com/tpope/vim-pathogen]] 
-    * crear dos directorios: ''~/.vim/autoload'' (ubicación vim-pathogen.vim) y ''~/.vim/bundle'' (home_directory de los plugins) 
-    * modificar **.vimrc** añadiendo ''execute pathogen#infect()'' 
-  * stateline.vim (requiere pathogen.vim):<code bash>cd ~/.vim/bundle 
-git clone git://github.com/millermedeiros/vim-statline.git</code> 
 ==Moving in the file ==Moving in the file
   * ''0'' : move the cursor to the begining of the line   * ''0'' : move the cursor to the begining of the line
Línia 36: 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 106: 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 112: 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 136: Línia 164:
   * '':e .'' : Open integrated file explorer   * '':e .'' : Open integrated file explorer
   * '':Sex'' : Split window and open integrated file explorer   * '':Sex'' : Split window and open integrated file explorer
-  * '':Sex!'' : Same as +  * '':Sex!'' : Same as ''Sex'' but split window vertically
-  * '':Sex'' but split window vertically+
   * '':browse e'' : Graphical file explorer   * '':browse e'' : Graphical file explorer
   * '':ls'' : List buffers   * '':ls'' : List buffers
Línia 234: 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.1534153415.txt.gz
  • Darrera modificació: 13/08/2018 02:43
  • per mate