girishji / autosuggest.vim

Autocompletion for Vim's command-line.
MIT License
59 stars 4 forks source link

Unwanted screen clearing on complete #3

Closed EgZvor closed 1 year ago

EgZvor commented 1 year ago

I have a couple of mapping that use a pattern of one command to display something with echo and another to choose an element from displayed ones. E. g.,

nnoremap <leader>b :buffers<cr>:buffer<space>

with autosuggest my echoed output is cleared as soon as I type one character.

girishji commented 1 year ago

Fixed. Use the exclude option. To stop :buffer command from being completed:

exclude: ['buffer']

https://github.com/girishji/autosuggest.vim/commit/4348a12a387fbcdb3172ddb29bb387d7904fa73f

girishji commented 1 year ago

You can also try the following

:nnoremap <leader>b :AutoSuggestDisable<cr>:buffers<cr>:let nr = input("Which one: ")<Bar>exe $'buffer {nr}'<bar>AutoSuggestEnable<cr>