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
19 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 ...
  • 1,665
3 votes
0 answers
22 views

How to get autocomplete for :set?

E.g. I am trying to change foldmethod to syntax: :set foldmethod=s^I^I When I press tab after typing s, I get ^I instead of auto-completing to syntax. Only possible options are manual,indent,expr,...
  • 161
1 vote
0 answers
39 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....
  • 491
1 vote
1 answer
34 views

how to get similar completion from coc as ycm

I've been user of YCM for years now. Recently discovered coc-vim and trying it out. Looks like it provides loads of additional features on top of what YCM has. One thing that I can't figure out how to ...
  • 131
0 votes
0 answers
19 views

How Can I Put Multiple Things Into One Completion Menu

I found this in the complete() documentation: inoremap <F5> <C-R>=ListMonths()<CR> func! ListMonths() call complete(col('.'), ['January', 'February', 'March', \...
0 votes
0 answers
24 views

Vimlsp and asyncomplete not displaying completion popups

Been trying for a couple days with no luck to get an lsp with autocompletion working in my Vim setup. My .vimrc file looks like this: let g:asyncomplete_log_file="/home/user/z_log" let g:...
0 votes
1 answer
46 views

Why Does Auto-Completion Returns Commands that Don't Work?

Why does VIM allow auto-completion of items that are not a valid command? For example, if I type :s, and press the tab key, the following entries are displayed: However, none of these commands seem ...
1 vote
0 answers
12 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: ...
0 votes
1 answer
120 views

Indent changes when using CoC, how do I stop this?

I have set up my init.vim file to always use tabs as indentation by adding this to it: set tabstop=4 set shiftwidth=4 set noexpandtab Ever since I installed CoC to use Rust's language server, it ...
2 votes
1 answer
38 views

Vim autocomplete to store words between documents

User statement: I use Vim to write many technical text documents, including emails. Question: Is it possible to "store unique words" from past documents in some .vim/file that would be ...
  • 125
3 votes
1 answer
81 views

How to undo in ctrl-x mode?

Let's say I just completed following path using Ctrl-x, Ctrl-f (twice) and I haven't exited the Ctrl-x mode yet and I got /home/john.doe/ Let's say I chose john.doe accidentally and actually want to ...
  • 165
0 votes
1 answer
104 views

Slow down system when open nvim [closed]

When I open neovim, system slows down. Even neovim's itself. switching between buffers take one or two seconds. I think this is because of autocompletion system. I use Coc. When I run neovim, a ...
2 votes
1 answer
38 views

Autocomplete LateX citations in chapters directory

Currently writing my thesis using LateX, I'm trying to obtain autocomplete on my citations when writing the chapters. The directory structure is that each chapter has its own main.tex files (template ...
  • 23
1 vote
0 answers
99 views

How do I cycle through autocomplete items with tab while also filling in the current selection in buffer?

I have the following in my init.vim "If PUM (complete menu) is visible, then execute <C-y> (which selects an item), otherwise, do a normal tab inoremap <silent><expr> <TAB&...
0 votes
1 answer
83 views

why is inoremap parentheses, brackets, quotes not working

I'm new to vim and trying to configure vim for my coding learning course. I tried these very basic inoremap lines in my ~/.vimrc, and there are also similar lines for <>'", but none of them ...
  • 13
0 votes
0 answers
37 views

Clang_complete not working (User defined completion (^U^N^P) E486: Pattern not found)

Can't get clang complete to work. I always get the same error (User defined completion (^U^N^P) E486: Pattern not found). Can anyone help?
  • 1
0 votes
0 answers
43 views

forced inserted ^Z in coc

I'm using the plugin coc for autocompletion. My problem is that when coc opens the pop up menu with the completion items and I continue typing then a ^Z character is inserted in the buffer as shown in ...
0 votes
0 answers
213 views

Enable icons for nvim-lsp

How to enable icons inside autocomplete window for nvim-lsp plugin? Now my autocomplete windows looks like this: But want make something like that:
1 vote
1 answer
111 views

Enabling Autocompletion for a Custom Command

I have the following lines in my vimrc: command -nargs=1 Compare call Compare(<f-args>) function Compare(file) execute "vnew " . a:file setlocal nomodifiable wincmd h ...
  • 13
0 votes
1 answer
105 views

Remapping Keys in Insert Mode Completion ( Autocomplete / ^X )

Using: NeoVim I would like to remap j/k in Insert completion mode: tab starts autocompletion (done, used :help ins-complete example) j/k navigate results like <C-n>/<C-p> If I understand ...
3 votes
1 answer
107 views

Sort tab-completion suggestions (files first, then directories) in vim command line

When i go to command mode, type :e and press tab, i get like this Excuse the file, directory writings on the right side (used for explanation) A.cpp file Adamwathan/ directory ...
  • 121
1 vote
2 answers
46 views

-complete=file without extra processing of the arguments

Without -complete=file: command! -nargs=* C1 echo <q-args> C1 fzf#vim#grep /home/yuri/.vim/pack/foo/start/fzf.vim " fzf#vim#grep /home/yuri/.vim/pack/foo/start/fzf.vim With -complete=file: ...
  • 339
1 vote
1 answer
800 views

Completion sources not recognized by nvim-cmp

I recently transitioned from LanguageClient-neovim to built-in lsp support and completion using omnifunc. However I was enticed by the promise of auto-imports and completion snippets including ...
0 votes
1 answer
116 views

Vim autocomplete not caching

In some of my projects, vim autocomplete is very quick, but in other projects it hangs the editor while displaying a status line "examining file ..." that slowly crawls through all the files ...
0 votes
0 answers
35 views

Autocomplete strings with spaces

Am using conqueror of completion with latex autocomplete. Created a label with spaces. If i type \ref{, autocomplete will display that label as one of the options, however ctrl+n will only complete ...
1 vote
2 answers
33 views

How can I leave completion mode keeping the completion result in a binding when there's no popup?

Currently: I have some key binding A → ^X^O (in insert mode) to omni-complete something I have some key binding B → ^Ogj to temporarily do something in normal mode (in this case, move down a display ...
-1 votes
1 answer
828 views

Error while configuring nvim cmp

I am trying to configure nvim-cmp (https://github.com/hrsh7th/nvim-cmp), by adding the following lines to ~/.config/nvim/lua/lsp-config.lua. After this, when I start nvim, I get an error as shown in ...
0 votes
0 answers
15 views

Remapping shortcut to discard auto-complete suggestion box

When vim suggests completions, I can discard them without accepting with Ctrl+y I would like to remap that shortcut to Escape while keeping the usual behavior of Escape (exit insert mode) when no ...
0 votes
0 answers
53 views

High vim CPU usage at GUI but not the CLI

I've previously noticed that vim spikes up the CPU usage whenever I scroll up or down at the terminal emulator within the GUI , and when I inspect the process it turns up to be xorg . I tried to ...
1 vote
1 answer
167 views

How to autocomplete from dictionary while typing?

I've set a dictionary with the command: set dictionary+=~/Dictionary.txt And add the following command to make more quickly to access it: set complete+=k But I still have to press <CTRL-N> to ...
  • 43
0 votes
1 answer
153 views

How can use Tab to navigate completion list

I use both coc.nvim and Ultisnip for completion in vim. coc-snippet does not support some feature in Ultisnip so I use Ultisnip instead But I have a problem is <Tab> for trigger completion in ...
0 votes
0 answers
142 views

Use LSP completion

I use rust-analyzer as LSP-server and hrsh7th/nvim-compe for autocomplete. As you can see on the pic, LSP providing some special completion for default() function, but how can I apply it to my code?
  • 1
0 votes
1 answer
68 views

vim autocompletion in vimscript

I wanted to make a vim snippet in my vimrc, without using a plugin. I want it to appear automatically when I type Ctrl-N iabbrev was good for short code addition, as mentioned in this post https://vim....
0 votes
0 answers
32 views

How can I make vim recognize when to <Enter> on autocomplete?

Im using TabNine YCM fork vim plugin. I'm getting cool suggestions and all, but it's super annoying that it doesn't <Enter> when it should, instead, outputs NULL ASCII Code ^@ Is this related ...
  • 1
0 votes
1 answer
132 views

YouCompleteMe doesn't complete functions from headers

After downloading YouCompleteMe from ubuntu repositories and installing it I have used this script as extra config. I suppose this config may help me with in-headers functions auto-completion. :...
1 vote
1 answer
63 views

How to show where the word is found when using "auto complete" if it's "The only match"

When I type some letters and hit CTRL+P, vim shows a list of possible words that may complete my letters. On the left of the list, it shows the completed word. And on the right of the list, it shows ...
  • 141
0 votes
1 answer
170 views

Change default tab behaviour for autocomplete to bash like tab

When I press tab for autocompletion (with the supertab plugin, but its applicable with vim's autocomplete feature as well), the selection scrolls from the bottom-most selection towards top with the ...
9 votes
4 answers
2k 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: ...
2 votes
0 answers
205 views

How to sort the list of buffers

How to sort the list of buffers Vim displays on entering :b <Tab> by most recent? I'm used to the Spacemacs ordering, which displays buffer filenames in separate rows (vertically) in the order ...
0 votes
0 answers
1k views

How do make autocompletion (Coc) work on Tab instead of Enter?

I use Coc-Python for Python autocompletions. It completes on Enter, however, I want to complete only on pressing Tab and reserve Enter for its normal behavior which is entering a new line. How do I do ...
2 votes
1 answer
116 views

How to make vim recognize variables from files in the current directory or sub directories?

I have recently been working on a web project and I would like my css files to recognize the classes and ids from the html files. Is there any way to make this work? Edit: So I use coc.nvim. By ...
3 votes
1 answer
338 views

UltiSnips comment variable

VSCode have the following variables that are quite helpful when creating snippets: BLOCK_COMMENT_START Example output: in PHP /* or in HTML <!-- BLOCK_COMMENT_END Example output: in PHP */ or in ...
2 votes
2 answers
82 views

Making functions react to keypress

Im very new to vim scripting. I have the following script in my .vimrc: If there is no user input aka I press <CR> => go to recent buffer If input is 'd' => delete all buffers except for ...
  • 33
0 votes
1 answer
420 views

Moving up/down on autocomplete selection box without arrow keys

I'm currently using vim on VSCode (with the vscodevim extension). When VSCode serves me some autocomplete options, I always have to use the arrow keys ↓ and ↑, which are a bit of a stretch. Is there a ...
0 votes
1 answer
464 views

Vimtex+YouComplteMe: How to disable autocompletion on plain text?

I have recently setup vimtex and YCM as the associated autocompleter. These work great in their intended scenario, however I believe the autocompleter is giving suggestions when I am typing plain text ...
1 vote
0 answers
790 views

NeoVim latest version autocompletion opens and closes immediately

I am new to Vim and NeoVim, I setup the latest NeoVim on MAC using brew install nvim --head. I setup the latest verison for the lsp suppport. I installed the CoC plugin and the CoC-go plugin for auto-...
  • 141
0 votes
1 answer
26 views

"auto-complete" normal mode command?

Once I press g (or anything that enters operator pending mode), is there a way to see what keys could follow (e.g. gf, ga etc)? Alternatively, is there a way to search builtin + mapped keys by regex? ...
  • 335
0 votes
2 answers
354 views

How to make neovim cmdline-completion suggests common matched substring?

I've installed vimspector. When I type :Vim in the command & hit tab, I get all matched autocomplete suggestion like VimspectorAbortInstall, VimspectorEval, Vim.... etc. I'm tired to iterate that ...
0 votes
0 answers
667 views

Getting Rust Language Server to work with vim

I'm trying to get tab completion support for rust programs in vim going. There are many descriptions on the net how to this and none of them work out-of-the-box in my environment. The first major ...
  • 341
2 votes
1 answer
71 views

How to Complete entire line containing keyword

I have hidden buffers and I'd like to be able to get an import from another file to place into a file. For example, if I were to have this in another buffer: import javafx.controls.Button; if I were ...
  • 133

1
2 3 4 5
7