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

Call a user-specified hook function when defining keybindings #339

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

jesboat
Copy link
Contributor

@jesboat jesboat commented Feb 19, 2024

This serves two purposes. First, it allows a user to define additional keybindings for commands without removing the standard <Leader>cXXX bindings. Second, it allows those bindings to be active specifically in Coqtail-managed buffers.

@jesboat jesboat force-pushed the add-hook-for-keybindings branch from 4da2252 to 9066a59 Compare February 19, 2024 14:29
@jesboat
Copy link
Contributor Author

jesboat commented Feb 19, 2024

I use this for:

function CoqtailHookDefineMappings()
  imap <buffer> <S-Down> <Plug>CoqNext
  imap <buffer> <S-Left> <Plug>CoqToLine
  imap <buffer> <S-Up> <Plug>CoqUndo
  nmap <buffer> <S-Down> <Plug>CoqNext
  nmap <buffer> <S-Left> <Plug>CoqToLine
  nmap <buffer> <S-Up> <Plug>CoqUndo
endfunction

It lets me use the key mappings I have muscle memory for (from the Coq plugin I used 3 iterations ago) in all Coq-related buffers, including panels, while still preserving the default Coqtail bindings.

README.md Outdated Show resolved Hide resolved
This serves two purposes. First, it allows a user to define additional
keybindings for commands without removing the standard `<Leader>cXXX`
bindings. Second, it allows those bindings to be active specifically
in Coqtail-managed buffers.
@jesboat jesboat force-pushed the add-hook-for-keybindings branch from 9066a59 to 3839207 Compare February 19, 2024 18:43
@jesboat jesboat requested a review from whonore February 19, 2024 18:45
Copy link
Owner

@whonore whonore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

@whonore whonore merged commit d27e33d into whonore:main Feb 19, 2024
6 checks passed
Rixxc pushed a commit to Rixxc/Coqtail that referenced this pull request Jul 2, 2024
…e#339)

This serves two purposes. First, it allows a user to define additional
keybindings for commands without removing the standard `<Leader>cXXX`
bindings. Second, it allows those bindings to be active specifically
in Coqtail-managed buffers.
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

Successfully merging this pull request may close these issues.

2 participants