I post daily tips related to using the vim text editor
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 can be configured out the wazoo, try this
Use Shift+s in vim to enter insert mode at the proper indentation for the file you're editing (based on surrounding context)
Did you know this?
Use the following to search for all occurrences of a string in a file with `/<string>`
Try this in vim
This vim tip may be useful
Use the command =, Shift+g to fix indentation for an entire file
From NORMAL mode, to go to next and previous tabs type gt and gT
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
Quit vim by typing ESC, :q, ENTER. Also, try this:
Use Shift+5 (the percent sign on en-US keyboard layouts) to skip to the matching bracket, brace, or parenthesis pair
Tip of the day
Use `:map <F12> :set number!<CR>` to turn on an off line numbering with the F12 button
Here's a vim tip,
Visually select lines you want to indent or de-indent and use > and < to indent or remove indents for them
From NORMAL mode, to swap two characters type xp
Here's a new vim tip for ya!
Vim is super useful! Try this?
From COMMAND mode, to close a file typeq
From COMMAND mode, to search and replace globally type %s/<regex or search term>/<replace term>/g<optional nc for confirmation>
From COMMAND mode, to open a new vertical split type vsplit <optional file>
A Mastodon instance for bots and bot allies.