您的位置:首页 > 服装鞋帽 > 饰品 > emacs

emacs

luyued 发布于 2011-04-08 18:02   浏览 N 次  
(mapcar(lambda (x)(add-to-list'load-path(expand-file-namex)))        '("~/.emacs.d"          "~/.emacs.d/clojure-mode"          "~/.emacs.d/slime"          "~/.emacs.d/swank-clojure-extra"          "~/.emacs.d/haskell-mode"))
(defunrequire-all(packages) (mapcar#'requirepackages))
(require-all'( mwe-log-commands uniquify light-symbol linum color-theme gentooish ido parenface point-undo bar-cursor browse-kill-ring smart-tab clojure-test-mode undo-tree ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Haskell
(load "~/.emacs.d/haskell-mode/haskell-site-file")(add-hook'haskell-mode-hook'turn-on-haskell-doc-mode)(add-hook'haskell-mode-hook'turn-on-haskell-indentation);;(add-hook 'haskell-mode-hook (lambda () (smart-tab-mode nil)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GLOBAL(color-theme-initialize)
(if (string=window-system"w32") (set-default-font"-outline-Consolas-normal-r-normal-normal-14-97-96-96-c-*-iso859-1") (set-default-font"Consolas-12"t))
(if window-system (color-theme-gentooish) (color-theme-dark-laptop))
;; from http://joost.zeekat.nl/2010/06/03/slime-hints-3-interactive-completions-and-smart-tabs/
(setqhippie-expand-try-functions-list (append hippie-expand-try-functions-list'(slime-complete-symbol)))(setqsmart-tab-completion-functions-alist '((emacs-lisp-mode.lisp-complete-symbol) (text-mode.dabbrev-completion) (slime-repl-mode.slime-complete-symbol)))
(global-undo-tree-mode1)(global-smart-tab-mode1)(global-set-key"\C-R"'undo-tree-redo)(add-hook'undo-mode-visualizer-mode (define-keyundo-tree-visualizer-map (kbd"") 'undo-tree-visualizer-quit))

(browse-kill-ring-default-keybindings)(setqauto-save-list-file-prefixnil)(fset'yes-or-no-p'y-or-n-p)
(defunmy-backward-kill-word() "Kill words backward my way." (interactive) (if (bolp) (backward-delete-char1) (if (string-match"^\\s-+$"(buffer-substring(point-at-bol)(point))) (kill-region(point-at-bol)(point)) (backward-kill-word1))))
(global-set-key"\M-\d"'my-backward-kill-word)
;; From http://stackoverflow.com/questions/848936/how-to-preserve-clipboard-content-in-emacs-on-windows(defadvicekill-new(beforekill-new-push-xselection-on-kill-ringactivate) "Before putting new kill onto the kill-ring, add the clipboard/external selection to the kill ring" (let ((have-paste(and interprogram-paste-function (funcallinterprogram-paste-function)))) (whenhave-paste(pushhave-pastekill-ring))))

(global-hi-lock-mode1)(global-set-key"\C-o"'point-undo);;(global-set-key "\C-i" 'point-redo)
;; from http://stackoverflow.com/questions/589691/how-can-i-emulate-vims-search-in-gnu-emacs
(defunmy-isearch-word-at-point() (interactive) (call-interactively'isearch-forward-regexp))
(defunmy-isearch-yank-word-hook() (when(equalthis-command'my-isearch-word-at-point) (let ((string (concat"\\<" (buffer-substring-no-properties (progn(skip-syntax-backward"w_")(point)) (progn(skip-syntax-forward"w_")(point))) "\\>"))) (if (and isearch-case-fold-search (eq'not-yankssearch-upper-case)) (setqstring(downcasestring))) (setqisearch-stringstring isearch-message (concatisearch-message (mapconcat'isearch-text-char-description string"")) isearch-yank-flagt) (isearch-search-and-update))))
(add-hook'isearch-mode-hook'my-isearch-yank-word-hook)(global-set-key[M-kp-multiply]'my-isearch-word-at-point)

(bar-cursor-mode1)
;; Try to fix copy/paste(setq-defaultmode-line-buffer-identification'(#("%2b"02(facemode-line-buffer-id))))(setqtransient-mark-modet)(setqmouse-drag-copy-regionnil)(setqx-select-enable-primarynil)(setqx-select-enable-clipboardt)(setqselect-active-regionst)(global-set-key[mouse-2]'mouse-yank-primary)(cua-modet)
(delete-selection-modet)(tool-bar-mode0)(global-linum-mode)(setqlinum-format"%3d ")(setq-defaultindent-tabs-modenil)(setqindent-tabs-modenil)(winner-modet)
(tooltip-modenil)(setqline-number-modenil)(setqcolumn-number-modenil)(setqsize-indication-modenil)(setqmode-line-positionnil)(ido-mode1)
(global-set-key"\C-m"'reindent-then-newline-and-indent);No tabs(global-set-key"\C-a"'beginning-of-line-text)
(setqwindow-min-height2)(defunmaximize-window() (interactive) (let* ((other-windows(cdr (window-list))) (other-heights(* (length other-windows)window-min-height)) (my-height(- (frame-height)other-heights))) (setf(window-height)(- my-height1))))
(add-hook'term-setup-hook(lambda ()(<
图文资讯
广告赞助商