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
8
votes
1answer
6k 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 ...
3
votes
1answer
600 views

Can I use the mouse scroll wheel to browse the auto-completion popup menu?

Is is possible to use <ScrollWheelUp> and <ScrollWheelDown> while the auto-complete popup is open? I tried using the map inoremap <expr> <ScrollWheelUp> pumvisible() ? "<Up&...
3
votes
1answer
720 views

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

I like the behavior of smartcase while searching, and I like Vim's auto-completion options, but I don't like them together. Is there any way to keep smartcase enabled, but have auto-completion results ...
17
votes
1answer
4k 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 ...
0
votes
2answers
763 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 ...
2
votes
1answer
389 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 '...
7
votes
1answer
170 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 ...
4
votes
1answer
587 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 ...
0
votes
1answer
2k 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
2answers
701 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: ...
0
votes
1answer
1k 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 ...
2
votes
1answer
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 ...
11
votes
1answer
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-...
4
votes
1answer
599 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
1answer
741 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
2answers
1k 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 ...
1
vote
2answers
525 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
0answers
452 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 ...
3
votes
1answer
1k 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,...
1
vote
1answer
80 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 ...
3
votes
2answers
176 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 ...
3
votes
1answer
1k 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(...
2
votes
2answers
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
2answers
616 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
1answer
96 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
votes
1answer
67 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 ...
3
votes
1answer
1k 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 ...
2
votes
1answer
101 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
votes
1answer
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 ...
7
votes
1answer
705 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
1answer
773 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
1answer
506 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
1
vote
1answer
641 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 ...
3
votes
1answer
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
vote
1answer
100 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 ...
1
vote
1answer
25 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....
3
votes
1answer
1k 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 ....
2
votes
0answers
850 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 ...
10
votes
2answers
284 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
vote
0answers
560 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 ...
4
votes
2answers
224 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:...
1
vote
2answers
226 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, ...
5
votes
0answers
712 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
1answer
74 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 ...
1
vote
1answer
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
2answers
410 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., ...
10
votes
2answers
124 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 ...
2
votes
2answers
296 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 ...
2
votes
1answer
398 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 ...
1
vote
0answers
88 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 ...