I was extremely surprised I didn't set up a note about my default and OG editor of choice, vim. It is what has helped long term become very fast at typing and in general for understanding the power of just using whatever editor you are most comfortable with at the end of the day. Vim is what I used when I was editing t things on a chromebook and it is still what I am using to this day.
There are many purposes to vim, you can use it for:
- [typing up your math notes ](https://castel.dev/post/lecture-notes-1/)by incorporating vim with [LaTeX](obsidian://open?vault=Coding%20Tips&file=Quantum%20Realm%2FTools%2FLaTeX)
- this [website](https://www.vim.so/#exercise) seems the easiest way to learn vim hands-on if you need a refresher
- [here are more tutorials](https://www.tutorialspoint.com/vim/index.htm) for reference, don't go to the site above
- ooh you can even create actions through vim for functions called ["tags"](https://www.tutorialspoint.com/vim/vim_using_vim_as_ide.htm)
- Tricks and tips from and for vim users is posted on the [wiki](https://vim.fandom.com/wiki/Vim_Tips_Wiki)
- generate the config file for your vimrc for different languages no matter where you go [here](https://vim-bootstrap.com/#tagline)
-`[range]`indicates that you can pass the range of lines. Pass % to find and replace in all lines. The range is separated by a comma. To find and replace between lines 5 to 10, pass 5,10. Use`.`to represent the current line and`$`the last line of the file.
-`{pattern}`indicates the pattern to find the text. You can pass regex patterns here.
-`{string}`is the string to replace in the found text.
-`[flags]`indicates if you wish to pass any additional flags (for example, the flag`c`is passed to confirm before replacing the text). By default, this does a case-sensitive search. You can change it to do a case-insensitive search by passing a`i`flag.
When you launch the Vim editor, you’re in the normal mode. In this mode, you can run Vim commands and navigate through the file.
To go back to normal mode from any other mode, just press the`Esc`key.
Vim has its own terminology for copying, cutting, and pasting. Copy is called yank (`y`), cut is called delete (`d`), and paste is called put (`p`).
### Copying (Yanking)
To copy text, place the cursor in the desired location and press the`y`key followed by the movement command. Below are some helpful yanking commands:
-`yy`- Yank (copy) the current line, including the newline character.
-`3yy`- Yank (copy) three lines, starting from the line where the cursor is positioned.
-`y$`- Yank (copy) everything from the cursor to the end of the line.
-`y^`- Yank (copy) everything from the cursor to the start of the line.
-`yw`- Yank (copy) to the start of the next word.
-`yiw`– Yank (copy) the current word.
-`y%`- Yank (copy) to the matching character. By default supported pairs are`()`,`{}`, and`[]`. Useful to copy text between matching brackets.
### Cutting (Deleting)
In normal mode,`d`is the key for cutting (deleting) text. Move the cursor to the desired position and press the`d`key, followed by the movement command. Here are some helpful deleting commands:
-`dd`- Delete (cut) the current line, including the newline character.
-`3dd`- Delete (cut) three lines, starting from the line where the cursor is positioned,
-`d$`- Delete (cut) everything from the cursor to the end of the line.
The movement commands that apply for yanking are also valid for deleting. For example`dw`, deletes to the start of the next word, and`d^`deletes everything from the cursor to the start of the line.
### Pasting (Putting)
To put the yanked or deleted text, move the cursor to the desired location and press`p`to put (paste) the text after the cursor or`P`to put (paste) before the cursor.
To undo a change in Vim, press`u`in command mode. To redo, press`CTRL + R`. You can prepend a number (n) with`u`to undo`n`times. for example,`2u`will undo 2 times. To list the available undo options, type`:undolist`in command mode.