added these 2 functions to ergoemacs-mode. (this post will be of interest only to key efficiency freaks)
(defun ergoemacs-beginning-of-line-or-block () "Move cursor to beginning of line, or beginning of current or previous text block. (a text block is separated by empty lines)" (interactive) (if (or (equal last-command this-command ) (equal last-command 'ergoemacs-end-of-line-or-block ) ) (ergoemacs-backward-block) (beginning-of-line) )) (defun ergoemacs-end-of-line-or-block () "Move cursor to end of line, or end of current or next text block. (a text block is separated by empty lines)" (interactive) (if (or (equal last-command this-command ) (equal last-command 'ergoemacs-beginning-of-line-or-block ) ) (ergoemacs-forward-block) (end-of-line) ))
i think it's a fantastic addition, and you should set the keys to move beginning/end of line to them. (if you are using
ergoemacs-mode, update to get the latest code, which has enhancement.) Here's explanation.
in ergoemacs-mode, you can press 【Alt+h】 to move cursor to beginning of line. (using QWERTY notation here) However, that key is a repeating key. 〔☛ Keybinding Design: Fast-repeat vs Non-fast-repeat Commands ＆ Keys〕 But the command
beginning-of-line is not a repeating command. So, once you press the key, it's dead there. The keyspot 【Alt+h】 is one of the top 20 precious ones. Also, in ergoemacs-mode, there's a
ergoemacs-backward-block, which takes another keyspot 【Alt+⇧ Shift+u】.
so, combing them should make a more economic/efficient keymap. Now, you press the key once to move to beginning of line, press again then it works as moving to previous text block, and you can hold to repeat. And this saves you one precious keyspot, and is slightly overall easier than the 【Alt+⇧ Shift+u】. Similarly for the
ergoemacs-forward-block key ＆ command.
addendum: Matthew L Fidler accepted the code and also made the key change. Also, he extended the code, so that it'll move to beginning of indentation at first, but the behavior can be changed via a option. Update your ergoemacs-mode, then call
describe-key on 【Alt+h】, then you can read about the detail.