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
1answer
23 views

<C-x><C-o> “Pattern not found” even with a Ctags file (C/C++)

<C-x><C-o> returns Pattern not found in C/C++ files even with a ctags file. It used to work and I haven't made any configuration/plugin changes that I know of Starting vim with vim -u ...
0
votes
0answers
14 views

omni complete throwing “E119: Not enough arguments for function: 1” error

I have <C-x><C-o> working just fine with neovim with my old vim configuration but when I switch over to my new config, I'm not having any luck and I can't figure out why. When I hit <C-...
0
votes
0answers
60 views

vim omni-complete and c++20

I have used vim for C++ development for quite a while now where, for auto completion, i would either use YCM or, lately, the combination of LanguageClient-neovim and clangd. Lately, however, having ...
0
votes
0answers
18 views

Auto-completion pop-up no clean up - how to debug

I'm trying to solve this issue for some time now. Quite often auto-suggestion pop-up leaves a text on the screen: even after being closed sometimes covering newer suggestion that was displayed after ...
0
votes
1answer
39 views

Put a tab autocompleted path into current buffer

I use autocompletion a lot, especially for long path names: e.g. $ /home/au/Doc<tab> <tab>uments/A<tab> <tab>\ file\ with\ a\ very\ long\ name This can be performed within ...
3
votes
2answers
51 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, ...
0
votes
2answers
26 views

Use the buffers auto completion in an input() dialogue

I am trying to add autocompletion, with suggestions from the currently edited buffer when reading input from the user for a search string: function! Testinput() return input("Enter search string: ...
0
votes
0answers
23 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 ...
3
votes
2answers
102 views

How to get auto completion provided by <C-N> without typing <C-N>?

I like the simple auto completion provided by Ctrl-N but not typing Ctrl-N everytime to get the completion. I would like it to work similar to how YouCompleteMe works with automatic suggestions. If ...
0
votes
0answers
50 views

How to (auto) complete filenames?

Developing in nodejs I have a lot of custom module require statements in my javascript source files, like this one: // // my nodejs program: // path/to/projecthome/lib/someModule.js // const EMOJI = ...
1
vote
1answer
30 views

How to enable autocomplete for writing in English?

Is there a way to enable autocomplete for writing in English? For example, if I write giv, I want Vim to automatically suggest give, given, gives, giving, giveaway, etc. In Emacs, this is easy to ...
6
votes
2answers
256 views

Shell scripting: A more elegant way to complete then…fi, do…done, case…esac pairs?

The problem In shell scripting, conditionals and loops don't use curly braces to indicate blocks, but rather special keywords: if [ ... ]; then statements close with fi, while [ ... ]; do statements ...
1
vote
1answer
77 views

neovim ruby/rails omnicomplete

I'm trying to get omnicomplete working in neovim (0.3.4) on debian 10 with Ruby 2.6.6 (rbenv). I have these plugins: Plug 'vim-ruby/vim-ruby' " ruby ...
2
votes
1answer
43 views

How to make Vim autocomplete with file system?

Let's say I have my directory/file tree as follows: / |_home |_myPC |_script.sh |_test.sh |_etc |_log.txt I'm working on script.sh and Vim has nothing like firejail to stop it from ...
1
vote
2answers
48 views

How to auto-complete filenames in sub-directories when opening them for editing using e.g. `:e </path/to/file>`?

How to autocomplete filenames in sub-directories when opening them for editing using e.g. :e </path/to/file>? When opening files in sub-directories for editing using e.g. :e </path/to/file&...
1
vote
1answer
29 views

How to set a maximum popup window height for auto completion?

As title, when there're tens of suggestions, the popup can expand the entire window. How to set a maximum window height for auto completion popup? I'd like to have a scrolling window.
0
votes
1answer
46 views

How to explicitly open the signature preview window when not completing?

When using <c-x><c-o>, vim opens a signature preview window which is different from the one opened when using :ptag. How to open that one when not completing like when reviewing in ...
2
votes
1answer
32 views

Rails Vim tab completition for model and controller works different than for views

I'm using Vim with Rails Vim plugin. When trying to tab-complete command :Emodel U or :Econtroller U and then <Tab> it won't recognize the user.rb or user_controller.rb file. But works fine for :...
1
vote
0answers
39 views

Word or phrase completion based on file

I would like to create a file people.txt which has contents such as George Bush Hillary Clinton Santa Clause If I am in vi and type "Clau", vi suggests "Santa Clause". Likewise, if I type "eorg", vi ...
1
vote
1answer
32 views

how to get dictionary and thesaurus completion

<C-x><C-K> allows for dictionary completion, and <C-x><C-T> for thesaurus completion. How can I get both completions at once? Ideally, is there a way I can add the thesaurus ...
0
votes
1answer
33 views

:o autocomplete

Without any plugins, I am able to autocomplete :vsp filena<tab> I wonder why I don't get autocompletion of filenames with :o. I have tried this in different installations, terminals and OS.
1
vote
1answer
81 views

Completion pop-ups hijack arrow keys. Any way to disable that?

Regardless of which code completion plugin I use (I tried asyncomplete and YouCompleteMe), when there's a completion pop-up, up and down arrow keys select completion options in it instead of moving ...
3
votes
3answers
125 views

Easiest way to go to the closest closing bracket?

When I'm choosing an option from the autocomplete suggestions, it automatically puts my cursor in the following location: function(|) Then I type the value that I want, and in order to get out of ...
0
votes
0answers
30 views

Autocomplete hidden files

This same question has already been posted by a user who asked why this happened with the autocompletion of the :e[dit] command here. However, the accepted answer doesn't fully answer the question ...
0
votes
0answers
710 views

coc not working in latest vim

I've installed coc following the instruction, using Vim-Plug (before that I did it without installing yarn and with kite still (partially) installed. I got a 'javascript file not found' error So I ...
1
vote
2answers
119 views

C-N using try-catch

When using autocompletion with <C-n>, if no matching string is found, vim shows the message Pattern not found into the status bar. I tried something with this simple function: function! TestCN(...
2
votes
0answers
190 views

How to fix this `Omni completion (^O^N^P) Pattern not found` error?

I am trying to set up syntax keyword based omnicompletion in vim. I have defined a few syntax keyword Constants in ~/.config/nvim/syntax/spl.vim They are correctly detected and highlighted. They are ...
1
vote
1answer
49 views

call omnicompletion from vimscript

I'd like to automatically call the omnicompletion (that is triggered manually by <Ctrl-X><Ctrl-O>) from within a vimscript function. I played around a bit with execute 'normal! …' and ...
3
votes
1answer
98 views

How to print a list of possible matches from C-n?

That is, doing autocompletition with C-n, is there a way to obtain the list of possible matches, same as returned into the popup menu ? Given the example below is it possible to retrieve {aaa, aaab, ...
1
vote
0answers
295 views

Autocompletion doesn't work when using ALE + deoplete

From my init.vim (I've checked that it doesn't work even with a minimal configuration): call plug#begin() Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'dense-analysis/ale' Plug '...
0
votes
0answers
28 views

What is the “stuck text” that happens on my screen as a byproduct of a plugin? How can I remove it?

When I'm using Vim in the terminal, I sometimes get stuff like this: The square bracket floating is what I'm talking about. When my autocompleter plugin stops completing, sometimes it "forgets" to ...
0
votes
1answer
69 views

“Wait” key in :map

In my .vimrc i have :imap .. .<C-x><C-o> and it work as it should (double dot to open menu with fields). But I also want to be able type text like [1..MAX] as you can see here vim will ...
0
votes
0answers
23 views

navigating dictionary completion

In my vimrc I have the following mappings: set completeopt=longest,menuone,preview inoremap <C-h> <C-n> inoremap <C-k> <C-p> inoremap <Leader>k <C-x><C-k&...
1
vote
2answers
178 views

What is the difference between loaded and unloaded buffers?

I was looking at the documentation for the 'complete' option, and I found it a bit confusing: . scan the current buffer ('wrapscan' is ignored) w scan buffers from other windows b scan other ...
0
votes
2answers
115 views

How to remap Autocomplete on Control+N, to Control+Space?

I am trying to remap this functionality: to Ctrl+Space, by using this line in .vimrc inoremap <C-Space> <C-n> However, I can not seem to get it to work. If I press Ctrl+Space after ...
0
votes
0answers
27 views

How can I complete both words and WORDS? [duplicate]

I found this question, but mine is a bit different. When I write code dealing with arrays or classes like $myArray['myElement'] or document.getElementById("myElement"), I get annoyed because I have ...
1
vote
0answers
221 views

How to get YouCompleteme to work with kernel headers

I am taking an OS class and we have an upcoming assignment involving Kernel modules. I'm reading Wiley OS text to prepare and they have the below code. I keep on getting an error that the header files ...
1
vote
1answer
89 views

Sophisticated autocompletion in Vim in a VScode manner

I'm currently switching to Vim as my main text editing tool and I try to investigate if it is possible to make Vim behave like VScode when it comes to autocompletion. I got really used to the way ...
1
vote
1answer
57 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 ...
3
votes
1answer
228 views

How to show completion menu when typing EX-command?

When I use MS Windows version gvim, when typing EX-command, I can press TAB then there will show a completion candidates menu. For example, if I type :colorscheme then a space then press TAB, gvim ...
2
votes
0answers
46 views

How to get this tab/autocompletion setup?

Basically what I want is a PyCharm-like completion: If there is only whitespace, insert <TAB>. If pum is visible and nothing is selected, complete with first, otherwise choose the selected word/...
1
vote
1answer
129 views

getting vim to autocomplete python methods

I am coming from statically types languages, but I will have to be using python for the next few years and I want to get my setup as smooth as possible. Right now I am using vim-jedi, and deoplete-...
5
votes
2answers
231 views

How to enable “on-the-fly” autocompletion?

How can I make it so that no command or extra keystroke is required for the autocompletion menu to pop up? i.e. what I want is the menu to be always present while in insert mode and to be constantly ...
1
vote
1answer
906 views

Autocompletion plugin for c/c++ with specific header path?

Is there a plugin which autocompletes C/C++ code from specific headers given in a specific path (i.e. /path/)? If I include some headers from that path, I would get autocompletion from given header.
1
vote
1answer
132 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 ...
0
votes
0answers
63 views

Temporary normal mode doesn't wait for the command

When I press C-o in insert mode, the expected behaviour is that vim will wait for me to execute a single command and then returns to insert mode. Usually, after pressing C-o I have all the time in the ...
1
vote
0answers
60 views

Prevent “Pattern not found” error in autocompletition (i_Ctrl-N)

I use the following mapping for <Tab>: inoremap <expr> <Tab> getline('.')[col('.') - 2] =~ '\w' ? "<C-N>" : "<Tab>" It works well except that if I want to insert a tab ...
0
votes
1answer
28 views

Adding directory (header and source) to autocompletition search

I use Ctrl+P and Ctrl-N for autocompletition, and since I have library sources in another directory, like /opt/ST/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc /opt/ST/...
2
votes
0answers
52 views

Next tab completion item

I was seeing how the different default colorschemes look like in vim. To do that I typed :colo, then space and tab. But then when I want to set the next one, I have to press tab a lot of times to get ...
3
votes
1answer
81 views

Autocompletion filenames with prefix in variable

In Vim I make auto-completion of the filesystem paths just by the shortcut Ctrl + x, Ctrl + f, in insert mode. In a Makefile I sometimes put a path's prefix in a variable. For instance STYLEDIR=/home/...

1
2 3 4 5