User Tools

Site Tools


linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux [2025/05/31 05:39] – [Text Editor] rootlinux [2025/06/01 22:44] (current) – [Macros in Vim] root
Line 9: Line 9:
 ===== Text Editor ===== ===== Text Editor =====
 Vim and Neovim all the way. I wrote my college application essay, and programmed my thesis application, all in Vim and Neovim.Esc:wq Vim and Neovim all the way. I wrote my college application essay, and programmed my thesis application, all in Vim and Neovim.Esc:wq
 +
 +==== Macros in Vim ====
 +Place yourself in the following scenario. You have a this .csv style line:\\
 +<code>2025-03-20,Lawrence of Arabia,1962,https://boxd.it/2wRE</code>\\
 +But, you need to format it to look like this:
 +<code>* **2025-03-20** - ''[[https://boxd.it/2wRE|Lawrence of Arabia]]'' - (1962)</code>\\
 +No problem right? It should only take around 30 seconds in a regular text editor (I tried it myself). Now image this, you have to do this [[movies#List of Movies I Have Watched|over a hundred times]]. Now, it seems like it would be a problem. 
 +
 +Now yes, you could just ask ChatGPT to do it for you, and it will do it with a very high degree of accuracy. However, you may have many valid reasons not to do so. Instead, you could use a vim macro. How it works is, you start recording a macro, perform the exact series of keyboard inputs, then save the macro. Then, you run it n number of times, and the macro will perform that exact operation on every single line you run it on. You have just saved over half an hour!
linux.1748669985.txt.gz · Last modified: by root