xahlee / xah-fly-keys

the most efficient keybinding for emacs
http://xahlee.info/emacs/misc/xah-fly-keys.html
484 stars 82 forks source link

Dear Xah, please understand the importance of C- keys #180

Open akashpal-21 opened 1 month ago

akashpal-21 commented 1 month ago

In your latest commit, you have resolved to removed many C- bindings, the rationale provided is that emacs key users are unlikely to move to xah-key.

I have been using your schema for sometime and have gotten used to it, but the biggest pain I face is that during normal insert operations I need to quickly do some operations such as move the cursor to the end of the line, delete a line, beginning of line and I find that none of the C- keys are operational in this regard. This is hugely inconvenient and time consuming to first switch to command mode and then use leader keys and so on.

The rationale for using C- keys and in extension non-modal keybindings is that sometimes it is just more convenient than to do the whole rigmarole of switching to command then do it then switch back to insert.

Please consider not overwriting the default keybindings unnecessarily, at a certain point - xah-keys will transform from the most efficient keybindings to Xah's personal quirks and choices.

There are advantages to both modal and non modal keybindings and xah should only choose the most efficient - without prejudice to any one method.

Please consider letting us use the C- keybinds especially relating to line movements and quick operations during insert mode.

Much thanks,

akashpal-21 commented 1 month ago

I recommend to users to do the following - before initialising the package

(setopt xah-fly-use-control-key nil)

This will prevent xah-fly from corrupting the C- keybindings

Then choose very carefully what commands to actually take and what to disregard

For my use case merely 10% of commands are useful

;;; C- keybindings

(global-set-key (kbd "<C-tab>") #'xah-next-user-buffer)
(global-set-key (kbd "<C-S-tab>") #'xah-previous-user-buffer)

(global-set-key (kbd "C-2") #'pop-global-mark)
(global-set-key (kbd "C-3") #'previous-error)
(global-set-key (kbd "C-4") #'next-error)
(global-set-key (kbd "C-5") #'xah-previous-emacs-buffer)
(global-set-key (kbd "C-6") #'xah-next-emacs-buffer)
(global-set-key (kbd "C-7") #'xah-previous-user-buffer)
(global-set-key (kbd "C-8") #'xah-next-user-buffer)
(global-set-key (kbd "C-9") #'scroll-down-command)
(global-set-key (kbd "C-0") #'scroll-up-command)

(global-set-key (kbd "C--") #'text-scale-decrease)
(global-set-key (kbd "C-=") #'text-scale-increase)

(global-set-key (kbd "C-SPC") #'xah-fly-command-mode-activate)

(global-set-key (kbd "C-S-n") #'make-frame-command)
(global-set-key (kbd "C-S-s") #'write-file)
(global-set-key (kbd "C-S-t") #'xah-open-last-closed)

(global-set-key (kbd "C-n") #'xah-new-empty-buffer)
(global-set-key (kbd "C-o") #'find-file)
(global-set-key (kbd "C-s") #'save-buffer)
(global-set-key (kbd "C-t") #'hippie-expand)
(global-set-key (kbd "C-v") #'yank)
(global-set-key (kbd "C-w") #'xah-close-current-buffer)
(global-set-key (kbd "C-y") #'undo)

Some of my choices explained

  1. C-a should not be bound to select all - doesn't matter if it is the universal choice - in Emacs it is an established protocol to use C-e and C-a to go forward and back a line
  2. C-y undo-redo makes no sense to me - since undo-redo is easily accessible by pressing C-g then doing undo. Since y is already used for undo in command mode it makes no sense to use C-z for undo - to remember two kinds of binds - instead C-y is the natural choice.

This way xah-fly will complement emacs rather than trying to take over.

It is unlikely xah will revert the patch that blocks most of C- including C-x map; this particular https://github.com/xahlee/xah-fly-keys/commit/7f638f05e0f8f8bfa2b8824b0084ea6ba60b336f patch according to me is a huge mistake. It goes the other way instead of making xah-fly the most efficient.

Users should select even a smaller subset from the C- map; this map is hugely efficient when trying to quickly pass commands without switching back to command mode.