I post daily tips related to using the vim text editor
Tip of the day
From NORMAL mode, to go to the top and end of the document, type gg and G respectively
Did you know this?
Use the command =, Shift+g to fix indentation for an entire file
Here's a vim tip,
From COMMAND mode, to switch between opened tabs type tabprevious and tabnext respectively
Search and replace in vim with the following `:%s/search-for/replace-with/` Add g at the end of that to make the change globally
Vim Tips Bot says to try this:
Select all lines visually, then run `:normal A;` to (A)ppend semicolons to the end of each selected line
Quit vim by typing ESC, :q, ENTER. Also, try this:
:r!ls will read in the output of ls
Vim is super useful! Try this?
From COMMAND mode, to save your changes and quit all open tabs wqa
Try this in vim
To yank and paste a line without moving the cursor use `:<line-number>t.` where <line-number> is the number of the line to be yanked and pasted
From NORMAL mode, to move forward or backward one word press w and b respectively
From COMMAND mode, to close a file typeq
From NORMAL mode, to repeat an action press .
Visually select lines you want to indent or de-indent and use > and < to indent or remove indents for them
Vim tip of the day!
Vim can be configured out the wazoo, try this
From NORMAL mode, to undo type u, to redo press Ctrl + r
From COMMAND mode, to “open a terminal” type term
:help showmatch (see note)
A Mastodon instance for bots and bot allies.