create account

Tutorial de Vim. N05. Modo línea de comandos by rafaelaquino

View this thread on: hive.blogpeakd.comecency.com
· @rafaelaquino ·
$3.84
Tutorial de Vim. N05. Modo línea de comandos
Cordiales Saludos

<center>
![05_vim.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23vrtXvJRJY58QgNCoxkcdy2jvgXLyxDNDmZR7cKNfa2D4A4yFTfbY2rjbZa4VcUiqCzJ.png)
</center>

## Modo línea de comandos


Comenzaremos la actividad de hoy con la creación de un nuevo archivo, con: ```ls > 05_ejercicio.txt``` 

<center>
![5_term_1.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSt2tGBPKUKmSue1n3uxEaHrzEKmqDZB9keoeymEuFebCkwKqM1VF5M15yH8AykKQy6.png)
</center>


~~~~
rafael@rafd:~$ cd tutorialVim/
rafael@rafd:~/tutorialVim$ ls
01_ejercicio.txt  02_ejercicio.txt  03_ejercicio.txt  04_ejercicio.txt
rafael@rafd:~/tutorialVim$ ls > 05_ejercicio.txt
rafael@rafd:~/tutorialVim$ 
rafael@rafd:~/tutorialVim$ cat 05_ejercicio.txt 
01_ejercicio.txt
02_ejercicio.txt
03_ejercicio.txt
04_ejercicio.txt
05_ejercicio.txt
rafael@rafd:~/tutorialVim$ 
~~~~


## ✳️ Modo línea de comandos

Estando en el **modo normal** para entrar al **modo linea de comando** se logra con los **dos puntos (:)**.


Cuando entramos a nuestro archivo en **vim** se activa automáticamente el **modo normal**, es el modo predeterminado, o si nos encontramos en otro modo, para volver al modo normal debemos presionar **ESC**. 

Repasando la primera publicación el **mo do linea de comando**lo usamos para:

☑️ :help version8
☑️ :q!
☑️ :w
☑️ :wq
☑️ :q!
☑️ :x


#### 

<center></center>


Entremos a nuestro archivo recien creado para la actividad de hoy.

~~~
vim 05_ejercicio.txt
~~~

Aquí vemos muestro archivo en **vim**. Recordemos que siempre entra en **el modo normal**.

<center>
![5_term_2.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23t88ngyCGRQYrGVqpcUwbgp4tCT4AXDQ5pkdWsUDyRtrUU2PJrsHZvcWsbLctKtKQt3m.png)
</center>

El **modo linea de comando** creo que es el más extenso de todos los modos. Con el tiempo te darás cuenta todo lo que se puede hacer.

En esta oportunidad vamos a ver *algunos comandos* muy comunes que nos permitirá conocer un poco más estas opciones de configuración de nuestro vim. 

El límite de aprendizaje de **vim**, lo ponemos nosotros. Yo sólo uso unos cuantos comandos que me sirven para funcionar perfectamente en la edición de textos y algunos scripts de **python y Bash**. Si quieres profundizar más, **internet** es una buena fuente para investigar.
 

### 🔸 :set number

Con **:set number** agregamos números en la primera columna de nuestro archivo. Es útil para enumerar, en algunos casos, las lineas de nuestro texto. Tiene mayor importancia cuando usamos nuestro editor favorito para escribir códigos en programación.

| | | 
:-------------------------:|:-------------------------:
![5_set_1.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/Eo4HtKEqfb8DabDS5SbHRHYV4cMwBLysg3FBMDhp9qpvVv5JPSQT9nP3QNYiZBUWoN6.png)|![5_set_2.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHXT3TAii1Xp49wH4uVbt5iMmbcEvCEDDozkys9fZ7pDsM7Risxv22pdZKeDePipT8B.png)

#### :set nu

El comando **:set nu** sería la abreviatura de **:set number** 
<center>
![5_set_3.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSskWtQUwefqvHB8JCtpJFVN3MRVGHDiNGZDo6PvrYAJd4zWfW986BW2UyxceuybHuS.png)
</center>

#### :set nonumber

Con **:set nonumber** podemos eliminar los números de las lineas


<center>
![5_set_4.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHV69Jv9z2EirwUbKrV6S4Rj5TPP52WVwKY4JuUKpqfvtA19FfEhFK3JjzRs3tWU62D.png)
</center>


#### :set nonu

Para eliminar los números también podemos usar **:set nonu**, lógicamente la abreviatura de *nonumber*.

| | | 
:-------------------------:|:-------------------------:
![5_set_5.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSsfnnR11NgLnji84BzXGyD7VnBavNqax6zPQjCc8smRdg5XCqoKL6ZsGN28nPER1Uy.png)|![5_set_6.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/Eo6QiQy4Vq2zMxSuTYA2WKdz4hWi8UBUXG4dwEEFnUazxYCcdpcRt1jbmXVX3FYFCFT.png)

### 🔸 :set relativenumber o :set rnu:

Para colocar los números relativos a cualquier linea podemos usar **:set rnu**. >
Se entiende mejor viendo la soiguiente captura.

| | | 
:-------------------------:|:-------------------------:
![5_set_7.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHUwUJqtSkNk56Bxa75BSFJHCUfGnyECJXzhUrkiXJ8Xopi8MDjyxDte1cttvDPp1Yt.png)|![5_set_8.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHUiyg5p21aH7dvCh6ULGbRDYvcT89AVhexWkeYLDQwdT6UsuzXLv5qRZKJE3BDMaWC.png)

### set nornu

Para eliminar **:set relativenumber** usaremos **:set nornu** 
<center>
![5_set_9.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHXT4Yi2cg5p2GmesnzStRzGttYNJakjvAdH1u6V3ecHNT6TY3cyPkweHDXsoVyKBRC.png)
</center>

Hay que aclarar que estas configuraciones se mantienen mientras estes trabajando con el documento. Más adelante veremos como mantener permanente estas configuraciones de numeros de lineas.

### 🔸 Pedir ayuda

En el **modo de linea de comando**, me sirve tambien para solicitar ayuda . En este caso solicito la ayuda acerca de los comandos **HJKL** del **modo normal**.
<center>
![5_set_10.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxnCREERuSziTyGP2hNHnmH5s2dg1coEH6A2k25GGTSfBbGNT9kPctndTBF1VfSxiM5.png)
</center>

Aqui (en la siguiente captura) tenemos la ayuda solicitada.
<center>
![5_set_11.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxhyUkrmmB8kZoJXwM1Ti2uuMZ7wh3zob21qPUdQhrucaqtdnCZyctCM4exbzoUgtQE.png)
</center>
Para salir de la ayuda, usamos **:q**.
<center>
![5_set_12.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxhQEXRhai6CP5tD6stNawE5p3McyHutxRCqgMGNqRi6pNVaMvno6uiLuEQdRmwzKzk.png)
</center>
Listo, aquí colvemos a nuestro archivo orginal.
<center>
![5_set_13.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxnCREERuXGXCPqpWXA4QY2BzeU6zbiZsru2a4FMgxea3psUchjEJsR2avXzPsxqA4G.png)
</center>
En el siguiente ejemplo solicito ayuda del comando **i**, del modo insertar** con:

~~~
:help i
~~~
<center>
![5_set_14.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSsbqtRzdBLVHj8UsvBZTaaJJWW4E38eod6rv6KFHhtfHFGGZV9bYh2z3ZfaQQjsvWV.png)
</center>
Ya has notado que cada palabra usada en el **modo de linea de comando** tiene su abreviatura. Aquí use, **:h hjkl**.
<center>
![5_set_15.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxnCREERuSziTX52Qpj8jSbCsk6yZ23D8mtuAJV26ihKF1rof62pxyodKp3cvRoffQM.png)
</center>

### 🔸 Crear un archivo desde vim

Podemos crear un nuevo archivo desde el editor **vim**.

<center>
![5_set_16.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/Eo8Y5qToVe7onGqgY6oyMU9vfMBNxrdqoHqAubWBYtYwAXR6phTJiid63dB1pZcDfY8.png)
</center>

Con **:edit holamundo.txt** se creó el nuevo archivo, muy fácil verdad!
<center>
![5_set_17.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxhyUkm5UwdsVHxrBYQrC4TxxJVtX7eaDpf3GcP4UNtiaRP5G9f18gD23agnvzzzCP5.png)
</center>
Luego podemos agregar el texto que queramos, en este caso "Hola mundo"
<center>
![5_set_18.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/Enz2ae6qWz4sByNQvQ2rBMVNTXDLtat9Nqz8Zz1EqzCXpP8VXijyLYgrFe15ioAWEwD.png)
</center>
Corresponde guardarlo
<center>
![5_set_19.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxi3kRuUSfudcveZZcYorjbqmFZYhs39RVVFF9C3X83pHwx8cypJ87tzy3H5bmAfMTo.png)
</center>

Y listo
<center>
![5_set_20.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23t86WDgHRbeEaeu71BM1T9t4qoNSaqP3kCW9drBLq8axCwDMTY4McnCJq1kEBwx2cQWk.png)
</center>

Aquí vemos nuestro archivo recien creado: **holamundo.txt**
<center>
![5_set_21.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tcGLB2UdbF5Wj8hWiYZ2m8Yv2WGtNanN7URH3cGdD6K5JgJLxgUpbqMXSQtQZ6hccWX.png)
</center>



### 🔸 Editar un archivo desde vim

Vamos ahora a entrar a un archivo ya existnte. En este caso entraremos al archivo correspondiente a esta publicación. 

<center>
![5_set_23.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxjhJd7jj3P1hBLEtTLigAPw2febtkPpCorzN7KkpU2W9utW3tjCjPcCNy3SxD3PKGe.png)
</center>
Ya estando aquí podemos editar todo el contenido de este archivo.
<center>
![5_set_24.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHUwUJqqnR8xAFy5AweEYfrwWN7xFape65YJaFzhVUtgTitBMpYzYnEJxidNbodP9MS.png)
</center>


Estos son los comandos básicos que he usado. Existen muchos más, más adelante veremos algunos. Conociendo los comandos básicos podemos trabajar con este editor cómodamente y sin ningún esfuerzo. 

A practicar todos!, incluyéndome. Nos vemos la próxima semana.

---

>**No nos abrumemos**: Esto se aprende de forma natural con la entrada constante a practicar con cualquier tipo de documento, te recomiendo que practiques un rato diariamente y verás que todas las letras usadas hoy se aprenden de manera natural. Las latras la utilizaremos de forma natural y casi sin darnos cuenta.**Aprender este editor: vim**. Nos permite, pasar gratos momentos y lo mejor aun ocupar la mente en algo productivo.  



<center>![01_vim_separador.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23vhAgx2YQWwwzmwCsvoKkbY3gP1oPfaUWWtQHT7qfpfEXokd1WdyvFmRh5eCG2VFJf1R.png)</center>

Mi curso de linux, lo puedes revisar por aquí: https://siraquino.github.io/pythoncumanes/linux.html 

Te animo a que aprendas linux porque muchas de las acciones que realizo en este curso están bajo el sistema operativo Linux. En mi caso estoy usando **Linux Mint**. De todas manera puedes seguir l curso bajo cualquier otro sistema operativo.

<center>![01_vim_separador.png](https://files.peakd.com/file/peakd-hive/rafaelaquino/23vhAgx2YQWwwzmwCsvoKkbY3gP1oPfaUWWtQHT7qfpfEXokd1WdyvFmRh5eCG2VFJf1R.png)</center>

[Mi twitter](https://twitter.com/Rafa_elaquino)
Nos vemos en una próxima entrega!
Rafael Aquino  
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 359 others
properties (23)
authorrafaelaquino
permlinktutorial-de-vim-n05-modo-linea-de-comandos
categoryhive-116823
json_metadata{"app":"peakd/2024.5.1","format":"markdown","tags":["spanish","linux","stemsocial","stem-espanol","neoxian","tribes","ctp","freesoftware","opensource","developer"],"users":["rafd"],"image":["https://files.peakd.com/file/peakd-hive/rafaelaquino/23vrtXvJRJY58QgNCoxkcdy2jvgXLyxDNDmZR7cKNfa2D4A4yFTfbY2rjbZa4VcUiqCzJ.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSt2tGBPKUKmSue1n3uxEaHrzEKmqDZB9keoeymEuFebCkwKqM1VF5M15yH8AykKQy6.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23t88ngyCGRQYrGVqpcUwbgp4tCT4AXDQ5pkdWsUDyRtrUU2PJrsHZvcWsbLctKtKQt3m.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/Eo4HtKEqfb8DabDS5SbHRHYV4cMwBLysg3FBMDhp9qpvVv5JPSQT9nP3QNYiZBUWoN6.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHXT3TAii1Xp49wH4uVbt5iMmbcEvCEDDozkys9fZ7pDsM7Risxv22pdZKeDePipT8B.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSskWtQUwefqvHB8JCtpJFVN3MRVGHDiNGZDo6PvrYAJd4zWfW986BW2UyxceuybHuS.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHV69Jv9z2EirwUbKrV6S4Rj5TPP52WVwKY4JuUKpqfvtA19FfEhFK3JjzRs3tWU62D.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tSsfnnR11NgLnji84BzXGyD7VnBavNqax6zPQjCc8smRdg5XCqoKL6ZsGN28nPER1Uy.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/Eo6QiQy4Vq2zMxSuTYA2WKdz4hWi8UBUXG4dwEEFnUazxYCcdpcRt1jbmXVX3FYFCFT.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHUwUJqtSkNk56Bxa75BSFJHCUfGnyECJXzhUrkiXJ8Xopi8MDjyxDte1cttvDPp1Yt.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHUiyg5p21aH7dvCh6ULGbRDYvcT89AVhexWkeYLDQwdT6UsuzXLv5qRZKJE3BDMaWC.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23tHXT4Yi2cg5p2GmesnzStRzGttYNJakjvAdH1u6V3ecHNT6TY3cyPkweHDXsoVyKBRC.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxnCREERuSziTyGP2hNHnmH5s2dg1coEH6A2k25GGTSfBbGNT9kPctndTBF1VfSxiM5.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxhyUkrmmB8kZoJXwM1Ti2uuMZ7wh3zob21qPUdQhrucaqtdnCZyctCM4exbzoUgtQE.png","https://files.peakd.com/file/peakd-hive/rafaelaquino/23sxhQEXRhai6CP5tD6stNawE5p3McyHutxRCqgMGNqRi6pNVaMvno6uiLuEQdRmwzKzk.png"]}
created2024-05-08 22:27:54
last_update2024-05-08 22:27:54
depth0
children2
last_payout2024-05-15 22:27:54
cashout_time1969-12-31 23:59:59
total_payout_value1.952 HBD
curator_payout_value1.889 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length9,682
author_reputation112,313,107,496,743
root_title"Tutorial de Vim. N05. Modo línea de comandos"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id133,486,653
net_rshares9,303,320,878,341
author_curate_reward""
vote details (423)
@hispapro ·
<center>
![Banner.png](https://files.peakd.com/file/peakd-hive/hispapro/EoyNWuenER5EAUdb3NrwiRBS2j7vBXnMH6RzZ7Cj9PYfcCiTNsX18vWnFxkk83mjry2.png)
</center>

<div class="text-justify">

<sub>From Venezuela, our witness drives decentralization and the adoption of Web3 technology, creating opportunities for the local community and contributing to the global ecosystem. // Desde Venezuela, nuestro testigo impulsa la descentralización y la adopción de la tecnología Web3, generando oportunidades para la comunidad local y contribuyendo al ecosistema global.</sub>

</div>

---

<sub>Sigue, contacta y se parte del testigo en: // Follow, contact and be part of the witness in:</sub>
<center>

|<sub><center>[Hive](https://ecency.com/@hispapro)</center></sub>|<sub><center>[Discord](https://discord.gg/tXTD3B6xvZ)</center></sub>|<sub><center>[Twitter](https://twitter.com/hispapro)</center></sub>|
-|-|-
|<sub><center>[FanBase](https://hive.vote/dash.php?fan=hispapro&i=2)</center></sub>|<sub><center>[Trail](https://hive.vote/dash.php?trail=hispapro&i=1)</center></sub>|<sub><center>Delegaciones: [10 - ](https://hivesigner.com/sign/delegateVestingShares?delegatee=hispapro&vesting_shares=10%20HP)[50 - ](https://hivesigner.com/sign/delegateVestingShares?delegatee=hispapro&vesting_shares=50%20HP)[100 - ](https://hivesigner.com/sign/delegateVestingShares?delegatee=hispapro&vesting_shares=100%20HP)[500](https://hivesigner.com/sign/delegateVestingShares?delegatee=hispapro&vesting_shares=500%20HP)</center></sub>|

</center>

<center>![](https://images.ecency.com/DQmPqdJgo7yymPEasCQpmSjRtGETJQCrgARDCW8eggXVsis/separador_1.png)</center>

# <center><sub><div class= "phishy">Vota por el testigo @Hispapro // Vote for the @Hispapro witness </div></sub></center>

###### <center>[Keychan](https://vote.hive.uno/@hispapro) - [Hive.blog](https://wallet.hive.blog/~witnesses) - [Ecency](https://ecency.com/witnesses) - [Peakd](https://peakd.com/me/witnesses)</center>
properties (22)
authorhispapro
permlinkre-rafaelaquino-202459t1535216z
categoryhive-116823
json_metadata{"tags":["spanish","linux","stemsocial","stem-espanol","neoxian","tribes","ctp","freesoftware","opensource","developer"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-05-09 13:35:00
last_update2024-05-09 13:35:00
depth1
children0
last_payout2024-05-16 13:35:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,959
author_reputation678,244,135,858,607
root_title"Tutorial de Vim. N05. Modo línea de comandos"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id133,504,467
net_rshares0
@stemsocial ·
re-rafaelaquino-tutorial-de-vim-n05-modo-linea-de-comandos-20240509t131335626z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-rafaelaquino-tutorial-de-vim-n05-modo-linea-de-comandos-20240509t131335626z
categoryhive-116823
json_metadata{"app":"STEMsocial"}
created2024-05-09 13:13:36
last_update2024-05-09 13:13:36
depth1
children0
last_payout2024-05-16 13:13:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length565
author_reputation22,927,767,309,334
root_title"Tutorial de Vim. N05. Modo línea de comandos"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id133,504,108
net_rshares0