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
0 votes
2 answers
861 views

How to get Youcompleteme to work with Vimscript?

I've switched from NeoComplete to YouCompleteMe because it has much better intellisense, though I had NeoComplete working much better with Omnicompletion. NeoComplete was able to automatically ...
  • 429
2 votes
1 answer
475 views

autocomplete without typing first character

When typing LaTeX one often needs to type a \ to invoke a command such as \omega. One of the nicer features of LaTeX is the ability to define your own commands, which can then be detected by Vim if '...
  • 932
8 votes
1 answer
211 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 ...
  • 3,153
5 votes
1 answer
714 views

Thesaurus Option is empty?

I recently started looking at completions, and it says in the help if I am in insert mode and press CTRL+X CTRL+T I should be able to bring up a thesaurus of other words in a drop-down completion, but ...
  • 3,153
0 votes
1 answer
3k views

<C-space> does nothing in YouCompleteMe

I'm on my 4th clean install of YouCompleteMe. I am trying to get to work with a Python file after a . (such as foo....Then I hit <C-space> and would hope to see a list of options to complete ...
2 votes
2 answers
854 views

What's the correct way to use pair completion?

I've disabled pair completion because it doesn't really save any key presses. I have to press right arrow to get out of a quote after completing the string. Am I missing something here? For example: ...
  • 161
0 votes
1 answer
2k views

<Tab> in insert mode brings up completion

Today when I open my computer and enter vi, strange things happened: backspace not working(solved), and Tab brings up keyword completion in insert mode, which is what I'm worrying about. Before, I can ...
  • 267
2 votes
1 answer
3k views

Deoplete with Neovim doesn't work

I have a problem with my deoplete plugin. When I write code, I don't have automatic completion on dot. I need to manually press <c-x><c-o> to make it work. Here is my deoplete ...
  • 121
11 votes
1 answer
2k 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-...
  • 932
6 votes
1 answer
839 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 ...
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, ...
-1 votes
2 answers
2k views

bypassing TAB auto-complete

Sometimes I need to press TAB, but instead of getting actual the tab key, a suggestion pops up and TAB cycles through the suggestions. How can I insert TAB without invoking the auto-completion ? The ...
  • 909
1 vote
2 answers
647 views

Vim buffer name autocompletion not working after first directory

I have a problem with Vim Autocompletion behavior for buffer names. Target Soft/OS I'm using gVim without plugins on Windows 10 What I would like to do Assuming we have a file tree like : +---- ...
1 vote
0 answers
500 views

vim c++ clang_complete doesn't work for std::cin.get()

I'm using vim to do c++ projects on Mac OS X. To auto complete, I use this plugin: clang_complete For most of cases, such as members of user-defined classes, members of namespaces, it works very ...
  • 893
3 votes
1 answer
2k views

set completeopt=noinsert fails

I use the auto complete function from this stackoverflow page. It works fine on my pc and notebook but it fails on my raspberry pi with this error: line 28: E474: Invalid argument: completeopt=menu,...
  • 31
1 vote
1 answer
119 views

Get all syntax elements with some group name from buffer

In my syntax file I have something like syn match cleanReal "[+-~]\?\<\d\+\.\d+\(E[+-~]\?\d+\)\?" display hi def link cleanReal Float Is there a way to get all strings that are matched as ...
's user avatar
3 votes
2 answers
233 views

Is there a way to use ignore case only for autocompletion in insert mode?

I know I can :set ignorecase smartcase to get autompletion to be case-insensitive but this has the side-effect of making all searches case-insensitive unless they contain an uppercase character. I ...
  • 272
3 votes
1 answer
2k views

How to write a `completefunc`/`omnifunc` that tries multiple base values?

I've been trying to write a simple complete function for Vim that tries multiple values for the base argument. Here is a version that works but which I find unsatisfactory: function! CompleteFunc(...
  • 133
3 votes
2 answers
2k views

Vim omnicomplete with Ruby 2.3.1

I've recently learned about Vim's omnicompletion and while attempting to make it work, I get the error Pattern not found. To test it I used the following code: class C def hello puts "Hello, ...
0 votes
2 answers
702 views

Why my dot key doesn't work properly in insert mode?

I have installed plugins YouCompleteMe and python-mode so as to use the auto-completion when editing a python file. But when I open an .py file and type . in insert mode, the cursor does not move ...
-1 votes
1 answer
101 views

Why vim can't find a word in a js buffer when autocompletting?

I have a unnamed buffer and a js buffer open in a vertical split. In the unnamed buffer I'm trying to type an already existing function name. In the js buffer I typed two characters, but when I <c-...
  • 2,389
2 votes
1 answer
78 views

How to trace the origin of an autocomplete feature, in order to turn it off?

Is there any way to trace the source of an auto-complete event within (Mac)Vim? Ie, where within which plugin this is and how it can be turned off? In my case, I type {} in a .tex file and it ...
  • 121
3 votes
1 answer
2k views

How to turn off completion (enabled by default in Arch)?

When I install vim from repository on Arch Linux, it has a completion feature that I don't like. What is it called and how do I turn it off? (It is active even with a blank .vimrc.) I would rather get ...
  • 171
2 votes
1 answer
127 views

Strange behavior from the complete() function

I've noticed that when using the complete() function if I backspace out of it, vim will go into "Whole line completion" mode. This is very frustrating as it makes things very sluggish when working ...
  • 7,476
7 votes
1 answer
2k 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 ...
  • 171
8 votes
1 answer
818 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. ...
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 ...
2 votes
1 answer
667 views

Autocomplete after serveral chars

I want to use the auto complete feature from vim (ctrln). How can I activate this feature automatically after I have entered e.g. 3 chars? Thank You
2 votes
1 answer
975 views

How to customize the entries in the completion menu?

In insert mode, when you hit ctrlp on a partially written word, a menu pops up with possible matches for completion. How can I customize those matches ? (I have a ruby-clangc gem that I want to use ...
  • 153
4 votes
1 answer
2k views

How can I make an inoremap that calls a function

I am very used to the shell autocompletion, which uses the <tab> character. Therefore I tried to build something similar into my .vimrc. I'm aware of the super popular YCM plugin but let's face ...
  • 1,626
1 vote
1 answer
107 views

Unexpected exit when <c-x><c-o> in Python file

Vim quits abruptly whenever I try to use omni-completion <c-x><c-o> in a Python file. This doesn't happen with other filetypes. :echo &omnifunc produces pythoncomplete#Complete. How ...
  • 179
1 vote
1 answer
29 views

Can I use emails in the completion list from CTRL-P

When I press <c-p> for autocompletion a list based on my complete setting appears. I have a completion file as follows (at ~/emails)`: barabara.high@someplace.com john.doe@gmail.com john....
  • 1,626
3 votes
1 answer
2k views

auto insert text when creating a new file [duplicate]

Is there a way to auto insert text in vim when a new file is created? Maybe there is a plugin for it? Here is what I'm talking about: I work a lot with C/C++ and Python. Very often I need to create ....
  • 669
2 votes
0 answers
925 views

Code Completion for Module based JavaScript files in Vim

I've been trying to get my Vim setup similar to other IDE's (pycharm, webstorm) and I'm hoping to get the functionality of having code completion for injected objects. I have YouCompleteMe and ...
  • 39
10 votes
2 answers
331 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 ...
  • 1,653
1 vote
0 answers
577 views

How to use external python modules with NeoComplete?

After trying out many auto-completion engines for Vim, NeoComplete combined with Jedi seems like a good choice for python development. However, I can't get it to use external libraries like PySide (Qt ...
  • 219
5 votes
2 answers
286 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:...
  • 519
1 vote
2 answers
234 views

how to show suggestions for a group of words inside a quote or bracket

I have several lines in my code. I am aware that Ctrl+x,Ctrl+l shows suggestions for completing a line, based on the similar lines available in the script. Now, I want only the part of a line, ...
  • 3,112
7 votes
0 answers
819 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 ...
2 votes
1 answer
108 views

How to get an Input() with directory completion and command line recall?

So I have an input, something like this: let dir = input("What is the directory you're looking for? ", "", "dir") This works great for typing and and getting directory input. But what if the path ...
  • 7,476
1 vote
1 answer
4k views

Need help for setting up completion for C/C++ with deoplete and neovim

I'm having some trouble to enable C/C++ completion with deoplete. I don't know what plugins I should really install and how to configure deoplete to work with them. I read that for C/C++ completion ...
1 vote
2 answers
465 views

How do I make abbreviations expand for minimal prefixes?

I want to create abbreviation for a large word, say configuration. Vim command works even if we type part of it. Example, s[ubstitute]. When you type s, su, sub, subs, subst, substi, substit, etc., ...
  • 3,112
10 votes
2 answers
156 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 ...
  • 3,492
2 votes
2 answers
365 views

make external command completion case insensitive when called from within Vim

I've been learning Vi/Vim for some month and, at the moment, I'm editing many files at once splitting the window, jumping from one buffer to the others. I find it very useful. One thing I don't like ...
  • 1,756
3 votes
1 answer
486 views

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

There is a CompleteDone and MenuPopup event. However, I can't find an event for the triggering of the insert mode completion popup menu. So if I want to do something when triggering the completion ...
  • 801
1 vote
0 answers
92 views

Changing color value for css syntax when using tab completion via emmet

Im using vim 7.4 and the Emmet plugin. While editing a css document and entering a selector .mylink for example, pressing Tab will typically yield a space, opening and closing braces and a blank line ...
5 votes
1 answer
268 views

How do I complete a WORD? [duplicate]

I use the complete function a lot. I have not found a solution to complete a WORD yet. For example, in LaTeX, I use the following expression: T_{R_{delta}} If I type T and then Ctrl+xCtrl+n, it ...
9 votes
1 answer
302 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 ...
  • 519
1 vote
0 answers
619 views

gtk.h not found

I am now using vi to edit a Gtk program in C. I can compile it easily using the command: gcc -Wall `pkg-config --cflags gtk+-3.0` -o gtk gtk.c `pkg-config --libs gtk+-3.0` There is no problem doing ...
  • 267
5 votes
1 answer
125 views

inscompletion: space separated words

I'd like to use the ins-completion function to suggest not words but WORDS, that is to say, space separated words. Is that possible? Example: (latex) \mathbb{R} \ma(Ctrl-n)
  • 141

1
3 4
5
6 7