vim-swap
vim-swap copied to clipboard
Insert command in swap mode
I was hoping to do some work to add in an insert command into swap mode, probably bound to i and a that would add in a delimiter and enter insert mode in the correct place. Potentially similar to sideways.vim's mappings.
I wanted to check in here though before I start to see:
- I this something that would be accepted at all into the plugin
- Is this the UX we want
- Where should I start and take a look if this has any interest behind it?
Thanks for the plugin and all the hard work!
Thank you for your request! If I did not misunderstand, it inserts a delimiter and enters into insert mode. Am I right?
It sounds interesting. In short, the step to add a new command is:
- Add a mode interface to
Swapmodeobject in autoload/swap/mode.vim - Implement the actual buffer processing into
Swapobject in autoload/swap/swap.vim - List it in
Swap._editmethod in autoload/swap/swap.vim - Connect the new function to a key in autoload/swap.vim
It may not be so easy... vim-swap gets complicated by time.
Thank you for the in depth help! I've gotten everything done except for implementing the buffer processing and entering insert mode, but I don't know how to proceed. Is there already a way to exit the interactive mode that's been created based on some return from my s:Swap._insert function? if not I can easily just insert a break in the _edit function
hmm... This is kind of difficult. There is no function like this. Probably, for example, s:Swap._insert exit the swap mode and go into insert mode(, and re-start swap mode if necessary).