Is it possible to use Ctrl+n style auto-completion when doing searches and substitution commands in vim?
What I mean is: say I have a variable named myNumber
in my current file. If I enter insert mode and type myNu
and then hit Ctrl+n, it will autocomplete the word to myNumber
(assuming there are no other words that start with those letters).
Is there any way to get this same functionality on the command line? Is there a setting or plugin that will allow me to type /myNu
and then hit a key to complete my text search to /myNumber
? Or, more realistically: let me type :s/myN
and complete that to :s/myNumber
so I can more quickly type out substitution commands?
While in command mode, press Ctrl+f — you will enter command line window. There you can edit your command like in vim. Auto-completion should work too.
Looks like the plugin http://www.vim.org/scripts/script.php?script_id=2222 does more or less exactly what I wanted. Upvoting Kent though, because that's really nifty.
This plugin also enables auto-completion in command line.
https://github.com/vim-scripts/sherlock.vim
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With