Permalink
Browse files

Preference updates

  • Loading branch information...
1 parent 0154133 commit 67379ff17290c749215d399b172603051a9c6286 @diasjorge committed Dec 4, 2012
Showing with 47 additions and 10 deletions.
  1. +34 −1 custom_functions.el
  2. +6 −7 init_keybindings.el
  3. +2 −1 init_mac.el
  4. +5 −1 init_preferences.el
View
@@ -262,4 +262,37 @@
(indent-region (region-beginning) (region-end))
(save-restriction
(narrow-to-region (region-beginning) (region-end))
- (delete-trailing-whitespace))))
+ (delete-trailing-whitespace))))
+
+(defun move-text-internal (arg)
+ (cond
+ ((and mark-active transient-mark-mode)
+ (if (> (point) (mark))
+ (exchange-point-and-mark))
+ (let ((column (current-column))
+ (text (delete-and-extract-region (point) (mark))))
+ (forward-line arg)
+ (move-to-column column t)
+ (set-mark (point))
+ (insert text)
+ (exchange-point-and-mark)
+ (setq deactivate-mark nil)))
+ (t
+ (beginning-of-line)
+ (when (or (> arg 0) (not (bobp)))
+ (forward-line)
+ (when (or (< arg 0) (not (eobp)))
+ (transpose-lines arg))
+ (forward-line -1)))))
+
+(defun move-text-down (arg)
+ "Move region (transient-mark-mode active) or current line
+ arg lines down."
+ (interactive "*p")
+ (move-text-internal arg))
+
+(defun move-text-up (arg)
+ "Move region (transient-mark-mode active) or current line
+ arg lines up."
+ (interactive "*p")
+ (move-text-internal (- arg)))
View
@@ -14,6 +14,7 @@
(global-set-key (kbd "C-c w") 'wget)
(global-set-key (kbd "C-c r") 'revert-buffer)
(global-set-key (kbd "C-c n") 'clean-up-buffer-or-region)
+(global-set-key (kbd "C-c a") 'ack-and-a-half)
;;; Packages
(eval-after-load "jekyll"
@@ -54,7 +55,10 @@
(eval-after-load "custom_functions"
'(progn
- (global-set-key (kbd "C-t") 'ido-goto-symbol)))
+ (global-set-key (kbd "C-t") 'ido-goto-symbol)
+ (global-set-key (kbd "M-<up>") 'move-text-up)
+ (global-set-key (kbd "M-<down>") 'move-text-down)
+ ))
(eval-after-load "find-file-in-project"
'(progn
@@ -85,7 +89,7 @@
(global-set-key (kbd "C-}") 'mc/mark-all-like-this)
(global-set-key (kbd "C-M-]") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-{") 'mc/mark-all-in-region)
- (global-set-key (kbd "C-+") 'mc/mark-more-like-this-extended)))
+ (global-set-key (kbd "C-+") 'mc/mark-more-like-this-extended)))
(eval-after-load "js2-mode"
'(progn
@@ -94,11 +98,6 @@
(define-key js2-mode-map (kbd "C-\"") 'ruby-tools-to-double-quote-string)
))
-(eval-after-load "ack-and-a-half"
- '(progn
- (global-set-key (kbd "C-c ' a") 'ack-and-a-half)))
-
-
;;; Disabled keys
(global-unset-key (kbd "C-w")) ;; prevent accidentally closing buffer
(global-unset-key (kbd "<insert>"))
View
@@ -1,4 +1,5 @@
(setq mac-command-modifier 'meta)
+(setq ns-function-modifier 'hyper)
(set-default-font "Monaco-14")
(defvar javascript-mode-syntax-table 'js-mode-syntax-table)
-(menu-bar-mode)
+(menu-bar-mode)
View
@@ -153,6 +153,10 @@
(set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))
(add-hook 'term-exec-hook 'my-term-use-utf8)
+;; uniquify buffere names
+(require 'uniquify)
+(setq uniquify-buffer-name-style 'post-forward)
+
;; § ----------------------------------------
;; auto compile elisp files after save, do so only if there's exists a byte-compiled file
@@ -249,4 +253,4 @@
(message "desktop read")
(desktop-remove)
(desktop-release-lock)))
-;; ;; § ----------------------------------------
+;; ;; § ----------------------------------------

0 comments on commit 67379ff

Please sign in to comment.