Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

Hi!

vifm is excellent!

Problem in VISUAL mode:
When I highlight two files and type "d" it seems to delete the 2 files with :delete

Here are the settings that I have in the vifmrc:

set trash
" set trashdir=$HOME/ark/trash
nnoremap dd :trash<cr>
" I have a custom trash script (that works perfectly when I highlight one file).
command! trash trash %f

nnoremap d <Nop>
cmap :d :trash
cnoremap delete :trash
cmap :delete :trash 
" set confirm-=delete

As you can see, I am trying everyting to disable or remap "d".
Nothing is working. vifm still behaves as though it uses :delete

I don't need :delete and am willing to disable it altogether.
My preference is to disable "d" and use "dd" to use my trash script.

1 Answer

0 votes
by

Hello.

cmap :d :trash
cnoremap delete :trash
cmap :delete :trash

These commands are about mapping in command-line mode and apply only to typing them (and non-noremap mapping). You can remove them.

Vifm doesn't use :delete, it uses the code which handles :delete. For visual mode use vnoremap:

vnoremap <silent> d :trash<cr>
by

This is a very refreshing experience!

  1. You responded very quickly.
  2. You provided the correct answer.

vifm is definitely my favorite file manager now.
I will be recommending it to "everyone" I know.

Thank you very much!!!

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...