Daily Vim Tip: From any bracket, brace, or parenthesis, % teleports you to its matching partner. In files with the matchit plugin loaded, it also hops between if/else/end blocks and HTML tags.

Learn more: run `vimtutor` in your terminal, or use `:help %` inside Vim.

#vim #vimtip #coding #ostechnix

Daily Vim tip: Use f{char} / F{char} to move the cursor at a specific character on the current line. f jumps forward to it; F hunts backward. After the first jump, ; repeats in the same direction and , reverses โ€” so you can skip through multiple matches without retyping.

Learn more: run `vimtutor` in your terminal, or use `:help f{char}` inside Vim.

#vim #vimtip #coding

Daily Vim Tip: Use e / E to land on the final character of the current word rather than the start of the next. Handy when you want to append to a word or delete to its tail. E skips punctuation just like W does.

Learn more: run `vimtutor` in your terminal, or use `:help e` inside Vim.

#vim #vimtip #coding #ostechnix

Vim tip of the day: b / B

Use b or B to move backward through Words. b treats every punctuation cluster as its own stop; B leaps back across entire non-space chunks at once. Pair with w to zip through code without touching arrow keys.

Learn more: run `vimtutor` in your terminal, or use `:help b` inside Vim.

#vim #vimtip #coding

#vimtip Better #man support when editing shell script.

autocmd filetype sh,bash,zsh { g:no_man_maps = 1 g:ft_man_open_mode = 'vert' runtime ftplugin/man.vim setlocal keywordprg=:Man } autocmd Filetype man { nnoremap <buffer> <silent> q :q<CR> setlocal keywordprg=:Man }

Pressing K loads the man page of word under cursor in a vertical split. q closes it. See also https://vimhelp.org/filetype.txt.html#manpager.vim

#vim #vim9script

Vim: filetype.txt

Vim help pages, always up-to-date

I run few maintenance tasks occasionally ~ once a month. I note down when I ran like below:

# Last run Wed 18 Jun 2025 12:24:39 PM EDT ssh vps1 runStuff.sh

To update the date, I used to run :r!date and then edit to replace.
I wrote a small command to automate that

command DateUp keeppatterns s/Last run \zs.*EDT/\=system("date")->trim()/

#vim #vimtip

TIL, in #vim (or #neovim) you can indent the current line *while in insert mode* with Ctrl-T and dedent it with Ctrl-D.

I've used Vim for decades and have always switched to Normal mode and used << and >>. This is so much better!

:help ins-special-keys is full of gems. #VimTip

Little shout out to past me for throwing this config in my .vimrc ages ago:

" Toggle spellcheck functionality
:map <F5> :setlocal spell! spelllang=en_us<CR>

Now I get to rebuild some lost muscle memory for fixing my speeling mesteaks

https://vimtricks.com/p/vim-spell-check/

#Vim #VimTip

Vim Spell Check - VimTricks

Vim spell check is a native feature that can check your spelling as you type and give you suggested spelling corrections right in Vim.

TIL about `<C-a>` and `<C-x>` in #vim for adding or subtracting.
(`:h ctrl-a` , `:h ctrl-x` )

Ctrl-a will add [count] to a number or alphabetic character at or after the cursor.
And Ctrl-x will do subtraction in the same way.

For example let's say I need to increment this 1 to be a 2.

```
replicas: 1
```

Normally I would type `f1` followed by `r2`
Or maybe even just `A` <backspace> `2`

But we can do better.

In this particular scenario I need only be on that line and do `<C-a>`
Since `<C-a>` will look ahead to find a digit on the current line and act upon it. Which means we can do this from the start of the line and it will turn into:

```
replicas: 2
```

And if I want to change it back to `1` I can use `<C-x>`

These two commands will even take a `[count]`. This means that if the current value is `replicas: 1` we can do `10<C-a>` and it will now say `replicas: 11`

#vim #vimtips #VimTip #TIL #vi

For my fellow #vim people.

Delete a group of lines with `:N,Nd`

For example:

```
1 this
2 is
3 an
4 example
: 2,3d <- Delete lines 2-3
```

This also works with other verbs in vim. For example copy (`y`) , change (`c`), indent (`>` or `<`),

You can even combine these action verbs with additional modifiers or commands for more powerful functionality.

For example:
`1,5>>` indents lines 1 through 5 by two levels.

`1,10!tr a-z A-Z` converts lines 1 through 10 to uppercase using the `tr` command.

Edit: Fixed an example for newer Vim versions Thanks @m1foley ๐Ÿค˜

#VimTip