Cordiales Saludos
![02_vim.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23u5touLQwZEdf9UBysAXmz9bNqXphXX7TY9eZW9hr6nVmWk8MatLkzwJs1vLp6npmC5G.png)
Creando nuestro segundo ejercicio
Primeramente comenzamos revisando nuestro directorio de trabajo, con el comando ls, dentro de nuestra terminal. Luego entramos a nuestro editor con vim.
Nota: Una forma de entrar a la terminal es con la combinación de teclas Ctrl + Alt + t, en nuestro sistema operativo linux.
![02_vim_01.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23swgJygZ9JoovdsHkbxtFDZAweXjnrX7B1YiCbyo96CarjfyubSHt2TADZqsFXYvYBE1.png)
Aquí nos muestra la pantalla de inicio de vim, ya vista en la publicación anterior.
![02_vim_02.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23swkfAxxNMQBUfV56w3xxNUzE6YwoajDxmR4u8eeZjUqFxbCqLB5XtNjb5iNzm8xaDnC.png)
Puede ocurrir si tenemos nuestra terminal redimensionada a un tamaño más pequeño, no nos aparezca el texto de bienvenida de vim. Lo muestro por si en algún momento te aparece así no te sientas confundido.
![02_vim_03.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23swi5iJXyLsMTfd3WD5k8NsNQxzvpJ7UaeAr5phyYNFtKuGoQQxNUNwiK4JVi7rixw9w.png)
Dentro de vim tecleamos la letra i para entrar al modo inserción.
Nos aparecerá la palabra : INSERTAR (ver recuadro verde)
![02_vim_04.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23swiJG4YGjPUoXwoqaVHx2YeSSo1KTp7JYn2p5268JVdBdkmKum3d3PyjR5K8T3Q1KXq.png)
A continuación escribimos nuestro texto.
![02_vim_05.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79F7DwFF7FNBUzLvMxjNLkzHCgGRFFbjznyjYrhfgU2C1BCRka8NzYAQXrSizMkXkL.png)
Luego para guardar el texto escrito, debemos salir del modo inserción con la tecla ESC. Así podremos colocar el comando :w 02_ejercicio.txt
. La w nos permite guardar el archivo.
![02_vim_06.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/Eo1wQDmj7LhgAfKfgVrv2ACgGU7MBW1w1zWGCRJTxgidQ4EsWkPf3NawmaWEht4EJ1u.png)
Listo, el archivo queda guardado mostrándonos el nombre de este al final, ver recuadro verde.
![02_vim_07.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79FAdTbEFnMxpdK1aUaJEMLPNoNG5ZAXCaHnVX2TXWTSBazGi5q8oU6mCppU4cmwZr.png)
Para salir escribimos :q
![02_vim_08.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t7932zMVJFMtJSYBKuYbSrvu7jdWzHLyE8g2o6SoQq1eWevkMsTbsDHFYbZQKTsanGa.png)
Revisamos nuevamente en nuestra terminal con el comando ls y vemos nuestro archivo recién creado: 02_ejercicio.txt
![02_vim_09.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t77FTSE95wWuJmZpFD3vETmtjRHRcYYhRQT2c2ZNiC8YSbJtwukyzm3U9CyReMCvY1Y.png)
Una forma rápida de revisar un archivo de texto es con el comando cat en linux, escribiendo en nuestra terminal:
cat 02_ejercicio.txt
![02_vim_10.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79KYDExKrcM65gAcsDeeTz65mscZFVVWWswKkZJFzBZR5dYUQCapCDDVQ5Ak2RDpoV.png)
Volvamos a vim. Ahora entraremos nuevamente con vim 02_ejercicio.txt
![02_vim_10a.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t74ZM4myjXsSRkrzrsx6CcZAoJzKqQXH2X4UXRKNnYej3ZQn5DnWewPUwENZg2XiUpY.png)
Aquí tenemos nuestro ejercicio realizado mostrando el archivo recién creado.
![02_vim_11.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79F7DwFF7FNAzozXLJWc5h4uxkqPUcbrygpgufu5bgmNTC7L3P347MT5ScSZdWh9PC.png)
Modificar texto
A continuación modificaremos el archivo agregándole texto, en este caso se agregó
Modificar implica
* Agregar texto
* Modificar una palabra o linea
* Eliminar palabra o linea
* Todo lo que implica modificar el texto existente
Recordemos que para agregar texto debemos teclear i, para pasar al modo inserción.
![02_vim_12.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79QH5dJeBBxLE7hiEhaJB8TwfSnZd3AqWRr7mKXqp57SWuWYryqa7qfbPu1NgqH2vX.png)
Guardar y cerrar al mismo tiempo
Ahora en este ejercicio vamos a guardar y salir con una sola orden. Para realizar el guardado y salida, le damos a la tecla ESC para pasar al modo comando, se activa la parte inferior para que escribamos :qw
. La w escribe (guarda los cambios)y con la q, nos salimos.
![02_vim_13.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79QHQoVtv7a3sVyTsMLomBJgipLmwScut8oiNFnnH19MVYsS628EtHsuP3iZsdBkCY.png)
A continuación entramos para revisar el archivo con:
vim 02_ejercicio.txt
![02_vim_14.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t76tEjwSdSRerKYBhFjRckwmyFtnA8YpBKj69nc7BB6ATUey9mDdCZEp8NWgdwogZir.png)
Y listo, vemos nuestro archivos con las modificaciones que en este caso fue agregar texto.
![02_vim_15.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t79QHQoVtv8feTsXbbrptWiixfumoA39HC2xcLaBBm3FjoQZQgvpeT7PKrS2pZBWVvB.png)
Otra manera de hacer el guardado y salida
Una vez abierto nuestro archivo, escribí un nuevo texto, veamos el recuadro rojo.
![02_vim_16.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t7BBNzQTi5QjKs1orT6LaZuDjm7Yo9ZPyGJUpKAQYRmnRJJj17gcysrrASZz4sYEU9Z.png)
El comando que utilizaremos es :x
, que en resumen es la combinación de los comando w y q.
![02_vim_17.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t78k8N8jJ8gDvP94ieQNt1FNJ9krRz173f925s16zL8YiNFHoGDhY9Nf5xQUBy4Q9nR.png)
Revisamos lo recién escrito, con el comando cat de linux, y vemos que efectivamente esta el nuevo texto agregado, Ver recuadro.
![02_vim_18.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t7AxwZC48uCfmYXG6F1mz7gWZffeu8rCwdHrHaG59dVTSQPfeJGK3Nak1zvcjQmzpxT.png)
Descartar alguna modificación o cambio en nuestro archivo
Escribí un linea, para este ejercicio:
Esto lo escribo y luego no quiero guardarlo
![02_vim_19.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t7BBR5BJuoFE2amWfFwGQSdexVUUpcEnSwokERtLSEkpWCj3wrsSL8o4YSN9zXXiG92.png)
Para que no se guarde lo recien escrito utilizaremos :q!
, quien forza la salida sin guardar es el carácter !.
![02_vim_20.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23tGZves9LCoiDX1wY6PHGj3VQGCye2qgHgAJdjhydFd4dNZnsKbpi8fzJ28Cwjo2WQAQ.png)
Revisamos nuestro archivo y vemos que no se agregó lo último escrito.
![02_vim_21.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23t7B77YL66z582THiaUz6syCir84UdRKhAwxcwZ6ZkTKkd9NSpqhhVNnfqiu16EHx7Bd.png)
Todos los comandos realizados aquí se complementan con otros comando, los cuales nos permiten hacer las misma operaciones de guardado y salida de vim. Todo esto sirve para practicar y familiarizarnos con estos comandos básicos. Estos comando los puedes usar de acuerdo a tus necesidades.
📌 Algo importante que debes acostumbrarte es siempre teclear ESC, para que vim esté en modo comando, a partir de allí teclear la letra i para insertar texto. Esto se hace para llevar el control de nuestro vim.
Nos vemos en una nueva oportunidad, ahora a practicar todos...
![01_vim_separador.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23vhAgx2YQWwwzmwCsvoKkbY3gP1oPfaUWWtQHT7qfpfEXokd1WdyvFmRh5eCG2VFJf1R.png)
Mi curso de linux, lo puedes revisar por aquí: https://siraquino.github.io/pythoncumanes/linux.html
![01_vim_separador.png](https://images.hive.blog/768x0/https://files.peakd.com/file/peakd-hive/rafaelaquino/23vhAgx2YQWwwzmwCsvoKkbY3gP1oPfaUWWtQHT7qfpfEXokd1WdyvFmRh5eCG2VFJf1R.png)
Mi twitter
Nos vemos en una próxima entrega!
Rafael Aquino
I can't speak the language but your level detail is very good.
!ALIVE
!DHEDGE
You Are Alive so I just staked 0.1 $ALIVE to your account on behalf of @ ben.haase. (4/20)@rafaelaquino!
The tip has been paid for by the We Are Alive Tribe
through the earnings on @alive.chat, feel free to swing by our daily chat any time you want, plus you can win Hive Power (2x 50 HP) and Alive Power (2x 500 AP) delegations (4 weeks), and Ecency Points (4x 50 EP), in our chat every day.
Thank you for reading my post and for your comment. It encourages me to continue explaining vim from the simplest to the most complex.
Thanks for your contribution to the STEMsocial community. Feel free to join us on discord 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.
Gracias por el apoyo
Pretty interesting tutorial… it is a difficult tool to use
`
Want to Know more about Hivepakistan?
Ping Us On Hive Pakistan Discord server
To support HivePakistan, delegate Hive Power to hivepakistan and earn 90% curation reward :)
Here are some handy links for delegation
A delegation of 500 or more HP makes you earn Hivepakistan supporter badge.
`
The difficulty decreases as you use vim. Over time a muscle memory (keyboard only) is created that makes all commands execute naturally.
Congratulations @rafaelaquino! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out our last posts: