ryvnf / readline.vim

Readline emulation for command-line mode
88 stars 2 forks source link

Is it possible to have readline.vim overrides vim-rsi? #6

Closed hupfdule closed 4 years ago

hupfdule commented 4 years ago

I like the readline mappings in insert mode as vim-rsi provides, but I also like that readline.vim in commandline mode is more "readline-like".

However when I have both installed, vim-rsi takes precedence. As vim-rsi doesn't provide an option to disable it in commandline mode, is it possible to somehow force readline.vim to override vim-rsis mappings or prevent vim-rsi form overriding readline.vims mappings?

ryvnf commented 4 years ago

The most straight forward way would be to edit the source file of vim-rsi to either remove all command-line mappings or add an option to disable them using an option. Though that might it difficult to sync it with future updates using git.

Another way would be to create a script file in .vim/after (see :help after-directory) which contains cunmap commands for all command-line mappings rsi-vim maps.

I don't think there is a way to do what you want without this kind of manual work. Unless vim-rsi would expose an option to disable command-line mappings.

ryvnf commented 4 years ago

I now realize that the second suggestion about using .vim/after would not work, because those scripts gets executed after loading all plugins (including readline.vim).

Now that I think more about it, I think changing the order in which plugins are loaded can be specified in some plugin-managers. I don't think there is a way in vanilla Vim.

hupfdule commented 4 years ago

Thanks for help.

I have now patched vim-rsi directly. Surely I have to adjust it every time I rebase it against a new version of vim-rsi, but that hopefully doesn't happen very often.

I have prepared a Pull Request against vim-rsi, but I am sceptical it will be integrated.

odnoletkov commented 4 years ago

It looks like it is only a dozen of insert mode maps in vim-rsi and all of them are pretty straight-forward – so the simplest option might be just to include them in .vimrc directly and don't use vim-rsi at all

hupfdule commented 4 years ago

Well, whether I put into my .vimrc or include use my own fork of vim-rsi doesn't make that much of a difference. Actually the plugin has the advantage that I can easily enable / disable it.