Simplify purpose-mode configuration
This commit is contained in:
parent
787943df9e
commit
271d87f6a6
13 changed files with 76 additions and 107 deletions
22
01mac.el
22
01mac.el
|
|
@ -13,6 +13,28 @@
|
||||||
(global-set-key (kbd "<f1> b") 'describe-bindings) ;; List all key bindings
|
(global-set-key (kbd "<f1> b") 'describe-bindings) ;; List all key bindings
|
||||||
;; there are.
|
;; there are.
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-c \\") 'split-window-right) ;; Split window to the right
|
||||||
|
(global-set-key (kbd "C-c /") 'split-window-below) ;; Split window to the bottom
|
||||||
|
|
||||||
|
|
||||||
|
;; Move between windows key bindings
|
||||||
|
(global-set-key (kbd "C-c <left>") 'windmove-left)
|
||||||
|
(global-set-key (kbd "C-c <right>") 'windmove-right)
|
||||||
|
(global-set-key (kbd "C-c <up>") 'windmove-up)
|
||||||
|
(global-set-key (kbd "C-c <down>") 'windmove-down)
|
||||||
|
|
||||||
|
;; Switch to previous and next buffer
|
||||||
|
(global-set-key (kbd "C-c w <left>") 'previous-buffer)
|
||||||
|
(global-set-key (kbd "C-c w <right>") 'next-buffer)
|
||||||
|
|
||||||
|
;; Kill current buffer and window
|
||||||
|
(global-set-key (kbd "C-c q") 'kill-buffer-and-window)
|
||||||
|
|
||||||
|
;; Create new terminal
|
||||||
|
(global-set-key (kbd "<f6>") (lambda ()
|
||||||
|
(interactive)
|
||||||
|
(ansi-term "/bin/zsh" "ANSI-Term : Zsh")))
|
||||||
|
|
||||||
;;; Window display
|
;;; Window display
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
|
|
|
||||||
22
02evil.el
22
02evil.el
|
|
@ -1,22 +0,0 @@
|
||||||
(evil-mode 1)
|
|
||||||
(global-evil-leader-mode 1)
|
|
||||||
|
|
||||||
(require 'evil-leader)
|
|
||||||
;;;;;;;;; EVIL Leader ;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
(evil-leader/set-leader "<SPC>")
|
|
||||||
|
|
||||||
(evil-leader/set-key
|
|
||||||
"w" 'delete-window ;; C-x 0
|
|
||||||
"," 'previous-buffer ;; C-x left
|
|
||||||
"." 'next-buffer ;; C-x right
|
|
||||||
"k" 'kill-buffer-and-window ;; C-x 4 0
|
|
||||||
"rb" 'revert-buffer) ;; S-u Reload current file from disk
|
|
||||||
|
|
||||||
(evil-leader/set-key "hs" 'split-window-below) ;; C-x 2
|
|
||||||
(evil-leader/set-key "vs" 'split-window-right) ;; C-x 3
|
|
||||||
|
|
||||||
(evil-leader/set-key
|
|
||||||
"gk" 'windmove-up
|
|
||||||
"gj" 'windmove-down
|
|
||||||
"gl" 'windmove-right
|
|
||||||
"gh" 'windmove-left)
|
|
||||||
13
03ivy.el
13
03ivy.el
|
|
@ -3,14 +3,13 @@
|
||||||
|
|
||||||
(counsel-mode 1)
|
(counsel-mode 1)
|
||||||
|
|
||||||
(evil-leader/set-key "ag" 'counsel-ag)
|
(global-set-key (kbd "C-c a") 'counsel-ag)
|
||||||
(evil-leader/set-key "b" 'ivy-switch-buffer)
|
(global-set-key (kbd "C-c b") 'ivy-switch-buffer)
|
||||||
(evil-leader/set-key "/" 'swiper)
|
(global-set-key (kbd "C-c t") 'counsel-find-file)
|
||||||
(evil-leader/set-key "t" 'counsel-find-file)
|
|
||||||
|
(global-set-key (kbd "C-s") 'swiper) ;; Find things by regexp
|
||||||
|
(global-set-key (kbd "M-x") 'counsel-M-x) ;; M-x on steroids
|
||||||
|
|
||||||
(global-set-key (kbd "C-s") 'swiper)
|
|
||||||
(global-set-key (kbd "M-x") 'counsel-M-x)
|
|
||||||
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
|
|
||||||
(global-set-key (kbd "<f1> f") 'counsel-describe-function)
|
(global-set-key (kbd "<f1> f") 'counsel-describe-function)
|
||||||
(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
|
(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
|
||||||
(global-set-key (kbd "<f1> l") 'counsel-find-library)
|
(global-set-key (kbd "<f1> l") 'counsel-find-library)
|
||||||
|
|
|
||||||
14
04magit.el
14
04magit.el
|
|
@ -1,9 +1,7 @@
|
||||||
;; Magit
|
; Magit
|
||||||
(evil-leader/set-key
|
(require 'magit)
|
||||||
"gs" 'magit-status
|
|
||||||
"gco" 'magit-checkout
|
|
||||||
;; TODO: Connect these two into one key
|
|
||||||
"gb" 'magit-blame
|
|
||||||
"gq" 'magit-blame-quit)
|
|
||||||
|
|
||||||
;; (require 'evil-magit)
|
(global-set-key (kbd "<f5> c") 'magit-checkout)
|
||||||
|
(global-set-key (kbd "<f5> b") 'magit-blame)
|
||||||
|
(define-key magit-blame-mode-map (kbd "<f5> b") 'magit-blame-quit)
|
||||||
|
(global-set-key (kbd "<f5> g") 'magit-status)
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,10 @@
|
||||||
(delete-selection-mode 1)
|
(delete-selection-mode 1)
|
||||||
|
|
||||||
;; Key bindings
|
;; Key bindings
|
||||||
(evil-leader/set-key "cl" 'comment-line) ;; Comment lines C-x C-;
|
|
||||||
(evil-leader/set-key "al" 'align-regexp) ;; Align code to some regexp NONE
|
|
||||||
(evil-leader/set-key "ir" 'indent-region) ;; Indent selected region C-M-\
|
|
||||||
(evil-leader/set-key "d" 'dash-at-point) ;; Jump to dash definition NONE
|
|
||||||
(define-key prog-mode-map (kbd "C-d") 'dash-at-point) ;; Jump to dash definition
|
(define-key prog-mode-map (kbd "C-d") 'dash-at-point) ;; Jump to dash definition
|
||||||
|
(define-key prog-mode-map (kbd "C-c c") 'comment-line)
|
||||||
|
(define-key prog-mode-map (kbd "C-c r") 'align-regexp) ;; Because C-c a is used by ag already.
|
||||||
|
(define-key prog-mode-map (kbd "C-c i") 'indent-region)
|
||||||
|
|
||||||
;; When possible, show code documentation
|
;; When possible, show code documentation
|
||||||
(global-eldoc-mode 1)
|
(global-eldoc-mode 1)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@
|
||||||
;; company-async-timeout 2
|
;; company-async-timeout 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(global-company-mode 1)
|
||||||
|
(yas-global-mode 1)
|
||||||
|
|
||||||
(setq-default company-backends '((company-capf company-keywords
|
(setq-default company-backends '((company-capf company-keywords
|
||||||
company-yasnippet
|
company-yasnippet
|
||||||
)
|
)
|
||||||
|
|
@ -31,6 +34,3 @@
|
||||||
company-files ; files & directory
|
company-files ; files & directory
|
||||||
company-ispell ; Ispell
|
company-ispell ; Ispell
|
||||||
))
|
))
|
||||||
|
|
||||||
(global-company-mode 1)
|
|
||||||
(yas-global-mode 1)
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
(projectile-mode t)
|
(projectile-mode t)
|
||||||
|
|
||||||
(evil-leader/set-key "ps" 'counsel-projectile-switch-project)
|
(global-set-key (kbd "C-c p s") 'counsel-projectile-switch-project)
|
||||||
(evil-leader/set-key "pt" 'counsel-projectile-find-file)
|
(global-set-key (kbd "C-c p t") 'counsel-projectile-find-file)
|
||||||
(evil-leader/set-key "pa" 'counsel-projectile-ag)
|
(global-set-key (kbd "C-c p a") 'counsel-projectile-ag)
|
||||||
(evil-leader/set-key "pc" 'projectile-invalidate-cache)
|
(global-set-key (kbd "C-c p c") 'projectile-invalidate-cache)
|
||||||
|
|
|
||||||
54
08purpose.el
54
08purpose.el
|
|
@ -5,66 +5,28 @@
|
||||||
(require 'window-purpose)
|
(require 'window-purpose)
|
||||||
(purpose-mode t)
|
(purpose-mode t)
|
||||||
|
|
||||||
;; Set everything to use code window
|
;; Set everything to use code windows
|
||||||
(add-to-list 'purpose-user-mode-purposes '(fundamental-mode . code))
|
(add-to-list 'purpose-user-mode-purposes '(fundamental-mode . code))
|
||||||
|
(add-to-list 'purpose-user-mode-purposes '(prog-mode . code))
|
||||||
;; Test
|
(add-to-list 'purpose-user-mode-purposes '(diff-mode . code))
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
(add-to-list 'purpose-user-mode-purposes '(magit-diff-mode . code))
|
||||||
'("_spec\\.rb\\(<.*>\\)?$" . test)) ;; Rspec
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
|
||||||
'("_test\\.rb\\(<.*>\\)?$" . test)) ;; Minitest
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
|
||||||
'("_preview\\.rb\\(<.*>\\)?$" . test)) ;; Mailer Previews
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
|
||||||
'("_test\\.exs\\(<.*>\\)?$" . test)) ;; ExUnit
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
|
||||||
'("test_.*\\.py\\(<.*>\\)?$" . test)) ;; Pytest
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
|
||||||
'("tests.rs\\(<.*>\\)?$" . test)) ;; Rust tests
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
|
||||||
'("_test.go\\(<.*>\\)?$" . test)) ;; Go tests
|
|
||||||
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(shell-mode . test))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(magit-diff-mode . test))
|
|
||||||
|
|
||||||
;; Enumerate through all stuff.
|
|
||||||
;; Git things
|
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
(add-to-list 'purpose-user-regexp-purposes
|
||||||
'("COMMIT_EDITMSG\\(<.*>\\)?$" . code))
|
'("COMMIT_EDITMSG\\(<.*>\\)?$" . code))
|
||||||
(add-to-list 'purpose-user-regexp-purposes
|
(add-to-list 'purpose-user-regexp-purposes
|
||||||
'("git-rebase-todo\\(<.*>\\)?$" . code))
|
'("git-rebase-todo\\(<.*>\\)?$" . code))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(diff-mode . code))
|
|
||||||
|
|
||||||
;; Programming files
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(enh-ruby-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(elixir-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(rust-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(haskell-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(haskell-cabal-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(web-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(java-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(python-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(js-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(emacs-lisp-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(sql-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(go-mode . code))
|
|
||||||
|
|
||||||
;; Other files that fall into 'code'
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(xml-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(markdown-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(terraform-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(yaml-mode . code))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(dockerfile-mode . code))
|
|
||||||
|
|
||||||
;; Tools
|
;; Tools
|
||||||
(add-to-list 'purpose-user-mode-purposes '(dired-mode . tools))
|
(add-to-list 'purpose-user-mode-purposes '(dired-mode . tools))
|
||||||
|
(add-to-list 'purpose-user-mode-purposes '(process-list . tools))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(magit-mode . tools))
|
(add-to-list 'purpose-user-mode-purposes '(magit-mode . tools))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(help-mode . tools))
|
(add-to-list 'purpose-user-mode-purposes '(help-mode . tools))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(ivy-mode . tools))
|
(add-to-list 'purpose-user-mode-purposes '(term-mode . tools))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(counsel-mode . tools))
|
|
||||||
(add-to-list 'purpose-user-mode-purposes '(compilation-mode . tools))
|
(add-to-list 'purpose-user-mode-purposes '(compilation-mode . tools))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(etags-select-mode . tools))
|
(add-to-list 'purpose-user-mode-purposes '(etags-select-mode . tools))
|
||||||
(add-to-list 'purpose-user-mode-purposes '(reb-mode . tools)) ;; Regexp builder
|
(add-to-list 'purpose-user-mode-purposes '(reb-mode . tools)) ;; Regexp builder
|
||||||
|
(add-to-list 'purpose-user-regexp-purposes
|
||||||
|
'("Process List\\(<.*>\\)?$" . tools))
|
||||||
|
|
||||||
(setq purpose-use-default-configuration nil)
|
(setq purpose-use-default-configuration nil)
|
||||||
(purpose-compile-user-configuration)
|
(purpose-compile-user-configuration)
|
||||||
|
|
|
||||||
17
10themes.el
17
10themes.el
|
|
@ -7,6 +7,7 @@
|
||||||
(sml/setup)
|
(sml/setup)
|
||||||
(sml/apply-theme 'respectful)
|
(sml/apply-theme 'respectful)
|
||||||
|
|
||||||
|
(load "~/.emacs.d/10themes-base16-not-harmonic.el")
|
||||||
(load-theme 'base16-mexico-light t t)
|
(load-theme 'base16-mexico-light t t)
|
||||||
(load-theme 'flatui t t)
|
(load-theme 'flatui t t)
|
||||||
|
|
||||||
|
|
@ -16,10 +17,22 @@
|
||||||
(set-face-attribute 'linum nil :font "Hasklig 15"
|
(set-face-attribute 'linum nil :font "Hasklig 15"
|
||||||
:slant 'normal))
|
:slant 'normal))
|
||||||
|
|
||||||
|
(defun base16-harmonic-custom ()
|
||||||
|
"Additional configuration for Base 16 theme."
|
||||||
|
(set-face-attribute 'linum nil :font "Hasklig 15"
|
||||||
|
:slant 'normal
|
||||||
|
:background "#2c3a47")
|
||||||
|
|
||||||
|
(set-face-attribute 'font-lock-comment-delimiter-face nil
|
||||||
|
:foreground "#aabcce")
|
||||||
|
(set-face-attribute 'mode-line nil :font "Hasklig 15")
|
||||||
|
(set-face-attribute 'fringe nil :background "#2c3a47"
|
||||||
|
:slant 'normal))
|
||||||
|
|
||||||
(if (display-graphic-p)
|
(if (display-graphic-p)
|
||||||
(progn
|
(progn
|
||||||
(enable-theme 'base16-mexico-light)
|
(enable-theme 'base16-not-harmonic)
|
||||||
(base16-mexico-light-custom))
|
(base16-harmonic-custom))
|
||||||
(progn
|
(progn
|
||||||
(enable-theme 'flatui)))
|
(enable-theme 'flatui)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
;; Start rvm before starting robe
|
;; Start rvm before starting robe
|
||||||
|
(require 'enh-ruby-mode)
|
||||||
|
|
||||||
(defadvice inf-ruby-console-auto (before activate-rvm-for-robe activate)
|
(defadvice inf-ruby-console-auto (before activate-rvm-for-robe activate)
|
||||||
(rvm-activate-corresponding-ruby))
|
(rvm-activate-corresponding-ruby))
|
||||||
|
|
||||||
|
|
@ -28,7 +30,7 @@
|
||||||
(add-hook 'enh-ruby-mode-hook 'activate-ruby-mode)
|
(add-hook 'enh-ruby-mode-hook 'activate-ruby-mode)
|
||||||
|
|
||||||
;; Ruby specific key bindings
|
;; Ruby specific key bindings
|
||||||
(evil-leader/set-key-for-mode 'enh-ruby-mode "j" 'robe-jump)
|
(define-key enh-ruby-mode-map (kbd "C-c j") 'robe-jump)
|
||||||
|
|
||||||
;;; ERB specific things
|
;;; ERB specific things
|
||||||
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
|
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
|
||||||
|
|
|
||||||
8
init.el
8
init.el
|
|
@ -16,15 +16,11 @@
|
||||||
(setq package-list '(
|
(setq package-list '(
|
||||||
exec-path-from-shell ;; Allow to execute path from shell
|
exec-path-from-shell ;; Allow to execute path from shell
|
||||||
|
|
||||||
evil ;; Behave like VIM
|
|
||||||
evil-leader ;; Allow to set leader key (usually space)
|
|
||||||
|
|
||||||
rainbow-delimiters ;; Colorize matching parens
|
rainbow-delimiters ;; Colorize matching parens
|
||||||
rainbow-mode ;; Make color symbols like #FFF colorfull
|
rainbow-mode ;; Make color symbols like #FFF colorfull
|
||||||
|
|
||||||
magit ;; Git interface for Emacs
|
magit ;; Git interface for Emacs
|
||||||
diff-hl ;; Highlight diff (also useful for git)
|
diff-hl ;; Highlight diff (also useful for git)
|
||||||
evil-magit ;; Evil mode for magit
|
|
||||||
|
|
||||||
column-enforce-mode ;; Enforce column length of X
|
column-enforce-mode ;; Enforce column length of X
|
||||||
|
|
||||||
|
|
@ -35,6 +31,7 @@
|
||||||
ivy
|
ivy
|
||||||
counsel
|
counsel
|
||||||
swiper
|
swiper
|
||||||
|
hydra ;; Create nice text menus without memorizing too much
|
||||||
|
|
||||||
;;; Code
|
;;; Code
|
||||||
dash-at-point
|
dash-at-point
|
||||||
|
|
@ -82,7 +79,6 @@
|
||||||
|
|
||||||
;; Additional files
|
;; Additional files
|
||||||
(load "~/.emacs.d/01mac.el")
|
(load "~/.emacs.d/01mac.el")
|
||||||
(load "~/.emacs.d/02evil.el")
|
|
||||||
(load "~/.emacs.d/03ivy.el")
|
(load "~/.emacs.d/03ivy.el")
|
||||||
(load "~/.emacs.d/04magit.el")
|
(load "~/.emacs.d/04magit.el")
|
||||||
(load "~/.emacs.d/05prog-mode.el")
|
(load "~/.emacs.d/05prog-mode.el")
|
||||||
|
|
@ -105,7 +101,7 @@
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
(quote
|
(quote
|
||||||
(markdown-mode solarized-theme company-ansible alchemist evil-magit window-purpose column-enforce-mode yaml-mode ansible dockerfile-mode ruby-end web-mode flymake-ruby rvm dash-at-point robe base16-theme exec-path-from-shell evil))))
|
(hydra markdown-mode solarized-theme company-ansible alchemist window-purpose column-enforce-mode yaml-mode ansible dockerfile-mode ruby-end web-mode flymake-ruby rvm dash-at-point robe base16-theme exec-path-from-shell))))
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
;; custom-set-faces was added by Custom.
|
;; custom-set-faces was added by Custom.
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
(t (0 0 284 74) (nil (0 0 284 62) (:purpose code :purpose-dedicated t :width 0.7056737588652482 :height 0.8266666666666667 :edges (0.0 0.0 0.7056737588652482 0.8266666666666667)) (:purpose test :purpose-dedicated t :width 0.30141843971631205 :height 0.8266666666666667 :edges (0.7056737588652482 0.0 1.0070921985815602 0.8266666666666667))) (:purpose tools :purpose-dedicated t :width 1.0070921985815602 :height 0.16 :edges (0.0 0.8266666666666667 1.0070921985815602 0.9866666666666667)))
|
(nil (0 0 284 74) (t (0 0 143 74) (:purpose code :purpose-dedicated t :width 0.5070921985815603 :height 0.5733333333333334 :edges (0.0 0.0 0.5070921985815603 0.5733333333333334)) (:purpose tools :purpose-dedicated t :width 0.5070921985815603 :height 0.41333333333333333 :edges (0.0 0.5733333333333334 0.5070921985815603 0.9866666666666667))) (:purpose code :purpose-dedicated t :width 0.5 :height 0.9866666666666667 :edges (0.5070921985815603 0.0 1.0070921985815602 0.9866666666666667)))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue