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
2answers
666 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
98 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
70 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
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 ...
2
votes
1answer
107 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 ...
8
votes
1answer
764 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
972 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
569 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
771 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 ...
4
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
105 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
27 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
878 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
297 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
570 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
239 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
228 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, ...
7
votes
0answers
762 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
84 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
438 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
142 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
333 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
430 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
91 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
1answer
257 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
1answer
288 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 ...
1
vote
0answers
539 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 ...
5
votes
1answer
115 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)
2
votes
1answer
876 views

How to make YCM load <GL/glew.h> by default?

I am currently learning OpenGL and C++ and I would like to have gl* completion ready on my C++ projects. YCM is not scanning the <GL/glew.h> header when I include it - isn't it supposed to do ...
4
votes
1answer
270 views

How to autocomplete tag names containing a colon?

Sometimes I want to autocomplete a tag name containing a colon, for example g:netrw_gx. I've added to the 'tags' option the location of the tags file of the main documentation (which on my machine ...
4
votes
1answer
2k views

On Linux, vim would search #include files automatically for auto-completion but on Windows not

I use vim on Linux and Windows. Strangely, on Linux (Ubuntu), when I write C/C++ code, vim would search the included file for auto-completion (Ctrl-P), even if I don't add anything related in my ....
3
votes
1answer
426 views

Using multiple arguments with custom tab completion

I have a command line tool that requires three parameters in the form of: command input1 input2 I'm trying to write a custom complete function that handles completion for different arguments... well,...
3
votes
1answer
970 views

java completion

I am always having problems, this time with java auto completion. I try to use the installation mentioned here, so that I can use vim to do my android development. However, after the installation, on ...
4
votes
1answer
752 views

neovim: autocompletion on user defined command plugin

I am write a plugin for neovim in python using this client and I looking for a way to offer completion when executing a command. I have look at the following example to structure my plugin. As an ...
4
votes
1answer
343 views

Delay after selecting item from completion list

I am using terminal vim 7.4 and standard completion, i.e. <C-x>,<C-p> for word completion <C-x><C-o> omnicompletion <C-x>,<C-f> for file completion etc, ~/....
12
votes
1answer
6k 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 updates the current directory ...
2
votes
0answers
566 views

Trying to get a particular SuperTab behavior with snippets and omnicomplete

I'm trying to get SuperTab to work a particular way with .tex files. I am also using the vimtex plugin as well as snipMate. The behavior I want is the following. In most text, I want the main ...
26
votes
7answers
22k 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 ...
4
votes
2answers
1k views

How do I get "~" (tilde) to expand when using File Name Completion in Insert Mode?

I often complete file paths in Vim using Ctrl-x Ctrl-f in insert mode, but there is one annoyance: the tilde character does not expand. This is fine for things like bash, but for Python (which does ...
4
votes
1answer
1k views

How to insert a file path with tab- or autocompletion relative to the current file's dir?

I am in vim in the .gitignore file. I now want to add a file path that already exists on the current dir, e.g. ./app/poit/narf/auth.json I don't want to type it though, I want to navigate to that ...
1
vote
0answers
487 views

Location list, preview window, autocompletion

I have the following problem. If the location list is open (e.g., by Syntastic) and some other plugin opens a preview window (e.g., YCM or jedi-vim), the cursor goes in the location list. Example: ...
3
votes
1answer
114 views

neovim doesn't show expansion "list" of completions

In this example, when class is typed, a list of potential expansions is shown. The snippet itself works in my nvim, but the list is not shown. Commenting out my whole init.vim (the vimrc of neovim), ...
26
votes
6answers
12k 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-...
1
vote
1answer
1k views

Bracket completion with correct tab and insert placement

I'm looking for a plugin that will autocomplete closing brackets for me. Furthermore, I'd like it to space and tab the inner block automatically. I've tried a number of them where if I'm typing ...
1
vote
0answers
103 views

How can I enable onmifunc completion automatically?

I want to enable omnifunc in my MacVim whenever I start to type in a few of leading words, such that whenever I type np., the completion list pops up to show me the candidates (e.g. np.random, np....
12
votes
1answer
584 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(...
4
votes
1answer
2k views

Adding ctags for a 3rd party library

I would like to know how to generate ctags and find them with auto-complete plugins for new libraries that I install in order to 1) auto-complete for 3rd party library namespaces, classes, etc. and 2) ...

1
3 4
5
6 7