Skip to main content
21 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
  • 41.8k
14 votes
Accepted

How to load files as a quickfix window at start-up

Vim has a startup option -q to read a quickfix file. So we have options (depending on your shell): cmd > results vim -q results Or my favorite vim -q <(cmd)
D. Ben Knoble's user avatar
  • 27.2k
12 votes

How to execute a command on vim startup

In my opinion, the cleanest method of doing this is simply to add the command to a file in your .vim/vimfiles directory: ~/.vim/after/ftplugin/python.vim or for Windows: $HOME\vimfiles\after\...
Rich's user avatar
  • 32.4k
11 votes
Accepted

Delay before running vim command?

In recent vim versions, you can use timer_start to delay an operation. For example, to execute winpos 200 milliseconds after vim starts, autocmd VimEnter * call timer_start(200, { tid -> execute('...
Mass's user avatar
  • 14.2k
9 votes
Accepted

How to execute a command on vim startup

Add in your .vimrc: au BufEnter *.py :TagbarToggle<CR> where au is autocmd, execute the command automatically. BufEnter is when you enter the file for first time. *.py is for filetype python. ...
kapil's user avatar
  • 428
7 votes

E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3

TL;DR: skip to the Resolution section. Background The issue is that neovim can't read/write vim's viminfo file format. Instead of using vim'sviminfo format for storing editing session information, ...
Tom Hale's user avatar
  • 2,721
6 votes

start vi automatically in hex mode

To start vim automatically in hex mode when editing a.out, put an autocommand like this one in your ~/.vimrc: au BufReadPost a.out silent %!xxd A more complete explanation with examples can be found ...
garyjohn's user avatar
  • 6,379
5 votes
Accepted

How to detect whether Vim has been invoked by another shell command?

Since vipe, git commit (and many other programs which invoke an editor) use the VISUAL and EDITOR variables (unless you specify an editor for git with git config core.editor), you can use that ...
muru's user avatar
  • 25.1k
5 votes

How to detect whether Vim has been invoked by another shell command?

I don't know how reliable it is but I found how to get the PID of the parent of a process here: ps -o ppid= -p <pid of the process> And how to get the name of a process from its PID here: ps -...
user9433424's user avatar
  • 6,168
5 votes

Is there some way to echo from terminal into new vim buffer

You can do this from directly inside of vim with the :read command, which is abbreviated to :r The 'read' command is intended to allow you to read a file, e.g. :r foo.txt Will insert the contents ...
DJMcMayhem's user avatar
  • 17.8k
5 votes
Accepted

Strange vim/xterm interaction: auto-insertion of `"` register when opening file

When vim starts up, it interrogates your terminal emulator, which responds with terminal codes. vim usually captures this in v:termresponse. Sometimes, however, the codes get through and they ...
Mass's user avatar
  • 14.2k
5 votes
Accepted

Run `vim -c <command>` before loading vimrc?

If you run vim --help you'll find the answer... $ vim --help | grep vimrc --cmd <command> Execute <command> before loading any vimrc file Some additional details under :help --cmd .....
B Layer's user avatar
  • 20k
4 votes
Accepted

Is it possible to open multiple files at the end or at the first occurrence of a string?

One workaround would be to use :argdo (which runs an ex command in each file in the argument list): vim +"argdo norm G" file1 file2 vim +"argdo /searchPattern" file1 file2 You will be left in the ...
Rich's user avatar
  • 32.4k
4 votes
Accepted

Interpreting the output when using --startuptime

How can I interpret the output? I can't find documentation to verify my assumptions (I checked :help startuptime). See just below :h :profd: You must always start with a ":profile start fname" ...
user938271's user avatar
  • 5,997
4 votes

Global plugins source only once?

It's described in :h startup/§:h load-plugins. You'll see that indeed plugin files are loaded only once. Yet, most plugin files have guards. They mainly serve to permit end-user to not load an ...
Luc Hermitte's user avatar
  • 17.7k
4 votes
Accepted

How to make Vim start at the end of a template?

If you associate a template to a file extension using the following autocmd: autocmd! BufNewFile *.foo 0r ~/vimfiles/template/template.foo The autocmd import the ~/vimfiles/template/template.foo when ...
Vivian De Smedt's user avatar
3 votes
Accepted

When are the files in ~.vim/after/ loaded?

Add them into ~/.vim/after/ftplugin/tex/. :h 'rtp' IIRC and :h ftplugin
Luc Hermitte's user avatar
  • 17.7k
3 votes

`E575: viminfo: Illegal starting char in line: ...` on startup

To solve this: rm ~/.viminfo vim ~/.viminfo # new file, leave it blank, then just wq. source terminal et voila
Eric Y's user avatar
  • 31
3 votes

`E575: viminfo: Illegal starting char in line: ...` on startup

For me, this problem keeps showing up even if I delete the ~/.viminfo file - not right away, but a couple of days later. I just noticed there's a way to skip using the viminfo file entirely, as ...
Brad Parks's user avatar
3 votes

How can I change Vim's start or intro screen?

Perhaps it's a bit of a hack, but the following one-liner anywhere in the .vimrc file will effectively truncate the Vim splash screen to a length of zero: set shortmess+=I
softronyx's user avatar
3 votes

Specify GDB version for Termdebug

As pointed out by Christian (all credits to him) in this comment, setting g:termdebugger does the trick. Put this into your .vimrc: let g:termdebugger='/path/to/your/gdb' Single quotes are needed.
Paulo's user avatar
  • 31
3 votes

How to load files as a quickfix window at start-up

If you'd like to invoke the command from inside Vim and populate the quickfix window with its output, you can use :cexpr together with system() or systemlist(). :cexpr system('...
filbranden's user avatar
  • 29.6k
2 votes

Why does this <Esc> normal mode mapping affect startup?

I have found that mapping ESC in /home/.vimrc will open vim with replace command. Instead, I did the exact mapping but in /etc/vim/vimrc file and the mapping is executed successfully without the ...
Maged Eltorkoman's user avatar
2 votes

The simplest way to start Vim in private mode

According to Vim documentation (:help -c) there can only be a maximum of 10 +{command}, -c {command} and -S {file} option arguments combined when starting Vim, and they execute _after_ the first file ...
mvanle's user avatar
  • 121
2 votes

Is there some way to echo from terminal into new vim buffer

If you want to just get the input from a terminal command, then just do the following ls | vim - Same for any other command output you want to pipe to Vim. If you want to read the output you can use ...
Durga Swaroop's user avatar
2 votes
Accepted

How to pause (with message) during .vimrc startup?

Problem description You're trying something that Vim was not really meant to do. Although your VimScript does work, I've modified it to: redraw! echo "xa" redraw! let i1 = input("y123456") redraw! ...
grochmal's user avatar
  • 1,666
2 votes

Vim immediately sent to background

I shouldn't have set the shell as interactive. Somehow it pauses the main Vim process. So: set shell=bash\ -i Should be: set shell=bash
ayyylter's user avatar
2 votes

Is there a way to edit secure data in vim without accessing the filesystem?

There are some things hidden in the vim docs that can help you. read ! your shell command: read the output of "your shell command" into the current buffer (a tempfile is used to read the data!) let ...
Lucas's user avatar
  • 1,649
2 votes

Hide bottom message when open new file

as suggested by Carpetsmoker in comments, here is how I solved this: set shortmess+=F
raring-coffee20's user avatar

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