Questions tagged [autocompletion]
For questions about the several commands to complete part of a keyword or line that has been typed.
339
questions
1
vote
0
answers
13
views
Can I interrupt the loop through a command completion custom list to trigger recomputation of the list?
Here's a minimal example:
function s:compl_list(argLead, cmdLine, cursorPos)
if a:argLead == 'opts='
return map(['op1', 'op2', 'op3'], {_, v -> a:argLead . v })
endif
return ['initial', '...
0
votes
1
answer
62
views
Prevent Neovim LSP from opening a scratch preview buffer
When auto-completing with neovim's LSP, whenever selecting a menu entry from the auto-complete list a scracth/preview buffer is created, even if empty:
How can I disable these buffers specifically ...
0
votes
1
answer
27
views
Adding dictionary words list to deoplete plugin
Let's say I have list of words in one file in my home directory (each word is in separate line):
bar
barfoo
foo
foobar
...
How can I add this list of words to vim deoplete auto-completion plugin? I'...
0
votes
1
answer
27
views
<tab> autocompletion not working
I installed ycm with vimplug and it's working, but I have to press <C-n> to scroll through the autocompletion menu.
How can I remap that to <tab>?
my .vimrc:
call plug#begin()
Plug '...
2
votes
1
answer
38
views
Access to the CTRL-N auto-complete UI functionality
I have a list of strings in an external file.
I want to be able to access those strings, and perform the auto complete functionality on those, in the same way that CTRL-N works usually.
See the below ...
0
votes
2
answers
267
views
Go to definition with LSP
I'm trying to use Jedi to do "jump-to-definition". For example, if my cursor is on MLPClassifier, I want to be able jump to the place where that class is defined in Python code from the ...
0
votes
1
answer
19
views
Why inoremapping <c-e> shadows <c-e> completion functionality?
Foreword
Open a new file with vim -Nu NONE and insert the following text (| is to indicate the position of the cursor, in insert mode)
longline
lo|
longerline
Now hit Ctrl-XCtrl-N and the ...
0
votes
0
answers
23
views
Remove words from comments in vim autocompletion
I have looked for similar questions but I was quite surprised to not find anything similar... either I am the first person on this planet to have this issue, or I have searched using bad keywords.
...
1
vote
1
answer
30
views
In neovim, can I use Enter to accept a command completion instead of executing the command?
Using neovim (v0.8.1 on Fedora 37) with its default configuration in my home directory, when I type :e <tab> the completion menu pops up, the first entry (here Desktop) is highlighted and the ...
0
votes
0
answers
62
views
How to tab autocomplete in command-line and search using CoC?
How can I have autocompletion in the colon command-line and during / search just as autocomplete works in my buffers?
1
vote
0
answers
42
views
Completion for ++flags in command-line mode
Is there any way to turn on tab completion for the various ++[flag] flags that some commands take?
For example, :e ++ff=unix whatever.txt overrides fileformat to unix for whatever.txt, but :e ++<...
1
vote
2
answers
51
views
Shorter way to call specific plugin function
In the middle of a Vim session, I need to call a particular plugin's function via:
:call UltiSnips#RefreshSnippets()
When from normal mode I type :call UltiS<Tab>, it auto-expands to ...
0
votes
1
answer
43
views
How do I call a user-defined command from a function, and wait until it finishes?
The two functions in the script below can be called independently via key mappings <leader>1 and <leader>2. In a perfect world, <leader>1 will always be called first. If the user ...
1
vote
1
answer
33
views
How to make file completion for a hidden file?
I use ctrlx f to autocomplete the file path. But the popup window won't have the dot file (hidden file, here it is the .obsidian.vimrc file I want to find) unless I press . first, then press ctrlx f.
...
1
vote
1
answer
48
views
Smart way to type latex `\SI{..}{..}` macro in vim (snipped/autocompletion)
A physics high school student of mine is typesetting latex documents using vim. I noticed however that he doesn't use the siunitx package which typesets units properly. However the syntax for example \...
0
votes
1
answer
25
views
ctrl-x, ctrl-k spelling completion not working on Windows
I use the same configuration on Linux and Windows. This is the config for spelling:
" Set dictionary and regenerate spl files on startup
set dictionary+=/usr/share/dict/words
set spelllang=en_gb
...
0
votes
1
answer
48
views
How to get the command short form for custom commands?
The built-in Vim command have a nice property. You have only to type as much such that Vim can guess the command.
For :cclose you can type:
:ccl
:cclo
:cclos
:cclose
Is there a way to get the same ...
0
votes
0
answers
23
views
How can I enable html autocomplete in .tmpl files?
I'm editing .tmpl files which are mostly html with some template language syntax inside {{ double curly braces }}.
I'm using COC for autocompletion and I want to be able to use the autocomplete ...
0
votes
2
answers
102
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 ...
4
votes
0
answers
46
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,...
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....
1
vote
1
answer
246
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 ...
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
76
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
48
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
402
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
43
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 ...
3
votes
1
answer
106
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 ...
0
votes
1
answer
250
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
71
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 ...
1
vote
0
answers
422
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
137
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 ...
0
votes
0
answers
71
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?
0
votes
0
answers
55
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 ...
1
vote
1
answer
244
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
...
0
votes
1
answer
217
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
132
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
...
1
vote
2
answers
53
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:
...
1
vote
1
answer
1k
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
169
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 ...
1
vote
2
answers
59
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
1k
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
60
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
262
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 ...
0
votes
1
answer
210
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
332
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?
0
votes
1
answer
74
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
34
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 ...