Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

What's the proper way to bind new custom actions? #295

Open
rafi opened this issue Dec 26, 2021 · 1 comment
Open

What's the proper way to bind new custom actions? #295

rafi opened this issue Dec 26, 2021 · 1 comment

Comments

@rafi
Copy link

rafi commented Dec 26, 2021

Hi. What's the proper way for creating & binding new actions that could be called with gina#action#call() and receive the current/marked candidate(s)?

function! s:my_action(candidates) abort
  " do something...
endfunction

" How can I bind 'my_action' to `my-action` in a command?

call gina#custom#mapping#nmap('status', 'p', ":<C-u>call gina#action#call('my-action')<CR>", {'noremap': 1})
@lambdalisue
Copy link
Owner

Ah... actions in gina are a bit difficult and not designed for users to define their original actions.

You can read and follow https://github.com/lambdalisue/gina.vim/blob/master/autoload/gina/action/ls.vim or whatever but the methods are not really for users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants