Skip to content

Best way to do keybinds #386

Answered by eshrh
slempinen asked this question in Q&A
Jan 18, 2023 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

I don't use use-package, so I'm not entirely sure, but I think what you're
doing in example 1 is in general correct. I think the recommended way is to use
:bind-keymap.

I'm not sure what the issue with just binding it to b in the leader (so,
SPC B) is. If projectile mode is not active, and the command is undefined,
then pressing SPC b will just do nothing, which is reasonable. You can also
use some kind of fallback behavior.

I do something like this with projectile also. If projectile is on and I'm in
a project, SPC-f will call projectile-find-file, but if not, then it calls
the normal find-file. Maybe this could be useful? I implement it like this:

(defun find-file-or-projectile ()
  (in…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@slempinen
Comment options

Answer selected by slempinen
Comment options

You must be logged in to vote
1 reply
@slempinen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants