20 votes

Most annoying slow-down of a plain-text editor!

Can somebody tell me how to avoid the very annoying vim's slowdown? Hopefully in a user friendly non-geeky way? I run Vim on a company-provided 2013 15" Retina MacBook with a 2.3 GHz i7 processor, 16 ...
romainl's user avatar
  • 40.6k
10 votes

Why is vim save so slow?

The culprit in this particular situation was the Syntastic plugin. It's forking eslint. I load Syntastic on entering insert mode (using a vim-plug function loader). Vim is plenty snappy on its own....
Steven Lu's user avatar
  • 2,251
9 votes
Accepted

Folding slow with vimtex

First: Did you bother to read the vimtex documentation, i.e. :h vimtex-folding? The docs clearly point out that the fold-expr method of folding is slow, and so therefore provides an option g:...
Karl Yngve Lervåg's user avatar
7 votes
Accepted

Fastest way to compare string with pattern

The operator version =~ is most likely faster than matchstr. This is for a couple reasons: function calls in vim script have a cost matchstr returns a string, therefore has an extra allocation I've ...
Mass's user avatar
  • 14.1k
5 votes

Fastest way to compare string with pattern

I've run @Mass bench against another one that avoids :for as I have the experience of extra costs associated to control statements. My convoluted solution also does its best to avoid lambdas. function!...
Luc Hermitte's user avatar
  • 17.4k
4 votes

is neovim faster than vim?

For most built-in operations, the runtime between Vim and NeoVim is not noticeably different. That is, both are fast enough to not care about any difference. I've seen one situation that NeoVim is ...
Chris Heithoff's user avatar
4 votes
Accepted

Slow startup time unrelated to plugins

If you are debugging plugins, then do the following: Disable half of your plugins. If it fixes the problem, re-enable half of the disabled ones. If it doesn't, disable half of the ones not yet ...
jjaderberg's user avatar
  • 3,489
3 votes

How can I make a slow-ish `system` call in a statusline without corrupting the display?

I have seen this problem in other plugins as well (and some take a LOT more than 0.04 seconds). The issue appears to be that Vim puts the terminal into "cooked" mode so that the command that is run ...
John O'M.'s user avatar
  • 8,562
3 votes
Accepted

Vim slows down with multiple buffers etc

I have no idea if any of the following will help, but here are a few things you could try. You have the following autocmd: :au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>85v.\+', -1) I can'...
user9433424's user avatar
  • 6,138
3 votes
Accepted

neovim takes a long time to open files

I did a search on GitHub and Google. From the results, it's pretty reasonable to assume that that function is from vim-css-color, which isn't in vim-polyglot. In fact it looks like it was removed in ...
Tommy A's user avatar
  • 6,770
2 votes

How to execute multiple command on file open?

My vim was slowing down because of Plugin 'Yggdroot/indentLine'. @laktak you was right
IC_'s user avatar
  • 151
2 votes
Accepted

Are there any performance difference between :edit and :buffer on existing unchanged buffer?

It's faster as :buf won't reload the file from disk, whereas :edit will, which is different behaviour. This is why it's slightly slower in some cases. For most purposes, this is not a huge issue, ...
Martin Tournoij's user avatar
2 votes
Accepted

Are there any built-in functions to search sorted list?

There is nothing built in. But you might check lh-vim-lib. It has the following functions working on sorted lists: lh#list#equal_range() lh#list#lower_bound() lh#list#upper_bound()
Ralf's user avatar
  • 9,197
2 votes
Accepted

Strangely slow key bindings

When you define a multi key mapping that starts with character that is itself a mapping, vim doesn't know which one you want after only the first character. It waits to see if you'll type another ...
Tumbler41's user avatar
  • 7,746
2 votes

How to track time-expenditure for Vim operations?

You can profile and measure time Vim spends on executing functions and scripts. For more details, run :h profile in Vim. Here's an example: profile start ~/vim-profile.log profile file ~/.vim/* ...
rafi's user avatar
  • 211
1 vote

How to improve CMP performance?

I was able to fix my issue by using someone's fork of cmp that targetered this specific issue. https://github.com/yioneko/nvim-cmp The suggestions seem to have some delay before showing up, but they ...
Bruno Braga's user avatar
1 vote
Accepted

Delete and change key sequences are slow

Turns out the issue was not with immediate changes as I thought, but with clipboard interaction. I bisected my vimrc repeatedly until I found the offending line, which was: set clipboard=unnamed,...
Exnur's user avatar
  • 51
1 vote

Vim takes a long time to close over SSH?

If $DISPLAY is (incorrectly) set in your SSH environment, then Vim may be timing out trying to connect to an X server that doesn't exist. It does this for functionality like copying to/from the X ...
jamessan's user avatar
  • 11.1k
1 vote

Vim slow to open buffers, but not specifically in any sourcing plugin step

Okay, so the startup log wasn't actually very helpful here. There wasn't really any indication in the log that this was the culprit, but it turns out it was vim-bundler. I actually didn't even paste ...
ttrmw's user avatar
  • 21
1 vote
Accepted

sheerun/vim-polyglot ruby seems cause enormous slow down, how to fix or better plugin to use?

It seems that if ruby path is not set correctly during vim compilation, it slows down vim when editing ruby files, check this post. Also, using old regex engine (set re=1) rather than the new one ...
Herz3h's user avatar
  • 126
1 vote

Analyze NeoVim Performance Bottlenecks

Yes: run vim --startuptime profile and work for a bit. (To purely measure time from "enter" to "open and ready", use vim --startuptime profile +q.) I used this and a single command ...
D. Ben Knoble's user avatar
  • 26.1k
1 vote
Accepted

Vim Slowing down when creating .vimrc in $HOME

Note that in version 8 Vim started loading some default configuration when no vimrc is found - :help defaults.vim. So you could try loading those defaults in your vimrc (as explained on that help ...
mMontu's user avatar
  • 6,630
1 vote
Accepted

Switching between tabs takes a few seconds

I started Vim without my vimrc and plugins using HOME=/dev/null vim -u NONE myfile.txt Works fast. So I need to investigate the plugins and my configuration... UPDATE: bottleneck was in plugin ...
Vitaly Zdanevich's user avatar
1 vote

Lag from filetype plugin indent on

Most likely you have something in your actual syntax files causing the lag. I'd reccomend running :syntime on, moving about a little, then doing :syntime report. This'll show you what patterns take ...
Wolfie's user avatar
  • 667
1 vote

How do I "draw" a buffer from scratch in an efficient manner?

I believe it is fine to use either :put or setline(). But as you are reading the contents from an external program, you could consider :read !: :[range]r[ead] [++opt] !{cmd} Execute {cmd} ...
mMontu's user avatar
  • 6,630
1 vote

Is there an autocmd event while triggering the insert mode completion popup menu?

First, addressing the low level issue… There's no flickering at all in the popup menu, no matter how long it is or if cursorline and/or cursorcolumn are enabled or not. Flickering only happens in ...
romainl's user avatar
  • 40.6k
1 vote

Improve performance of syntax highlighting in Vim

I suggest you to disable syntax highlighting as default. It will change your mind about your needs of using it and will definilety improve every performance issue you had in vim: insert in large ...
falcucci's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible