emacs-gdscript-mode
emacs-gdscript-mode copied to clipboard
Default keybindings could be provided as a keymap
The default keybindings that this mode assumes conflicts with what I've already setup. I suggest, that the default keybindings should be provided as keymap that the user can then bind it to a key. Also binding imenu should just be a suggestion, alike me, many would've already bound it to something else (in my case C-c i which this package rebinds to insert-file-path-at-point). its just too confusing.
For inspiration, taken from projectile.el
(defvar projectile-command-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "a") #'projectile-find-other-file)
(define-key map (kbd "b") #'projectile-switch-to-buffer)
(define-key map (kbd "C") #'projectile-configure-project)
(define-key map (kbd "c") #'projectile-compile-project)
(define-key map (kbd "d") #'projectile-find-dir)
; ...
; ...
; ...
; .....
map)
"Keymap for Projectile commands after `projectile-keymap-prefix'.")
(fset 'projectile-command-map projectile-command-map)
In my config I then,
(use-package projectile
:bind-keymap ("C-c p" . projectile-command-map))
Now all the projectile commands neatly come under C-c p and I can access them like C-c p a for projectile-find-other-file etc.
Same way, I should be able to bind all gdscript mode specific stuff under C-c g for ex and be able to do C-c g i instead of C-c i for gdscript-completion-insert-file-path-at-point.
Reading the code of gdscript-mode.el - Line 53 seems to be implemented. The issue can be closed.
Closing per @cmirdesouza's comment.