Cmd2.vim icon indicating copy to clipboard operation
Cmd2.vim copied to clipboard

A question and maybe a feature request

Open cpfaff opened this issue 10 years ago • 1 comments

He

I just stumbled upon your plug-in and really like it. By now I was always using ''vim-scripts/CmdlineComplete.git' to allow for a completion on command line. The problem with that one however is that the completion in a search and replace is only working before the / not in the second part. This seems to be the same for your plug-in? Or can I achieve that with the right options set? Any help with that would be appreciated.

My setup now is:

let g:Cmd2_options = {
       \ '_complete_ignorecase': 1,
       \ '_complete_uniq_ignorecase': 0,
       \ '_complete_fuzzy': 1,
       \ }

 cmap <expr> <Tab> Cmd2#ext#complete#InContext() ? "\<Plug>(Cmd2Complete)" : "\<Tab>"

 set wildcharm=<Tab>

cpfaff avatar Dec 23 '15 12:12 cpfaff

Thank you for using and sorry for the big delay in replying.

The cmap <expr> <Tab> checks that Cmd2#ext#complete#InContext() is true to trigger the completion. The current implementation is quite simple, checking if it is just before the first s/. Hence it is possible to replace the check if a function of your own, or even just default to always true. Check the implementation in the source code. The regex would need to be changed to something a bit more complicated as now it would have to check for possible escaped /s in the search string.

If you need further help I might be able to write the regex depending on your use case.

gelguy avatar May 20 '16 21:05 gelguy