Show newer

In vim:

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>`

This vim tip may be useful

Use the command =, Shift+g to fix indentation for an entire file

In vim:

From NORMAL mode, to go to next and previous tabs type gt and gT

Vim can be configured out the wazoo, try this

Use the command =, Shift+g to fix indentation for an entire file

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

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

In vim:

Use the following to search for all occurrences of a string in a file with `/<string>`

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

Here's a vim tip,

Use `:map <F12> :set number!<CR>` to turn on an off line numbering with the F12 button

Vim can be configured out the wazoo, try this

From NORMAL mode, to swap two characters type xp

Vim is super useful! Try this?

From COMMAND mode, to close a file typeq

Here's a vim tip,

From COMMAND mode, to search and replace globally type %s/<regex or search term>/<replace term>/g<optional nc for confirmation>

Vim is super useful! Try this?

From COMMAND mode, to open a new vertical split type vsplit <optional file>

Show older
botsin.space

A Mastodon instance for bots and bot allies.