r/vim

▲ 186 r/vim

10+ year user, learned today how to easy swap two selected sections

This is so simple I feel dumb for not seeing it earlier.

  1. visual mode select one part of text then d for delete

  2. visual mode select the text you want it to replace then p for paste

  3. go back to the original location and hit p for paste

that's it. Deleting the text places it in the register so you have it available in step 2. Replacing the text places it into the register, so you have it available in step 3.

For a decade plus I was adding extra steps like hitting Y or trying to avoid deleting the text so I have it available after I added the other, etc.

How many hours have I lost to not knowing this simple trick

reddit.com
u/Swagasaurus-Rex — 3 days ago
▲ 36 r/vim

Learning the motions with an ice cream van

This is doing the rounds on Hacker News and it wasn’t already posted here so thought I’d share it: https://vimscoops.dev

u/_squirts — 4 days ago
▲ 11 r/vim

Bringing images to vim.

https://codeberg.org/zoomlogo/image.vim

I wrote this plugin to basically bring images to vim using only vim9script. It depends on the kitty graphics protocol and ImageMagick. I was inspired by image.nvim lol. As of now it only displays image files (and provides an API), no markdown integration.

https://preview.redd.it/7hyho3aa9tah1.png?width=1920&format=png&auto=webp&s=cb59303d24ed0ba9404bc6f641bd96252398611a

https://preview.redd.it/p30u9qxx9tah1.png?width=1920&format=png&auto=webp&s=8b4eb9d23eec9a6749bb934ce9a2a85bf47b0a28

I plan on using it to render inline equations (using eqn and groff) but I wanted to hear what y'all think of the plugin, its my first time posting here.

reddit.com
u/zoomlogo_ — 4 days ago
▲ 35 r/vim

I missed the milestone: Belated Happy 100 to the Awesome-Vim9 list

Over 100 plugins now on the awesome-vim9 list. Many slept on, so have a look around.

github.com
u/Shay-Hill — 5 days ago
▲ 126 r/vim

You can actually use ":exit" instead of ":wq" or ":x" to exit Vim

Accidentally mixed up the Vim exit command with the terminal exit command exit, just to find that :exit actually works perfectly in Vim!

  • :exit works exactly like :x.
  • Saves only if the changes were made, then exits.

Probably the ultimate solution to the "How to exit Vim" problem.

reddit.com
u/Brainfuck_01 — 9 days ago
▲ 17 r/vim

I made a light mode theme of my previous Artemis2 inspired theme.

Honestly, this theme reminds me more of the video game "Starfield", but I love it regardless. In case you want to harass me about how bad it is; you can find it here.

p.s. I have no motivation in posting this beyond sharing something cool I did.

u/JonahRileyHuggins — 6 days ago
▲ 4.3k r/vim+1 crossposts

Can't spell "revolution" without "vi"

u/mxsifr — 14 days ago
▲ 5 r/vim

Opinionated TLDR for Windows users

After identifying another speed bump for Windows users, I've added a TLDR to Install Vim in Windows.

If you already have a setup you're happy with, these might help with any nagging issues.

  • Install PowerShell 7 # Vim in PowerShell 5 and CMD are tougher. "My OS is my IDE" doesn't with WSL.

​

winget install Microsoft.PowerShell --source winget
  • Install GNU zip and unzip # Plugins look for these

​

winget install GnuWin32.Zip GnuWin32.UnZip --source winget
[Environment]::SetEnvironmentVariable("PATH", "$($env:PATH);C:\Program Files (x86)\GnuWin32\bin", [EnvironmentVariableTarget]::User)
  • Don't use the latest Copilot. Lock version at 1.4.1 or clone ShayHill/copilot.vim
  • in vimrc (in this order):

​

set shell=pwsh
set termguicolors
&t_8u = "\<Esc>[58:2::%lu:%lu:%lum"  # fix spelling and `yegappan/lsp` error rendering
  • Install DejaVuSansMono.ttf # A fixed-width font with plenty of symbols and dotted 0
  • in gvimrc:

​

set guifont=DejaVu_Sans_Mono:h10:cANSI:qDRAFT
set renderoptions=type:directx,gamma:1.0,geom:0,renmode:5,taamode:1  # better symbol colors
u/Shay-Hill — 10 days ago
▲ 6 r/vim

Vim plugins while :edit scp://

Recently I started using a containerised dev env. I would like to work in the host system so I installed a ssh server and followed the steps listed under :h ssh.

​

So far so good. I depend (for good or bad) heavily on vim fugitive and :FZF plugins. They are good. But they do not work on the host system inside a SCPed remote. I can use :find to open some remote file, it works. But using :G is an issue.

​

Question

--------------

How do you use plugins while :e scp://user@host/path/dir/ ?

reddit.com
u/ngnirmal — 14 days ago