r/vim

A method to learn Vim/Neovim without getting overwhelmed (Suggestions for beginners)
▲ 25 r/vim+1 crossposts

A method to learn Vim/Neovim without getting overwhelmed (Suggestions for beginners)

In this video, I explain a method I use to learn Vim/Neovim and focus only on what I need, avoiding information overload.

The method consists of 4 steps:

  1. Identify a problem
  2. Identify solutions to that problem
  3. Keep the solution that covers the most cases
  4. Learn the rest later
youtu.be
u/NazgulResebo — 1 day ago
▲ 106 r/vim

How to get rid of this?

This extra thing appears when I when to type a command, i'm not sure how to stop it from appearing. I'm on windows and this is currently gvim but it behaves the same in other ways of instancing vim

u/Available-Ant-5747 — 3 days ago
▲ 227 r/vim

NeoVim is Overhyped, Vim is Criminally Underrated

I think NeoVim is extremely overhyped, while Vim — especially gVim — is drastically underrated. NeoVim changes hyper‑actively together with its plugins, so something that worked one day might stop working the next because of constant updates. Because of this, maintaining it can be a complete nightmare, even if someone is a Lua prodigy. In contrast, classic Vim is stable, reliable, and rock‑solid.

What makes NeoVim appealing compared to Vim is that it’s full of flashy plugins, but in reality most of those plugins are completely unnecessary for real projects. Plus, NeoVim users conveniently forget to mention that almost every important plugin has a proper equivalent in Vim. For example: Telescope → fzf.vim, nvim-tree → NERDTree, lualine → vim-airline, commenting → vim-commentary, surround → vim-surround, Git → vim-fugitive. And they’re much more straightforward. Thanks to Vimscript, configuring Vim is far easier than mindlessly copying Lua code. And there’s coc.nvim available for classic Vim as well, which can turn Vim into a very powerful IDE.

I’m sticking with gVim even if it’s probably the most despised version of Vim (in my opinion completely unjustifiably). Thanks to the GUI, it’s much better than a terminal program because it doesn’t depend on the terminal, and copy/paste from the clipboard works simply and flawlessly — exactly how a text and code editor should.

It’s a bit like how Arch Linux users tend to look down on Debian users, regardless of the fact that Arch isn’t exactly stable — it’s just well‑hyped and more rapidly developed, but it also breaks more easily. Meanwhile Debian is solid and stable.

reddit.com
u/BattleKooky3416 — 4 days ago
▲ 3 r/vim

Vim in WSL: `+yy` gives `W23: Clipboard register not available` despite `+clipboard`

I'm running Vim inside WSL and can't get the `+` register to work.

When I try:

"+yy

I get:

W23: Clipboard regiter not available, using register 0

However:

:echo has('clipboard')               "1
:echo has('unnamedplus')             "1

vim --version | grep clipboard
+clipboard
+xterm_clipboard

I'm running /usr/bin/vim.gtk3, but:

  • $DISPLAY is empty
  • $WAYLAND_DISPLAY is empty
  • xclip/xsel are not installed
  • clip.exe workgs from WSL (echo test | /mnt/c/Windows/System32/clip.exe)

Is this expected because I'm runnign a headless TTY, or should vim.gt3 still be able to use the Windows clipboard? Is win32yank.exe the recommended solution?

reddit.com
u/logikwright — 2 days ago
▲ 34 r/vim

Increase Vim Speed in Windows Terminal

Last time I mentioned running Vim in Windows Terminal, some users reported having tried that setup and experiencing sluggishness. I've added some performance recommendations to my guide:

scrollback buffer

Windows Terminal has a large default scrollback buffer (9000 lines). This keeps a lot of history, but it can slow down terminal applications like Vim. If you've used Vim in Windows Terminal before and found it slowing down over time, this is the likely culprit. To confirm this diagnosis, start a new Windows Terminal instance, run Vim, and see if you percieve a speed increase. If so, the scrollback buffer is almost certainly the cause. There are two ways to address this issue:

  1. Decrease the limit: In Windows Terminal settings -> PowerShell -> Advanced -> History size, set the "History size" to a smaller number, like 1000. This will reduce the scrollback buffer for all PowerShell tabs in Windows Terminal.
  2. Clear the buffer when you notice a slowdown: If Vim starts to get sluggish, press <ctrl-shift-k> to clear the scrollback buffer. This is better done outside of Vim.

Either of these will fix the problem. You won't need both. Your Windows Terminal config is stored in ~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json. Editing this file directly with pasted-in termina commands isn't straightforward, so I haven't given those commands here. But you can commit this settings.json if you wish. If you're new to Windows, don't be misled by the 8wekyb3d8bbwe part of the path. It is a hash, but it will be the same hash on all Windows 11 systems.

Windows Defender

Windows Defender will scan every backup file, swap file, snippet file, etc. This can cause a speed decrease in Vim. We'll do two things to address this: 1. Put our temporary files in ~\vimfiles, and 2. Add an exclusion for ~\vimfiles in Windows Defender.

Move temporary files to ~\vimfiles

In your ~\vimfiles\vimrc, add the following:

# ---------------------------------------------------------------------------- #
#
#  keep temporary files in ~/vimfiles
#
# ---------------------------------------------------------------------------- #

&directory = $'{$MYVIMDIR}.tmp/swap/'
&backupdir = $'{$MYVIMDIR}.tmp/backup//'
&undodir = $'{$MYVIMDIR}.tmp/undo//'

def MkdirIfNotExists(dir: string): void
  if !isdirectory(dir)
    mkdir(dir, "p")
  endif
enddef

MkdirIfNotExists(&directory)
MkdirIfNotExists(&backupdir)
MkdirIfNotExists(&undodir)

set backup
set undofile

If you decide to commit your vimfiles, make sure you .gitignore the .tmp directory. There may be sensitive information in your temporary files.

The full guide is here: article_install_vim_in_windows/README.md at main · ShayHill/article_install_vim_in_windows

u/Shay-Hill — 7 days ago
▲ 22 r/vim+1 crossposts

How do I change the cursor to a block in normal mode and to a beam in insert mode, inside vim's built in :terminal ?

In neovim, this can be done by:

vim.opt.guicursor:append("t:ver25")
vim.opt.guicursor:append("t:blinkon0")

but, this doesn't work in vim, written in vim script:

set guicursor+=t:ver25
set guicursor+=t:blinkon0

E546: Illegal mode: guicursor+=t:ver25 line 30: E546: Illegal mode: guicursor+=t:blinkon0

I have the following to make my cursor a block in normal mode and a beam in insert mode in Vim, but this doesnt work for the :terminal

let &t_SI = "\<Esc>[6 q"
let &t_EI = "\<Esc>[2 q"

is there a way to make the same behaviour possible inside vim's built in terminal ?

OS : cachyos
vim : 9.2
terminal : konsole and kitty

Thanks in advance

reddit.com
u/Odd-Procedure5985 — 8 days ago
▲ 50 r/vim

how do you copy text from one document and paste it into another in vim?

I’m working with two files, File A and File B, and I want to copy text from one file to the other.

Specifically, I want to:

  1. Open File A and select/yank a section of text.
  2. Switch to File B.
  3. Paste the yanked text into File B.

What is the correct way to yank text from File A and paste it into File B? Is there a specific register or command I should use to copy text between separate files?

reddit.com
u/TheEyebal — 13 days ago
▲ 67 r/vim

Monthly Thread: Tools with Vim-like Keybindings

We regularly remove standalone posts about tools that use vim-inspired keybindings. There are too many of them, and individually they dilute the subreddit. But the content is valuable, and many of you want to know about these tools.

So here's the place for it.

Share any tool that uses vim-like keybindings, whether it's a browser extension, terminal emulator, IDE plugin, note-taking app, PDF reader, or anything else. If it has hjkl navigation, modal editing, or vim-inspired controls, it belongs here.

For each tool you share, try to include:

  • What it is and what problem it solves
  • Which vim features it supports (navigation, modal editing, text objects, etc.)
  • A link to the project

This thread is posted monthly. If you find something mid-month, save it for here rather than posting a standalone thread (which will be removed).

reddit.com
u/AutoModerator — 13 days ago
▲ 0 r/vim

What AI agent harness for vim?

I discovered ai agents lately, and I am wondering if there is any good harness for Vim. I have tried to run copilot CLI in a terminal window but it was a bad experience due to that copilot cli is a full tui program that cannot be replicated satisfactorily in a vim terminal.

Any hints?

Preferably in Vim9.

reddit.com
u/Desperate_Cold6274 — 11 days ago
▲ 23 r/vim+1 crossposts

viww: the vim web wowser (feedback + suggestions)

Please be gentle, first time publishing something publicly.

I use this emacs' eww-inspired html/plain text browser that uses curl and pandoc to do html -> plain text into a vim buffer. It is sufficient for my daily quick searches and keeps the results in a vim buffer for reference.

If this is useful and works for you, I would appreciate feedback on publishing and maintaining this as a plugin for everyone

github.com
u/GinormousBaguette — 12 days ago
▲ 20 r/vim

What All Can I Do With A Visual Selection?

I'm looking for creative things one could do with selected blocks to make life easier - and associate them to keys. Some common keybindings I use are:

xnoremap _ :g/^\s*$/d<CR> # delete all empty lines
xnoremap # :g/^\s*#/d<CR> # delete all comments (assuming #)
xnoremap s :sort<CR>
reddit.com
u/CRTejaswi — 14 days ago
▲ 3 r/vim

Persist ECHO (from function) on Visual Selection

How to persist echo from this function call (without using timers)

function! VisualStats()
    let wc      = wordcount()
    let [l1,l2] = sort([line('v'), line('.')])
    let txt     = join(getline(l1,l2), "\n")
    let sp      = len(substitute(txt, '[^ ]', '', 'g'))
    let st      = len(substitute(txt, '[^.!?]', '', 'g'))
    let pa      = empty(txt) ? 0 : len(split(txt, '\n\s*\n'))
    echo "CHARs " . wc.visual_chars . " WORDs " . wc.visual_words
    \. " SENTs " . (st > 0 ?st :1) . " PARAs " . pa . " SPACEs " . sp
endfunction
xnoremap <silent> C <Cmd>call VisualStats()<CR>

just like when directly keymapped?

xnoremap <silent> c <Cmd>let g:wc=wordcount()<CR><Esc>:
    \let t=join(getline("'<","'>"),"\n")<Bar>
    \let sp=len(substitute(t,'[^ ]','','g'))<Bar>
    \let st=len(substitute(t,'[^.!?]','','g'))<Bar>
    \let pa=empty(t)?0:len(split(t,'\n\s*\n'))<Bar>
    \echo "CHARs ".g:wc.visual_chars." WORDs ".g:wc.visual_words.
    \" SENTs ".(st>0?st:1)." PARAs ".pa." SPACEs ".sp<Bar>
    \unlet g:wc t sp st pa<CR>
reddit.com
u/CRTejaswi — 13 days ago