Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Preference updates

  • Loading branch information...
commit 67379ff17290c749215d399b172603051a9c6286 1 parent 0154133
Jorge Dias authored December 04, 2012
35  custom_functions.el
@@ -262,4 +262,37 @@
262 262
     (indent-region (region-beginning) (region-end))
263 263
     (save-restriction
264 264
       (narrow-to-region (region-beginning) (region-end))
265  
-      (delete-trailing-whitespace))))
  265
+      (delete-trailing-whitespace))))
  266
+
  267
+(defun move-text-internal (arg)
  268
+   (cond
  269
+    ((and mark-active transient-mark-mode)
  270
+     (if (> (point) (mark))
  271
+            (exchange-point-and-mark))
  272
+     (let ((column (current-column))
  273
+              (text (delete-and-extract-region (point) (mark))))
  274
+       (forward-line arg)
  275
+       (move-to-column column t)
  276
+       (set-mark (point))
  277
+       (insert text)
  278
+       (exchange-point-and-mark)
  279
+       (setq deactivate-mark nil)))
  280
+    (t
  281
+     (beginning-of-line)
  282
+     (when (or (> arg 0) (not (bobp)))
  283
+       (forward-line)
  284
+       (when (or (< arg 0) (not (eobp)))
  285
+            (transpose-lines arg))
  286
+       (forward-line -1)))))
  287
+
  288
+(defun move-text-down (arg)
  289
+   "Move region (transient-mark-mode active) or current line
  290
+  arg lines down."
  291
+   (interactive "*p")
  292
+   (move-text-internal arg))
  293
+
  294
+(defun move-text-up (arg)
  295
+   "Move region (transient-mark-mode active) or current line
  296
+  arg lines up."
  297
+   (interactive "*p")
  298
+   (move-text-internal (- arg)))
13  init_keybindings.el
@@ -14,6 +14,7 @@
14 14
 (global-set-key (kbd "C-c w") 'wget)
15 15
 (global-set-key (kbd "C-c r") 'revert-buffer)
16 16
 (global-set-key (kbd "C-c n") 'clean-up-buffer-or-region)
  17
+(global-set-key (kbd "C-c a") 'ack-and-a-half)
17 18
 
18 19
 ;;; Packages
19 20
 (eval-after-load "jekyll"
@@ -54,7 +55,10 @@
54 55
 
55 56
 (eval-after-load "custom_functions"
56 57
   '(progn
57  
-     (global-set-key (kbd "C-t") 'ido-goto-symbol)))
  58
+     (global-set-key (kbd "C-t") 'ido-goto-symbol)
  59
+     (global-set-key (kbd "M-<up>") 'move-text-up)
  60
+     (global-set-key (kbd "M-<down>") 'move-text-down)
  61
+     ))
58 62
 
59 63
 (eval-after-load "find-file-in-project"
60 64
   '(progn
@@ -85,7 +89,7 @@
85 89
     (global-set-key (kbd "C-}") 'mc/mark-all-like-this)
86 90
     (global-set-key (kbd "C-M-]") 'mc/mark-previous-like-this)
87 91
     (global-set-key (kbd "C-{") 'mc/mark-all-in-region)
88  
-   (global-set-key (kbd "C-+") 'mc/mark-more-like-this-extended)))
  92
+    (global-set-key (kbd "C-+") 'mc/mark-more-like-this-extended)))
89 93
 
90 94
 (eval-after-load "js2-mode"
91 95
   '(progn
@@ -94,11 +98,6 @@
94 98
      (define-key js2-mode-map (kbd "C-\"") 'ruby-tools-to-double-quote-string)
95 99
      ))
96 100
 
97  
-(eval-after-load "ack-and-a-half"
98  
-  '(progn
99  
-     (global-set-key (kbd "C-c ' a") 'ack-and-a-half)))
100  
-
101  
-
102 101
 ;;; Disabled keys
103 102
 (global-unset-key (kbd "C-w")) ;; prevent accidentally closing buffer
104 103
 (global-unset-key (kbd "<insert>"))
3  init_mac.el
... ...
@@ -1,4 +1,5 @@
1 1
 (setq mac-command-modifier 'meta)
  2
+(setq ns-function-modifier 'hyper)
2 3
 (set-default-font "Monaco-14")
3 4
 (defvar javascript-mode-syntax-table 'js-mode-syntax-table)
4  
-(menu-bar-mode)
  5
+(menu-bar-mode)
6  init_preferences.el
@@ -153,6 +153,10 @@
153 153
   (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))
154 154
 (add-hook 'term-exec-hook 'my-term-use-utf8)
155 155
 
  156
+;; uniquify buffere names
  157
+(require 'uniquify)
  158
+(setq uniquify-buffer-name-style 'post-forward)
  159
+
156 160
 
157 161
 ;; § ----------------------------------------
158 162
 ;; auto compile elisp files after save, do so only if there's exists a byte-compiled file
@@ -249,4 +253,4 @@
249 253
             (message "desktop read")
250 254
             (desktop-remove)
251 255
             (desktop-release-lock)))
252  
-;; ;; § ----------------------------------------
  256
+;; ;; § ----------------------------------------

0 notes on commit 67379ff

Please sign in to comment.
Something went wrong with that request. Please try again.