*vm-faq.txt*    Version 0.3.0    Last change: June 15 2019

FREQUENTLY ASKED QUESTIONS                                             *vm-faq*
===============================================================================

                                                                *vm-faq-errors*
VM has quit with errors and I can't clear VM highlight matches.~

Run |:VMClear|.

-------------------------------------------------------------------------------
                                                                *vm-faq-search*
How to start VM looking for a pattern? ~

Run |:VMSearch|. It also accepts a pattern and a |range| (% finds all matches).

-------------------------------------------------------------------------------
                                                              *vm-faq-mappings*
I want to remap the main VM mappings.~

You have to initialize the mappings dictionary and replace individual mappings
with your own. Below there are some examples.

For a full list of mappings and other informations, see |vm-mappings.txt|.
>
  let g:VM_maps = {}
  let g:VM_maps["Exit"]               = '<C-C>'   " quit VM
  let g:VM_maps['Find Under']         = '<C-d>'   " replace C-n
  let g:VM_maps['Find Subword Under'] = '<C-d>'   " replace visual C-n
  let g:VM_maps["Add Cursor Down"]    = '<M-j>'   " new cursor down
  let g:VM_maps["Add Cursor Up"]      = '<M-k>'   " new cursor up
  let g:VM_maps["Toggle Mappings"]    = '<CR>'    " toggle VM buffer mappings

To disable a specific mapping, set it to an empty string:
>
  let g:VM_maps["Select Operator"]    = ''
<
-------------------------------------------------------------------------------
                                                      *vm-faq-disable-mappings*
How can I temporarily disable VM mappings? ~

VM has a <Plug> for that. Normally it is bound to |VM_leader| + <Space>, but
unless you use <Space> as |VM_leader|, you may prefer an easier mapping:
>
  let g:VM_maps["Toggle Mappings"] = '<Space>'
<

-------------------------------------------------------------------------------
                                                             *vm-faq-functions*
How can I do something before VM starts, or after VM ends? ~

You can create these functions: >
  function! VM_Start()
  function! VM_Exit()
<
Or you can rely on a user autocommand:  >
  autocmd User visual_multi_start   call MyVmStart()
  autocmd User visual_multi_exit    call MyVmExit()
<
If you want to override some VM mapping (and you know what you're doing), this
autocommand is triggered after mappings have been set:
>
  autocmd User visual_multi_mappings  call MyVmMappings()

If you need to perform some action before/after `each` VM command is run: >
  autocmd User visual_multi_before_cmd   call MyFunc1()
  autocmd User visual_multi_after_cmd    call MyFunc2()

-------------------------------------------------------------------------------
                                                                 *vm-faq-remap*
How can I remap x in VM? ~

There are several ways: either do a remap using the functions described above,
e.g.:
>
  function! VM_Start()
    nmap <buffer> <C-C> <Esc>
    imap <buffer> <C-C> <Esc>
  endfunction

  function! VM_Exit()
    nunmap <buffer> <C-C>
    iunmap <buffer> <C-C>
  endfunction
<
or check one of the following settings:

  |g:VM_custom_remaps|
  |g:VM_custom_noremaps|
  |g:VM_custom_motions|


-------------------------------------------------------------------------------
                                                       *vm-faq-custom-mappings*
Can I have a mapping for...? ~

If you find yourself repeating a certain action, you can create mappings like:
>
  nmap cp vip<Plug>(VM-Visual-Cursors)
<
This would create a column of cursors that spans over the current inner
paragraph.
>
Obviously you can just use keys rather than plugs:
>
  nmap  cp vip\\c
<

 vim: ft=help et sw=2 ts=2 sts=2 tw=79
