Hot answers tagged

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 ...
user avatar
  • 33.1k
18 votes
Accepted

Cut vim load time

If you just want to see what's consuming start up time, then you can use the --startuptime option. vim --startuptime timing.out The file will look like this: times in msec clock self+sourced ...
user avatar
  • 10.4k
17 votes
Accepted

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

Vim sends during startup some special terminal codes (that usually contain the <esc> key) to determine several things (colors, bs,...) If you mapped <esc> this will most likely confuse the ...
user avatar
14 votes

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

The Linux terminal uses ANSI escape sequences (i.e. strings of characters starting with <Esc>) to send special keys to Vim, and as part of the communication protocol with which the application ...
user avatar
  • 16.9k
12 votes
Accepted

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

Turns out the answer was in the error message all along.. the offending file was ~/.viminfo which was somehow corrupted.
user avatar
12 votes

How can I get Vim to ignore all user configuration, as if it were freshly installed?

One way to eliminate user-specific files would be to use a different value of $HOME. To allow nothing to be read, or written to (such as viminfo), you could use /dev/null: HOME=/dev/null vim -u NONE ...
user avatar
  • 23.9k
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\...
user avatar
  • 28k
11 votes

The simplest way to start Vim in private mode

Well, a bit belated but to respond to: Some magic (from a comment by Carpetsmoker in this thread) My general idea was that you always want to start "private mode" if you're using an ...
user avatar
11 votes
Accepted

How do I make Vim use a default filename when not given any filenames?

Try putting this at the end of your .vimrc (modify as appropriate) if @% == "" && getcwd() == "/tmp" :silent edit test.sh endif This checks if the current filename is empty (@% ...
user avatar
  • 8,072
10 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('...
user avatar
  • 12.8k
9 votes
Accepted

Prevent 'Press ENTER' when pathogen loads but keep for other scripts

Change the call pathogen#runtime_append_all_bundles() line in your vimrc to call pathogen#infect(), as the message suggests.
user avatar
  • 10.4k
9 votes
Accepted

Why does gvim read /usr/share/vim/vimrc instead of ~/.vim/vimrc

Reading system-level configuration before user-level configuration is totally normal and expected in UNIX land. Anyway, this sentence: The files are searched in the order specified above and only ...
user avatar
  • 33.1k
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. ...
user avatar
  • 398
9 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)
user avatar
  • 21.4k
7 votes

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

Actually the answer is in startify. In startify.vim around line 15 we can see autocmd VimEnter * nested \ if !argc() && (line2byte('$') == -1) && (v:progname =~? '^[-gmnq]\=vim\=x\=\%...
user avatar
  • 589
7 votes

How can I start vim and then execute a particular command that includes a \, from the command line?

-c doesn't execute keybinds in normal mode; it executes commands (what you normally do with :). So you need to use the execute command, which seems to work: $ vim -c 'execute "normal \\t"' We need ...
user avatar
6 votes
Accepted

Why won't gvim start after reinstall?

You can capture a full log of a Vim session with gvim -V20vimlog. After quitting Vim, examine the vimlog log file for suspect commands. Also, it may be something in your configuration, so try ...
user avatar
  • 16.9k
6 votes
Accepted

non-default colorschemes can't be loaded; setting them manually after startup works

Although, i haven't found out what exactly was the problem or how i could solve it in the expected way (just placing colorscheme babymate256 in my config as everyone else does) => i now use just ...
user avatar
  • 547
6 votes
Accepted

How can I start vim and then execute a particular command that includes a \, from the command line?

You could make a function that creates the new entry, and then use the function as part of your mapping: nnoremap <leader>t :call NewEntry()<cr> function! NewEntry() let title = expand('...
user avatar
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 ...
user avatar
  • 5,934
5 votes
Accepted

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

Here's the code that I extracted from vim-startify; the key parts are creating a new buffer on the VimEnter autocmd, putting some text in that, and then mapping the i to start a new buffer and then go ...
user avatar
5 votes

How do I make Vim use a default filename when not given any filenames?

A modification of John's answer may be useful: if @% == "" && getcwd() == "/tmp" :silent edit `=glob("test\.*", 1, 1)[0]` endif That opens the first file which begins with test.. ...
user avatar
  • 191
5 votes

Cut vim load time

You can debug startup time by using the built in Vim profiler (tutorial) If your version of vim is compiled with :profile you can run: vim --cmd 'profile start vimrc.profile' --cmd 'profile! file ~/....
user avatar
  • 611
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 ...
user avatar
  • 16.8k
5 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, ...
user avatar
  • 2,281
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 ...
user avatar
  • 23.9k
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 .....
user avatar
  • 18.4k
4 votes
Accepted

I get the error "./en_US.UTF-8: No such file or directory" when starting nvi

This seems to be an old but known problem on OS X. This issue has a patch, which is unfortunately not yet incorporated. You can apply it manually to fix your nvi build.
user avatar

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