I'm pretty new to vim but I'm trying to create some C++ IDE.
I'm used to ctrl f (or ctrl-shift-f) to help me find in files.. so I saw a plugin I liked called pss.
I'd like to replace ctrl-f with something that would accept input but still add parameters of it's own(*.cpp for example).. I was thinking of something like:
how can I do it correctly?
noremap <C-f>:Pss $1 *.cpp
Since you have editing capabilities in the command-line, a commonly used approach just builds an incomplete mapping. You can position the cursor in the edit location, like this:
:noremap <C-f> :Pss *.cpp<Left><Left><Left><Left><Left><Left>
After triggering the mapping (via <C-f>), you can insert the search pattern, and then trigger the search via <CR>.
You can query for input via the input() function; its result can be inserted into the command-line via :execute:
:noremap <C-f> :execute 'Pss' input('Pattern: ') '*.cpp'<CR>
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