Help! I'm trapped in emacs!
This commit is contained in:
parent
3e8d7d1266
commit
1da1ff4583
26 changed files with 306 additions and 405 deletions
|
@ -5,7 +5,7 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq evil-want-visual-char-semi-exclusive t
|
(setq evil-want-visual-char-semi-exclusive t
|
||||||
evil-search-module 'isearch
|
evil-search-module 'evil-search
|
||||||
evil-search-wrap nil
|
evil-search-wrap nil
|
||||||
evil-magic 'magic
|
evil-magic 'magic
|
||||||
evil-want-C-u-scroll t ; enable C-u for scrolling
|
evil-want-C-u-scroll t ; enable C-u for scrolling
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
;; Always ensure evil-shift-width is consistent with tab-width
|
;; Always ensure evil-shift-width is consistent with tab-width
|
||||||
(add-hook! 'after-change-major-mode-hook (setq evil-shift-width tab-width))
|
(add-hook! 'after-change-major-mode-hook (setq evil-shift-width tab-width))
|
||||||
|
(add-hook 'prog-mode-hook 'hs-minor-mode)
|
||||||
|
|
||||||
;; highlight matching delimiters where it's important
|
;; highlight matching delimiters where it's important
|
||||||
(defun show-paren-mode-off () (show-paren-mode -1))
|
(defun show-paren-mode-off () (show-paren-mode -1))
|
||||||
|
@ -51,19 +52,10 @@
|
||||||
(use-package evil-numbers)
|
(use-package evil-numbers)
|
||||||
(use-package evil-matchit :config (global-evil-matchit-mode 1))
|
(use-package evil-matchit :config (global-evil-matchit-mode 1))
|
||||||
(use-package evil-surround :config (global-evil-surround-mode 1))
|
(use-package evil-surround :config (global-evil-surround-mode 1))
|
||||||
(use-package evil-visualstar :config (global-evil-visualstar-mode 1))
|
(use-package evil-commentary :config (evil-commentary-mode 1))
|
||||||
|
(use-package evil-search-highlight-persist
|
||||||
(use-package evil-commentary
|
:config
|
||||||
:config (evil-commentary-mode 1))
|
(global-evil-search-highlight-persist t))
|
||||||
|
|
||||||
;; (use-package evil-nerd-commenter
|
|
||||||
;; :commands (evilnc-comment-operator
|
|
||||||
;; evilnc-comment-or-uncomment-lines
|
|
||||||
;; evilnc-toggle-invert-comment-line-by-line
|
|
||||||
;; evilnc-comment-or-uncomment-paragraphs
|
|
||||||
;; evilnc-quick-comment-or-uncomment-to-the-line
|
|
||||||
;; evilnc-copy-and-comment-lines)
|
|
||||||
;; :init (setq evilnc-hotkey-comment-operator "gc"))
|
|
||||||
|
|
||||||
(use-package evil-jumper
|
(use-package evil-jumper
|
||||||
:init (setq evil-jumper-file (expand-file-name "jumplist" my-tmp-dir))
|
:init (setq evil-jumper-file (expand-file-name "jumplist" my-tmp-dir))
|
||||||
|
@ -79,17 +71,23 @@
|
||||||
(when evil-exchange--overlays
|
(when evil-exchange--overlays
|
||||||
(evil-exchange-cancel))))
|
(evil-exchange-cancel))))
|
||||||
|
|
||||||
(use-package evil-search-highlight-persist
|
(use-package evil-visualstar
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(global-evil-search-highlight-persist t)
|
;; I cut this down because the original visualstar wouldn't remember
|
||||||
(set-face-attribute 'evil-search-highlight-persist-highlight-face nil :inherit 'evil-ex-lazy-highlight)))
|
;; the last search if evil-search-module was 'evil-search.
|
||||||
|
(defun evil-visualstar/begin-search (beg end direction)
|
||||||
|
(when (evil-visual-state-p)
|
||||||
|
(evil-exit-visual-state)
|
||||||
|
(let ((selection (regexp-quote (buffer-substring-no-properties beg end))))
|
||||||
|
(setq isearch-forward direction)
|
||||||
|
(evil-search selection direction t))))
|
||||||
|
(global-evil-visualstar-mode 1)))
|
||||||
|
|
||||||
(use-package evil-snipe
|
(use-package evil-snipe
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(global-evil-snipe-mode +1)
|
(global-evil-snipe-mode +1)
|
||||||
|
|
||||||
(setq evil-snipe-smart-case t)
|
(setq evil-snipe-smart-case t)
|
||||||
(setq evil-snipe-override-evil t)
|
(setq evil-snipe-override-evil t)
|
||||||
(setq evil-snipe-scope 'line)
|
(setq evil-snipe-scope 'line)
|
||||||
|
@ -117,25 +115,20 @@
|
||||||
(progn ; evil hacks
|
(progn ; evil hacks
|
||||||
(defadvice evil-force-normal-state (before evil-esc-quit activate)
|
(defadvice evil-force-normal-state (before evil-esc-quit activate)
|
||||||
(shut-up (evil-search-highlight-persist-remove-all) ; turn off highlights
|
(shut-up (evil-search-highlight-persist-remove-all) ; turn off highlights
|
||||||
|
(evil-ex-nohighlight)
|
||||||
;; Exit minibuffer is alive
|
;; Exit minibuffer is alive
|
||||||
(if (minibuffer-window-active-p (minibuffer-window))
|
(if (minibuffer-window-active-p (minibuffer-window))
|
||||||
(my--minibuffer-quit))))
|
(my--minibuffer-quit))))
|
||||||
|
|
||||||
;; Popwin: close popup window, if any
|
;; Popwin: close popup window, if any
|
||||||
(after "popwin"
|
|
||||||
(defadvice evil-force-normal-state (before evil-esc-quit-popwin activate)
|
(defadvice evil-force-normal-state (before evil-esc-quit-popwin activate)
|
||||||
(shut-up (popwin:close-popup-window))))
|
(shut-up (popwin:close-popup-window)))
|
||||||
|
|
||||||
;; Jump to new splits
|
;; Jump to new splits
|
||||||
(defadvice evil-window-split (after evil-window-split-jump activate)
|
(defadvice evil-window-split (after evil-window-split-jump activate)
|
||||||
(evil-window-down 1))
|
(evil-window-down 1))
|
||||||
(defadvice evil-window-vsplit (after evil-window-vsplit-jump activate)
|
(defadvice evil-window-vsplit (after evil-window-vsplit-jump activate)
|
||||||
(evil-window-right 1))
|
(evil-window-right 1)))
|
||||||
|
|
||||||
(defadvice undo-tree-load-history-hook (around undo-tree-load-history-shut-up activate)
|
|
||||||
(shut-up ad-do-it))
|
|
||||||
(defadvice undo-tree-save-history-hook (around undo-tree-save-history-shut-up activate)
|
|
||||||
(shut-up ad-do-it)))
|
|
||||||
|
|
||||||
(progn ; extensions
|
(progn ; extensions
|
||||||
(defun evil-visual-line-state-p ()
|
(defun evil-visual-line-state-p ()
|
||||||
|
@ -195,7 +188,7 @@
|
||||||
(evil-define-command my:kill-buffers (&optional bang)
|
(evil-define-command my:kill-buffers (&optional bang)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!>")
|
(interactive "<!>")
|
||||||
(if (and bang (projectile-project-p))
|
(if (and (not bang) (projectile-project-p))
|
||||||
(projectile-kill-buffers)
|
(projectile-kill-buffers)
|
||||||
(mapc 'kill-buffer (buffer-list)))
|
(mapc 'kill-buffer (buffer-list)))
|
||||||
(delete-other-windows))
|
(delete-other-windows))
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
;; Send current file to OSX apps
|
;; Send current file to OSX apps
|
||||||
(defun my-open-with (&optional app-name path)
|
(defun my-open-with (&optional app-name path)
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((app-name (if app-name (concat "-p " app-name)))
|
(let ((app-name (if app-name (concat "-a " app-name)))
|
||||||
(path (or path (if (eq major-mode 'dired-mode) (dired-get-file-for-visit) (buffer-file-name)))))
|
(path (or path (if (eq major-mode 'dired-mode) (dired-get-file-for-visit) (buffer-file-name)))))
|
||||||
|
(message "Trying: %s" (concat "open " app-name " " (shell-quote-argument path)))
|
||||||
(shell-command (concat "open " app-name " " (shell-quote-argument path)))))
|
(shell-command (concat "open " app-name " " (shell-quote-argument path)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
(setq-default visible-bell nil) ; silence of the bells
|
(setq-default visible-bell nil) ; silence of the bells
|
||||||
(setq-default use-dialog-box nil) ; avoid GUI
|
(setq-default use-dialog-box nil) ; avoid GUI
|
||||||
(setq-default redisplay-dont-pause t)
|
(setq-default redisplay-dont-pause t)
|
||||||
(setq window-combination-resize t)
|
;; (setq window-combination-resize nil)
|
||||||
|
|
||||||
;; do not soft-wrap lines
|
;; do not soft-wrap lines
|
||||||
(setq-default truncate-lines t)
|
(setq-default truncate-lines t)
|
||||||
|
@ -73,7 +73,9 @@
|
||||||
" wg"
|
" wg"
|
||||||
" ~"
|
" ~"
|
||||||
" s-/"
|
" s-/"
|
||||||
" yas"
|
;; " yas"
|
||||||
|
" emr"
|
||||||
|
" Refactor"
|
||||||
) "\\|"))
|
) "\\|"))
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
|
|
40
core/core.el
40
core/core.el
|
@ -102,7 +102,7 @@
|
||||||
(keyboard-translate ?\C-i ?\H-i)
|
(keyboard-translate ?\C-i ?\H-i)
|
||||||
|
|
||||||
;; Save clipboard contents into kill-ring before replace them
|
;; Save clipboard contents into kill-ring before replace them
|
||||||
(setq save-interprogram-paste-before-kill t)
|
(setq save-interprogram-paste-before-kill nil)
|
||||||
|
|
||||||
;; don't let the cursor go into minibuffer prompt
|
;; don't let the cursor go into minibuffer prompt
|
||||||
;; Tip taken from Xah Lee: http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html
|
;; Tip taken from Xah Lee: http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html
|
||||||
|
@ -132,7 +132,12 @@
|
||||||
;; Save history across sessions
|
;; Save history across sessions
|
||||||
(require 'savehist)
|
(require 'savehist)
|
||||||
(setq savehist-file (concat my-tmp-dir "savehist") ; keep the home clean
|
(setq savehist-file (concat my-tmp-dir "savehist") ; keep the home clean
|
||||||
savehist-additional-variables '(kill-ring mark-ring global-mark-ring search-ring regexp-search-ring extended-command-history)
|
savehist-additional-variables '(kill-ring
|
||||||
|
mark-ring
|
||||||
|
global-mark-ring
|
||||||
|
search-ring
|
||||||
|
regexp-search-ring
|
||||||
|
extended-command-history)
|
||||||
history-length 1000)
|
history-length 1000)
|
||||||
(savehist-mode 1)
|
(savehist-mode 1)
|
||||||
|
|
||||||
|
@ -162,7 +167,6 @@
|
||||||
(setq-default tab-width 4)
|
(setq-default tab-width 4)
|
||||||
|
|
||||||
(setq require-final-newline t)
|
(setq require-final-newline t)
|
||||||
|
|
||||||
(setq delete-trailing-lines nil)
|
(setq delete-trailing-lines nil)
|
||||||
(add-hook 'makefile-mode-hook 'indent-tabs-mode) ; Use normal tabs in makefiles
|
(add-hook 'makefile-mode-hook 'indent-tabs-mode) ; Use normal tabs in makefiles
|
||||||
|
|
||||||
|
@ -184,9 +188,10 @@ determine if a directory is a project."
|
||||||
(throw 'found path)))))) default-directory)
|
(throw 'found path)))))) default-directory)
|
||||||
default-directory))
|
default-directory))
|
||||||
|
|
||||||
(defun project-has-files (&rest files)
|
(defun project-has-files (files &optional root)
|
||||||
"Return non-nil if `file' exists in the project root."
|
"Return non-nil if `file' exists in the project root."
|
||||||
(let ((root (project-root))
|
(let ((root (or root (project-root)))
|
||||||
|
(files (if (listp files) files (list files)))
|
||||||
found-p file)
|
found-p file)
|
||||||
(while (and files (not found-p))
|
(while (and files (not found-p))
|
||||||
(setq file (pop files))
|
(setq file (pop files))
|
||||||
|
@ -228,11 +233,15 @@ the checking happens for all pairs in auto-minor-mode-alist"
|
||||||
(let* ((scratch-buffer (get-buffer-create "*scratch*"))
|
(let* ((scratch-buffer (get-buffer-create "*scratch*"))
|
||||||
(project-name (project-name))
|
(project-name (project-name))
|
||||||
(root (project-root)))
|
(root (project-root)))
|
||||||
|
(mapc (lambda (b)
|
||||||
|
(if (string-match-p "\\*scratch\\* (.+)" (buffer-name b))
|
||||||
|
(kill-buffer b)))
|
||||||
|
(buffer-list))
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
(switch-to-buffer scratch-buffer)
|
(switch-to-buffer scratch-buffer)
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(cd root)
|
(cd root)
|
||||||
(insert ";; Project: " project-name "\n\n"))))
|
(rename-buffer (format "*scratch* (%s)" project-name)))))
|
||||||
(add-hook 'find-file-hook 'project-create-scratch-buffer)
|
(add-hook 'find-file-hook 'project-create-scratch-buffer)
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,7 +264,26 @@ the checking happens for all pairs in auto-minor-mode-alist"
|
||||||
(progn ; popwin config
|
(progn ; popwin config
|
||||||
(popwin-mode 1)
|
(popwin-mode 1)
|
||||||
(setq popwin:popup-window-height 0.45)
|
(setq popwin:popup-window-height 0.45)
|
||||||
|
;; (setq display-buffer-function 'popwin:display-buffer)
|
||||||
|
|
||||||
|
(push '("\\`\\*helm.*?\\*\\'" :regexp t :position bottom :height 15) popwin:special-display-config)
|
||||||
|
|
||||||
|
(push '("^\\*Flycheck.*\\*$" :regexp t :position bottom :height 0.25 :noselect t) popwin:special-display-config)
|
||||||
|
(push '(inf-enh-ruby-mode :position bottom :stick t) popwin:special-display-config)
|
||||||
|
(push '(snippet-mode :position bottom :stick t) popwin:special-display-config)
|
||||||
|
|
||||||
|
(push '("*ansi-term*" :position bottom :height 0.45 :stick t) popwin:special-display-config)
|
||||||
|
(push '("*terminal*" :position bottom :height 0.45 :stick t) popwin:special-display-config)
|
||||||
|
(push '("*Async Shell Command*" :position bottom) popwin:special-display-config)
|
||||||
|
|
||||||
|
(push '("* Regexp Explain *" :position top :height 0.35) popwin:special-display-config)
|
||||||
|
|
||||||
|
(push '("*anaconda-doc*" :position bottom :height 15 :noselect t) popwin:special-display-config)
|
||||||
|
(push '("*anaconda-nav*" :position bottom :height 15 :stick t) popwin:special-display-config)
|
||||||
|
(push '("^\\*Python.+\\*$" :regexp t :position bottom :height 20 :noselect t) popwin:special-display-config)
|
||||||
|
|
||||||
|
(push '(help-mode :height 0.5 :position bottom :stick t) popwin:special-display-config)
|
||||||
|
(push '(compilation-mode :height 0.5 :position bottom :noselect t) popwin:special-display-config)
|
||||||
(push '(diff-mode :position bottom :stick t) popwin:special-display-config)
|
(push '(diff-mode :position bottom :stick t) popwin:special-display-config)
|
||||||
(push '("*Backtrace*") popwin:special-display-config)
|
(push '("*Backtrace*") popwin:special-display-config)
|
||||||
(push '("*Warnings*") popwin:special-display-config)
|
(push '("*Warnings*") popwin:special-display-config)
|
||||||
|
|
|
@ -97,7 +97,7 @@ gets killed.")
|
||||||
(defun my-kill-matching-buffers (regexp &optional buffer-list)
|
(defun my-kill-matching-buffers (regexp &optional buffer-list)
|
||||||
(interactive)
|
(interactive)
|
||||||
(mapc (lambda (b)
|
(mapc (lambda (b)
|
||||||
(if (s-matches? regexp (buffer-name b))
|
(if (string-match-p regexp (buffer-name b))
|
||||||
(kill-buffer b)))
|
(kill-buffer b)))
|
||||||
(if buffer-list buffer-list (buffer-list))))
|
(if buffer-list buffer-list (buffer-list))))
|
||||||
|
|
||||||
|
|
7
init.el
7
init.el
|
@ -46,7 +46,7 @@
|
||||||
(require 'cask)
|
(require 'cask)
|
||||||
(cask-initialize)
|
(cask-initialize)
|
||||||
|
|
||||||
(eval-when-compile (require 'use-package))
|
(require 'use-package)
|
||||||
(mapc 'require
|
(mapc 'require
|
||||||
;; ls init/{init,my}* | xargs basename | sed -e 's/\..*$//'
|
;; ls init/{init,my}* | xargs basename | sed -e 's/\..*$//'
|
||||||
'(core
|
'(core
|
||||||
|
@ -61,10 +61,9 @@
|
||||||
;; init-floobits ; when I'm feeling lonely
|
;; init-floobits ; when I'm feeling lonely
|
||||||
init-fly ; fly(check|spell)
|
init-fly ; fly(check|spell)
|
||||||
init-git ; git-gutter + modes
|
init-git ; git-gutter + modes
|
||||||
init-helm ; a search engine for your life
|
|
||||||
init-ido ; a search engine for your car keys
|
init-ido ; a search engine for your car keys
|
||||||
|
init-helm ; a search engine for your life
|
||||||
init-project ; project tools - dired, perspective, neotree
|
init-project ; project tools - dired, perspective, neotree
|
||||||
init-projectile ; when you forget where you put your house
|
|
||||||
|
|
||||||
init-cc ; C/C++/Obj-C madness
|
init-cc ; C/C++/Obj-C madness
|
||||||
;; init-d ; D - It's C, but better!
|
;; init-d ; D - It's C, but better!
|
||||||
|
@ -76,7 +75,7 @@
|
||||||
init-go
|
init-go
|
||||||
init-java ; the poster child for carpal tunnel syndome
|
init-java ; the poster child for carpal tunnel syndome
|
||||||
init-js ; alert("not java, javascript!")
|
init-js ; alert("not java, javascript!")
|
||||||
init-lua ; zero-based indices? Zero-based indices.
|
init-lua ; one-based indices? One-based indices.
|
||||||
;; init-org ; for fearless [organized] leader
|
;; init-org ; for fearless [organized] leader
|
||||||
init-php ; making php less painful to work with
|
init-php ; making php less painful to work with
|
||||||
init-python ; beautiful is better than ugly
|
init-python ; beautiful is better than ugly
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
(provide 'init-auto-complete)
|
|
||||||
|
|
||||||
(defconst my-dicts-dir (concat my-dir "dict/"))
|
|
||||||
|
|
||||||
(setq tags-case-fold-search nil)
|
|
||||||
|
|
||||||
(use-package pos-tip)
|
|
||||||
|
|
||||||
(use-package auto-complete
|
|
||||||
:init
|
|
||||||
(progn
|
|
||||||
(require 'auto-complete-config)
|
|
||||||
|
|
||||||
(setq ac-auto-start nil
|
|
||||||
ac-auto-show-menu t ; Suggestions box must be invoked manually (see core-keymaps.el)
|
|
||||||
ac-use-menu-map t ; Enable ac-menu-map map when menu is open
|
|
||||||
ac-use-quick-help nil ; Don't show tooltips unless invoked (see core-keymaps.el)
|
|
||||||
ac-use-fuzzy nil
|
|
||||||
ac-use-comphist t
|
|
||||||
ac-candidate-limit 25)
|
|
||||||
(setq ac-comphist-file (concat my-tmp-dir "ac-comphist.dat"))
|
|
||||||
|
|
||||||
(setq-default ac-sources '(ac-source-yasnippet)))
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
;; Redefine this function so auto-complete is available [almost] everywhere
|
|
||||||
(defun auto-complete-mode-maybe ()
|
|
||||||
(unless (minibufferp (current-buffer))
|
|
||||||
(auto-complete-mode 1)))
|
|
||||||
|
|
||||||
(defun auto-complete--backend (hook &rest backends)
|
|
||||||
(add-hook hook
|
|
||||||
`(lambda()
|
|
||||||
(set (make-local-variable 'ac-sources) (append '(,@backends) ac-sources)))))
|
|
||||||
|
|
||||||
(global-auto-complete-mode t)
|
|
||||||
|
|
||||||
(let ((bg (face-attribute 'default :background)))
|
|
||||||
(require 'color)
|
|
||||||
(custom-set-faces
|
|
||||||
;; `(company-scrollbar-bg ((t (:background ,(color-lighten-name bg 15)))))
|
|
||||||
;; `(company-scrollbar-fg ((t (:background ,(color-lighten-name bg 5)))))
|
|
||||||
`(ac-yasnippet-candidate-face ((t (:inherit ac-candidate-face :background ,(color-lighten-name bg 5)))))
|
|
||||||
`(ac-yasnippet-selection-face ((t (:inherit ac-selection-face :background ,(color-lighten-name bg 10)))))
|
|
||||||
`(ac-completion-face ((t (:background ,(color-lighten-name bg 15)))))
|
|
||||||
`(ac-candidate-face ((t (:inherit font-lock-function-name-face :background ,(color-lighten-name bg 4)))))
|
|
||||||
`(ac-selection-face ((t (:background ,(color-lighten-name bg 9)))))))
|
|
||||||
|
|
||||||
(add-to-list 'ac-dictionary-directories my-dicts-dir)
|
|
||||||
|
|
||||||
(auto-complete--backend 'emacs-lisp-mode-hook 'ac-source-features 'ac-source-functions 'ac-source-variables 'ac-source-symbols)
|
|
||||||
(auto-complete--backend 'scss-mode-hook 'ac-source-css-property)
|
|
||||||
|
|
||||||
(push '("*Popup Help*" :position bottom :height 0.35 :noselect t) popwin:special-display-config)
|
|
||||||
|
|
||||||
;; Tell ido not to care about case
|
|
||||||
;; (setq completion-ignore-case t)
|
|
||||||
|
|
||||||
(bind 'insert ac-mode-map
|
|
||||||
(kbd "C-x C-k") 'ac-complete-dictionary
|
|
||||||
(kbd "C-x C-f") (λ (let ((ac-sources '(ac-source-filename ac-source-files-in-current-dir)))
|
|
||||||
(auto-complete)))
|
|
||||||
(kbd "C-x C-]") 'ac-complete-etags
|
|
||||||
(kbd "C-x s") 'ac-complete-ispell
|
|
||||||
(kbd "C-x C-s") 'ac-complete-yasnippet
|
|
||||||
(kbd "C-x C-n") 'ac-complete-words-in-all-buffer
|
|
||||||
(kbd "C-x C-p") 'ac-complete-words-in-same-mode-buffers
|
|
||||||
(kbd "C-x C-o") 'auto-complete
|
|
||||||
(kbd "C-SPC") 'auto-complete)
|
|
||||||
|
|
||||||
(bind ac-completing-map
|
|
||||||
(kbd "<tab>") 'ac-complete
|
|
||||||
(kbd "C-n") 'ac-next
|
|
||||||
(kbd "C-p") 'ac-previous
|
|
||||||
(kbd "C-h") 'ac-quick-help
|
|
||||||
(kbd "C-S-h") 'ac-help
|
|
||||||
(kbd "<ESC>") 'ac-stop
|
|
||||||
(kbd "<RET>") 'ac-complete)
|
|
||||||
|
|
||||||
(use-package ac-etags
|
|
||||||
:commands (ac-complete-etags)
|
|
||||||
:config (ac-etags-setup))
|
|
||||||
|
|
||||||
(use-package ac-ispell
|
|
||||||
:commands (ac-complete-ispell ac-complete-ispell-fuzzy)
|
|
||||||
:config
|
|
||||||
(progn (ac-ispell-setup)
|
|
||||||
(setq ac-ispell-requires 1
|
|
||||||
ac-ispell-fuzzy-limit 25)))))
|
|
|
@ -154,11 +154,6 @@
|
||||||
(looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$"))))
|
(looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$"))))
|
||||||
0 ; no additional indent
|
0 ; no additional indent
|
||||||
ad-do-it))) ; default behavior
|
ad-do-it))) ; default behavior
|
||||||
|
|
||||||
|
|
||||||
;; Tools/defuns ;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(push '("*compilation*" :height 0.5 :position bottom :noselect t) popwin:special-display-config)
|
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
(use-package xcscope
|
(use-package xcscope
|
||||||
:init (cscope-setup)
|
:init (cscope-setup)
|
||||||
:config (push '("*cscope*" :position bottom) popwin:special-display-config))
|
:config
|
||||||
|
;; (push '("*cscope*" :position bottom) popwin:special-display-config)
|
||||||
|
)
|
||||||
|
|
||||||
(add-hook 'ruby-mode-hook (function cscope-minor-mode))
|
(add-hook 'ruby-mode-hook (function cscope-minor-mode))
|
||||||
|
|
|
@ -39,7 +39,9 @@
|
||||||
(make-variable-buffer-local 'my-build-command)
|
(make-variable-buffer-local 'my-build-command)
|
||||||
|
|
||||||
(defun set-build-command (command &optional file)
|
(defun set-build-command (command &optional file)
|
||||||
(setq my-build-command (command . file)))
|
(when (or (null file)
|
||||||
|
(project-has-files file))
|
||||||
|
(setq my-build-command `(,command . ,file))))
|
||||||
|
|
||||||
(evil-define-command my:build (arg)
|
(evil-define-command my:build (arg)
|
||||||
"Call a build command in the current directory.
|
"Call a build command in the current directory.
|
||||||
|
|
|
@ -32,10 +32,7 @@
|
||||||
(add-hook 'evil-normal-state-entry-hook 'my--evil-flycheck-buffer)
|
(add-hook 'evil-normal-state-entry-hook 'my--evil-flycheck-buffer)
|
||||||
;; And on ESC in normal mode.
|
;; And on ESC in normal mode.
|
||||||
(defadvice evil-force-normal-state (after evil-esc-flycheck-buffer activate)
|
(defadvice evil-force-normal-state (after evil-esc-flycheck-buffer activate)
|
||||||
(my--evil-flycheck-buffer))
|
(my--evil-flycheck-buffer))))
|
||||||
|
|
||||||
(push '("^\\*Flycheck.*\\*$" :regexp t :position bottom :height 0.25 :noselect t)
|
|
||||||
popwin:special-display-config)))
|
|
||||||
|
|
||||||
(use-package flyspell :commands flyspell-mode)
|
(use-package flyspell :commands flyspell-mode)
|
||||||
|
|
||||||
|
|
|
@ -2,29 +2,34 @@
|
||||||
:config
|
:config
|
||||||
(progn ; helm settings
|
(progn ; helm settings
|
||||||
(defvar helm-global-prompt ">>> ")
|
(defvar helm-global-prompt ">>> ")
|
||||||
|
|
||||||
(setq helm-quick-update t
|
(setq helm-quick-update t
|
||||||
helm-idle-delay 0.01
|
helm-idle-delay 0.01
|
||||||
helm-input-idle-delay 0.01
|
helm-input-idle-delay 0.01
|
||||||
helm-reuse-last-window-split-state t
|
helm-reuse-last-window-split-state t
|
||||||
helm-buffers-fuzzy-matching nil
|
helm-buffers-fuzzy-matching nil
|
||||||
|
helm-candidate-number-limit 40
|
||||||
helm-bookmark-show-location t)
|
helm-bookmark-show-location t)
|
||||||
|
|
||||||
|
(after "winner"
|
||||||
|
;; Tell winner-mode to ignore helm buffers
|
||||||
|
(dolist (bufname '("*helm recentf*"
|
||||||
|
"*helm projectile*"
|
||||||
|
"*helm imenu*"
|
||||||
|
"*helm company*"
|
||||||
|
"*helm buffers*"
|
||||||
|
;; "*helm tags*"
|
||||||
|
"*helm-ag*"
|
||||||
|
"*Helm Swoop*"))
|
||||||
|
(push bufname winner-boring-buffers)))
|
||||||
|
|
||||||
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
||||||
|
|
||||||
;; disable popwin-mode in an active Helm session It should be disabled
|
(use-package helm-ag)
|
||||||
;; otherwise it will conflict with other window opened by Helm persistent
|
(use-package helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss
|
||||||
;; action, such as *Help* window.
|
:commands (helm-css-scss
|
||||||
(add-hook! 'helm-after-initialize-hook (popwin-mode -1))
|
helm-css-scss-multi
|
||||||
|
helm-css-scss-insert-close-comment))
|
||||||
|
|
||||||
;; Restore popwin-mode after a Helm session finishes.
|
|
||||||
(add-hook! 'helm-cleanup-hook (popwin-mode 1))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(use-package helm-ag
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as
|
;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as
|
||||||
;; regexp.
|
;; regexp.
|
||||||
(evil-define-operator my:helm-ag-search (beg end &optional search hidden-files-p pwd-p regex-p)
|
(evil-define-operator my:helm-ag-search (beg end &optional search hidden-files-p pwd-p regex-p)
|
||||||
|
@ -48,39 +53,29 @@
|
||||||
:input input
|
:input input
|
||||||
:prompt helm-global-prompt)))
|
:prompt helm-global-prompt)))
|
||||||
|
|
||||||
(evil-define-operator my:helm-ag-regex-search (beg end &optional bang search)
|
(evil-define-operator my:helm-ag-regex-search (beg end &optional search bang)
|
||||||
:type inclusive
|
:type inclusive :repeat nil
|
||||||
:repeat nil
|
(interactive "<r><a><!>")
|
||||||
(interactive "<r><!><a>")
|
|
||||||
(my:helm-ag-search beg end search bang nil t))
|
(my:helm-ag-search beg end search bang nil t))
|
||||||
|
(evil-define-operator my:helm-ag-search-cwd (beg end &optional search bang)
|
||||||
;; Ex-mode interface for `helm-do-ag'. If `bang', then `search' is interpreted
|
;; Ex-mode interface for `helm-do-ag'. If `bang', then `search' is interpreted
|
||||||
;; as regexp
|
;; as regexp
|
||||||
(evil-define-operator my:helm-ag-search-cwd (beg end &optional search bang)
|
:type inclusive :repeat nil
|
||||||
:type inclusive
|
|
||||||
:repeat nil
|
|
||||||
(interactive "<r><a><!>")
|
(interactive "<r><a><!>")
|
||||||
(my:helm-ag-search beg end search bang t nil))
|
(my:helm-ag-search beg end search bang t nil))
|
||||||
|
|
||||||
(evil-define-operator my:helm-ag-regex-search-cwd (beg end &optional search bang)
|
(evil-define-operator my:helm-ag-regex-search-cwd (beg end &optional search bang)
|
||||||
:type inclusive
|
:type inclusive :repeat nil
|
||||||
:repeat nil
|
|
||||||
(interactive "<r><a><!>")
|
(interactive "<r><a><!>")
|
||||||
(my:helm-ag-search beg end search bang t t))))
|
(my:helm-ag-search beg end search bang t t))
|
||||||
|
|
||||||
(use-package helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss
|
|
||||||
:commands (helm-css-scss
|
|
||||||
helm-css-scss-multi
|
|
||||||
helm-css-scss-insert-close-comment))
|
|
||||||
|
|
||||||
(use-package helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
(use-package helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
||||||
:commands (my:helm-swoop helm-swoop helm-multi-swoop)
|
:commands (helm-swoop helm-multi-swoop)
|
||||||
:config
|
:config
|
||||||
(progn
|
|
||||||
(setq helm-swoop-use-line-number-face t
|
(setq helm-swoop-use-line-number-face t
|
||||||
helm-swoop-split-with-multiple-windows t
|
helm-swoop-split-with-multiple-windows t
|
||||||
helm-swoop-speed-or-color t
|
helm-swoop-speed-or-color t
|
||||||
helm-swoop-split-window-function 'popwin:popup-buffer)
|
;; helm-swoop-split-window-function 'popwin:popup-buffer
|
||||||
|
))
|
||||||
|
|
||||||
;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or
|
;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or
|
||||||
;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is
|
;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is
|
||||||
|
@ -90,43 +85,25 @@
|
||||||
(interactive "<a><!>")
|
(interactive "<a><!>")
|
||||||
(if (eq major-mode 'scss-mode)
|
(if (eq major-mode 'scss-mode)
|
||||||
(if bang (helm-css-scss-multi search) (helm-css-scss search))
|
(if bang (helm-css-scss-multi search) (helm-css-scss search))
|
||||||
(if bang (helm-multi-swoop-all search) (helm-swoop :$query search))))))
|
(if bang (helm-multi-swoop-all search) (helm-swoop :$query search))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
(use-package projectile
|
||||||
|
:init (setq-default projectile-enable-caching t)
|
||||||
(after "winner"
|
|
||||||
;; Tell winner-mode to ignore helm buffers
|
|
||||||
(dolist (bufname '("*helm recentf*"
|
|
||||||
"*helm projectile*"
|
|
||||||
"*helm imenu*"
|
|
||||||
"*helm company*"
|
|
||||||
"*helm buffers*"
|
|
||||||
;; "*helm tags*"
|
|
||||||
"*helm-ag*"
|
|
||||||
"*Helm Swoop*"))
|
|
||||||
(push bufname winner-boring-buffers)))
|
|
||||||
|
|
||||||
(after "company"
|
|
||||||
(use-package helm-company
|
|
||||||
:config
|
:config
|
||||||
(defun helm-company ()
|
(progn
|
||||||
(interactive)
|
(projectile-global-mode +1)
|
||||||
(unless company-candidates
|
(setq projectile-sort-order 'recentf
|
||||||
(company-complete))
|
projectile-cache-file (concat my-tmp-dir "projectile.cache")
|
||||||
(when company-point
|
projectile-known-projects-file (concat my-tmp-dir "projectile.projects")
|
||||||
(helm :sources 'helm-source-company
|
projectile-indexing-method 'alien)
|
||||||
:buffer "*helm company*"
|
(add-to-list 'projectile-globally-ignored-files "ido.last")
|
||||||
:prompt helm-global-prompt
|
(add-to-list 'projectile-globally-ignored-directories "assets")
|
||||||
:candidate-number-limit helm-company-candidate-number-limit)))))
|
(add-to-list 'projectile-other-file-alist '("scss" "css"))
|
||||||
|
(add-to-list 'projectile-other-file-alist '("css" "scss"))
|
||||||
(after "projectile"
|
(use-package helm-projectile)
|
||||||
(use-package helm-projectile
|
|
||||||
:config
|
|
||||||
(setq projectile-switch-project-action 'helm-projectile))
|
|
||||||
|
|
||||||
;; Don't show the project name in the prompts; I already know.
|
;; Don't show the project name in the prompts; I already know.
|
||||||
(defun projectile-prepend-project-name (string)
|
(defun projectile-prepend-project-name (string) (format helm-global-prompt string))
|
||||||
(format helm-global-prompt string))
|
|
||||||
|
|
||||||
;; All this for a smaller prompt (it was redundant with helm headers)
|
;; All this for a smaller prompt (it was redundant with helm headers)
|
||||||
(defmacro helm-projectile-command (command source prompt)
|
(defmacro helm-projectile-command (command source prompt)
|
||||||
|
@ -147,7 +124,7 @@
|
||||||
(helm-projectile-command "find-file-dwim" 'helm-source-projectile-files-dwim-list helm-global-prompt)
|
(helm-projectile-command "find-file-dwim" 'helm-source-projectile-files-dwim-list helm-global-prompt)
|
||||||
(helm-projectile-command "find-dir" helm-source-projectile-directories-and-dired-list helm-global-prompt)
|
(helm-projectile-command "find-dir" helm-source-projectile-directories-and-dired-list helm-global-prompt)
|
||||||
(helm-projectile-command "recentf" 'helm-source-projectile-recentf-list helm-global-prompt)
|
(helm-projectile-command "recentf" 'helm-source-projectile-recentf-list helm-global-prompt)
|
||||||
(helm-projectile-command "switch-to-buffer" 'helm-source-projectile-buffers-list helm-global-prompt))
|
(helm-projectile-command "switch-to-buffer" 'helm-source-projectile-buffers-list helm-global-prompt)))
|
||||||
|
|
||||||
(progn ; helm hacks
|
(progn ; helm hacks
|
||||||
;; No persistent header
|
;; No persistent header
|
||||||
|
@ -182,10 +159,6 @@
|
||||||
(propertize (concat " " hlstr hlend) 'face 'helm-header))))
|
(propertize (concat " " hlstr hlend) 'face 'helm-header))))
|
||||||
(when force (force-mode-line-update))))
|
(when force (force-mode-line-update))))
|
||||||
|
|
||||||
(progn ; popwin
|
|
||||||
(push '("^\\*helm.*\\*$" :position bottom :regexp t :height 18)
|
|
||||||
popwin:special-display-config))
|
|
||||||
|
|
||||||
(progn ; evil
|
(progn ; evil
|
||||||
(evil-set-initial-state 'helm-mode 'emacs)
|
(evil-set-initial-state 'helm-mode 'emacs)
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,13 @@
|
||||||
;; (set-keymap-parent ido-file-completion-map ido-file-dir-completion-map)
|
;; (set-keymap-parent ido-file-completion-map ido-file-dir-completion-map)
|
||||||
;; (set-keymap-parent ido-buffer-completion-map ido-common-completion-map)
|
;; (set-keymap-parent ido-buffer-completion-map ido-common-completion-map)
|
||||||
|
|
||||||
(require 'ido-ubiquitous)
|
|
||||||
(require 'ido-vertical-mode)
|
|
||||||
(require 'flx-ido)
|
|
||||||
|
|
||||||
(ido-mode 1)
|
(ido-mode 1)
|
||||||
(ido-vertical-mode 1)
|
|
||||||
(ido-everywhere 1)
|
(ido-everywhere 1)
|
||||||
(ido-ubiquitous-mode 1)
|
|
||||||
(flx-ido-mode 1)
|
(use-package ido-vertical-mode :config (ido-vertical-mode 1))
|
||||||
|
(use-package ido-ubiquitous :config (ido-ubiquitous-mode 1))
|
||||||
|
(use-package flx-ido :config (flx-ido-mode 1))
|
||||||
|
|
||||||
(setq ido-use-faces nil
|
(setq ido-use-faces nil
|
||||||
ido-confirm-unique-completion t
|
ido-confirm-unique-completion t
|
||||||
|
@ -37,6 +35,21 @@
|
||||||
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
|
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
|
||||||
"_region_" " output\\*$" "^TAGS$" "^\*Ido"))
|
"_region_" " output\\*$" "^TAGS$" "^\*Ido"))
|
||||||
|
|
||||||
|
; sort ido filelist by mtime instead of alphabetically
|
||||||
|
(add-hook 'ido-make-file-list-hook 'ido-sort-mtime)
|
||||||
|
(add-hook 'ido-make-dir-list-hook 'ido-sort-mtime)
|
||||||
|
(defun ido-sort-mtime ()
|
||||||
|
(setq ido-temp-list
|
||||||
|
(sort ido-temp-list
|
||||||
|
(lambda (a b)
|
||||||
|
(time-less-p
|
||||||
|
(sixth (file-attributes (concat ido-current-directory b)))
|
||||||
|
(sixth (file-attributes (concat ido-current-directory a)))))))
|
||||||
|
(ido-to-end ;; move . files to end (again)
|
||||||
|
(delq nil (mapcar
|
||||||
|
(lambda (x) (and (char-equal (string-to-char x) ?.) x))
|
||||||
|
ido-temp-list))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-ido)
|
(provide 'init-ido)
|
||||||
;;; init-ido.el ends here
|
;;; init-ido.el ends here
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
""))
|
""))
|
||||||
|
|
||||||
(use-package eclim
|
(use-package eclim
|
||||||
|
:disabled t
|
||||||
:commands (eclim-mode global-eclim-mode)
|
:commands (eclim-mode global-eclim-mode)
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
|
@ -36,9 +37,12 @@
|
||||||
(use-package android-mode
|
(use-package android-mode
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
|
(add-hook 'android-mode-hook (set-build-command "./gradlew %s" "build.gradle"))
|
||||||
(add-hook! 'java-mode-hook
|
(add-hook! 'java-mode-hook
|
||||||
(when (project-has-files "AndroidManifest.xml")
|
(let ((root (project-root)))
|
||||||
(android-mode +1))))
|
(when (or (project-has-files "AndroidManifest.xml" root)
|
||||||
|
(project-has-files "src/main/AndroidManifest.xml" root))
|
||||||
|
(android-mode +1)))))
|
||||||
|
|
||||||
(use-package groovy-mode :mode "\\.gradle$")
|
(use-package groovy-mode :mode "\\.gradle$")
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
:lighter " lb6"
|
:lighter " lb6"
|
||||||
:keymap (make-sparse-keymap)
|
:keymap (make-sparse-keymap)
|
||||||
(my--init-yas-mode 'lb6-mode))
|
(my--init-yas-mode 'lb6-mode))
|
||||||
(associate-minor-mode "/Contents/\\(Scripts\\|Resources\\)/.*$" 'lb6-mode)
|
(associate-minor-mode "\\.lb\\(action\\|ext\\)/.*$" 'lb6-mode)
|
||||||
|
|
||||||
(provide 'init-js)
|
(provide 'init-js)
|
||||||
;;; init-js.el ends here
|
;;; init-js.el ends here
|
||||||
|
|
|
@ -11,6 +11,11 @@
|
||||||
(kbd "TAB") 'neotree-enter
|
(kbd "TAB") 'neotree-enter
|
||||||
(kbd "RET") 'neotree-enter))))
|
(kbd "RET") 'neotree-enter))))
|
||||||
|
|
||||||
|
(defun my-ido-find-project-file ()
|
||||||
|
(interactive)
|
||||||
|
(let ((default-directory (project-root)))
|
||||||
|
(ido-find-file)))
|
||||||
|
|
||||||
|
|
||||||
;; (use-package dired
|
;; (use-package dired
|
||||||
;; :disabled t
|
;; :disabled t
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
(use-package projectile
|
|
||||||
:init (setq-default projectile-enable-caching t)
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(projectile-global-mode +1)
|
|
||||||
|
|
||||||
(setq projectile-sort-order 'recentf
|
|
||||||
projectile-cache-file (concat my-tmp-dir "projectile.cache")
|
|
||||||
projectile-known-projects-file (concat my-tmp-dir "projectile.projects")
|
|
||||||
projectile-indexing-method 'alien)
|
|
||||||
|
|
||||||
(add-to-list 'projectile-globally-ignored-files "ido.last")
|
|
||||||
(add-to-list 'projectile-globally-ignored-directories "assets")
|
|
||||||
(add-to-list 'projectile-other-file-alist '("scss" "css"))
|
|
||||||
(add-to-list 'projectile-other-file-alist '("css" "scss"))))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-projectile)
|
|
||||||
;;; init-projectile.el ends here
|
|
|
@ -23,10 +23,6 @@
|
||||||
(bind 'motion anaconda-mode-map "gd" 'anaconda-mode-goto-definitions)
|
(bind 'motion anaconda-mode-map "gd" 'anaconda-mode-goto-definitions)
|
||||||
(bind 'normal anaconda-nav-mode-map [escape] 'anaconda-nav-quit)
|
(bind 'normal anaconda-nav-mode-map [escape] 'anaconda-nav-quit)
|
||||||
|
|
||||||
(push '("*anaconda-doc*" :position bottom :height 15 :noselect t) popwin:special-display-config)
|
|
||||||
(push '("*anaconda-nav*" :position bottom :height 15 :stick t) popwin:special-display-config)
|
|
||||||
(push '("^\\*Python.+\\*$" :regexp t :position bottom :height 20 :noselect t) popwin:special-display-config)
|
|
||||||
|
|
||||||
;; Delete the window on escape or C-g
|
;; Delete the window on escape or C-g
|
||||||
(defadvice anaconda-mode-doc-buffer (after anaconda-doc-buffer-escape-to-close activate)
|
(defadvice anaconda-mode-doc-buffer (after anaconda-doc-buffer-escape-to-close activate)
|
||||||
(with-current-buffer (get-buffer "*anaconda-doc*")
|
(with-current-buffer (get-buffer "*anaconda-doc*")
|
||||||
|
|
|
@ -50,9 +50,7 @@
|
||||||
(progn
|
(progn
|
||||||
(bind 'normal rxt-help-mode-map [escape] 'kill-buffer-and-window)
|
(bind 'normal rxt-help-mode-map [escape] 'kill-buffer-and-window)
|
||||||
|
|
||||||
(after "re-builder" (setq reb-re-syntax 'pcre))
|
(after "re-builder" (setq reb-re-syntax 'pcre))))
|
||||||
(after "popwin"
|
|
||||||
(push '("* Regexp Explain *" :position top :height 0.35) popwin:special-display-config))))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-regex)
|
(provide 'init-regex)
|
||||||
|
|
|
@ -63,7 +63,6 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(evil-set-initial-state 'inf-enh-ruby-mode 'insert)
|
(evil-set-initial-state 'inf-enh-ruby-mode 'insert)
|
||||||
(push '(inf-enh-ruby-mode :position bottom :stick t) popwin:special-display-config)
|
|
||||||
|
|
||||||
(after "company"
|
(after "company"
|
||||||
(use-package company-inf-ruby
|
(use-package company-inf-ruby
|
||||||
|
@ -95,11 +94,10 @@
|
||||||
(use-package company-robe
|
(use-package company-robe
|
||||||
:config (company--backend-on 'enh-ruby-mode-hook 'company-robe)))
|
:config (company--backend-on 'enh-ruby-mode-hook 'company-robe)))
|
||||||
|
|
||||||
(add-hook! 'enh-ruby-mode-hook
|
;; (add-hook! 'enh-ruby-mode-hook
|
||||||
(unless (f-ext? (buffer-file-name) "org") ;; in case of org-mode
|
;; (unless (f-ext? (buffer-file-name) "org") ;; in case of org-mode
|
||||||
(robe-mode 1)
|
;; (robe-mode 1)
|
||||||
;; (after "auto-complete" (ac-robe-setup))
|
;; (my--ruby-load-file buffer-file-name)))
|
||||||
(my--ruby-load-file buffer-file-name)))
|
|
||||||
|
|
||||||
(defun my--ruby-load-file (&optional file)
|
(defun my--ruby-load-file (&optional file)
|
||||||
(let ((file (or file buffer-file-name)))
|
(let ((file (or file buffer-file-name)))
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
(after "popwin"
|
|
||||||
(push '("*ansi-term*" :position bottom :height 0.45 :stick t) popwin:special-display-config)
|
|
||||||
(push '("*terminal*" :position bottom :height 0.45 :stick t) popwin:special-display-config)
|
|
||||||
(push '("*Async Shell Command*" :position bottom) popwin:special-display-config))
|
|
||||||
|
|
||||||
(my--cleanup-buffers-add "^\\*Shell Command Output\\*$")
|
(my--cleanup-buffers-add "^\\*Shell Command Output\\*$")
|
||||||
(my--cleanup-buffers-add "^\\*Async Shell Command\\*$")
|
(my--cleanup-buffers-add "^\\*Async Shell Command\\*$")
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
(progn
|
(progn
|
||||||
(add-hook 'web-mode-hook 'enable-tab-width-2)
|
(add-hook 'web-mode-hook 'enable-tab-width-2)
|
||||||
|
|
||||||
(setq web-mode-ac-sources-alist '(("css" . (ac-source-css-property)))
|
(setq web-mode-markup-indent-offset 2
|
||||||
web-mode-markup-indent-offset 2
|
|
||||||
web-mode-code-indent-offset 2
|
web-mode-code-indent-offset 2
|
||||||
web-mode-css-indent-offset 2
|
web-mode-css-indent-offset 2
|
||||||
web-mode-style-padding 2
|
web-mode-style-padding 2
|
||||||
|
@ -43,6 +42,7 @@
|
||||||
",t" 'web-mode-element-rename)
|
",t" 'web-mode-element-rename)
|
||||||
(bind '(normal visual) web-mode-map
|
(bind '(normal visual) web-mode-map
|
||||||
"]a" 'web-mode-attribute-next
|
"]a" 'web-mode-attribute-next
|
||||||
|
"[a" 'web-mode-attribute-previous
|
||||||
"]t" 'web-mode-tag-next
|
"]t" 'web-mode-tag-next
|
||||||
"[t" 'web-mode-tag-previous
|
"[t" 'web-mode-tag-previous
|
||||||
"]T" 'web-mode-element-child
|
"]T" 'web-mode-element-child
|
||||||
|
@ -60,21 +60,29 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq emmet-move-cursor-between-quotes t)
|
(setq emmet-move-cursor-between-quotes t)
|
||||||
|
|
||||||
(bind 'insert emmet-mode-keymap
|
(bind 'insert emmet-mode-keymap
|
||||||
(kbd "M-e") 'emmet-expand-yas
|
"M-e" 'emmet-expand-yas
|
||||||
(kbd "M-E") 'emmet-expand-line)))
|
"M-E" 'emmet-expand-line)))
|
||||||
|
|
||||||
(define-minor-mode jekyll-mode
|
(define-minor-mode jekyll-mode
|
||||||
:init-value nil
|
:init-value nil
|
||||||
:lighter " :{"
|
:lighter " :{"
|
||||||
:keymap (make-sparse-keymap)
|
:keymap (make-sparse-keymap)
|
||||||
(my--init-yas-mode 'jekyll-mode))
|
(my--init-yas-mode 'jekyll-mode))
|
||||||
|
(defun jekyll-mode-enable-maybe ()
|
||||||
|
(when (project-has-files '("_config.yml" "_layouts"))
|
||||||
|
(jekyll-mode 1)))
|
||||||
(associate-minor-mode "/_\\(layouts\\|posts\\)/.+$" 'jekyll-mode)
|
(associate-minor-mode "/_\\(layouts\\|posts\\)/.+$" 'jekyll-mode)
|
||||||
(add-hooks '(web-mode-hook scss-mode-hook html-mode-hook markdown-mode markdown-mode-hook)
|
(add-hooks '(web-mode-hook scss-mode-hook html-mode-hook markdown-mode markdown-mode-hook)
|
||||||
(lambda ()
|
'jekyll-mode-enable-maybe)
|
||||||
(when (project-has-files "_config.yml" "_layouts")
|
|
||||||
(jekyll-mode 1))))
|
(define-minor-mode wordpress-mode
|
||||||
|
:init-value nil
|
||||||
|
:lighter " wp"
|
||||||
|
:keymap (make-sparse-keymap)
|
||||||
|
(my--init-yas-mode 'wordpress-mode))
|
||||||
|
(associate-minor-mode "/wp-\\(content\\|admin\\|includes\\)/.+$" 'wordpress-mode)
|
||||||
|
(associate-minor-mode "/wp-.+\\.php$" 'wordpress-mode)
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-web)
|
(provide 'init-web)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
:mode (("emacs\\.d/snippets/.+$" . snippet-mode))
|
:mode (("emacs\\.d/snippets/.+$" . snippet-mode))
|
||||||
|
:demand t
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
(defvar yas-minor-mode-map
|
(defvar yas-minor-mode-map
|
||||||
|
@ -10,12 +11,11 @@
|
||||||
(bind 'visual map (kbd "<backtab>") 'yas-insert-snippet)
|
(bind 'visual map (kbd "<backtab>") 'yas-insert-snippet)
|
||||||
map))
|
map))
|
||||||
|
|
||||||
(add-hook 'snippet-mode-hook 'disable-final-newline)
|
;; (add-hook 'snippet-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'snippet-mode-hook 'yas-minor-mode)
|
;; (add-hook 'text-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'text-mode-hook 'yas-minor-mode)
|
;; (add-hook 'prog-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'prog-mode-hook 'yas-minor-mode)
|
;; (add-hook 'org-mode-hook 'yas-minor-mode-on))
|
||||||
;; (add-hook 'markdown-mode-hook 'yas-minor-mode)
|
(add-hook 'snippet-mode-hook 'disable-final-newline))
|
||||||
(add-hook 'org-mode-hook 'yas-minor-mode))
|
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq yas-verbosity 0)
|
(setq yas-verbosity 0)
|
||||||
|
@ -26,15 +26,12 @@
|
||||||
(setq yas-snippet-dirs `(,my-snippets-dir))
|
(setq yas-snippet-dirs `(,my-snippets-dir))
|
||||||
(setq yas-prompt-functions '(yas-ido-prompt yas-no-prompt))
|
(setq yas-prompt-functions '(yas-ido-prompt yas-no-prompt))
|
||||||
|
|
||||||
(push '(snippet-mode :position bottom :stick t) popwin:special-display-config)
|
(yas-global-mode 1)
|
||||||
|
|
||||||
(yas-reload-all)
|
(yas-reload-all)
|
||||||
|
|
||||||
(after "auto-complete"
|
(after "helm"
|
||||||
(defadvice ac-expand (before advice-for-ac-expand activate)
|
(add-to-list 'yas-dont-activate 'helm-alive-p))
|
||||||
(when (yas-expand) (ac-stop))))
|
|
||||||
|
|
||||||
(after "evil"
|
|
||||||
;; Exit snippets on ESC in normal mode
|
;; Exit snippets on ESC in normal mode
|
||||||
(defadvice evil-force-normal-state (before evil-esc-quit-yasnippet activate)
|
(defadvice evil-force-normal-state (before evil-esc-quit-yasnippet activate)
|
||||||
(yas-exit-all-snippets))
|
(yas-exit-all-snippets))
|
||||||
|
@ -61,7 +58,7 @@
|
||||||
(add-hook! 'yas-after-exit-snippet-hook
|
(add-hook! 'yas-after-exit-snippet-hook
|
||||||
(setq-local yas-selected-text nil))
|
(setq-local yas-selected-text nil))
|
||||||
|
|
||||||
(evil-define-operator ex:snippets (beg end &optional name)
|
(evil-define-operator my:snippets (beg end &optional name)
|
||||||
:motion nil
|
:motion nil
|
||||||
:move-point nil
|
:move-point nil
|
||||||
:type exclusive
|
:type exclusive
|
||||||
|
@ -72,7 +69,7 @@
|
||||||
(if name
|
(if name
|
||||||
(popwin:find-file (concat my-snippets-dir
|
(popwin:find-file (concat my-snippets-dir
|
||||||
(symbol-name major-mode) "/" name))
|
(symbol-name major-mode) "/" name))
|
||||||
(yas-visit-snippet-file)))))
|
(yas-visit-snippet-file))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
|
|
||||||
(bind "A-x" 'smex
|
(bind "A-x" 'smex
|
||||||
"A-X" 'smex-major-mode-commands
|
"A-X" 'smex-major-mode-commands
|
||||||
|
"A-M-x" 'helm-M-x
|
||||||
"A-;" 'eval-expression
|
"A-;" 'eval-expression
|
||||||
"C-`" 'popwin:toggle-popup-window
|
"C-`" 'popwin:toggle-popup-window
|
||||||
"M-=" 'text-scale-increase
|
"M-=" 'text-scale-increase
|
||||||
"M--" 'text-scale-decrease
|
"M--" 'text-scale-decrease
|
||||||
"M-w" 'evil-window-delete
|
"M-w" 'evil-window-delete
|
||||||
"M-/" 'evilnc-comment-or-uncomment-lines
|
"M-/" 'evil-commentary-line
|
||||||
"M-b" 'my:build)
|
"M-b" 'my:build)
|
||||||
|
|
||||||
(bind 'motion
|
(bind 'motion
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
|
|
||||||
'normal
|
'normal
|
||||||
"M-o" 'ido-find-file
|
"M-o" 'ido-find-file
|
||||||
|
"M-O" 'my-ido-find-project-file
|
||||||
"M-d" 'dash-at-point
|
"M-d" 'dash-at-point
|
||||||
"M-R" 'my:eval-buffer)
|
"M-R" 'my:eval-buffer)
|
||||||
|
|
||||||
|
@ -36,24 +38,34 @@
|
||||||
;; <leader>
|
;; <leader>
|
||||||
(bind my-leader-map
|
(bind my-leader-map
|
||||||
"," 'helm-projectile-switch-to-buffer
|
"," 'helm-projectile-switch-to-buffer
|
||||||
"." 'helm-resume
|
"." 'ido-find-file
|
||||||
|
">" 'my-ido-find-project-file
|
||||||
"/" 'helm-projectile-find-file
|
"/" 'helm-projectile-find-file
|
||||||
";" 'helm-semantic-or-imenu
|
";" 'helm-semantic-or-imenu
|
||||||
"<" 'helm-mini
|
"<" 'helm-mini
|
||||||
"E" 'my:init-files
|
|
||||||
"M" 'helm-projectile-recentf ; recent PROJECT files
|
"M" 'helm-projectile-recentf ; recent PROJECT files
|
||||||
"]" 'helm-etags-select
|
"]" 'helm-etags-select
|
||||||
"a" 'helm-projectile-find-other-file
|
"a" 'helm-projectile-find-other-file
|
||||||
"b" 'my:build
|
"E" 'my:init-files
|
||||||
"e" 'ido-find-file
|
|
||||||
"g" 'git-gutter+-show-hunk
|
"g" 'git-gutter+-show-hunk
|
||||||
"h" 'helm-apropos
|
"h" 'helm-apropos
|
||||||
"m" 'helm-recentf
|
"m" 'helm-recentf
|
||||||
"p" 'helm-projectile-switch-project
|
"p" 'helm-projectile-switch-project
|
||||||
|
"r" 'emr-show-refactor-menu ; init-dev.el
|
||||||
"qq" 'evil-save-and-quit
|
"qq" 'evil-save-and-quit
|
||||||
"QQ" 'evil-quit-all
|
"QQ" 'evil-quit-all
|
||||||
"r" 'emr-show-refactor-menu ; init-dev.el
|
|
||||||
"y" 'helm-show-kill-ring)
|
"oo" 'my-open-with
|
||||||
|
"of" (λ (my-open-with "Finder.app" default-directory))
|
||||||
|
"oF" (λ (my-open-with "Finder.app" (project-root)))
|
||||||
|
"ou" (λ (my-open-with "Transmit"))
|
||||||
|
"oU" (λ (my-open-with "Transmit" default-directory))
|
||||||
|
"ol" (λ (my-open-with "LaunchBar"))
|
||||||
|
"oL" (λ (my-open-with "LaunchBar" default-directory))
|
||||||
|
;; tmux: cd (default-directory)
|
||||||
|
"ot" (λ (my:tmux-chdir nil t))
|
||||||
|
;; tmux: cd [project root]
|
||||||
|
"oT" 'my:tmux-chdir)
|
||||||
|
|
||||||
;; <localleader>
|
;; <localleader>
|
||||||
(bind my-localleader-map
|
(bind my-localleader-map
|
||||||
|
@ -62,19 +74,6 @@
|
||||||
"=" 'toggle-transparency
|
"=" 'toggle-transparency
|
||||||
"E" 'evil-emacs-state
|
"E" 'evil-emacs-state
|
||||||
|
|
||||||
"oo" 'my-open-with
|
|
||||||
"of" (λ (my-open-with "Finder" default-directory))
|
|
||||||
"oF" (λ (my-open-with "Finder" (project-root)))
|
|
||||||
"ou" (λ (my-open-with "Transmit"))
|
|
||||||
"oU" (λ (my-open-with "Transmit" default-directory))
|
|
||||||
"ol" (λ (my-open-with "LaunchBar"))
|
|
||||||
"oL" (λ (my-open-with "LaunchBar" default-directory))
|
|
||||||
|
|
||||||
;; tmux: cd (default-directory)
|
|
||||||
"ot" (λ (my:tmux-chdir nil t))
|
|
||||||
;; tmux: cd [project root]
|
|
||||||
"oT" 'my:tmux-chdir
|
|
||||||
|
|
||||||
"]" 'next-buffer
|
"]" 'next-buffer
|
||||||
"[" 'previous-buffer
|
"[" 'previous-buffer
|
||||||
|
|
||||||
|
@ -115,9 +114,9 @@
|
||||||
(evil-normal-state)
|
(evil-normal-state)
|
||||||
(evil-visual-restore))
|
(evil-visual-restore))
|
||||||
|
|
||||||
'motion
|
'normal "X" 'evil-exchange
|
||||||
"X" 'evil-exchange
|
|
||||||
|
|
||||||
|
'motion
|
||||||
"]g" 'git-gutter+-next-hunk
|
"]g" 'git-gutter+-next-hunk
|
||||||
"[g" 'git-gutter+-previous-hunk
|
"[g" 'git-gutter+-previous-hunk
|
||||||
|
|
||||||
|
@ -180,13 +179,13 @@
|
||||||
|
|
||||||
(when is-mac
|
(when is-mac
|
||||||
;; Restore text nav keys
|
;; Restore text nav keys
|
||||||
(bind (kbd "<A-left>") 'backward-word
|
(bind "<A-left>" 'backward-word
|
||||||
(kbd "<A-right>") 'forward-word
|
"<A-right>" 'forward-word
|
||||||
(kbd "<M-backspace>") 'my.backward-kill-to-bol-and-indent
|
"<M-backspace>" 'my.backward-kill-to-bol-and-indent
|
||||||
(kbd "M-a") 'mark-whole-buffer
|
"M-a" 'mark-whole-buffer
|
||||||
(kbd "M-c") 'evil-yank
|
"M-c" 'evil-yank
|
||||||
(kbd "M-v") 'evil-paste-after
|
"M-s" 'save-buffer
|
||||||
(kbd "M-s") 'save-buffer))
|
"M-v" 'yank))
|
||||||
|
|
||||||
;; Fix osx keymappings and then some
|
;; Fix osx keymappings and then some
|
||||||
(use-package smart-forward
|
(use-package smart-forward
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
(exmap "rec[ent]" 'my:helm-recentf))
|
(exmap "rec[ent]" 'my:helm-recentf))
|
||||||
|
|
||||||
(after "yasnippet"
|
(after "yasnippet"
|
||||||
(exmap "snip[pets]" 'ex:snippets))
|
(exmap "snip[pets]" 'my:snippets))
|
||||||
|
|
||||||
(after "emr"
|
(after "emr"
|
||||||
(exmap "ref[actor]" 'emr-show-refactor-menu))
|
(exmap "ref[actor]" 'emr-show-refactor-menu))
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
(set-face-background 'show-paren-match nil)
|
(set-face-background 'show-paren-match nil)
|
||||||
(set-face-foreground 'show-paren-match "orange")
|
(set-face-foreground 'show-paren-match "orange")
|
||||||
(set-face-attribute 'show-paren-match nil :weight 'extra-bold)
|
(set-face-attribute 'show-paren-match nil :weight 'extra-bold)
|
||||||
|
(let ((face 'evil-search-highlight-persist-highlight-face))
|
||||||
|
(set-face-attribute face nil :inherit 'isearch-lazy-highlight-face)
|
||||||
|
(set-face-foreground face nil)
|
||||||
|
(set-face-background face nil))
|
||||||
|
|
||||||
(set-register ?. "~/.dotfiles/")
|
(set-register ?. "~/.dotfiles/")
|
||||||
(set-register ?d "~/Dropbox/Projects/")
|
(set-register ?d "~/Dropbox/Projects/")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue