diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs | 65 |
1 files changed, 30 insertions, 35 deletions
@@ -5,6 +5,7 @@ ;; If there is more than one, they won't work right. '(Buffer-menu-use-frame-buffer-list nil) '(abbrev-mode t) + '(ac-auto-start t) '(ac-dwim t) '(ac-modes (quote (emacs-lisp-mode lisp-interaction-mode c-mode cc-mode c++-mode java-mode perl-mode cperl-mode python-mode ruby-mode ecmascript-mode javascript-mode js2-mode php-mode css-mode makefile-mode sh-mode fortran-mode f90-mode ada-mode xml-mode sgml-mode delphi-mode))) '(all-christian-calendar-holidays t) @@ -26,6 +27,10 @@ '(column-number-mode t) '(compilation-skip-threshold 2) '(confirm-kill-emacs (quote y-or-n-p)) + '(cua-delete-selection nil) + '(cua-rectangle-mark-key [134217760]) + '(cua-remap-control-v nil) + '(cua-remap-control-z nil) '(curchg-default-cursor-color "white") '(curchg-overwrite/read-only-cursor-type (quote hollow)) '(current-language-environment "English") @@ -344,14 +349,8 @@ (global-set-key (kbd "<f8>") 'switch-dictionary) ; update flyspell after changing dictionary -(defadvice ispell (after advice) - (flyspell-buffer)) -(ad-activate 'ispell t) -(defadvice ispell-word (after advice) - (flyspell-buffer)) -(ad-activate 'ispell-word t) (defadvice ispell-pdict-save (after advice) - (flyspell-buffer)) + (save-excursion (flyspell-buffer))) (ad-activate 'ispell-pdict-save t) ; byte-compile .emacs @@ -411,34 +410,23 @@ (setq x-select-enable-clipboard t) (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) -; rectangle selection -(require 'rect-mark) -(global-set-key (kbd "C-x r SPC") 'rm-set-mark) -(global-set-key (kbd "C-S-y") 'yank-rectangle) - -(global-set-key (kbd "C-x C-x") - '(lambda(p) (interactive - (if rm-mark-active - (rm-exchange-point-and-mark p) (exchange-point-and-mark p))))) - -; if rectangle mark active, copy/cut/ rectangle and -; if not copy whole line when no region is active -(global-set-key (kbd "C-w") - '(lambda(b a) (interactive "r") - (if rm-mark-active - (rm-kill-region b a) - (if mark-active - (kill-region b a) - (kill-region (line-beginning-position) (line-beginning-position 2)))))) - -(global-set-key (kbd "M-w") - '(lambda(b a) (interactive "r") - (if rm-mark-active - (rm-kill-ring-save b a) - (if mark-active - (kill-ring-save b a) - (kill-ring-save (line-beginning-position) (line-beginning-position 2)))))) +;; use cua-mode, but only for rectangle selections +(setq cua-enable-cua-keys nil) +(cua-mode t) +;; copy/kill whole line when no region is active +(defadvice kill-ring-save (before slick-copy activate compile) + (interactive (if mark-active (list (region-beginning) (region-end)) (message + "Copied line") (list (line-beginning-position) (line-beginning-position + 2))))) +(ad-activate 'kill-ring-save) + +(defadvice kill-region (before slick-cut activate compile) + (interactive + (if mark-active (list (region-beginning) (region-end)) + (list (line-beginning-position) + (line-beginning-position 2))))) +(ad-activate 'kill-region) ;; rudel (obby/... connection) ;(add-to-list 'load-path "SOMEDIR/rudel/") @@ -464,7 +452,14 @@ (winring-initialize) (global-set-key (kbd "C-x j") 'winring-jump-to-configuration) (global-set-key (kbd "C-x n") 'winring-new-configuration) -(global-set-key (kbd "C-x K") 'winring-delete-configuration) + +; ask before deleting winring configuration +(defun winring-ask-delete-configuration () + (interactive) + (if (y-or-n-p "Delete winring configuration? ") + (winring-delete-configuration))) + +(global-set-key (kbd "C-x K") 'winring-ask-delete-configuration) ;; etags (require 'etags-table) |