Skip to content

Instantly share code, notes, and snippets.

@aufrank
Created April 27, 2010 18:23
Show Gist options
  • Save aufrank/381099 to your computer and use it in GitHub Desktop.
Save aufrank/381099 to your computer and use it in GitHub Desktop.
(defun mark-line (&optional arg)
(interactive "p")
(beginning-of-line)
(let ((here (point)))
(dotimes (i arg)
(end-of-line))
(set-mark (point))
(goto-char here)))
(defun mark-sentence (&optional arg)
(interactive "P")
(backward-sentence)
(mark-end-of-sentence arg))
(define-key global-map [(meta shift ?w)] 'mark-word)
(define-key global-map [(meta shift ?l)] 'mark-line)
(define-key global-map [(meta shift ?s)] 'mark-sentence)
(define-key global-map [(meta shift ?x)] 'mark-sexp)
(define-key global-map [(meta shift ?b)] 'python-mark-block)
(define-key global-map [(meta shift ?h)] 'mark-paragraph)
(define-key global-map [(meta shift ?d)] 'mark-defun)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment