Commits

Roma Sokolov committed e896b4c

emcas fixes

  • Participants
  • Parent commits 2c44cbe

Comments (0)

Files changed (5)

File .emacs.d/init.el

 
 (add-hook 'after-save-hook 'autocompile)
 
-;; cedet hack
-(let ((cedet-dir (expand-file-name "cedet" el-get-dir)))
-  (add-to-list 'load-path (expand-file-name
-                           "common" cedet-dir))
-  (add-to-list 'load-path (expand-file-name
-                           "speedbar" cedet-dir))
-  (require 'inversion nil t))
-
 (load-init
  '(general elpackages frame funs
    bs eshell org custom tab modes keys))

File .emacs.d/load/custom_init.el

 (custom-set-variables
-  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
-  ;; Your init file should contain only one such instance.
- '(js2-basic-offset 4)
- '(js2-mode-indent-ignore-first-tab t)
- '(org-agenda-files (quote ("~/org/timesheet.org" "~/org/life.org")))
- '(safe-local-variable-values (quote ((test-case-name . openid\.test\.test_consumer) (encoding . utf-8) (prompt-to-byte-compile))) t))
+ ;; 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.
+ '(rainbow-delimiters-highlight-braces-p nil))
 (custom-set-faces
-  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
-  ;; Your init file should contain only one such instance.
- '(fixed-pitch ((t (:foreground "dark green"))))
- '(org-column ((t (:strike-through nil :underline nil :weight normal :height 120 :family "outline-unifont"))))
- '(rng-error-face ((t (:underline nil)))))
+ ;; 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.
+ '(highlight ((t (:background "cyan" :foreground "black"))))
+ '(rainbow-delimiters-depth-1-face ((t (:foreground "cyan"))))
+ '(rainbow-delimiters-depth-2-face ((t (:foreground "magenta"))))
+ '(rainbow-delimiters-depth-3-face ((t (:foreground "yellow"))))
+ '(rainbow-delimiters-depth-4-face ((t (:foreground "cyan"))))
+ '(rainbow-delimiters-depth-5-face ((t (:foreground "magenta"))))
+ '(rainbow-delimiters-depth-6-face ((t (:foreground "yellow"))))
+ '(rainbow-delimiters-depth-7-face ((t (:foreground "cyan"))))
+ '(rainbow-delimiters-depth-8-face ((t (:foreground "magenta"))))
+ '(rainbow-delimiters-depth-9-face ((t (:foreground "yellow"))))
+ '(rainbow-delimiters-unmatched-face ((t (:background "red" :foreground "white"))))
+ '(sp-wrap-overlay-face ((t (:inherit sp-pair-overlay-face))))
+ '(sp-wrap-tag-overlay-face ((t (:inherit sp-pair-overlay-face)))))

File .emacs.d/load/elpackages_init.el

+
 ;; list of el-get packages
 (el-get-add
  (:name package))
 
 (el-get-add
-(:name python-mode))
-
+ (:name python-mode))
 
 (el-get-add
  (:name kill-ring-search
-  :type http
-  :url "http://nschum.de/src/emacs/kill-ring-search/kill-ring-search.el"
-  :features kill-ring-search
-  :after (progn () (global-set-key (kbd "C-M-y") 'kill-ring-search))))
+        :type http
+        :url "http://nschum.de/src/emacs/kill-ring-search/kill-ring-search.el"
+        :features kill-ring-search
+        :after (progn () (global-set-key (kbd "C-M-y") 'kill-ring-search))))
 
 (el-get-add
  (:name piu
-  :type http
-  :url "http://paste.in.ua/piu.el"
-  :features piu
-  :after (progn () (global-set-key (kbd "C-x p") 'piu))))
+        :type http
+        :url "http://paste.in.ua/piu.el"
+        :features piu
+        :after (progn () (global-set-key (kbd "C-x p") 'piu))))
 
 (el-get-add
  (:name puc
-  :type http
-  :url "http://paste.undev.cc/puc.el"
-  :features puc))
+        :type http
+        :url "http://paste.undev.cc/puc.el"
+        :features puc))
 
 
 (el-get-add
  (:name tuareg-mode
-  :after (progn ()
-                (setq ocaml-compiler "ocamlfind ocamlc")
-                (defun ocaml-open-interface ()
-                  (interactive)
-                  (let* ((filename (file-name-nondirectory buffer-file-name))
-                         (basename (file-name-sans-extension filename)))
-                    (cond
-                     ((string-match ".*\\.ml\$" filename)
-                      (ty:util-open-file basename ".mli" "No Interface Found!"))
-                     ((string-match ".*\\.mli\$" filename)
-                      (ty:util-open-file basename ".ml" "No Implementation Found!"))
-                     )))
-                (global-set-key (kbd "C-c i") 'ocaml-open-interface)
-                (add-hook
-                 'tuareg-mode-hook
-                 (lambda () 'ocaml-set-compile-command)))))
+        :after (progn ()
+                      (setq ocaml-compiler "ocamlfind ocamlc")
+                      (defun ocaml-open-interface ()
+                        (interactive)
+                        (let* ((filename (file-name-nondirectory buffer-file-name))
+                               (basename (file-name-sans-extension filename)))
+                          (cond
+                           ((string-match ".*\\.ml\$" filename)
+                            (ty:util-open-file basename ".mli" "No Interface Found!"))
+                           ((string-match ".*\\.mli\$" filename)
+                            (ty:util-open-file basename ".ml" "No Implementation Found!"))
+                           )))
+                      (global-set-key (kbd "C-c i") 'ocaml-open-interface)
+                      (add-hook
+                       'tuareg-mode-hook
+                       (lambda () 'ocaml-set-compile-command)))))
 
 (el-get-add
  (:name lua-mode))
 
-(el-get-add
- (:name matlab-mode))
 
 (el-get-add
-  (:name utop
-   :type http
-   :url "https://raw.github.com/gist/1170388/af3c4f025b63976c27c3260c953d1aa6ab9d4d17/utop.el"
-   :features utop
-   :after (progn ()
-      (autoload 'utop "utop" "Toplevel for OCaml" t))))
+ (:name utop
+        :type http
+        :url "https://gist.github.com/little-arhat/1170388/raw/af3c4f025b63976c27c3260c953d1aa6ab9d4d17/utop.el"
+        :features utop
+        :after (progn ()
+                      (autoload 'utop "utop" "Toplevel for OCaml" t))))
 
 (el-get-add
  (:name q-mode))
 
 (el-get-add
  (:name filladapt
-  :after (progn () (autoload 'filladapt-mode "filladapt" nil t))))
+        :after (progn () (autoload 'filladapt-mode "filladapt" nil t))))
 
-(el-get-add
- (:name grep+
-  :features grep+))
-
-(el-get-add
- (:name pointback
-  :features pointback
-  :after (progn () (global-pointback-mode))))
 
 (el-get-add
  (:name fic-ext-mode
-  :features fic-ext-mode
-  :after (progn ()
-           (dolist (hook '(python-mode-hook
-                           emacs-lisp-mode-hook))
-             (add-hook hook 'fic-ext-mode)))))
-
-(el-get-add
- (:name highlight-parentheses
-  :after (progn () (autoload 'highlight-parentheses-mode "highlight-parentheses" nil t)
-           (dolist (hook '(python-mode-hook
-                           emacs-lisp-mode-hook))
-             (add-hook hook 'highlight-parentheses-mode)))))
+        :features fic-ext-mode
+        :after (progn ()
+                      (dolist (hook '(python-mode-hook
+                                      emacs-lisp-mode-hook))
+                        (add-hook hook 'fic-ext-mode)))))
 
 (el-get-add
  (:name project-root
 
 (el-get-add
  (:name sudo-save
-  :type emacswiki
-  :features sudo-save))
+        :type emacswiki
+        :features sudo-save))
 
 (el-get-add
  (:name sql
-  :type emacswiki
-  :after (progn ()
-           (defalias 'sql-get-login 'ignore)
-           (autoload 'sql-mode "sql" "Major Mode For Editing Sql Files" t)
-           (autoload 'plsql-mode "plsql" "Major Mode For Editing PL/Sql Files" t))))
+        :type emacswiki
+        :after (progn ()
+                      (defalias 'sql-get-login 'ignore)
+                      (autoload 'sql-mode "sql" "Major Mode For Editing Sql Files" t)
+                      (autoload 'plsql-mode "plsql" "Major Mode For Editing PL/Sql Files" t))))
 
 
 (el-get-add
 
 (el-get-add
  (:name ruby-suite
-  :type git
-  :url "git://github.com/little-arhat/ruby-suite.git"
-  :features (ruby-mode inf-ruby)
-  :after (progn ()
-           (autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby process" t)
-           (autoload 'inf-ruby-keys "inf-ruby" "" t)
-           (eval-after-load 'ruby-mode '(add-hook 'ruby-mode-hook 'inf-ruby-keys)))))
+        :type git
+        :url "git://github.com/little-arhat/ruby-suite.git"
+        :features (ruby-mode inf-ruby)
+        :after (progn ()
+                      (autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby process" t)
+                      (autoload 'inf-ruby-keys "inf-ruby" "" t)
+                      (eval-after-load 'ruby-mode '(add-hook 'ruby-mode-hook 'inf-ruby-keys)))))
 
 (el-get-add
  (:name ruby-end
-  :after (progn ()
-           (setq ruby-end-check-statement-modifiers t))))
-
-(el-get-add
- (:name enclose
-  :features (enclose)
-  :after (progn ()
-           (enclose-global-mode t))))
+        :after (progn ()
+                      (setq ruby-end-check-statement-modifiers t))))
 
 (el-get-add
  (:name org-mode))
  (:name clojure-mode))
 
 (el-get-add
- (:name nrepl))
+ (:name cider
+  :after (progn ()
+                (add-hook 'cider-mode-hook 'cider-turn-on-eldoc-mode)
+                (setq nrepl-hide-special-buffers t)
+                (add-hook 'cider-repl-mode-hook 'smartparens-strict-mode)
+                (add-hook 'cider-repl-mode-hook 'rainbow-delimiters-mode)
+                )))
 
 (el-get-add
- (:name paredit
+ (:name smartparens
   :after (progn ()
-                (add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
-                (add-hook 'lisp-interaction-mode-hook 'enable-paredit-mode)
-                (add-hook 'lisp-mode-hook 'enable-paredit-mode)
-                (add-hook 'clojure-mode-hook 'enable-paredit-mode)
-                (add-hook 'nrepl-mode-hook 'enable-paredit-mode)
-                (add-hook 'ielm-mode-hook 'enable-paredit-mode)
-                (define-key paredit-mode-map (kbd "M-q") 'paredit-reindent-defun)
-                (define-key paredit-mode-map (kbd "RET") 'paredit-newline)
-                (define-key paredit-mode-map (kbd "M-c") 'pr-copy-parenthesis))))
+                (smartparens-global-mode t)
+                (require 'smartparens-config)
+                (show-smartparens-global-mode t)
+                (show-paren-mode nil)
+                (add-hook 'lisp-mode-hook 'smartparens-strict-mode)
+                (add-hook 'clojure-mode-hook 'smartparens-strict-mode)
+
+                (define-key sp-keymap (kbd "C-M-f") 'sp-forward-sexp)
+                (define-key sp-keymap (kbd "C-M-b") 'sp-backward-sexp)
+                (define-key sp-keymap (kbd "C-M-d") 'sp-down-sexp)
+                (define-key sp-keymap (kbd "C-M-e") 'sp-up-sexp)
+                (define-key sp-keymap (kbd "C-S-a") 'sp-beginning-of-sexp)
+                (define-key sp-keymap (kbd "C-S-d") 'sp-end-of-sexp)
+                (define-key sp-keymap (kbd "C-M-n") 'sp-next-sexp)
+                (define-key sp-keymap (kbd "C-M-p") 'sp-previous-sexp)
+
+                (define-key sp-keymap (kbd "C-c (") 'sp-add-to-next-sexp)
+                (define-key sp-keymap (kbd "C-c )") 'sp-add-to-previous-sexp)
+
+                (define-key sp-keymap (kbd "C-M-k") 'sp-kill-sexp)
+                (define-key sp-keymap (kbd "C-M-w") 'sp-copy-sexp)
+
+                (define-key sp-keymap (kbd "M-<delete>") 'sp-unwrap-sexp)
+                (define-key sp-keymap (kbd "M-<backspace>") 'sp-backward-unwrap-sexp)
+
+                (define-key sp-keymap (kbd "M-s") 'sp-splice-sexp)
+                (define-key sp-keymap (kbd "M-c") 'sp-copy-sexp)
+
+                (sp-pair "(" ")" :wrap "M-(")
+                (sp-pair "\"" "\"" :wrap "M-\""))))
+
+(el-get-add
+ (:name rainbow-delimiters
+  :after (progn ()
+                (global-rainbow-delimiters-mode t))))
 
 (el-get-add
  (:name slime))
 
+(el-get-add
+ (:name ido-hacks
+  :after (progn ()
+                (ido-hacks-mode t))))
+
+(el-get-add
+ (:name ace-jump-mode
+  :after (progn ()
+                (require 'ace-jump-mode)
+                (define-key global-map (kbd "C-c SPC") 'ace-jump-mode))))
+
 (setq el-get-sources (reverse el-get-sources))
 
-(el-get) ;; 'wait (mapcar 'el-get-source-name el-get-sources))
+(el-get 'sync (mapcar 'el-get-source-name el-get-sources))

File .emacs.d/load/keys_init.el

 (global-set-key (kbd "M-0") 'delete-window)
 
 ;; buffers
-(global-set-key (kbd "<up>") (fun-for-bind other-window -1))
-(global-set-key (kbd "<down>") 'other-window)
-
-(global-set-key (kbd "<left>") 'pc-bufsw::lru)
-(global-set-key (kbd "<right>") 'pc-bufsw::previous)
+(global-set-key (kbd "<up>")     'windmove-up)
+(global-set-key (kbd "<down>")   'windmove-down)
+(global-set-key (kbd "<left>")   'windmove-left)
+(global-set-key (kbd "<right>")  'windmove-right)
 
 (global-set-key (kbd "C-q C-q") 'rotate-windows)
 

File .emacs.d/load/modes_init.el

         '("\\.nu\\'" . lisp-mode)
         '("\\.podsl\\'" . lisp-mode)
         '("\\.m\\'" . objc-mode)
+        '("\\.mm\\'" . objc-mode)
         )
         auto-mode-alist))
 
          ;; to catch .m.bak , m.in etc
          (aux-name (file-name-sans-extension filename))
          (basename (file-name-sans-extension aux-name)))
-    (cond ((or (string-match ".*\\.m\$" filename) (string-match ".*\\.m\$" aux-name))
+    (cond ((or (string-match ".*\\.m\$" filename)
+               (string-match ".*\\.m\$" aux-name)
+               (string-match ".*\\.mm\$" filename)
+               (string-match ".*\\.mm\$" aux-name)
+               (string-match ".*\\.cpp\$" filename)
+               (string-match ".*\\.cpp\$" aux-name)
+               (string-match ".*\\.c\$" filename)
+               (string-match ".*\\.c\$" aux-name)
+               )
           (when (not (ty:project-root-open-file basename ".h"))
             (message "Can not open header")))
           ((string-match ".*\\.h$" filename)
            (when (not (ty:project-root-open-file basename ".m"))
              (when (not (ty:project-root-open-file basename ".c"))
-               (message "Can not open implementation")))))))
+               (when (not (ty:project-root-open-file basename ".cpp"))
+                 (message "Can not open implementation"))))))))
 
 (add-hook 'objc-mode-hook
           (lambda ()
             (c-set-offset 'substatement-open 0)
 ))
 
+(add-hook 'cpp-mode-hook
+          (lambda ()
+            (global-set-key (kbd "C-c i") 'c-open-header)
+            (global-set-key (kbd "C-c C-o") 'comment-region)
+            (global-set-key (kbd "C-c C-y") 'uncomment-region)
+            (setq comment-start "/*")
+            (setq comment-end "*/")
+            (subword-mode)
+            (setq tab-width 8)
+            (setq c-basic-offset 8)
+            (c-set-offset 'substatement-open 0)
+))
+
 
 ;; lisp
 
     (goto-char (+ end 1))
     (insert "\"")))
 
-;; paredit
+;; ;; paredit
 
-(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
-(add-hook 'lisp-interaction-mode-hook 'enable-paredit-mode)
-(add-hook 'lisp-mode-hook 'enable-paredit-mode)
-(add-hook 'ielm-mode-hook 'enable-paredit-mode)
-(add-hook 'clojure-mode-hook 'enable-paredit-mode)
-(add-hook 'slime-repl-mode-hook 'enable-paredit-mode)
+;; (add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
+;; (add-hook 'lisp-interaction-mode-hook 'enable-paredit-mode)
+;; (add-hook 'lisp-mode-hook 'enable-paredit-mode)
+;; (add-hook 'ielm-mode-hook 'enable-paredit-mode)
+;; (add-hook 'clojure-mode-hook 'enable-paredit-mode)
+;; (add-hook 'slime-repl-mode-hook 'enable-paredit-mode)