Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hupfdule opened this issue Nov 7, 2019 · 5 comments
Closed

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

hupfdule opened this issue Nov 7, 2019 · 5 comments

Comments

@hupfdule
Copy link

hupfdule commented Nov 7, 2019

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
Copy link
Owner

ryvnf commented Nov 8, 2019

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
Copy link
Owner

ryvnf commented Nov 11, 2019

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
Copy link
Author

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
Copy link

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
Copy link
Author

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.

@ryvnf ryvnf added the question label Nov 20, 2019
@ryvnf ryvnf closed this as completed Nov 20, 2019
@ryvnf ryvnf removed the question label Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants