Skip to content

Instantly share code, notes, and snippets.

@panfu
Created July 11, 2010 12:34
Show Gist options
  • Save panfu/471517 to your computer and use it in GitHub Desktop.
Save panfu/471517 to your computer and use it in GitHub Desktop.
我的emacs配置简略
(global-set-key "\C-c\C-d" "\C-a\C- \C-n\M-w\C-y")
;; (menu-bar-mode 0)
(tool-bar-mode 0)
(define-key global-map [menu-bar tools] nil)
(add-to-list 'load-path "~/emacs")
(require 'my_config)
;; (setq mac-option-modifier 'meta)
(setq tetris-score-file "~/.emacs.d/tetris-scores")
(setq snake-score-file "~/.emacs.d/snake-scores")
;; (global-set-key (kbd "<M-return>") 'other-window)
;; Use control-arrow keys for window resizing
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
(global-set-key (kbd "<C-left>") 'shrink-window-horizontally)
;;
;; YASnippet
;;
(add-to-list 'load-path "~/.emacs.d/plugins")
(require 'yasnippet-bundle)
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/snippets")
;; ido
(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t) ;; enable fuzzy matching
;; rinari
(add-to-list 'load-path "~/.emacs.d/plugins/inf-ruby-2.1")
(add-to-list 'load-path "~/.emacs.d/plugins/inflections-1.0")
(add-to-list 'load-path "~/.emacs.d/plugins/jump-2.0")
(add-to-list 'load-path "~/.emacs.d/plugins/gist-0.4")
(add-to-list 'load-path "~/.emacs.d/plugins/findr-0.7")
(add-to-list 'load-path "~/.emacs.d/plugins/paredit-20")
(add-to-list 'load-path "~/.emacs.d/plugins/magit-0.8.1")
(add-to-list 'load-path "~/.emacs.d/plugins/ruby-compilation-0.7")
(add-to-list 'load-path "~/.emacs.d/plugins/ruby-mode-1.1")
(add-to-list 'load-path "~/.emacs.d/plugins/rinari-2.1")
(require 'rinari)
(require 'magit)
;;
;; Standard Emacs settings
;;
;; Set my email address.
(setq user-mail-address "[email protected]")
;; Set the shell emacs uses.
(setq explicit-shell-file-name "/bin/bash")
;; Use column and line numbering.
(line-number-mode 1)
(column-number-mode 1)
;; Display time in the minibuffer
(display-time)
;; color-theme
(require 'color-theme)
(color-theme-initialize)
(load-file "~/.emacs.d/themes/color-theme-railscasts.el")
(color-theme-railscasts)
;; Behave like vi's o command
(defun open-next-line (arg)
"Move to the next line and then opens a line.
See also `newline-and-indent'."
(interactive "p")
(end-of-line)
(open-line arg)
(next-line 1)
(when newline-and-indent
(indent-according-to-mode)))
(global-set-key (kbd "<A-return>") 'open-next-line)
;; Behave like vi's O command
(defun open-previous-line (arg)
"Open a new line before the current one.
See also `newline-and-indent'."
(interactive "p")
(beginning-of-line)
(open-line arg)
(when newline-and-indent
(indent-according-to-mode)))
(global-set-key (kbd "<A-M-return>") 'open-previous-line)
;; Autoindent open-*-lines
(defvar newline-and-indent t
"Modify the behavior of the open-*-line functions to cause them to autoindent.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment