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

Key Binding Overwrites Important Default Mapping of Vim #15

Open
Carltoffel opened this issue Aug 13, 2021 · 8 comments
Open

Key Binding Overwrites Important Default Mapping of Vim #15

Carltoffel opened this issue Aug 13, 2021 · 8 comments

Comments

@Carltoffel
Copy link

The last commit has broken the default mapping of vim. For example I no longer can use the 'ce' command (create executable gets triggered). I guess something went wrong with the mapping of the leader key.

@rudrab
Copy link
Owner

rudrab commented Aug 14, 2021

I will check that. Thanks for reporting.

@rudrab
Copy link
Owner

rudrab commented Aug 17, 2021

Oh, I thought I have misunderstood you. You can define the keybindings in your vimrc. For Fortran90 menus, where ce is defined, you can overrite them as:

let fortran_compile="your value"
let fortran_exe=
let fortran_run=
let fortran_cla=
let fortran_dbg=
let fortran_make=
let fortran_makeProp=
let fortran_genProj=

@rudrab
Copy link
Owner

rudrab commented Aug 17, 2021

Please let me know if this solved your issue or revert back to me.
Please close the issue and consider upvote the project if it solves your problem.

@Carltoffel
Copy link
Author

This is not what i wanted to say. IMHO it is just not very smart for a plugin to overwrite a default vim command with something completely different. I would suggest to use the leader key of vim to initiate the commands of the plugin. Sure, I can rebind it, e.g. let fortran_compile="<Leader>ce", but I think this should be the default for the plugin, and if a user wants to overwrite the default vim mapping, it is still possible.

@rudrab
Copy link
Owner

rudrab commented Aug 17, 2021

I agree it is not very good (or should be avoided by all means) to override default mappings. The keybinding is actually defined in most generic way possible as:
let b:fortran_compile = get(g:,"fortran_compile", get(g:,'mapleader', '\')."cc")
so, if you define a mapleader, the problem is solved IMHO. Any suggestion is welcome though.

@Carltoffel
Copy link
Author

I do have the mapleader defined (let mapleader="\<SPACE>"). Maybe this is the problem. If I set the mapleader to something else it works. Just a guess: Maybe your way of getting the mapleader is not aware of leader-keys longer than one character?

@Carltoffel
Copy link
Author

Carltoffel commented Aug 17, 2021

Okay with let mapleader=" " I can fix my problem without changing the behaviour of vim. So maybe there is a problem with either the escape sequence or with the multi-character-leader.

Edit: I somehow was on the previous commit where it only worked with the " " leader. With the newest commit it only works if i set the mapleader to something like m but just a space does not work.

let mapleader="\<SPACE>" doesn't work
let mapleader=" " doesn't work
let mapleader="m" does work

@Carltoffel
Copy link
Author

I don't know what your commands with let b:fortran_compile = get(... are doing exactly, but if I change them to be simply let b:fortran_compile = "<Leader>cc" etc. it works with all mapleaders mentioned above.

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

2 participants