u/Shay-Hill

Increase Vim Speed in Windows Terminal
▲ 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

Does anyone have a pic of the 1BV (green map, jaundiced) LCD behind a 1AV (white print on black) faceplate?

Everything is in the title.

reddit.com
u/Shay-Hill — 1 month ago
▲ 31 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 — 2 months ago
▲ 7 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 — 2 months ago
▲ 6 r/vim

Modernized Python sections for Vim-in-Windows article.

- Removed content related to multiple Python installs.
- Updated vimspector config for Python 3.11+.

github.com
u/Shay-Hill — 2 months ago
▲ 0 r/vim

If Copilot used to "just work" for you and now it doesn't, this looks like the reason. The problem lies in an update with pre-compiled binaries between 1.41.0 and 1.42.0. There might be an easy patch to get the latest version working, but I won't go down that rabbit hole.

This makes easy work of reverting without scripts, tweaking your package manager, or forking yourself. BTW, removing `github/copilot.vim` and adding `ShayHill/copilot.vim` to your package manager config probably won't accomplish anything, because the names are the same. You'll need to delete / clean / or similar before adding `ShayHill/copilot.vim`.

ShayHill/copilot.vim: GitHub copilot reverted to 1.41.0

reddit.com
u/Shay-Hill — 4 months ago
▲ 0 r/vim

Copilot worked for me for years, but now I have an endless auth loop: log in, appears to communicate with server, everything fails because the token is expired or wrong.

I am having the same issue with Windsurf.

I have been through MANY iterations of "clean" runs, deleting caches, trying things on the GitHub end, config tweaks, install / uninstall node. No clues. Does anyone have this working? It's been a few years since I've been stuck like this in Vim.

reddit.com
u/Shay-Hill — 4 months ago