Bubble up smart-line-beginning

master
Jacopo De Simoi 8 years ago
parent 782a99fff8
commit 4939ca2829
  1. 25
      global.org

@ -230,6 +230,20 @@
(global-set-key (kbd "C-x k") 'kill-this-buffer)
(global-set-key (kbd "C-S-v") 'scroll-down-command)
#+END_SRC
** Smart beginning-of-line
This is a relatively smart way to go back to the beginning of the line
#+BEGIN_SRC emacs-lisp
(defun smart-line-beginning ()
"Move point to the beginning of text on the current line; if that
is already the current position of point, then move it to the
beginning of the line."
(interactive)
(let ((pt (point)))
(beginning-of-line-text)
(when (eq pt (point))
(beginning-of-line))))
(global-set-key (kbd "C-a") 'smart-line-beginning)
#+END_SRC
** Whitespace
Trailing whitespace is evil; get rid of it
#+BEGIN_SRC emacs-lisp
@ -397,17 +411,6 @@
(global-smart-tab-mode 1)
(global-set-key (kbd "C-j") 'smart-tab) ;; try this; I never use C-j for goto-line
;; * redefine line-beginning to handle indentation properly
(defun smart-line-beginning ()
"Move point to the beginning of text on the current line; if that is already
the current position of point, then move it to the beginning of the line."
(interactive)
(let ((pt (point)))
(beginning-of-line-text)
(when (eq pt (point))
(beginning-of-line))))
(global-set-key (kbd "C-a") 'smart-line-beginning)
;; * load expand-region
(require 'expand-region)

Loading…
Cancel
Save