Skip to main content

Questions tagged [autocompletion]

For questions about the several commands to complete part of a keyword or line that has been typed.

Filter by
Sorted by
Tagged with
73 votes
7 answers
115k views

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

Many IDEs automatically complete function names, variables, method names, etc. as the user types. The best ones complete the names based both on the language's built-in library as well as what has ...
drs's user avatar
  • 3,038
48 votes
3 answers
80k views

How to get intelligent C++ auto-completion?

Some editors (such as Visual Studio on windows) do C++ autocompletion which understand C++. For example, given: #include <vector> int main(void) { std::vector<int> v; v.i In Visual ...
Chris Jefferson's user avatar
44 votes
1 answer
21k views

Is there any way to change the popup menu color?

Is there any way to change the background color of the popup menu in gvim? The default background color is pink, which is a little weird to me.
Searene's user avatar
  • 543
31 votes
3 answers
9k views

How to create my own autocomplete function?

How do I create my own list of auto-completion for certain filetypes? For example I would like css and html to autocomplete from the list of css classes in FontAwesome.
firedev's user avatar
  • 2,422
31 votes
7 answers
33k views

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

Most editors have a feature like when you press some keys by placing caret over a function, it pops the documentation of that function along with number and type of arguments that function takes. I ...
sherelock's user avatar
  • 411
30 votes
7 answers
16k views

Easiest way to switch git branches

Right now I'm using fugitive to manage almost everything git related, but I can't find a good workflow to quickly visualize and switch between available branches. I can do :Git checkout <branch-...
Sergio D. Márquez's user avatar
29 votes
6 answers
20k views

Vim Code Completion for Python 3

I am running Debian Jessie and use the current vim-nox (with +python -python3). I am having a hard time trying to program in Python 3, as I struggle with Python 3 code completion. YouCompleteMe doesn'...
xt440's user avatar
  • 351
19 votes
1 answer
6k views

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

I'm brushing up on my vim skills and fiddling with completion using the Ctrl-n command. I'm programming in Perl. When I am in insert mode and hit Ctrl-n, I get a message that it is "Scanning included ...
StevieD's user avatar
  • 1,492
18 votes
1 answer
2k views

Bash-like partial tab-complete for filenames in Vim

In Bash, when there are several files with the same prefix and I type part of the prefix and hit Tab, it completes the common prefix and allows me to continue typing to differentiate among the ...
John O'M.'s user avatar
  • 8,612
18 votes
1 answer
1k views

Filename Completion for Remote Files

My friend showed me a cool trick on Emacs some days ago where he could just open a file on a remote server and I instantly thought "there should be a way to do that in vim too" and it was true. I ...
m.ajallooeian's user avatar
16 votes
1 answer
2k views

How do I exclude certain file extensions from completion?

Is there a way to configure vim regarding what file types it considers "suitable" for opening? Let me clarify by an example. Imagine you are working on a latex document. Once you build your file, you ...
Shahbaz's user avatar
  • 549
14 votes
2 answers
3k views

How can I lookup LaTeX symbols in Vim?

Can I integrate some form of symbol completion to Vim? Dedicated TeX editors like TeXMaker provide a list of symbols for completion (for example, \al shows a list with \alpha, \la shows \lambda and \...
muru's user avatar
  • 25k
13 votes
1 answer
3k views

cancel complete

Usually insert mode completion (<C-n>) inserts the right word the first time I press <C-n>, but not always. Therefore, I would like Vim to insert the match it deems best when I press <C-...
Octaviour's user avatar
  • 982
13 votes
1 answer
8k views

Vim filename/path completion

I know I can complete filenames/paths from the current directory using Ctrl+X, Ctrl+F (compl-filename). That works great in combination with set autochdir, which changes the current directory to the ...
Rafael Barbosa's user avatar
13 votes
1 answer
706 views

Dynamic completion

I'm trying to enhance an old completion function. I'd like it to update the choices displayed in the popup menu as I type new characters My completion function is function! lh#icomplete#ecm(...
Luc Hermitte's user avatar
  • 17.5k
12 votes
2 answers
2k views

Zsh-like tab completion of partial paths

Related to Bash-like partial tab-complete for filenames in Vim One of the truly fantastic features of zsh is that you can type, for example, ls /u/s/m/m/who.1, press Tab and have it complete to ls /...
muru's user avatar
  • 25k
12 votes
1 answer
1k views

Ins-completion of WORDs

<C-p> and <C-n> allow the completion of words found within the current document. I am taking some notes and writing say {0,1}^n and (E,D) many times. These are WORDs constituted by ...
Gonçalo Ribeiro's user avatar
11 votes
1 answer
5k views

Argument completion for python

Is there a way to get argument completion for python? I am currently using a combination of ctags, python-mode and YouCompleteMe, but I am missing a function to autocomplete the arguments of a ...
kyra's user avatar
  • 213
11 votes
1 answer
8k views

Why doesn't YouCompleteMe complete function paramters?

I'd like to use YouCompleteMe with C++ semantic completion, but after hours of trying, I can't find why it doesn't work as expected. Everything seems to be working but I can't complete function ...
hippunk's user avatar
  • 301
11 votes
3 answers
209 views

Auto completion for option values on the cmdline

I cannot count the number of times I have tried to do this: :set foldmethod=syn^I It seems that completion doesn't work on option values! In some cases options are complex strings where completion ...
joeytwiddle's user avatar
  • 3,652
11 votes
2 answers
206 views

How can Vim help me remember the trailing commas in BibTeX files?

I edit quite a few BibTeX files, and I regularly forget the trailing commas: For example: @Book{cooke2015british, author = {Cooke, Lez}, title = {British Television Drama}, publisher = {...
Kristian Nordestgaard's user avatar
11 votes
1 answer
1k views

How can I use insert mode completion in a macro?

I'm trying to define a macro which quickly generates a list of random-ish words. I want the macro to turn this into a list like a b c d e into this arezzo bywords czars détente eyrie What I have ...
the_velour_fog's user avatar
10 votes
3 answers
13k views

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

I'm wanting to learn Vim, but think it's probably too daunting. I imagine learning enough to become powerful with it, then forgetting 99% after I'm on a computerless project for a while. I know just ...
user12711's user avatar
  • 367
10 votes
4 answers
4k views

Vertical WildMenu in Vim

One thing that really bothers me in vim (probably the only thing), is the wildmenu. In neovim, the wildmenu is vertical and looks as following: However, in vim, it is horizontal and looks like this: ...
Lea Hubert's user avatar
10 votes
2 answers
338 views

How can I make vim stop splitting my words into chunks?

English language users probably don't have this trouble, but vim is pretty dumb when it comes to regular expressions. In my case most letters in the Turkish alphabet outside the EN alphabet don't seem ...
Caleb's user avatar
  • 2,245
10 votes
2 answers
4k views

How to select a matched autocompletion item

I want to select the 6th item (here readImage) in the auto-completion items. The normal way i knew is pressing ctrln for 6 times until the matched word is selected and then press enter. I tried ...
showkey's user avatar
  • 1,150
10 votes
1 answer
840 views

How can I limit number of suggestions when using YouCompleteMe?

I'm working on fairly large php codebase (~1.3 mil lines of code). I have generated tags and now when I'm typing something like $data-> YouCompleteMe lags really hard and basically freezes Vim ...
dkns's user avatar
  • 599
10 votes
2 answers
352 views

Share completions between running vim instances

I use tmux for the most part instead of using vim tabs and splits. Does vim have the ability to share completions (via Ctrln and Ctrlp) between running instances? Is there a way to set it up where ...
Greg Nisbet's user avatar
  • 1,859
9 votes
2 answers
374 views

Is there a way to disable the foldexpr during autocomplete?

I've noticed that vim's fold method affects the efficiency of autocomplete, e.g. C-N is slow, and C-X L is hideously slow in medium sized files with relatively expensive foldexprs. I can't see the ...
artfulrobot's user avatar
9 votes
1 answer
314 views

Smart word completion when in the middle of a word

Consider a file with the following two lines: someLongFunction someFunction When I am in the insert mode in the middle of the second word some|Function and I press Ctrl-n, I get ...
s3rvac's user avatar
  • 549
8 votes
2 answers
2k views

How to Autocomplete CSS class names that include a minus character?

I'm having the following CSS class structure .mAIcon .mAIcon-reject .mAIcon-edit .mAIcon-accept .event and so on. Inside my HTML files I want to autocomplete these class names. But when I type &...
Raphael Ahrens's user avatar
8 votes
1 answer
276 views

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

The dictionary feature in vim allows you to use a file (for instance /usr/share/dict/words) and set multiple paths within the dict option to search on. Now the file I'm searching on has several ...
leeand00's user avatar
  • 3,601
8 votes
1 answer
889 views

File name completion relative to currently edited file

If I open a file that isn't in the current directly, when I used Vim to autocomplete a filename, Vim provides files relative to the location where I launched Vim, not the currently edited file. ...
Scribblemacher's user avatar
8 votes
1 answer
1k views

Filename Completion with Spaces

I have a lot of files that have spaces in their names, and this is giving me problems. If I try to do command line completion for the find command, and one of these files come up, Vim will find it, ...
A Gold Man's user avatar
8 votes
1 answer
423 views

Autocomplete for make

If I set a custom make program, is there any way to provide a list of tab completion options that would get activated when I type :make+Space+Tab? With custom commands I can do f.i.: command! -nargs=...
flukus's user avatar
  • 275
8 votes
0 answers
884 views

Can I give YouCompleteMe a static list of completions?

I am using the Julia programming language, and as of right now, there are no good syntax-completer for VIM. I am working on one, but haven't fully got my head around how to hook into ycmd. Til I ...
Frames Catherine White's user avatar
7 votes
3 answers
410 views

Return from command autocomplete

If I type :e foo/**/foo*.js and hit tab then vim replaces the *s with all possible suggestions in the filepath. What if I realized that I wasn't specific enough (there are too many results in ...
user2453676's user avatar
7 votes
2 answers
1k views

Convert absolute path to one relative to another absolute one

Context I’m working on an 'omnifunc' function for Markdown editing. It’s supposed to help me link to other Markdown files while I’m typing a link – based on file content though, not file name. Suppose ...
scy won't contribute anymore's user avatar
7 votes
3 answers
932 views

How to set up tags for Ruby, SASS, Slim and Coffescript?

I am developing main in Rails using SASS, Slim and Coffeescript. I have Exuberant Ctags installed and using tpope's setup It kind of works so at least I can move around my ruby code. But I would ...
firedev's user avatar
  • 2,422
7 votes
1 answer
3k views

Python imports autocompletion

I'm trying to configure vim for python development. Right now I'm working on code autocompletion feature. I'm using YouCompleteMe plugin and it seems to be working great but only when I've already ...
mateuszb's user avatar
  • 171
6 votes
2 answers
176 views

How do I get filename completion to ignore a leading `=`?

Occasionally, when writing shell scripts and such, I have entries of the form: foo=/bar/baz To get filename completion (<C-x> <C-f>) to work, I have to put a space after the =, and then ...
muru's user avatar
  • 25k
6 votes
2 answers
436 views

imap beginning with <C-o> interferes with omnicomplete

I added the following key mappings: inoremap <silent> <Up> <C-o>gk inoremap <silent> <Down> <C-o>gj The goal was that j/k would still work the way that I was ...
Drew's user avatar
  • 605
6 votes
1 answer
3k views

Cycle through autocomplete menu using tab

I am activating my autocomplete menu in vim using: inoremap <C-@> <C-n> and after it opened and only when it opened I would like to use the "tab" key to cycle through the menu. But when ...
Silence and I's user avatar
6 votes
1 answer
13k views

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

In the example below, how do I use <tab> to select HttpResponse the item instead of <enter>? I'd like to make this change permanent. This is using Kite within vim in case it matters.
WickedJargon's user avatar
6 votes
2 answers
2k views

How to get auto completion provided by <C-N> without typing <C-N>?

I like the simple auto completion provided by Ctrl-N but not typing Ctrl-N everytime to get the completion. I would like it to work similar to how YouCompleteMe works with automatic suggestions. If ...
Dkoder's user avatar
  • 63
6 votes
2 answers
349 views

Shell scripting: A more elegant way to complete then...fi, do...done, case...esac pairs?

The problem In shell scripting, conditionals and loops don't use curly braces to indicate blocks, but rather special keywords: if [ ... ]; then statements close with fi, while [ ... ]; do statements ...
Drake P's user avatar
  • 175
6 votes
1 answer
2k views

How to show completion menu when typing EX-command?

When I use MS Windows version gvim, when typing EX-command, I can press TAB then there will show a completion candidates menu. For example, if I type :colorscheme then a space then press TAB, gvim ...
Shan-Hung Hsu's user avatar
6 votes
2 answers
329 views

Line completion disregarding line prefix

In Vim, C-x C-l performs line completion. However, it expects the prefix of the currently typed line to match the prefix of another line. For example, consider that | below denotes the cursor position:...
s3rvac's user avatar
  • 549
6 votes
1 answer
3k views

Completion suggestions while typing

I use Vim a lot for writing tasks and I used ^p for completions. However, is there a plugin that suggests you completions while typing like in Andriod-smartphones ? Thanks.
ScottFritzpatrick's user avatar
6 votes
1 answer
988 views

Add closing parenthesis when completing function (omnicomplete)

I can complete functions with omnicomplete using c-x c-o but it only adds the opening parenthesis, is it possible to make it add the closing parenthesis and put my cursor between them? Seems ...
hermancain's user avatar

1
2 3 4 5
8