Skip to main content

Questions tagged [ins-completion]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
0 answers
213 views

switching `<Down>` and `<C-n>` in popup menu

I'd like to switch the behaviour of the <Down> and <C-n> keys when the popup menu (like from omnicompletion) is visible (and <Up>/<C-p> respectively). The following two ...
radlan's user avatar
  • 687
3 votes
1 answer
678 views

Cancel command line completion insert

I notice a different behavior in command line completion from the regular completion in a buffer. Usually even if I select and item from the completion menu, CTRL-E cancels the completion and reverts ...
Svilen's user avatar
  • 73
3 votes
1 answer
41 views

Word completion ^P / ^N is very slow because of scanning a :term buffer

I open a terminal window inside of a vim session and leave it there for weeks, use it for compilation, running and debugging my code. After couple of days the length of the terminal buffer grows over ...
ilya's user avatar
  • 133
3 votes
2 answers
440 views

Keep <C-X> <C-F> filename completion menu alive between directories

I'd like to use <C-X> <C-F> to autocomplete a long filename in insert mode, say /foo/bar/baz.txt. When I type in /f, I can press <C-X> <C-F> to complete to /foo/. However, ...
identicon's user avatar
  • 133
3 votes
1 answer
68 views

Ignore a filetype when opening but not when using insert-mode popup-menu [duplicate]

Using :h wildignore, I can ignore certain types of files or certain folders when searching through them to open one of them. But that also means those files and directories will be ignored when I try ...
3N4N's user avatar
  • 5,774
2 votes
1 answer
288 views

Filter file completion list

When I write markdown and want to insert an image, i_CTRL-X_CTRL-F comes in handy. I know that I can filter by typing a few characters that precede the filename, but actually what I want is either ...
JohnDoe's user avatar
  • 363
2 votes
1 answer
244 views

How does ft-c-omni work and how can I make it faster?

As I was studying the various ways of doing completion in Vim 8.0, I came across the very interesting "omni-completion" feature and its 'omnifunc' option, which is specialized as ccomplete#...
PiCTo's user avatar
  • 369
2 votes
1 answer
160 views

How to get insert mode map to work regardless of completion popup?

I have an insert mode mapping which calls a function to select some text and leave vim in select mode. inoremap <silent> <C-J> <C-\><C-O>:call MyFunction()<CR> This ...
Andy Stewart's user avatar
  • 1,359
2 votes
0 answers
125 views

Complete text with one tap

I use a plugin called supertab( ervandew/supertab) that provide completion options. A menu automatically appears after I type 2 characters. What I want to do, is to have a mapping that completes the ...
eyal karni's user avatar
  • 1,136
2 votes
0 answers
49 views

How to omit dictionary source file in dictionary completion

<C-X><C-K> complete words with long dictionary file name, such as /home/xxx/.vim/mydict. I'd like to omit or shorten the descriptive info. I have googled but got no hints. Any advice?
asepsiswu's user avatar
1 vote
1 answer
994 views

Unmap <c-n> / <c-p> in completion menu to use as previous / next snippet placeholder with Coc

My completion mappings scheme with coc is the following: <c-@> (ctrl-space): trigger the menu / use the selected item (or the first one) <c-j> and <c-k>: navigate the list (or also ...
Biggybi's user avatar
  • 2,770
1 vote
1 answer
41 views

Recognizing the right expression to complete in insert mode

When one triggers a completion, vim guesses what was the expression (behind the cursor) that you want to complete. I don't fully understand the logic, but it seems that it assumes that the expression ...
eyal karni's user avatar
  • 1,136
1 vote
1 answer
388 views

Can I disable insert-mode completion (ins-completion) key mapping (CTRL-X)?

Because the keys d and xare used in normal mode to delete letters, I map <ctrl-d> and <ctrl-x> in insert mode to delete and backspace. However, when I started to use completion plugin (I ...
Shan-Hung Hsu's user avatar
1 vote
0 answers
31 views

Autocommand for i_CTRL-x mode?

Is there a way to run a function when entering i_CTRL-X (ins-completion) mode? It doesn't seem to be an event I can run an autocmd for? I can just imap C-S-x (say) to run my function and then call C-x....
Ronak M Soni's user avatar
1 vote
0 answers
49 views

How to to get commmand completions for selection from a keymap?

The idea is to have a keybinding, which executes a lua/vimscript function to paste yanked text into the command line and then have the command completion showing suggestions or directly get the ...
Jay-Pi's user avatar
  • 123
1 vote
0 answers
40 views

Completion menu closes after typing more characters in substring matches

Let's assume you have the following completefunc defintion: vim9script const py_keywords = [ { 'word': 'pandas.api.extensions.ExtensionArray.argsort'}, { 'word': 'pandas.api.extensions....
r_31415's user avatar
  • 576
1 vote
0 answers
13 views

How can I get language and keyword completion in omnifunc? [duplicate]

Let's say I'm editing this Python script: something = 1 something_else = 2 My cursor is on the third line, in insert mode. When omnifunc is unset, <C-X><C-O> displays an error: E764: ...
Big McLargeHuge's user avatar
1 vote
0 answers
4k views

Stuck on X mode (INSERT COMPL), how do I quit?

I've been using vim for 3 years and this is the first time I hear about this mode. This is also quite embarrassing. I have no idea what did I type, I didn't intend to enter this mode. Vim will write ...
Christopher Francisco's user avatar
1 vote
0 answers
36 views

Ins-completion C-X C-F and the path variable [duplicate]

Can the insert-completion of file names CTRL+XCTRL+F can be used to complete filenames that are not in the current working directory ? But rather in any in the path variable ? Can we, for example, ...
perelo's user avatar
  • 471
1 vote
0 answers
176 views

How to start insert-mode completion from select mode using Vimscript?

I have some text selected in select mode. I want to delete it and start insert-mode completion. When I type these keystrokes into Vim it works perfectly: gvc<C-X><C-U> gv switches to ...
Andy Stewart's user avatar
  • 1,359
1 vote
0 answers
353 views

Mapping to have completion attempt one mode and fall back to another if no completions found

I am attempting to map ,<tab> in insert mode to first attempt omnicompletion then fall back to <c-p> or <c-x><c-p> completion. I have used this reference to successfully send ...
David Richardson's user avatar
0 votes
2 answers
402 views

Remap line completion to Ctrl-X

I am trying to remap the line-completion command (^X^L) to the simpler ^L (or Ctrl-L, or <C-L>). VIM's help (see :h ins-completion) suggests the following : :inoremap ^L ^X^L I tried adding ...
Feffe's user avatar
  • 1,771
0 votes
2 answers
30 views

<c-n><c-p> start to scan tags in insert mode whereas I just want to complete with existing words in the buffer

I found this issue while editing my .vimrc. I tried to do the same in other files, such as .txt and .sh with no problems. While in insert mode, I use <c-p> for completing words that are in the ...
Barzi2001's user avatar
  • 640
0 votes
1 answer
79 views

Omnifunc doesn't trigger after a few uses

I use omnifunc with the neovim built in LSP functionality and this is my configuration. local lspconfig = require("lspconfig") vim.opt.completeopt = { "longest", "menuone"...
YJH16120's user avatar
  • 135
0 votes
1 answer
38 views

How to search hidden buffer during insert-mode completion?

I am trying to write a completion function which has as its source a 386k line (CSS) file. Initially I read the file into a list with readfile() and used a for loop to iterate over each line, matching ...
Andy Stewart's user avatar
  • 1,359
0 votes
1 answer
314 views

Explain `infercase` option

I don't understand what :h infercase is supposed to do. I tried out some scenarios, but still can't figure out the differences between when it is turned off and on. Can someone explain it to me, ...
3N4N's user avatar
  • 5,774
0 votes
1 answer
28 views

html id completion

I'm familiar with vim's built in completion, one of the completion methods allow me to autocomplete filepaths. I am working with a large html project where I need to reference filepaths along with id'...
cuppajoeman's user avatar
0 votes
1 answer
53 views

How to map <C-z> to act like <C-y> in completion menu?

My keyboard has z and y switched compared to US keyboards, which makes pressing C-y for completions pretty awkward. I tried adding imap <expr> <C-z> pumvisible() ? "<C-y>" :...
fbence's user avatar
  • 697
0 votes
1 answer
54 views

'scrolloff' in insert-mode completion menu (like in vertical command-line completion)?

I just realized that vim's completion list could be a bit nicer to use if it mimicked the vertical-style command-line completion menu (wildoptions=pum), which gives some scrolloff. This lets the user ...
Biggybi's user avatar
  • 2,770