Vim mapping with user input

后端 未结 3 491
傲寒
傲寒 2021-02-05 12:55

I\'m wondering if it\'s possible in Vim to create a mapping (for normal mode) that allows user input before the mapping executes.

I want to create a mapping for a shortc

3条回答
  •  无人共我
    2021-02-05 12:59

    An alternative would be create a custom command and use a mapping to call the new command.

    command! -nargs=+ -complete=file -bar Grep grep! |cw
    

    Now you can create your mapping:

    nnoremap  :Grep
    

    You probably also want to stay away from mapping the F key as it a pretty handy mapping.

    For more help see:

    :h :command
    

提交回复
热议问题