emacs-gdscript-mode icon indicating copy to clipboard operation
emacs-gdscript-mode copied to clipboard

Default keybindings could be provided as a keymap

Open aarvay opened this issue 5 years ago • 1 comments

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.

aarvay avatar Oct 10 '20 02:10 aarvay

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.

aarvay avatar Oct 10 '20 03:10 aarvay

Reading the code of gdscript-mode.el - Line 53 seems to be implemented. The issue can be closed.

cmirdesouza avatar Nov 07 '22 18:11 cmirdesouza

Closing per @cmirdesouza's comment.

Calinou avatar Nov 07 '22 19:11 Calinou