Skip to main content
67 votes
Accepted

Is there any way to change the popup menu color?

You can use the following highlight groups: Pmenu – normal item PmenuSel – selected item PmenuSbar – scrollbar PmenuThumb – thumb of the scrollbar For example to set a grey background: :highlight ...
Martin Tournoij's user avatar
22 votes
Accepted

Is there a version of Vim or plugin with a Command Mode auto completion?

I really don't think that having autocompletion or not will help you learning how to use Vim. Your main problem in my opinion is to learn the basics of the editor and then learn more and more commands....
statox's user avatar
  • 50.1k
19 votes
Accepted

cancel complete

From :h complete_CTRL-E: *complete_CTRL-E* When completion is active you can use CTRL-E to stop it and go back to the originally typed text. ...
Antony's user avatar
  • 2,590
19 votes
Accepted

Ctrl-n completion takes a long time for “scanning included file”

By default, when you hit C-n or C-p, Vim looks inside various sources to find candidates which will populate the completion menu. These sources can be configured with the buffer-local 'complete' ...
user9433424's user avatar
  • 6,158
12 votes

Is it possible to have vim auto-complete function names, variables, etc. when using it to program?

In insert mode, type the first couple of characters of a word, then press: Ctrl-N to insert the next matching word; or Ctrl-P to insert the previous matching word. This is particularly useful when ...
surendra nath's user avatar
11 votes

Vertical WildMenu in Vim

Patch 8.2.4325 added the vertical wildmenu support to Vim.
Yegappan Lakshmanan's user avatar
10 votes

Easiest way to insert LaTeX matrix?

Honza's UltiSnips Snippet gentbl<number>x<number> available in the repository https://github.com/honza/vim-snippets/blob/master/UltiSnips/tex.snippets Using this snippet which uses the ...
Hotschke's user avatar
  • 4,790
10 votes
Accepted

Cycle through autocomplete menu using tab

Put the following insert-mode mapping (see :h mapmode-i) in your vimrc: inoremap <expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>" inoremap <expr> <S-TAB> pumvisible(...
3N4N's user avatar
  • 5,774
9 votes

How to get intelligent C++ auto-completion?

One option (what I currently use) I don't use YouCompleteMe anymore. coc-clangd is much better and simpler. Today I use coc.nvim + coc-clangd instead. Another option (what I used to use) YouCompleteMe ...
oblitum's user avatar
  • 276
9 votes
Accepted

Neovim: Select an autocomplete option with <tab> instead of <return>

You need this map: inoremap <expr> <TAB> pumvisible() ? "<C-y>" : "<TAB>" If PUM (complete menu) is visible, then execute <C-y> (which selects an ...
Diego Somar's user avatar
8 votes

How to create my own autocomplete function?

Sometimes you want a custom auto-completion that doesn't interfere with any of the built-in or user-defined autocompletions at all. This is especially useful for scripts or plugins that are intended ...
Martin Tournoij's user avatar
8 votes
Accepted

File name completion relative to currently edited file

You can :cd in Vim to change the current directory: :cd xml Or more generally, if you want to set it sometimes: nnoremap gp :cd %:p:h<CR> Or if you want to always be in the current file's ...
nobe4's user avatar
  • 16.1k
8 votes

set completeopt=noinsert fails

The noinsert option became available with Vim version 7.4.775. Your Vim on the raspberry pi is (probably) older. You can check with :version.
Karl Yngve Lervåg's user avatar
8 votes
Accepted

When using the dictionary feature in vim, can you make dashes a matching part of a word?

The option iskeyword defines which characters should be considered as part of a word. This option uses the += and -= syntax to add or remove some characters. Thus the following line will add the ...
statox's user avatar
  • 50.1k
7 votes

Easiest way to switch git branches

The fugitive Git checkout <branch> has a downside that it doesn't autocomplete the branch name. Using fzf.vim I've created this command: function! s:changebranch(branch) execute 'Git ...
kubek2k's user avatar
  • 171
7 votes
Accepted

Disable case sensitive auto-completion, while "smartcase" search is enabled?

Update: I created a plugin named vim-idetools that implements this feature along with a bunch of related refactoring tools. Feel free to try it out. Original answer: Well, I figured out a way to do ...
Luke Davis's user avatar
  • 1,397
7 votes
Accepted

Change keybinding for up/down when in vim popup

You can't "directly" map keys in the pop-up menu, you'll have to use expression mappings and the pumvisible() function to check if the popup menu is visible. inoremap <expr> <C-j> ...
Martin Tournoij's user avatar
7 votes
Accepted

Is it possible to put the cursor on the first item on auto-completion?

If you use the noinsert flag in completeopt in combination with menu, the first item will be selected (but not inserted into the buffer). set completeopt=menu,noinsert
Mass's user avatar
  • 14.2k
6 votes

Autocompletion with NodeJS, Visual Studio style

Ok, after years of trying many things, I finally found a viable solution! And the winner is: COC "It's a completion framework and language server client which supports extension features of ...
godot's user avatar
  • 256
6 votes
Accepted

Confirm selection among options

The behavior you are describing is controlled by the wildmenu option (:h 'wildmenu') While the "wildmenu" is active the following keys have special meanings: <Left> <Right> - ...
statox's user avatar
  • 50.1k
6 votes
Accepted

What is the difference between set complete+=t and set complete+=k in vim?

From :h 'complete': k scan the files given with the 'dictionary' option ] tag completion t same as "]" The tag k allows you to specify a file containing some words you want to use for ...
statox's user avatar
  • 50.1k
6 votes
Accepted

How to show completion menu when typing EX-command?

Thanks for the answer from @D. Ben Knoble This feature is called wildmenu, putting this line set wildmenu in the .vimrc or .gvimrc (_vimrc or _gvimrc on MS Windows version) can turn this feature on. ...
Shan-Hung Hsu's user avatar
6 votes

What is the difference between loaded and unloaded buffers?

A buffer is listed if it's in the buffer list, you can see it in :h :buffers , you can refer to it with :h :buffer , :h :bnext , etc . It's controled by setting :h 'buflisted' . A buffer is loaded if ...
dedowsdi's user avatar
  • 6,298
6 votes
Accepted

What is the difference between loaded and unloaded buffers?

The situation with buffers is quite complicated. Use :ls (of :buffers) to inspect them. There can be the following states: Active buffer --- both loaded into RAM and shown in (at least one) window. ...
Matt's user avatar
  • 20.9k
5 votes

Easiest way to switch git branches

Ever since this commit in Jul 2019, this has been possible using Git fugitive only. Type :G branch will open a split buffer with all the branches in a list. Place your cursor on the branch and press ...
hernytan's user avatar
5 votes

How can I get Vim to show documentation of a C/C++ function?

Using only vanilla Vim and complementary to tags-based solutions, K calls 'keywordprg' (defaults to man) on the word under the cursor (in normal mode) or the current selection (in visual mode) and ...
PiCTo's user avatar
  • 369
5 votes

make external command completion case insensitive when called from within Vim

You can define a new command like :E instead of :! and write a custom completion function for it (see :help :command). command! -nargs=+ -complete=custom,s:CustComp E execute "!" . "<args>" ...
Ingo's user avatar
  • 986
5 votes
Accepted

How do I make abbreviations expand for minimal prefixes?

If you really want to use abbreviations, I'm afraid you'll have to either define one abbreviation for each leading part. or to define a mapping on a trigger like <tab> (or whatever) that ...
Luc Hermitte's user avatar
  • 17.5k
5 votes
Accepted

How to customize the entries in the completion menu?

About ctrlp, the doc says: Find previous match for words that start with the keyword in front of the cursor, looking in places specified with the 'complete' option. The found keyword is ...
statox's user avatar
  • 50.1k
5 votes
Accepted

Thesaurus Option is empty?

it just says thesaurus option is empty. To use the thesaurus in vim, option thesaurus has to be defined in .vimrc, pointing to the location of the thesaurus text file. Use set thesaurus+=<...
Ashok Arora's user avatar

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