Vim imcrementing and tmux copying

· sillybit


Got a number of lines in Vim you need to increment? No problem! There's a feature for that.

Check the help pages for Ctrl-A or 'adding and subtracting'.

:help CTRL-A

Using that you can take an example like this (line for numbers for reference)

1. example1
2. example1
3. example1
4. example1

Then move the cursor to line 2 and visually select the next 3 lines or use visual block selection to select the next three 1's and then use the sequence g, Ctrl-A to effectively produce a sequence of incrementing numbers. Use Ctrl-X to subtract.

1. example1
2. example2
3. example3
4. example4

more info: https://irian.to/blogs/quick-vim-tips-to-generate-and-increment-numbers/

Tmux #

Want to copy the tmux copy buffer to your system clipboard?

Use a compatible terminal emulator like foot and set the tmux-clipboard to use OSC 52.

Check it with these commands

$ tmux show -s set-clipboard
set-clipboard external

$ tmux set -s set-clipboard external

more info: https://github.com/tmux/tmux/wiki/Clipboard

In my case, since I use nix btw, I had to install wl-clipboard and switch from Gnome terminal to Foot which is fine.