Skip to content

Instantly share code, notes, and snippets.

@nsuke
Last active December 27, 2015 20:09
Show Gist options
  • Save nsuke/7382999 to your computer and use it in GitHub Desktop.
Save nsuke/7382999 to your computer and use it in GitHub Desktop.
; cedet
(unless (featurep 'cedet)
(when (file-directory-p "~/.emacs.d/cedet")
(progn
(add-to-list 'load-path "~/.emacs.d/cedet")
(load-file "~/.emacs.d/cedet/cedet-devel-load.el"))))
(setq semantic-default-submodes
'(;; cache(?)
global-semanticdb-minor-mode
global-semantic-highlight-edits-mode
global-semantic-idle-local-symbol-highlight-mode
global-cedet-m3-minor-mode
;; code helpers
global-semantic-idle-scheduler-mode
global-semantic-idle-summary-mode
global-semantic-idle-completions-mode
;; eye candy
global-semantic-decoration-mode
global-semantic-highlight-func-mode
global-semantic-highlight-edits-mode
global-semantic-stickyfunc-mode
;; debugging semantic itself
global-semantic-show-parser-state-mode 1 ;; show the parsing state in the mode line
global-semantic-show-unmatched-syntax-mode 1
;; not sure
global-semantic-idle-local-symbol-highlight-mode
global-semantic-mru-bookmark-mode
))
(global-ede-mode 1)
(semantic-mode 1)
(require 'semantic/ia)
(require 'semantic/bovine/gcc)
(require 'semantic/db-javap)
(require 'semantic/sb)
;; (semantic-load-enable-gaudy-code-halpers)
(defvar android-sdk-root "/opt/android-sdk-linux")
(defvar java-home "/usr/lib/jvm/java-7-oracle")
(defvar android-platform-version "17")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(cedet-android-sdk-root (quote (android-sdk-root)))
'(cedet-java-classpath-extension
(quote
((concat java-home "jre/lib/rt.jar")
(concat android-sdk-root "/platforms/android-" android-platform-version "/android.jar")
(concat android-sdk-root "/platforms/android-" android-platform-version "/data/layout]lib.jar"))))
'(cedet-java-jdk-root (quote ("")))
'(quack-browse-url-browser-function (quote browse-url-mozilla))
'(quack-default-program "racket")
'(quack-fontify-style (quote emacs))
'(semanticdb-javap-classpath
(quote
((concat java-home "jre/lib/rt.jar")
(concat android-sdk-root "/platforms/android-" android-platform-version "/android.jar")
(concat android-sdk-root "/platforms/android-" android-platform-version "/data/layout]lib.jar"))))
'(send-mail-function (quote smtpmail-send-it)))
;; general settings
(let ((default-directory "~/.emacs.d/auto-complete/lib/"))
(normal-top-level-add-subdirs-to-load-path))
(add-to-list 'load-path "~/.emacs.d/auto-complete/")
(add-to-list 'load-path "~/.emacs.d/auto-install/")
(add-to-list 'load-path "~/.emacs.d/added/")
(setq inhibit-startup-echo-area-message t)
(setq inhibit-startup-message t)
(load-theme 'wombat t)
(set-face-attribute 'default nil :height 110)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; (defun toggle-fullscreen ()
;; "Toggle full screen on X11"
;; (interactive)
;; (when (eq window-system 'x)
;; (set-frame-parameter
;; nil 'fullscreen
;; (when (not (frame-parameter nil 'fullscreen)) 'fullboth))))
;; (global-set-key [f11] 'toggle-full-scre)
(global-set-key (kbd "<Scroll_Lock>") 'scroll-lock-mode)
(windmove-default-keybindings 'meta)
(global-set-key [(control h)] 'delete-backward-char)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default tab-stop-list (number-sequence 2 120 2))
(global-hl-line-mode t)
(setq search-highlight t
query-replace-highlight t)
(defun kill-region-or-backward-kill-word ()
(interactive)
(if (region-active-p)
(kill-region (point) (mark))
(backward-kill-word 1)))
(global-set-key (kbd "C-w") 'kill-region-or-backward-kill-word)
(defun kill-word-or-delete-horizontal-space (arg)
(interactive "p")
(let ((pos (point)))
(if (and (not (eobp))
(= (char-syntax (char-after pos)) 32)
(= (char-syntax (char-after (1+ pos))) 32))
(prog1 (delete-horizontal-space)
(unless (memq (char-after pos) '(?( ?) ?{ ?} ?[ ?]))
(insert " ")))
(kill-word arg))))
(global-set-key (kbd "M-d") 'kill-word-or-delete-horizontal-space)
(global-set-key (kbd "<f8>") 'ff-find-other-file)
;; mozc
(when (require 'mozc nil t)
(set-language-environment "Japanese")
(setq default-input-method "japanese-mozc"))
;; package
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
(defvar my-pkgs '(
;; anything
;; tabbar
;; misc
nav
auto-install
auto-complete
popup
;; lisp ?
rainbow-delimiters
geiser
ac-geiser
slime
ac-slime
quack
;; clojure
clojure-mode
clojure-test-mode
cider
lein
nrepl
ac-nrepl
;; scala
scala-mode2
sbt-mode
;; ensime
;; python
jedi
ein
;; android-mode
;; thrift
;; ninja-mode
;; monky
;; magit
))
(dolist (pkg my-pkgs)
(when (not (package-installed-p pkg))
(package-install pkg)))
;; auto-install
(require 'auto-install)
(setq auto-install-directory "~/.emacs.d/auto-install/")
(auto-install-update-emacswiki-package-name t)
(auto-install-compatibility-setup)
;; auto-complete
(require 'auto-complete-config)
(ac-config-default)
;; scheme
(require 'geiser)
(require 'quack)
;; scala
(require 'scala-mode2)
; (add-to-list 'load-path "/home/x/ensime/ensime/elisp/")
; (require 'ensime)
; (add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
(progn (setq android-ndk-root-path "/opt/android-ndk-r9c")
(setq android-sdk-root-path android-sdk-root))
(setq android-default-package "org.leit")
(when (require 'androidmk-mode nil t)
(add-hook 'androidmk-mode-hook
(lambda ()
(progn (local-set-key [M-f5] 'androidndk-build)
(local-set-key [M-S-f5] 'androidndk-rebuild)
(local-set-key [C-f5] 'androidsdk-build)
(local-set-key [C-S-f5] 'androidsdk-rebuild)
))))
;; ocaml
;(add-to-list 'load-path (concat
; (replace-regexp-in-string "\n$" ""
; (shell-command-to-string "opam config var share"))
; "/emacs/site-lisp"))
; (require 'ocp-indent)
;; slime
(setq inferior-lisp-program "/usr/bin/sbcl")
(require 'slime)
(slime-setup)
;; Python
; (require 'python-mode)
(setq-default py-indent-offset 2)
(require 'jedi)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:setup-keys t)
(setq jedi:complete-on-dot t)
(when (require 'monky nil t)
(setq monky-process-type 'cmdserver))
(require 'rainbow-delimiters)
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
(prefer-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-input-method nil)
(set-keyboard-coding-system 'utf-8)
(set-language-environment "UTF-8")
(set-selection-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(setq locale-coding-system 'utf-8)
(setq read-quoted-char-radix 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment