By default, scroll-up and scroll-down will not move to the bottom or top of the buffer if you are already on the last or first page. This adds that functionality:
(defunmy-scroll-up()"Scroll unless on last page of buffer, in which case go to end of buffer."(interactive)(condition-casenil(scroll-up)(error(goto-char(point-max)))))(defunmy-scroll-down()"Scroll unless on first page of buffer, in which case go to beginning of buffer."(interactive)(condition-casenil(scroll-down)(error(goto-char(point-min)))))
Sometimes its nice to scroll without moving the cursor/point. This can be done easily, I just added it as a function to I could bind it. I realize I could add it as a lambda function directly in the global-set-key call, but I prefer to have it as a separate function.
(defunscroll-up-without-moving-point()"Scroll up without moving the cursor/point."(interactive)(scroll-up1))(defunscroll-down-without-moving-point()"Scroll down without moving the cursor/point."(interactive)(scroll-down1))
other-window is nice, but only for going forwards. This is an easy function for binding going backwards with other-window:
(defunother-window-backwards()"Move to the previous window."(interactive)(other-window-1))
As blasphemous as it might be, I like a little more “vi-like” functionality when I open a new line. Try open-line in the middle of a line, then try this one to get a feel for the differences. Got this one from EmacsWiki:
(defunopen-new-line(arg)"Move to the next line and then opens a line. See also `newline-and-indent'."(interactive"p")(beginning-of-line)(open-linearg)(whennewline-and-indent(indent-according-to-mode)))