2011-12-05 15:36:23 +00:00
|
|
|
;; Setup load directory
|
|
|
|
(add-to-list 'load-path "~/.kuso.d/")
|
2013-02-11 15:58:56 +00:00
|
|
|
(add-to-list 'load-path "~/.kuso.d/ecb/")
|
2011-12-05 15:36:23 +00:00
|
|
|
|
|
|
|
;; auto complete ------------------------------------------------------------
|
|
|
|
(require 'auto-complete-config)
|
|
|
|
(add-to-list 'ac-dictionary-directories "~/.kuso.d/ac-dict")
|
|
|
|
(ac-config-default)
|
|
|
|
|
|
|
|
(global-auto-complete-mode t)
|
|
|
|
|
|
|
|
;; ssh configuration ---------------------------------------------------------
|
|
|
|
(setq tramp-default-method "ssh")
|
|
|
|
|
|
|
|
;; python configuration ------------------------------------------------------
|
|
|
|
(autoload 'python-mode "python-mode" "Python Mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
|
|
|
|
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
|
|
|
|
(require 'python-mode)
|
|
|
|
(define-key py-mode-map (kbd "\C-c @") 'uncomment-region)
|
|
|
|
|
2013-04-02 00:14:19 +01:00
|
|
|
;; python autocomplete
|
|
|
|
(require 'deferred)
|
|
|
|
(require 'epc)
|
|
|
|
(autoload 'jedi:setup "jedi" nil t)
|
|
|
|
(add-hook 'python-mode-hook 'jedi:setup)
|
|
|
|
(setq jedi:setup-keys t)
|
|
|
|
|
2011-12-05 15:36:23 +00:00
|
|
|
;; php-mode -------------------------------------------------------------------
|
|
|
|
(autoload 'php-mode "php-mode" "PHP editing mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode))
|
|
|
|
|
|
|
|
;; yasnippet configuration ----------------------------------------------------
|
|
|
|
(require 'yasnippet)
|
|
|
|
(yas/initialize)
|
|
|
|
(yas/load-directory "~/.kuso.d/snippets")
|
|
|
|
|
|
|
|
;; Setting up color them -------------------------------------------------------
|
|
|
|
(require 'color-theme)
|
|
|
|
(eval-after-load "color-theme"
|
|
|
|
'(progn
|
|
|
|
(color-theme-initialize)
|
|
|
|
(color-theme-arjen)
|
|
|
|
))
|
|
|
|
;; Setting up customization -----------------------------------------------------
|
|
|
|
(custom-set-variables
|
|
|
|
;; custom-set-variables was added by Custom.
|
|
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
|
|
;; Your init file should contain only one such instance.
|
|
|
|
;; If there is more than one, they won't work right.
|
|
|
|
'(c-plugin nil)
|
|
|
|
;'(color-theme-selection "Arjen" nil (color-theme_seldefcustom))
|
2012-08-11 15:44:35 +01:00
|
|
|
'(developer-email "--EMAIL--")
|
|
|
|
'(developer-name "--FULLNAME--")
|
|
|
|
'(kuso-workspace "--WORKSPACE--")
|
2011-12-05 15:36:23 +00:00
|
|
|
'(face-font-family-alternatives (quote (("courier" "Monospace" "fixed") ("courier" "CMU Typewriter Text" "fixed") ("Sans Serif" "helv" "helvetica" "arial" "fixed") ("helv" "helvetica" "arial" "fixed"))))
|
|
|
|
'(inhibit-startup-screen t)
|
|
|
|
'(rng-nxml-auto-validate-flag nil))
|
|
|
|
(custom-set-faces
|
|
|
|
;; custom-set-faces was added by Custom.
|
|
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
|
|
;; Your init file should contain only one such instance.
|
|
|
|
;; If there is more than one, they won't work right.
|
|
|
|
'(font-lock-comment-face ((t (:foreground "orange red"))))
|
|
|
|
'(font-lock-keyword-face ((t (:foreground "DeepSkyBlue1")))))
|
|
|
|
|
|
|
|
;; flymake ---------------------------------------------------------
|
|
|
|
(require 'flymake)
|
|
|
|
(add-hook 'find-file-hook 'flymake-find-file-hook)
|
|
|
|
|
|
|
|
(when (load "flymake" t)
|
|
|
|
(defun flymake-pyflakes-init ()
|
|
|
|
(let* ((temp-file (flymake-init-create-temp-buffer-copy
|
|
|
|
'flymake-create-temp-inplace))
|
|
|
|
(local-file (file-relative-name
|
|
|
|
temp-file
|
|
|
|
(file-name-directory buffer-file-name))))
|
2012-08-11 15:44:35 +01:00
|
|
|
(list "--ADDR--/pyemacs.sh" (list local-file))))
|
2011-12-05 15:36:23 +00:00
|
|
|
(add-to-list 'flymake-allowed-file-name-masks
|
|
|
|
'("\\.py$" flymake-pyflakes-init)))
|
|
|
|
|
|
|
|
(defun flymake-html-init ()
|
|
|
|
(let* ((temp-file (flymake-init-create-temp-buffer-copy
|
|
|
|
'flymake-create-temp-inplace))
|
|
|
|
(local-file (file-relative-name
|
|
|
|
temp-file
|
|
|
|
(file-name-directory buffer-file-name))))
|
|
|
|
(list "tidy" (list local-file))))
|
|
|
|
|
|
|
|
(add-to-list 'flymake-allowed-file-name-masks
|
|
|
|
'("\\.html$\\|\\.ctp" flymake-html-init))
|
|
|
|
|
|
|
|
(add-to-list 'flymake-err-line-patterns
|
|
|
|
'("line \\([0-9]+\\) column \\([0-9]+\\) - \\(Warning\\|Error\\): \\(.*\\)"
|
|
|
|
nil 1 2 4))
|
|
|
|
|
|
|
|
(defun flymake-css-init ()
|
|
|
|
(let* ((temp-file (flymake-init-create-temp-buffer-copy
|
|
|
|
'flymake-create-temp-inplace))
|
|
|
|
(local-file (file-relative-name
|
|
|
|
temp-file
|
|
|
|
(file-name-directory buffer-file-name))))
|
|
|
|
(list "cssparse" (list local-file))))
|
|
|
|
(add-to-list 'flymake-allowed-file-name-masks
|
|
|
|
'("\\.css$" flymake-css-init))
|
|
|
|
(add-to-list 'flymake-err-line-patterns
|
|
|
|
'("\\(.*\\) \\[\\([0-9]+\\):\\([0-9]+\\): \\(.*\\)\\]"
|
|
|
|
nil 2 3 1))
|
|
|
|
(add-hook 'css-mode-hook
|
|
|
|
(lambda () (flymake-mode t)))
|
|
|
|
|
|
|
|
;; flymake shortkeys
|
|
|
|
(global-set-key (kbd "\C-x a") 'flymake-display-err-menu-for-current-line)
|
|
|
|
(global-set-key (kbd "\C-x p") 'flymake-goto-next-error)
|
|
|
|
|
|
|
|
;; dabbrev configuration ----------------------------------------------------------
|
|
|
|
(require 'ac-dabbrev)
|
|
|
|
(setq ac-sources
|
|
|
|
(list ac-source-dabbrev
|
|
|
|
))
|
|
|
|
(global-set-key (kbd "<backtab>") 'dabbrev-expand)
|
|
|
|
|
|
|
|
|
|
|
|
;; C configuration ----------------------------------------------------------------
|
|
|
|
;; clang auto completion
|
|
|
|
(require 'auto-complete-clang)
|
|
|
|
(setq clang-completion-suppress-error 't)
|
|
|
|
|
|
|
|
(defun my-c-mode-common-hook()
|
|
|
|
(setq ac-auto-start nil)
|
|
|
|
(setq ac-expand-on-auto-complete nil)
|
|
|
|
(setq ac-quick-help-delay 0.3)
|
|
|
|
(define-key c-mode-base-map (kbd "M-3") 'ac-complete-clang)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Linux style for c programming ------------------------------------------------
|
|
|
|
(setq c-default-style '((java-mode . "java")
|
|
|
|
(awk-mode . "awk")
|
|
|
|
(other . "linux")))
|
|
|
|
|
|
|
|
;; KUSO configuration ------------------------------------------------------------
|
2012-08-11 15:44:35 +01:00
|
|
|
(load-file "--KUSOHOME--/src/kuso-ide.el")
|
2011-12-05 15:36:23 +00:00
|
|
|
(kuso-mode)
|
|
|
|
|
|
|
|
;; General configuration ---------------------------------------------------------
|
|
|
|
(autoload 'python-pylint "python-pylint")
|
|
|
|
(autoload 'pylint "python-pylint")
|
|
|
|
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(setq x-select-enable-clipboard t)
|
|
|
|
(column-number-mode t)
|
|
|
|
(global-linum-mode)
|
2012-08-11 15:44:35 +01:00
|
|
|
|
|
|
|
;; IDO config ----------------------------------------------------------------
|
|
|
|
(require 'ido)
|
|
|
|
(ido-mode t)
|
|
|
|
|
|
|
|
;; Workgroups ----------------------------------------------------------------
|
|
|
|
(require 'workgroups)
|
|
|
|
|
|
|
|
|
|
|
|
;; org-mode ------------------------------------------------------
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
|
|
|
|
(add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when(global-set-key "\C-cl" 'org-store-link)
|
|
|
|
(global-set-key "\C-ca" 'org-agenda)
|
|
|
|
(global-set-key "\C-cb" 'org-iswitchb)
|
2013-02-24 18:09:01 +00:00
|
|
|
|
2013-03-25 14:32:27 +00:00
|
|
|
;; HideShow --------------------
|
2013-02-24 18:09:01 +00:00
|
|
|
(load-library "hideshow")
|
|
|
|
(global-set-key (kbd "C-\-") 'hs-toggle-hiding)
|
|
|
|
(global-set-key (kbd "C-\\") 'toggle-selective-display)
|
|
|
|
|
|
|
|
(add-hook 'c-mode-common-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'java-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'lisp-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'perl-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'sh-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'python-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'lua-mode-hook 'hs-minor-mode)
|
|
|
|
(add-hook 'js-mode-hook 'hs-minor-mode)
|
2013-02-11 15:58:56 +00:00
|
|
|
|
|
|
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
|
|
|
|
|
|
|
;; Configuring ECB and CEDET
|
2013-03-25 14:32:27 +00:00
|
|
|
;;(load-file "~/.kuso.d/cedet/cedet-devel-load.el")
|
|
|
|
;;(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode t)
|
|
|
|
;;(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode t)
|
2013-02-11 15:58:56 +00:00
|
|
|
|
2013-03-25 14:32:27 +00:00
|
|
|
;;(global-ede-mode 1)
|
|
|
|
;;(semantic-load-enable-code-helpers)
|
|
|
|
;;(global-srecode-minor-mode 1)
|
2013-02-11 15:58:56 +00:00
|
|
|
|
2013-03-25 14:32:27 +00:00
|
|
|
;;(require 'ecb)
|
2013-02-24 20:54:33 +00:00
|
|
|
|
2013-03-25 14:32:27 +00:00
|
|
|
;; Lua-mode -------------------
|
2013-02-24 20:54:33 +00:00
|
|
|
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
|
|
|
|
(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
|
2013-03-05 17:43:36 +00:00
|
|
|
|
2013-03-25 14:32:27 +00:00
|
|
|
;; JS folding ----------------
|
2013-03-05 17:43:36 +00:00
|
|
|
(add-hook 'js-mode-hook
|
|
|
|
(lambda ()
|
|
|
|
;; Scan the file for nested code blocks
|
|
|
|
(imenu-add-menubar-index)
|
|
|
|
;; Activate the folding mode
|
|
|
|
(hs-minor-mode t)))
|