Open roachsinai opened 4 years ago
Thank you for the suggestion. That's a great idea!
This can be done by doing the following
let g:Lf_NormalMap = {
\ "Filer": [
\ ['m', ':call Lf_filer_context_menu()<CR>']
\ ],
\}
function! Lf_filer_context_menu() abort
exec g:Lf_py "from filerExpl import *"
let l:commands = ['create_file', 'mkdir', 'rename', 'copy', 'paste']
let l:selection = confirm('Action?', "New &file\n&New Directory\n&Rename\n&Copy\n&Paste")
silent exe 'redraw'
exec printf('exec g:Lf_py "filerExplManager.do_command(''%s'')"', l:commands[l:selection - 1])
endfunction
I'm going to add it to the README. Thank you so much!
let g:Lf_NormalMap = {
\ "File": [["<ESC>", ':exec g:Lf_py "fileExplManager.quit()"<CR>']],
\ "Filer": [['m', ':call Lf_filer_context_menu()<CR>']],
\ "Buffer": [["<ESC>", ':exec g:Lf_py "bufExplManager.quit()"<CR>']],
\ "Mru": [["<ESC>", ':exec g:Lf_py "mruExplManager.quit()"<CR>']],
\ "Tag": [["<ESC>", ':exec g:Lf_py "tagExplManager.quit()"<CR>']],
\ "BufTag": [["<ESC>", ':exec g:Lf_py "bufTagExplManager.quit()"<CR>']],
\ "Function": [["<ESC>", ':exec g:Lf_py "functionExplManager.quit()"<CR>']],
\ "Colorscheme": [["<ESC>", ':exec g:Lf_py "colorschemeExplManager.quit()"<CR>']],
\ }
I have my setting about this issue above, and use Lf_filer_context_menu
you posted above. Could you tell me how to trigger the function?
I can't trigger when on Filer normal mode press m
.
Try running it with a minimal vimrc. Also, take a look at the minimal vimrc.
How do you reproduce it?
I'm sorry. I couldn't set the popup mapping in g:Lf_NormalMap
.
The implementation is going to have to change.
OK, thanks for your work! Just wairing for the success! Btw does the reason there is no delete operation is the delete is dangerous?
If so I think it will be better to let people to decided whether add it to normal map.
Using g:Lf_NormalMap
, customizing popup mappings is technically difficult, but I'll put it in the TODO.
Btw does the reason there is no delete operation is the delete is dangerous?
Yes. I'm struggling with how to implement it because it's dangerous.
Sure, it's just a matter of not mapping it out. I'll try to implement it in the future.
Thank you!
When using
defx
I can use setting below to create file/directory, remove file, and no need to remember all that maps, just one mapm
.Could this possible when using LeaderF-filer?