Yet another massive update
This commit is contained in:
parent
ee6ac2095e
commit
d32b9f0dd0
28 changed files with 1124 additions and 601 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -18,5 +18,5 @@ smex-items
|
||||||
*.dat
|
*.dat
|
||||||
*.eld
|
*.eld
|
||||||
|
|
||||||
*.cache
|
*.cache-*
|
||||||
*.log
|
*.log
|
||||||
|
|
8
Cask
8
Cask
|
@ -13,7 +13,8 @@
|
||||||
(depends-on "use-package")
|
(depends-on "use-package")
|
||||||
(depends-on "smex")
|
(depends-on "smex")
|
||||||
(depends-on "pos-tip")
|
(depends-on "pos-tip")
|
||||||
;;(depends-on "vim-empty-lines-mode")
|
(depends-on "nlinum")
|
||||||
|
(depends-on "vim-empty-lines-mode")
|
||||||
(depends-on "hlinum" :git "https://github.com/tom-tan/hlinum-mode")
|
(depends-on "hlinum" :git "https://github.com/tom-tan/hlinum-mode")
|
||||||
|
|
||||||
;; OSX
|
;; OSX
|
||||||
|
@ -34,7 +35,8 @@
|
||||||
(depends-on "rainbow-delimiters")
|
(depends-on "rainbow-delimiters")
|
||||||
(depends-on "smartparens")
|
(depends-on "smartparens")
|
||||||
(depends-on "yasnippet")
|
(depends-on "yasnippet")
|
||||||
(depends-on "git-gutter-fringe+")
|
(depends-on "diff-hl")
|
||||||
|
;; (depends-on "git-gutter-fringe+")
|
||||||
;; (depends-on "ace-jump-mode")
|
;; (depends-on "ace-jump-mode")
|
||||||
(depends-on "pcre2el")
|
(depends-on "pcre2el")
|
||||||
(depends-on "emr")
|
(depends-on "emr")
|
||||||
|
@ -73,7 +75,7 @@
|
||||||
(depends-on "helm-projectile")
|
(depends-on "helm-projectile")
|
||||||
(depends-on "helm-swoop")
|
(depends-on "helm-swoop")
|
||||||
(depends-on "helm-company")
|
(depends-on "helm-company")
|
||||||
(depends-on "neotree")
|
(depends-on "neotree" :git "https://github.com/jeffplang/emacs-neotree")
|
||||||
(depends-on "ido-ubiquitous")
|
(depends-on "ido-ubiquitous")
|
||||||
(depends-on "ido-vertical-mode")
|
(depends-on "ido-vertical-mode")
|
||||||
(depends-on "flx-ido")
|
(depends-on "flx-ido")
|
||||||
|
|
467
contrib/applescript-mode.el
Normal file
467
contrib/applescript-mode.el
Normal file
|
@ -0,0 +1,467 @@
|
||||||
|
;;; applescript-mode.el --- major mode for editing AppleScript source
|
||||||
|
|
||||||
|
;; Copyright (C) 2004 MacEmacs JP Project
|
||||||
|
|
||||||
|
;;; Credits:
|
||||||
|
;; Copyright (C) 2003,2004 FUJIMOTO Hisakuni
|
||||||
|
;; http://www.fobj.com/~hisa/w/applescript.el.html
|
||||||
|
;; Copyright (C) 2003 443,435 (Public Domain?)
|
||||||
|
;; http://pc.2ch.net/test/read.cgi/mac/1034581863/
|
||||||
|
;; Copyright (C) 2004 Harley Gorrell <harley@mahalito.net>
|
||||||
|
;; http://www.mahalito.net/~harley/elisp/osx-osascript.el
|
||||||
|
|
||||||
|
;; Author: sakito <sakito@users.sourceforge.jp>
|
||||||
|
;; Keywords: languages, tools
|
||||||
|
|
||||||
|
(defconst applescript-mode-version "$Revision$"
|
||||||
|
"The current version of the AppleScript mode.")
|
||||||
|
|
||||||
|
(defconst applescript-mode-help-address "sakito@users.sourceforge.jp"
|
||||||
|
"Address accepting submission of bug reports.")
|
||||||
|
|
||||||
|
;; This file is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
;; any later version.
|
||||||
|
|
||||||
|
;; This file is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with GNU Emacs; see the file COPYING. If not, write to
|
||||||
|
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
;; Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
;; acquired from http://github.com/ieure/applescript-mode/
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; AppleScript Mode
|
||||||
|
|
||||||
|
;;; Usage:
|
||||||
|
;; To use applescript-mode.el put the following line in your .emacs:
|
||||||
|
;; (autoload 'applescript-mode "applescript-mode"
|
||||||
|
;; "Major mode for editing AppleScript source." t)
|
||||||
|
;; (add-to-list 'auto-mode-alist '("\\.applescript$" . applescript-mode))
|
||||||
|
|
||||||
|
;; Please use the SourceForge MacEmacs JP Project to submit bugs or
|
||||||
|
;; patches:
|
||||||
|
;;
|
||||||
|
;; http://sourceforge.jp/projects/macemacsjp
|
||||||
|
|
||||||
|
;; FOR MORE INFORMATION:
|
||||||
|
|
||||||
|
;; There is some information on applescript-mode.el at
|
||||||
|
|
||||||
|
;; http://macemacsjp.sourceforge.jp/documents/applescript-mode/
|
||||||
|
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;; user customize variables
|
||||||
|
(defgroup applescript nil
|
||||||
|
"Support for AppleScript, <http://www.apple.com/applescript/>"
|
||||||
|
:group 'languages
|
||||||
|
:prefix "as-")
|
||||||
|
|
||||||
|
(defcustom as-osascript-command "osascript"
|
||||||
|
"*execute AppleScripts and other OSA language scripts."
|
||||||
|
:type 'string
|
||||||
|
:group 'applescript)
|
||||||
|
|
||||||
|
(defcustom as-osacompile-command "osacompile"
|
||||||
|
"*compile AppleScripts and other OSA language scripts."
|
||||||
|
:type 'string
|
||||||
|
:group 'applescript)
|
||||||
|
|
||||||
|
(defcustom as-osascript-command-args '("-ss")
|
||||||
|
"*List of string arguments to be used when starting a osascript."
|
||||||
|
:type '(repeat string)
|
||||||
|
:group 'applescript)
|
||||||
|
|
||||||
|
(defcustom as-indent-offset 4
|
||||||
|
"*Amount of offset per level of indentation.
|
||||||
|
`\\[as-guess-indent-offset]' can usually guess a good value when
|
||||||
|
you're editing someone else's AppleScript code."
|
||||||
|
:type 'integer
|
||||||
|
:group 'applescript)
|
||||||
|
|
||||||
|
(defcustom as-continuation-offset 4
|
||||||
|
"*Additional amount of offset to give for some continuation lines.
|
||||||
|
Continuation lines are those that immediately follow a
|
||||||
|
Continuation sign terminated line. Only those continuation lines
|
||||||
|
for a block opening statement are given this extra offset."
|
||||||
|
:type 'integer
|
||||||
|
:group 'applescript)
|
||||||
|
|
||||||
|
;; Face Setting
|
||||||
|
|
||||||
|
;; Face for true, false, me, it
|
||||||
|
(defvar as-pseudo-keyword-face 'as-pseudo-keyword-face
|
||||||
|
"Face for pseudo keywords in AppleScript mode, like me, true, false.")
|
||||||
|
(make-face 'as-pseudo-keyword-face)
|
||||||
|
|
||||||
|
;; Face for command
|
||||||
|
(defvar as-command-face 'as-command-face
|
||||||
|
"Face for command like copy, get, set, and error.")
|
||||||
|
(make-face 'as-command-face)
|
||||||
|
|
||||||
|
(defun as-font-lock-mode-hook ()
|
||||||
|
(or (face-differs-from-default-p 'as-pseudo-keyword-face)
|
||||||
|
(copy-face 'font-lock-keyword-face 'as-pseudo-keyword-face))
|
||||||
|
(or (face-differs-from-default-p 'as-command-face)
|
||||||
|
(copy-face 'font-lock-keyword-face 'as-command-face)))
|
||||||
|
(add-hook 'font-lock-mode-hook 'as-font-lock-mode-hook)
|
||||||
|
|
||||||
|
(defvar applescript-font-lock-keywords
|
||||||
|
(let (
|
||||||
|
;; expressions and control Statements
|
||||||
|
(kw1 (regexp-opt
|
||||||
|
'("and" "app" "application" "considering" "div"
|
||||||
|
"else" "end" "exit" "is" "mod" "not" "on" "or"
|
||||||
|
"if" "ignoring" "reopen" "repeat"
|
||||||
|
"tell" "then" "to"
|
||||||
|
"using[ \t]terms[ \t]from"
|
||||||
|
"with[ \t]timeout" "with[ \t]transaction")))
|
||||||
|
;; commands
|
||||||
|
(kw2 (regexp-opt
|
||||||
|
'("ASCII[ \t]character" "ASCII[ \t]number" "activate" "AGStart"
|
||||||
|
"beep" "copy" "count" "choose[ \t]application"
|
||||||
|
"choose[ \t]file" "choose[ \t]folder" "close[ \t]access"
|
||||||
|
"current[ \t]date" "display[ \t]dialog" "get" "get[ \t]EOF"
|
||||||
|
"info[ \t]for" "launch" "list[ \t]disks" "list[ \t]folder"
|
||||||
|
"load[ \t]script" "log" "monitor[ \t]depth" "max[ \t]monitor[ \t]depth"
|
||||||
|
"min[ \t]monitor[ \t]depth" "new[ \t]file" "offset"
|
||||||
|
"open[ \t]for[ \t]access" "path[ \t]to" "random[ \t]number"
|
||||||
|
"read" "round" "run" "run[ \t]script" "scripting[ \t]component"
|
||||||
|
"set" "set[ \t]EOF" "set[ \t]monitor[ \t]depth" "set[ \t]volume"
|
||||||
|
"start[ \t]log" "stop[ \t]log" "store[ \t]script"
|
||||||
|
"time[ \t]to[ \t]GMT" "write")))
|
||||||
|
;; misc
|
||||||
|
(kw3 (regexp-opt
|
||||||
|
'("buttons" "default[ \t]answer" "default[ \t]button"
|
||||||
|
"to[ \t]begining[ \t]of" "to[ \t]word" "starting[ \t]at"
|
||||||
|
"with[ \t]icon" "write[ \t]permission"))))
|
||||||
|
(list
|
||||||
|
;; keywords
|
||||||
|
(cons (concat "\\b\\(" kw1 "\\)\\b[ \n\t(]") 1)
|
||||||
|
(cons (concat "\\b\\(" kw2 "\\)\\b[ \n\t(]") 1)
|
||||||
|
;; kw3 not yet..
|
||||||
|
(cons (concat "\\b\\(" kw3 "\\)\\b[ \n\t(]") 1)
|
||||||
|
;; functions
|
||||||
|
'("\\bon[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
|
||||||
|
1 font-lock-function-name-face)
|
||||||
|
'("\\bto[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
|
||||||
|
1 font-lock-function-name-face)
|
||||||
|
;; pseudo-keywords
|
||||||
|
'("\\b\\(it\\|me\\|my\\|true\\|false\\)\\b"
|
||||||
|
1 as-pseudo-keyword-face))))
|
||||||
|
(put 'applescript-mode 'font-lock-defaults '(applescript-font-lock-keywords))
|
||||||
|
|
||||||
|
;; Major mode boilerplate
|
||||||
|
|
||||||
|
;; define a mode-specific abbrev table for those who use such things
|
||||||
|
(defvar applescript-mode-abbrev-table nil
|
||||||
|
"Abbrev table in use in `applescript-mode' buffers.")
|
||||||
|
(define-abbrev-table 'applescript-mode-abbrev-table nil)
|
||||||
|
|
||||||
|
(defvar applescript-mode-hook nil
|
||||||
|
"*Hook called by `applescript-mode'.")
|
||||||
|
|
||||||
|
(defvar as-mode-map ()
|
||||||
|
"Keymap used in `applescript-mode' buffers.")
|
||||||
|
(if as-mode-map
|
||||||
|
nil
|
||||||
|
(setq as-mode-map (make-sparse-keymap))
|
||||||
|
;; Key bindings
|
||||||
|
|
||||||
|
;; subprocess commands
|
||||||
|
(define-key as-mode-map "\C-c\C-c" 'as-execute-buffer)
|
||||||
|
(define-key as-mode-map "\C-c\C-s" 'as-execute-string)
|
||||||
|
(define-key as-mode-map "\C-c|" 'as-execute-region)
|
||||||
|
|
||||||
|
;; Miscellaneous
|
||||||
|
(define-key as-mode-map "\C-c;" 'comment-region)
|
||||||
|
(define-key as-mode-map "\C-c:" 'uncomment-region))
|
||||||
|
|
||||||
|
(defvar as-mode-syntax-table nil
|
||||||
|
"Syntax table used in `applescript-mode' buffers.")
|
||||||
|
(when (not as-mode-syntax-table)
|
||||||
|
(setq as-mode-syntax-table (make-syntax-table))
|
||||||
|
|
||||||
|
(modify-syntax-entry ?\" "\"" as-mode-syntax-table)
|
||||||
|
|
||||||
|
(modify-syntax-entry ?: "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\; "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?& "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\| "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?+ "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?/ "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?= "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?< "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?> "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?$ "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\[ "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\] "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\{ "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\} "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?. "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\\ "." as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\' "." as-mode-syntax-table)
|
||||||
|
|
||||||
|
;; a double hyphen starts a comment
|
||||||
|
(modify-syntax-entry ?- ". 12" as-mode-syntax-table)
|
||||||
|
|
||||||
|
;; comment delimiters
|
||||||
|
(modify-syntax-entry ?\f "> " as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\n "> " as-mode-syntax-table)
|
||||||
|
|
||||||
|
;; define parentheses to match
|
||||||
|
(modify-syntax-entry ?\( "()1" as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\) ")(4" as-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?* ". 23b" as-mode-syntax-table))
|
||||||
|
|
||||||
|
;; Utilities
|
||||||
|
(defmacro as-safe (&rest body)
|
||||||
|
"Safely execute BODY, return nil if an error occurred."
|
||||||
|
(` (condition-case nil
|
||||||
|
(progn (,@ body))
|
||||||
|
(error nil))))
|
||||||
|
|
||||||
|
(defsubst as-keep-region-active ()
|
||||||
|
"Keep the region active in XEmacs."
|
||||||
|
;; Ignore byte-compiler warnings you might see. Also note that
|
||||||
|
;; FSF's Emacs 19 does it differently; its policy doesn't require us
|
||||||
|
;; to take explicit action.
|
||||||
|
(when (featurep 'xemacs)
|
||||||
|
(and (boundp 'zmacs-region-stays)
|
||||||
|
(setq zmacs-region-stays t))))
|
||||||
|
|
||||||
|
(defsubst as-point (position)
|
||||||
|
"Returns the value of point at certain commonly referenced POSITIONs.
|
||||||
|
POSITION can be one of the following symbols:
|
||||||
|
|
||||||
|
bol -- beginning of line
|
||||||
|
eol -- end of line
|
||||||
|
bod -- beginning of on or to
|
||||||
|
eod -- end of on or to
|
||||||
|
bob -- beginning of buffer
|
||||||
|
eob -- end of buffer
|
||||||
|
boi -- back to indentation
|
||||||
|
bos -- beginning of statement
|
||||||
|
|
||||||
|
This function does not modify point or mark."
|
||||||
|
(let ((here (point)))
|
||||||
|
(cond
|
||||||
|
((eq position 'bol) (beginning-of-line))
|
||||||
|
((eq position 'eol) (end-of-line))
|
||||||
|
((eq position 'bod) (as-beginning-of-handler 'either))
|
||||||
|
((eq position 'eod) (as-end-of-handler 'either))
|
||||||
|
;; Kind of funny, I know, but useful for as-up-exception.
|
||||||
|
((eq position 'bob) (beginning-of-buffer))
|
||||||
|
((eq position 'eob) (end-of-buffer))
|
||||||
|
((eq position 'boi) (back-to-indentation))
|
||||||
|
((eq position 'bos) (as-goto-initial-line))
|
||||||
|
(t (error "Unknown buffer position requested: %s" position)))
|
||||||
|
(prog1 (point) (goto-char here))))
|
||||||
|
|
||||||
|
;; Menu definitions, only relevent if you have the easymenu.el package
|
||||||
|
;; (standard in the latest Emacs 19 and XEmacs 19 distributions).
|
||||||
|
(defvar as-menu nil
|
||||||
|
"Menu for AppleScript Mode.
|
||||||
|
This menu will get created automatically if you have the
|
||||||
|
`easymenu' package. Note that the latest X/Emacs releases
|
||||||
|
contain this package.")
|
||||||
|
|
||||||
|
(and (as-safe (require 'easymenu) t)
|
||||||
|
(easy-menu-define
|
||||||
|
as-menu as-mode-map "AppleScript Mode menu"
|
||||||
|
'("AppleScript"
|
||||||
|
["Comment Out Region" comment-region (mark)]
|
||||||
|
["Uncomment Region" uncomment-region (mark)]
|
||||||
|
"-"
|
||||||
|
["Execute buffer" as-execute-buffer t]
|
||||||
|
["Execute region" as-execute-region (mark)]
|
||||||
|
["Execute string" as-execute-string t]
|
||||||
|
"-"
|
||||||
|
["Mode Version" as-mode-version t]
|
||||||
|
["AppleScript Version" as-language-version t])))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun applescript-mode ()
|
||||||
|
"Major mode for editing AppleScript files."
|
||||||
|
(interactive)
|
||||||
|
;; set up local variables
|
||||||
|
(kill-all-local-variables)
|
||||||
|
(make-local-variable 'font-lock-defaults)
|
||||||
|
(make-local-variable 'paragraph-separate)
|
||||||
|
(make-local-variable 'paragraph-start)
|
||||||
|
(make-local-variable 'require-final-newline)
|
||||||
|
(make-local-variable 'comment-start)
|
||||||
|
(make-local-variable 'comment-end)
|
||||||
|
(make-local-variable 'comment-start-skip)
|
||||||
|
(make-local-variable 'comment-column)
|
||||||
|
(make-local-variable 'comment-indent-function)
|
||||||
|
(make-local-variable 'indent-region-function)
|
||||||
|
(make-local-variable 'indent-line-function)
|
||||||
|
(make-local-variable 'add-log-current-defun-function)
|
||||||
|
(make-local-variable 'fill-paragraph-function)
|
||||||
|
;;
|
||||||
|
|
||||||
|
;; Maps and tables
|
||||||
|
(use-local-map as-mode-map)
|
||||||
|
|
||||||
|
(set-syntax-table as-mode-syntax-table)
|
||||||
|
|
||||||
|
;; Names
|
||||||
|
(setq major-mode 'applescript-mode
|
||||||
|
mode-name "AppleScript"
|
||||||
|
local-abbrev-table applescript-mode-abbrev-table
|
||||||
|
font-lock-defaults '(applescript-font-lock-keywords)
|
||||||
|
paragraph-separate "[ \t\n\f]*$"
|
||||||
|
paragraph-start "[ \t\n\f]*$"
|
||||||
|
require-final-newline t
|
||||||
|
comment-start "-- "
|
||||||
|
comment-end ""
|
||||||
|
comment-start-skip "---*[ \t]*"
|
||||||
|
comment-column 40)
|
||||||
|
|
||||||
|
;; Support for outline-minor-mode
|
||||||
|
(set (make-local-variable 'outline-regexp)
|
||||||
|
"\\([ \t]*\\(on\\|to\\|if\\|repeat\\|tell\\|end\\)\\|--\\)")
|
||||||
|
(set (make-local-variable 'outline-level) 'as-outline-level)
|
||||||
|
|
||||||
|
;; add the menu
|
||||||
|
(if as-menu
|
||||||
|
(easy-menu-add as-menu))
|
||||||
|
|
||||||
|
;; Run the mode hook. Note that applescript-mode-hook is deprecated.
|
||||||
|
(if applescript-mode-hook
|
||||||
|
(run-hooks 'applescript-mode-hook)
|
||||||
|
(run-hooks 'applescript-mode-hook)))
|
||||||
|
|
||||||
|
(when (not (or (rassq 'applescript-mode auto-mode-alist)
|
||||||
|
(push '("\\.applescript$" . applescript-mode) auto-mode-alist))))
|
||||||
|
|
||||||
|
;;; Subprocess commands
|
||||||
|
|
||||||
|
;; function use variables
|
||||||
|
(defconst as-output-buffer "*AppleScript Output*"
|
||||||
|
"Name for the buffer to display AppleScript output.")
|
||||||
|
(make-variable-buffer-local 'as-output-buffer)
|
||||||
|
|
||||||
|
;; Code execution commands
|
||||||
|
(defun as-execute-buffer (&optional async)
|
||||||
|
"Execute the whole buffer as an Applescript"
|
||||||
|
(interactive "P")
|
||||||
|
(as-execute-region (point-min) (point-max) async))
|
||||||
|
|
||||||
|
(defun as-execute-string (string &optional async)
|
||||||
|
"Send the argument STRING to an AppleScript."
|
||||||
|
(interactive "sExecute AppleScript: ")
|
||||||
|
(save-excursion
|
||||||
|
(set-buffer (get-buffer-create
|
||||||
|
(generate-new-buffer-name as-output-buffer)))
|
||||||
|
(insert string)
|
||||||
|
(as-execute-region (point-min) (point-max) async)))
|
||||||
|
|
||||||
|
(defun as-execute-region (start end &optional async)
|
||||||
|
"Execute the region as an Applescript"
|
||||||
|
(interactive "r\nP")
|
||||||
|
(let ((region (buffer-substring start end))
|
||||||
|
(as-current-win (selected-window)))
|
||||||
|
(pop-to-buffer as-output-buffer)
|
||||||
|
(insert (as-execute-code region))
|
||||||
|
(select-window as-current-win)))
|
||||||
|
|
||||||
|
(defun as-execute-code (code)
|
||||||
|
"pop to the AppleScript buffer, run the code and display the results."
|
||||||
|
(as-decode-string
|
||||||
|
(do-applescript (as-string-to-sjis-string-with-escape code))))
|
||||||
|
|
||||||
|
(defun as-mode-version ()
|
||||||
|
"Echo the current version of `applescript-mode' in the minibuffer."
|
||||||
|
(interactive)
|
||||||
|
(message "Using `applescript-mode' version %s" applescript-mode-version)
|
||||||
|
(as-keep-region-active))
|
||||||
|
|
||||||
|
(defun as-language-version()
|
||||||
|
"Echo the current version of AppleScript Version in the minibuffer."
|
||||||
|
(interactive)
|
||||||
|
(message "Using AppleScript version %s"
|
||||||
|
(as-execute-code "AppleScript's version"))
|
||||||
|
(as-keep-region-active))
|
||||||
|
|
||||||
|
;; as-beginning-of-handler, as-end-of-handler,as-goto-initial-line not yet
|
||||||
|
|
||||||
|
;; Support for outline.el
|
||||||
|
(defun as-outline-level ()
|
||||||
|
"This is so that `current-column` DTRT in otherwise-hidden text"
|
||||||
|
(let (buffer-invisibility-spec)
|
||||||
|
(save-excursion
|
||||||
|
(back-to-indentation)
|
||||||
|
(current-column))))
|
||||||
|
|
||||||
|
;; for Japanese
|
||||||
|
(defun as-unescape-string (str)
|
||||||
|
"delete escape char '\'"
|
||||||
|
(replace-regexp-in-string "\\\\\\(.\\)" "\\1" str))
|
||||||
|
|
||||||
|
(defun as-escape-string (str)
|
||||||
|
"add escape char '\'"
|
||||||
|
(replace-regexp-in-string "\\\\" "\\\\\\\\" str))
|
||||||
|
|
||||||
|
(defun as-sjis-byte-list-escape (lst)
|
||||||
|
(cond
|
||||||
|
((null lst) nil)
|
||||||
|
((= (car lst) 92)
|
||||||
|
(append (list 92 (car lst)) (as-sjis-byte-list-escape (cdr lst))))
|
||||||
|
(t (cons (car lst) (as-sjis-byte-list-escape (cdr lst))))))
|
||||||
|
|
||||||
|
(defun as-string-to-sjis-string-with-escape (str)
|
||||||
|
"String convert to SJIS, and escape \"\\\" "
|
||||||
|
(apply 'string
|
||||||
|
(as-sjis-byte-list-escape
|
||||||
|
(string-to-list
|
||||||
|
(as-encode-string str)))))
|
||||||
|
|
||||||
|
(defun as-decode-string (str)
|
||||||
|
"do-applescript return values decode sjis-mac"
|
||||||
|
(decode-coding-string str 'sjis-mac))
|
||||||
|
|
||||||
|
(defun as-encode-string (str)
|
||||||
|
"do-applescript return values encode sjis-mac"
|
||||||
|
(encode-coding-string str 'sjis-mac))
|
||||||
|
|
||||||
|
(defun as-parse-result (retstr)
|
||||||
|
"String convert to Emacs Lisp Object"
|
||||||
|
(cond
|
||||||
|
;; as list
|
||||||
|
((string-match "\\`\\s-*{\\(.*\\)}\\s-*\\'" retstr)
|
||||||
|
(let ((mstr (match-string 1 retstr)))
|
||||||
|
(mapcar (lambda (item) (as-parse-result item))
|
||||||
|
(split-string mstr ","))))
|
||||||
|
|
||||||
|
;; AERecord item as cons
|
||||||
|
((string-match "\\`\\s-*\\([^:\\\"]+\\):\\(.*\\)\\s-*\\'" retstr)
|
||||||
|
(cons (intern (match-string 1 retstr))
|
||||||
|
(as-parse-result (match-string 2 retstr))))
|
||||||
|
|
||||||
|
;; as string
|
||||||
|
((string-match "\\`\\s-*\\\"\\(.*\\)\\\"\\s-*\\'" retstr)
|
||||||
|
(as-decode-string
|
||||||
|
(as-unescape-string (match-string 1 retstr))))
|
||||||
|
|
||||||
|
;; as integer
|
||||||
|
((string-match "\\`\\s-*\\([0-9]+\\)\\s-*\\'" retstr)
|
||||||
|
(string-to-int (match-string 1 retstr)))
|
||||||
|
|
||||||
|
;; else
|
||||||
|
(t (intern retstr))))
|
||||||
|
|
||||||
|
(provide 'applescript-mode)
|
||||||
|
;;; applescript-mode.el ends here
|
40
init.el
40
init.el
|
@ -5,15 +5,8 @@
|
||||||
;;
|
;;
|
||||||
;;; Description:
|
;;; Description:
|
||||||
;;
|
;;
|
||||||
;; My emacs.d, which sets out to rustle emacs users' jimmies by making
|
;; My emacs.d sets out to rustle emacs users' jimmies by making emacs as
|
||||||
;; emacs as vim-like as possible.
|
;; vim-like as possible.
|
||||||
;;
|
|
||||||
;; Naming conventions:
|
|
||||||
;; * my--<defun-name> ; interal defuns, meant for use via elisp
|
|
||||||
;; * my-<defun-name> ; interactive command, can be used via M-x
|
|
||||||
;; * my.<defun-name> ; commands with buffer side-effects (for keybinds)
|
|
||||||
;; * my:<defun-name> ; defuns meant to be used from Ex mode
|
|
||||||
;; * *<defun/var-name> ; for altering the visual state
|
|
||||||
;;
|
;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(defconst DEBUG-MODE nil)
|
(defconst DEBUG-MODE nil)
|
||||||
|
@ -23,17 +16,13 @@
|
||||||
(defconst my-contrib-dir (concat my-dir "contrib/"))
|
(defconst my-contrib-dir (concat my-dir "contrib/"))
|
||||||
(defconst my-themes-dir (concat my-dir "themes/"))
|
(defconst my-themes-dir (concat my-dir "themes/"))
|
||||||
(defconst my-snippets-dir (concat my-dir "snippets/"))
|
(defconst my-snippets-dir (concat my-dir "snippets/"))
|
||||||
(defconst my-tmp-dir (concat my-dir ".cache/"))
|
(defconst my-tmp-dir (concat my-dir ".cache-" (system-name) "/"))
|
||||||
|
|
||||||
(defconst *dark-theme 'v0)
|
(defconst *default-theme 'v0)
|
||||||
(defconst *light-theme 'github) ; wtb better light theme...
|
(defconst *default-font (font-spec :family "Terminus (TTF)" :size 12 :antialias nil))
|
||||||
(defconst *fonts `(,(font-spec :family "Terminus (TTF)" :size 12 :antialias nil)
|
|
||||||
,(font-spec :family "Inconsolata" :size 14 :antialias t)
|
|
||||||
,(font-spec :family "Ubuntu Mono" :size 20 :antialias t)
|
|
||||||
))
|
|
||||||
|
|
||||||
(push my-modules-dir load-path)
|
(add-to-list 'load-path my-modules-dir)
|
||||||
(push my-contrib-dir load-path)
|
(add-to-list 'load-path my-contrib-dir)
|
||||||
;; Add cask dirs to load-path
|
;; Add cask dirs to load-path
|
||||||
(let ((default-directory (expand-file-name (concat ".cask/" emacs-version "/elpa/") my-dir)))
|
(let ((default-directory (expand-file-name (concat ".cask/" emacs-version "/elpa/") my-dir)))
|
||||||
(normal-top-level-add-subdirs-to-load-path))
|
(normal-top-level-add-subdirs-to-load-path))
|
||||||
|
@ -47,23 +36,24 @@
|
||||||
core-evil ; evil-mode and its plugins
|
core-evil ; evil-mode and its plugins
|
||||||
core-editor ; completing the editor
|
core-editor ; completing the editor
|
||||||
|
|
||||||
init-auto-insert ; for the lazy typis
|
init-auto-insert ; for the lazy typist
|
||||||
init-company ; see above
|
init-company ; see above
|
||||||
init-fly ; fly(check|spell)
|
init-fly ; fly(check|spell)
|
||||||
init-git ; git-gutter + modes
|
init-vc ; version control gutter + git modes
|
||||||
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-helm ; a search engine for your life
|
||||||
init-project ; project tools: dired, neotree
|
init-project ; dired, neotree
|
||||||
|
init-present ; for when I need to show off
|
||||||
|
|
||||||
init-cc ; C/C++/Obj-C madness
|
init-cc ; C/C++/Obj-C madness
|
||||||
;; init-cscope
|
;; init-cscope
|
||||||
init-csharp
|
init-csharp
|
||||||
;; init-eshell
|
;; init-eshell
|
||||||
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 ; one-based indices? One-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
|
||||||
init-regex ; /^[^\s](meaning)[^\n]*/
|
init-regex ; /^[^\s](meaning)[^\n]*/
|
||||||
|
@ -75,8 +65,8 @@
|
||||||
init-tmux
|
init-tmux
|
||||||
;; init-rust
|
;; init-rust
|
||||||
;; init-R
|
;; init-R
|
||||||
init-web
|
init-web ; For the 2.0'er
|
||||||
init-workgroups
|
init-workgroups ; session management I can understand
|
||||||
init-yasnippet ; type for me
|
init-yasnippet ; type for me
|
||||||
|
|
||||||
my-defuns
|
my-defuns
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
;; Global editor behavior
|
;; Global editor behavior
|
||||||
(electric-indent-mode 1)
|
(electric-indent-mode -1)
|
||||||
(setq electric-indent-chars '(? ?: ?{))
|
(setq electric-indent-chars '(? ?: ?{))
|
||||||
(add-hook! 'org-mode-hook (electric-indent-mode -1))
|
(add-hook 'python-mode-hook 'electric-indent-local-mode)
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
(add-hook! 'eldoc-mode-hook (diminish 'eldoc-mode " ?"))
|
||||||
|
|
||||||
(setq-default fill-column 80)
|
(setq-default fill-column 80)
|
||||||
|
(diminish 'auto-fill-function)
|
||||||
;; Sane scroll settings
|
;; Sane scroll settings
|
||||||
(setq scroll-margin 5)
|
(setq scroll-margin 5)
|
||||||
(setq scroll-conservatively 9999)
|
(setq scroll-conservatively 9999)
|
||||||
|
@ -42,9 +44,15 @@
|
||||||
(set-face-foreground face nil)
|
(set-face-foreground face nil)
|
||||||
(set-face-background face nil))
|
(set-face-background face nil))
|
||||||
|
|
||||||
|
(diminish 'isearch-mode)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package anzu
|
||||||
|
:diminish anzu-mode
|
||||||
|
:config (global-anzu-mode +1))
|
||||||
|
|
||||||
(use-package smartparens
|
(use-package smartparens
|
||||||
|
:diminish smartparens-mode
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(require 'smartparens-config)
|
(require 'smartparens-config)
|
||||||
|
@ -72,6 +80,10 @@
|
||||||
(sp-local-pair "/* " " */" :post-handlers '(("||\n[i]" "RET")))
|
(sp-local-pair "/* " " */" :post-handlers '(("||\n[i]" "RET")))
|
||||||
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET"))))
|
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET"))))
|
||||||
|
|
||||||
|
;; Support for generics
|
||||||
|
(sp-with-modes '(c-mode c++-mode objc-mode java-mode)
|
||||||
|
(sp-local-pair "<" ">" :when '(sp-point-after-word-p) :unless '(sp-point-before-same-p)))
|
||||||
|
|
||||||
(sp-with-modes '(objc-mode scss-mode css-mode)
|
(sp-with-modes '(objc-mode scss-mode css-mode)
|
||||||
(sp-local-pair "/*\n" "\n */" :post-handlers '(("||[i]" "RET"))))
|
(sp-local-pair "/*\n" "\n */" :post-handlers '(("||[i]" "RET"))))
|
||||||
|
|
||||||
|
@ -89,7 +101,7 @@
|
||||||
:commands (smart-up smart-down smart-left smart-right))
|
:commands (smart-up smart-down smart-left smart-right))
|
||||||
|
|
||||||
(use-package expand-region
|
(use-package expand-region
|
||||||
:commands (er/expand-region er/contract-region))
|
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
||||||
|
|
||||||
(use-package hl-todo
|
(use-package hl-todo
|
||||||
:commands hl-todo-mode
|
:commands hl-todo-mode
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
;;;; Eeeeeeevil ;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;; Eeeeeeevil ;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(use-package evil
|
(use-package evil
|
||||||
|
:diminish undo-tree-mode
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq evil-want-visual-char-semi-exclusive t
|
(setq evil-want-visual-char-semi-exclusive nil
|
||||||
evil-search-module 'evil-search
|
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
|
||||||
evil-ex-visual-char-range t ; column range for ex commands
|
evil-ex-visual-char-range t ; column range for ex commands
|
||||||
evil-ex-search-vim-style-regexp t
|
evil-ex-search-vim-style-regexp t
|
||||||
|
evil-ex-interactive-search-highlight 'selected-window
|
||||||
|
|
||||||
;; Color-coded state cursors
|
;; Color-coded state cursors
|
||||||
evil-normal-state-cursor '("white" box)
|
evil-normal-state-cursor '("white" box)
|
||||||
|
@ -19,9 +21,9 @@
|
||||||
(evil-mode 1)
|
(evil-mode 1)
|
||||||
|
|
||||||
;; 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! 'evil-local-mode-hook (setq evil-shift-width tab-width))
|
||||||
;; Fix code folding
|
;; Fix code folding
|
||||||
(add-hook 'prog-mode-hook 'hs-minor-mode)
|
(add-hook! 'prog-mode-hook (hs-minor-mode 1) (diminish '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))
|
||||||
|
@ -74,6 +76,7 @@
|
||||||
:config (global-evil-search-highlight-persist t))
|
:config (global-evil-search-highlight-persist t))
|
||||||
|
|
||||||
(use-package evil-commentary
|
(use-package evil-commentary
|
||||||
|
:diminish evil-commentary-mode
|
||||||
:commands (evil-commentary
|
:commands (evil-commentary
|
||||||
evil-commentary-yank
|
evil-commentary-yank
|
||||||
evil-commentary-line)
|
evil-commentary-line)
|
||||||
|
@ -82,10 +85,8 @@
|
||||||
(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))
|
||||||
:config
|
:config
|
||||||
(progn
|
(setq evil-jumper-auto-center t
|
||||||
(setq evil-jumper-auto-center t
|
evil-jumper-auto-save-interval 3600))
|
||||||
evil-jumper-auto-save-interval 3600)
|
|
||||||
(define-key evil-motion-state-map (kbd "H-i") 'evil-jumper/forward)))
|
|
||||||
|
|
||||||
(use-package evil-exchange
|
(use-package evil-exchange
|
||||||
:commands (evil-exchange)
|
:commands (evil-exchange)
|
||||||
|
@ -111,6 +112,7 @@
|
||||||
(global-evil-visualstar-mode 1)))
|
(global-evil-visualstar-mode 1)))
|
||||||
|
|
||||||
(use-package evil-snipe
|
(use-package evil-snipe
|
||||||
|
:diminish evil-snipe-mode
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(global-evil-snipe-mode +1)
|
(global-evil-snipe-mode +1)
|
||||||
|
@ -167,16 +169,15 @@
|
||||||
(mapc 'kill-buffer
|
(mapc 'kill-buffer
|
||||||
(my-living-buffer-list (if bang (projectile-project-buffers) (buffer-list)))))
|
(my-living-buffer-list (if bang (projectile-project-buffers) (buffer-list)))))
|
||||||
|
|
||||||
(evil-define-command my:init-files (&optional bang)
|
(evil-define-command my:init-files (&optional bang) :repeat nil
|
||||||
:repeat nil
|
|
||||||
(interactive "<!>")
|
(interactive "<!>")
|
||||||
(if bang
|
(if bang
|
||||||
(ido-find-file-in-dir my-modules-dir)
|
(ido-find-file-in-dir my-modules-dir)
|
||||||
(ido-find-file-in-dir my-dir)))
|
(ido-find-file-in-dir my-dir)))
|
||||||
|
|
||||||
(evil-define-command my:notes ()
|
(evil-define-command my:notes () :repeat nil
|
||||||
:repeat nil
|
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(require 'org)
|
||||||
(ido-find-file-in-dir org-directory))
|
(ido-find-file-in-dir org-directory))
|
||||||
|
|
||||||
(evil-define-command my:byte-compile (&optional bang)
|
(evil-define-command my:byte-compile (&optional bang)
|
||||||
|
|
|
@ -12,8 +12,10 @@
|
||||||
(setq mac-option-modifier 'alt)
|
(setq mac-option-modifier 'alt)
|
||||||
|
|
||||||
;; fix emacs PATH on OSX (GUI only)
|
;; fix emacs PATH on OSX (GUI only)
|
||||||
(require 'exec-path-from-shell)
|
(use-package exec-path-from-shell
|
||||||
(exec-path-from-shell-initialize)
|
:config (exec-path-from-shell-initialize))
|
||||||
|
|
||||||
|
(use-package applescript-mode :mode "\\.applescript$")
|
||||||
|
|
||||||
(after "evil"
|
(after "evil"
|
||||||
;; On OSX, stop copying each visual state move to the clipboard:
|
;; On OSX, stop copying each visual state move to the clipboard:
|
||||||
|
@ -26,10 +28,10 @@
|
||||||
;; 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 "-a " app-name)))
|
(let* ((path (f-full (s-replace "'" "\\'" (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)))))
|
(command (concat "open " (when app-name (concat "-a " (shell-quote-argument app-name))) " '" path "'")))
|
||||||
(message "Trying: %s" (concat "open " app-name " " (shell-quote-argument path)))
|
(message "Trying: %s" command)
|
||||||
(shell-command (concat "open " app-name " " (shell-quote-argument path)))))
|
(shell-command command)))
|
||||||
|
|
||||||
|
|
||||||
(provide 'core-osx)
|
(provide 'core-osx)
|
||||||
|
|
190
init/core-ui.el
190
init/core-ui.el
|
@ -1,50 +1,105 @@
|
||||||
;;; core-ui.el -- User interface layout & behavior
|
;;; core-ui.el -- User interface layout & behavior
|
||||||
|
|
||||||
;;;; Load Theme ;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;; Load Theme ;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(when window-system
|
|
||||||
(set-frame-parameter nil 'alpha '(96 86))
|
|
||||||
(cycle-font 0)) ; Load font
|
|
||||||
|
|
||||||
|
(when window-system
|
||||||
|
(set-frame-font *default-font)
|
||||||
|
(set-frame-parameter nil 'alpha '(100 75)))
|
||||||
(add-to-list 'custom-theme-load-path my-themes-dir)
|
(add-to-list 'custom-theme-load-path my-themes-dir)
|
||||||
(load-dark-theme)
|
(load-theme *default-theme t)
|
||||||
|
|
||||||
|
|
||||||
;;;; GUI Settings ;;;;;;;;;;;;;;;;;;;;;;
|
;;;; GUI Settings ;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(when window-system
|
(when window-system
|
||||||
(scroll-bar-mode -1) ; no scrollbar
|
(scroll-bar-mode -1) ; no scrollbar
|
||||||
(tool-bar-mode -1) ; no toolbar
|
(tool-bar-mode -1) ; no toolbar
|
||||||
(menu-bar-mode -1)) ; no menubar
|
(menu-bar-mode -1) ; no menubar
|
||||||
|
(fringe-mode '(2 . 8))) ; no nonsense
|
||||||
|
|
||||||
(tooltip-mode -1)
|
(global-hl-line-mode 1) ; do highlight line
|
||||||
(blink-cursor-mode 1) ; blink cursor
|
(blink-cursor-mode 1) ; do blink cursor
|
||||||
(global-hl-line-mode -1) ; highlight line
|
(line-number-mode 1) ; do show line no in modeline
|
||||||
|
(column-number-mode 1) ; do show col no in modeline
|
||||||
;; Highlight curent line number
|
(tooltip-mode -1) ; don't show tooltips
|
||||||
(use-package hlinum
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(hlinum-activate)
|
|
||||||
;; A little excessive
|
|
||||||
(remove-hook 'pre-command-hook 'hlinum-unhighlight-current-line)))
|
|
||||||
|
|
||||||
;; Line numbers
|
|
||||||
(setq linum-format " %4d ")
|
|
||||||
(add-hooks '(text-mode-hook prog-mode-hook) 'linum-mode)
|
|
||||||
|
|
||||||
;; Multiple cursors across buffers cause a strange redraw delay for
|
;; Multiple cursors across buffers cause a strange redraw delay for
|
||||||
;; some things, like auto-complete or evil-mode's cursor color
|
;; some things, like auto-complete or evil-mode's cursor color
|
||||||
;; switching.
|
;; switching.
|
||||||
(setq-default cursor-in-non-selected-windows nil)
|
(setq-default cursor-in-non-selected-windows nil
|
||||||
|
visible-bell nil ; silence of the bells
|
||||||
|
use-dialog-box nil ; avoid GUI
|
||||||
|
redisplay-dont-pause t
|
||||||
|
;; do not soft-wrap lines
|
||||||
|
truncate-lines t
|
||||||
|
truncate-partial-width-windows nil
|
||||||
|
indicate-buffer-boundaries nil
|
||||||
|
indicate-empty-lines nil
|
||||||
|
fringes-outside-margins t)
|
||||||
|
|
||||||
(setq-default visible-bell nil) ; silence of the bells
|
(use-package nlinum
|
||||||
(setq-default use-dialog-box nil) ; avoid GUI
|
:commands nlinum-mode
|
||||||
(setq-default redisplay-dont-pause t)
|
:init
|
||||||
|
(progn
|
||||||
|
(defface linum-highlight-face '((t (:inherit linum)))
|
||||||
|
"Face for line highlights")
|
||||||
|
|
||||||
;; do not soft-wrap lines
|
;; Preset width nlinum
|
||||||
(setq-default truncate-lines t)
|
(add-hook! 'nlinum-mode-hook
|
||||||
(setq-default truncate-partial-width-windows nil)
|
(setq nlinum--width
|
||||||
(setq-default indicate-buffer-boundaries nil)
|
(length (number-to-string
|
||||||
(setq-default indicate-empty-lines nil)
|
(count-lines (point-min) (point-max))))))
|
||||||
|
|
||||||
|
;; Highlight line number
|
||||||
|
(setq hl-nlinum-overlay nil)
|
||||||
|
(setq hl-nlinum-line nil)
|
||||||
|
(defun hl-nlinum-unhighlight-line ()
|
||||||
|
(when hl-nlinum-overlay
|
||||||
|
(let* ((ov hl-nlinum-overlay)
|
||||||
|
(disp (get-text-property 0 'display (overlay-get ov 'before-string)))
|
||||||
|
(str (nth 1 disp)))
|
||||||
|
(put-text-property 0 (length str) 'face 'linum str)
|
||||||
|
(setq hl-nlinum-overlay nil)
|
||||||
|
(setq hl-nlinum-line nil))))
|
||||||
|
|
||||||
|
(defun hl-nlinum-highlight-line ()
|
||||||
|
(let ((line-no (line-number-at-pos (point))))
|
||||||
|
(when (and nlinum-mode (not (eq line-no hl-nlinum-line)))
|
||||||
|
(let* ((pbol (point-at-bol))
|
||||||
|
(peol (1+ pbol)))
|
||||||
|
;; Handle EOF case
|
||||||
|
(when (>= peol (point-max))
|
||||||
|
(setq pbol (line-beginning-position 0))
|
||||||
|
(setq peol (line-end-position 0)))
|
||||||
|
(jit-lock-fontify-now pbol peol)
|
||||||
|
(let* ((overlays (overlays-in pbol peol))
|
||||||
|
(ov (-first (lambda (item) (overlay-get item 'nlinum)) overlays)))
|
||||||
|
(when ov
|
||||||
|
(hl-nlinum-unhighlight-line)
|
||||||
|
(let* ((disp (get-text-property 0 'display (overlay-get ov 'before-string)))
|
||||||
|
(str (nth 1 disp)))
|
||||||
|
(put-text-property 0 (length str) 'face 'linum-highlight-face str)
|
||||||
|
(put-text-property 0 (length str) 'face 'linum-highlight-face str)
|
||||||
|
(setq hl-nlinum-overlay ov)
|
||||||
|
(setq hl-nlinum-line line-no))))))))
|
||||||
|
|
||||||
|
(defun nlinum-toggle ()
|
||||||
|
(interactive)
|
||||||
|
(if nlinum-mode
|
||||||
|
(nlinum-disable)
|
||||||
|
(nlinum-enable)))
|
||||||
|
(defun nlinum-enable ()
|
||||||
|
(nlinum-mode +1)
|
||||||
|
(add-hook 'post-command-hook 'hl-nlinum-highlight-line))
|
||||||
|
(defun nlinum-disable ()
|
||||||
|
(nlinum-mode -1)
|
||||||
|
(remove-hook 'post-command-hook 'hl-nlinum-highlight-line)
|
||||||
|
(hl-nlinum-unhighlight-line))
|
||||||
|
|
||||||
|
(add-hooks '(text-mode-hook prog-mode-hook) 'nlinum-enable)
|
||||||
|
(add-hook 'org-mode-hook 'nlinum-disable))
|
||||||
|
:config
|
||||||
|
(setq-default nlinum-format " %4d "))
|
||||||
|
|
||||||
(when window-system
|
(when window-system
|
||||||
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
||||||
|
@ -58,11 +113,11 @@
|
||||||
;; [pedantry intensifies]
|
;; [pedantry intensifies]
|
||||||
(rename-mode-name emacs-lisp-mode "Elisp")
|
(rename-mode-name emacs-lisp-mode "Elisp")
|
||||||
|
|
||||||
|
(use-package vim-empty-lines-mode
|
||||||
|
:config (global-vim-empty-lines-mode +1))
|
||||||
|
|
||||||
|
|
||||||
;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; (use-package vim-empty-lines-mode
|
|
||||||
;; :config (global-vim-empty-lines-mode +1))
|
|
||||||
|
|
||||||
(use-package uniquify
|
(use-package uniquify
|
||||||
:config
|
:config
|
||||||
(setq uniquify-buffer-name-style 'post-forward-angle-brackets
|
(setq uniquify-buffer-name-style 'post-forward-angle-brackets
|
||||||
|
@ -70,28 +125,6 @@
|
||||||
uniquify-ignore-buffers-re "^\\*"))
|
uniquify-ignore-buffers-re "^\\*"))
|
||||||
|
|
||||||
(use-package smart-mode-line
|
(use-package smart-mode-line
|
||||||
:init
|
|
||||||
(defvar rm-blacklist
|
|
||||||
(mapconcat 'identity
|
|
||||||
'(" SP"
|
|
||||||
" Fill"
|
|
||||||
" EvilOrg"
|
|
||||||
" Abbrev"
|
|
||||||
" snipe"
|
|
||||||
" company"
|
|
||||||
" Anaconda"
|
|
||||||
" WS"
|
|
||||||
" GitGutter"
|
|
||||||
" Undo-Tree"
|
|
||||||
" Projectile\\[.+\\]"
|
|
||||||
" hs"
|
|
||||||
" ElDoc"
|
|
||||||
" wg"
|
|
||||||
" ~"
|
|
||||||
" s-/"
|
|
||||||
" emr"
|
|
||||||
" Refactor"
|
|
||||||
) "\\|"))
|
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq sml/no-confirm-load-theme t
|
(setq sml/no-confirm-load-theme t
|
||||||
|
@ -99,11 +132,12 @@
|
||||||
sml/extra-filler (if window-system -1 0)
|
sml/extra-filler (if window-system -1 0)
|
||||||
sml/show-remote nil
|
sml/show-remote nil
|
||||||
sml/modified-char "*"
|
sml/modified-char "*"
|
||||||
sml/encoding-format nil)
|
sml/encoding-format nil
|
||||||
|
sml/replacer-regexp-list '(("^~/Dropbox/Projects/" "PROJECTS:")
|
||||||
(setq sml/replacer-regexp-list '(("^~/Dropbox/Projects/" "PROJECTS:")
|
("^~/.emacs.d/" "EMACS.D:")
|
||||||
("^~/.emacs.d/" "EMACS.D:")))
|
("^~/Dropbox/notes/" "NOTES:")))
|
||||||
|
|
||||||
|
;; Hide evil state indicator
|
||||||
(after "evil" (setq evil-mode-line-format nil))
|
(after "evil" (setq evil-mode-line-format nil))
|
||||||
|
|
||||||
(setq-default mode-line-misc-info
|
(setq-default mode-line-misc-info
|
||||||
|
@ -111,23 +145,24 @@
|
||||||
(global-mode-string ("" global-mode-string ""))))
|
(global-mode-string ("" global-mode-string ""))))
|
||||||
|
|
||||||
(add-hook! 'after-change-major-mode-hook
|
(add-hook! 'after-change-major-mode-hook
|
||||||
(setq mode-line-format
|
(unless (null mode-line-format)
|
||||||
'((if window-system " ")
|
(setq mode-line-format
|
||||||
"%e"
|
'((if window-system " ")
|
||||||
mode-line-mule-info
|
"%e"
|
||||||
mode-line-client
|
;; mode-line-mule-info
|
||||||
mode-line-remote
|
;; mode-line-client
|
||||||
mode-line-frame-identification
|
;; mode-line-remote
|
||||||
mode-line-buffer-identification
|
;; mode-line-frame-identification
|
||||||
mode-line-modified
|
mode-line-buffer-identification
|
||||||
mode-line-modes
|
mode-line-modified
|
||||||
mode-line-misc-info
|
mode-line-modes
|
||||||
(vc-mode vc-mode)
|
mode-line-misc-info
|
||||||
" "
|
(vc-mode vc-mode)
|
||||||
mode-line-position
|
" "
|
||||||
" "
|
mode-line-position
|
||||||
mode-line-front-space
|
" "
|
||||||
))
|
mode-line-front-space
|
||||||
|
)))
|
||||||
|
|
||||||
(add-to-list 'mode-line-modes
|
(add-to-list 'mode-line-modes
|
||||||
'(sml/buffer-identification-filling
|
'(sml/buffer-identification-filling
|
||||||
|
@ -138,7 +173,6 @@
|
||||||
(let ((-linepo mode-line-position))
|
(let ((-linepo mode-line-position))
|
||||||
(sml/setup)
|
(sml/setup)
|
||||||
(sml/apply-theme 'respectful)
|
(sml/apply-theme 'respectful)
|
||||||
|
|
||||||
(setq mode-line-position -linepo)
|
(setq mode-line-position -linepo)
|
||||||
(sml/filter-mode-line-list 'mode-line-position))))
|
(sml/filter-mode-line-list 'mode-line-position))))
|
||||||
|
|
||||||
|
|
108
init/core.el
108
init/core.el
|
@ -1,8 +1,3 @@
|
||||||
(when (functionp 'scroll-bar-mode) (scroll-bar-mode -1)) ; no scrollbar
|
|
||||||
(when (functionp 'tool-bar-mode) (tool-bar-mode -1)) ; no toolbar
|
|
||||||
(when (functionp 'menu-bar-mode) (menu-bar-mode -1)) ; no menubar
|
|
||||||
(when (fboundp 'fringe-mode) (fringe-mode '(4 . 10))) ; no nonsense
|
|
||||||
|
|
||||||
(defconst is-mac (eq system-type 'darwin))
|
(defconst is-mac (eq system-type 'darwin))
|
||||||
(defconst is-linux (eq system-type 'gnu/linux))
|
(defconst is-linux (eq system-type 'gnu/linux))
|
||||||
(defconst is-windows (eq system-type 'windows-nt))
|
(defconst is-windows (eq system-type 'windows-nt))
|
||||||
|
@ -33,12 +28,10 @@
|
||||||
;; (setq load-prefer-newer t)
|
;; (setq load-prefer-newer t)
|
||||||
(setq debug-on-quit DEBUG-MODE)
|
(setq debug-on-quit DEBUG-MODE)
|
||||||
|
|
||||||
;;;; Sane defaults ;;;;;;;;;;;;;;;;;;;;;;;
|
;;;; Sane defaults ;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(line-number-mode 1) ; hide line no in modeline
|
|
||||||
(column-number-mode 1) ; hide col no in modeline
|
|
||||||
(auto-compression-mode t) ; Transparently open compressed files
|
(auto-compression-mode t) ; Transparently open compressed files
|
||||||
(global-font-lock-mode t) ; Enable syntax highlighting for older emacs
|
(global-font-lock-mode t) ; Enable syntax highlighting for older emacs
|
||||||
(global-auto-revert-mode 1) ; revert buffers for changed files
|
;; (global-auto-revert-mode 1) ; revert buffers for changed files
|
||||||
|
|
||||||
;;; window layout undo/redo
|
;;; window layout undo/redo
|
||||||
(setq winner-boring-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*"
|
(setq winner-boring-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*"
|
||||||
|
@ -51,8 +44,8 @@
|
||||||
:init (add-hook 'prog-mode-hook 'semantic-mode)
|
:init (add-hook 'prog-mode-hook 'semantic-mode)
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(semantic-mode 1)
|
(setq semanticdb-default-save-directory (expand-file-name "semanticdb" my-tmp-dir))
|
||||||
(setq semanticdb-default-save-directory (expand-file-name "semanticdb" my-tmp-dir))))
|
(semantic-mode 1)))
|
||||||
|
|
||||||
;;; UTF-8 please
|
;;; UTF-8 please
|
||||||
(setq locale-coding-system 'utf-8) ; pretty
|
(setq locale-coding-system 'utf-8) ; pretty
|
||||||
|
@ -81,26 +74,23 @@
|
||||||
|
|
||||||
(setq ring-bell-function 'ignore)
|
(setq ring-bell-function 'ignore)
|
||||||
|
|
||||||
(setq inhibit-startup-screen t) ; don't show EMACs start screen
|
(setq inhibit-startup-screen t ; don't show EMACs start screen
|
||||||
(setq inhibit-splash-screen t)
|
inhibit-splash-screen t
|
||||||
(setq inhibit-startup-buffer-menu t)
|
inhibit-startup-buffer-menu t
|
||||||
|
|
||||||
(setq initial-major-mode 'text-mode) ; initial scratch buffer mode
|
initial-major-mode 'fundamental-mode ; initial scratch buffer mode
|
||||||
(setq initial-scratch-message nil)
|
initial-scratch-message nil
|
||||||
(setq initial-scratch-buffer nil) ; empty scratch buffer
|
initial-scratch-buffer nil ; empty scratch buffer
|
||||||
|
|
||||||
(setq compilation-always-kill t)
|
compilation-always-kill t
|
||||||
(setq compilation-ask-about-save nil)
|
compilation-ask-about-save nil
|
||||||
(setq compilation-scroll-output t)
|
compilation-scroll-output t)
|
||||||
|
|
||||||
(setq sentence-end-double-space nil) ; sentences end with periods. Period.
|
(setq sentence-end-double-space nil) ; sentences end with periods. Period.
|
||||||
|
|
||||||
(setq ediff-diff-options "-w")
|
(setq ediff-diff-options "-w"
|
||||||
(setq ediff-split-window-function 'split-window-horizontally) ; side-by-side diffs
|
ediff-split-window-function 'split-window-horizontally ; side-by-side diffs
|
||||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain) ; no extra frames
|
ediff-window-setup-function 'ediff-setup-windows-plain) ; no extra frames
|
||||||
|
|
||||||
;; Fixes C-i's synonymity with TAB
|
|
||||||
(keyboard-translate ?\C-i ?\H-i)
|
|
||||||
|
|
||||||
;; Don't save clipboard contents into kill-ring before replacing them
|
;; Don't save clipboard contents into kill-ring before replacing them
|
||||||
(setq save-interprogram-paste-before-kill nil)
|
(setq save-interprogram-paste-before-kill nil)
|
||||||
|
@ -118,7 +108,7 @@
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq savehist-file (concat my-tmp-dir "savehist") ; keep the home clean
|
(setq savehist-file (expand-file-name "savehist" my-tmp-dir) ; keep the home clean
|
||||||
history-length 1000
|
history-length 1000
|
||||||
savehist-additional-variables '(kill-ring
|
savehist-additional-variables '(kill-ring
|
||||||
global-mark-ring
|
global-mark-ring
|
||||||
|
@ -131,7 +121,7 @@
|
||||||
(use-package saveplace
|
(use-package saveplace
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq-default save-place-file (concat my-tmp-dir "saveplace"))
|
(setq-default save-place-file (expand-file-name "saveplace" my-tmp-dir))
|
||||||
;; activate save-place only for files that exist
|
;; activate save-place only for files that exist
|
||||||
(add-hook! 'find-file-hook (if (file-exists-p buffer-file-name) (setq save-place t)))))
|
(add-hook! 'find-file-hook (if (file-exists-p buffer-file-name) (setq save-place t)))))
|
||||||
|
|
||||||
|
@ -139,10 +129,10 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(add-hook 'kill-emacs-hook 'recentf-cleanup)
|
(add-hook 'kill-emacs-hook 'recentf-cleanup)
|
||||||
(setq recentf-save-file (concat my-tmp-dir "recentf")
|
(setq recentf-save-file (expand-file-name "recentf" my-tmp-dir)
|
||||||
recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" "/\\.cache/.+" "emacs\\.d/workgroups/.+$" ".emacs.workgroup")
|
recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" "/\\.cache/.+" "emacs\\.d/workgroups/.+$" ".emacs.workgroup")
|
||||||
recentf-max-menu-items 0
|
recentf-max-menu-items 0
|
||||||
recentf-max-saved-items 1000
|
recentf-max-saved-items 250
|
||||||
recentf-auto-cleanup 'never)
|
recentf-auto-cleanup 'never)
|
||||||
(recentf-mode 1)))
|
(recentf-mode 1)))
|
||||||
|
|
||||||
|
@ -320,38 +310,32 @@ 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)
|
(setq popwin:special-display-config
|
||||||
|
(append '(("\\`\\*helm.*?\\*\\'" :regexp t :position bottom :height 15)
|
||||||
(push '("\\`\\*helm.*?\\*\\'" :regexp t :position bottom :height 15) popwin:special-display-config)
|
("^\\*Flycheck.*\\*$" :regexp t :position bottom :height 0.25 :noselect t)
|
||||||
|
(inf-enh-ruby-mode :position bottom :stick t)
|
||||||
(push '("^\\*Flycheck.*\\*$" :regexp t :position bottom :height 0.25 :noselect t) popwin:special-display-config)
|
(snippet-mode :position bottom :stick t)
|
||||||
(push '(inf-enh-ruby-mode :position bottom :stick t) popwin:special-display-config)
|
("^\\*eclim.*\\*" :regexp t :position bottom :height 0.25)
|
||||||
(push '(snippet-mode :position bottom :stick t) popwin:special-display-config)
|
("*ansi-term*" :position bottom :height 0.45 :stick t)
|
||||||
(push '("^\\*eclim.*\\*" :regexp t :position bottom :height 0.25) popwin:special-display-config)
|
("*terminal*" :position bottom :height 0.45 :stick t)
|
||||||
|
("*Async Shell Command*" :position bottom)
|
||||||
(push '("*ansi-term*" :position bottom :height 0.45 :stick t) popwin:special-display-config)
|
("*Shell Command Output*" :position bottom :stick t :height 15)
|
||||||
(push '("*terminal*" :position bottom :height 0.45 :stick t) popwin:special-display-config)
|
("* Regexp Explain *" :position top :height 0.35)
|
||||||
(push '("*Async Shell Command*" :position bottom) popwin:special-display-config)
|
("*anaconda-doc*" :position bottom :height 15 :noselect t)
|
||||||
(push '("*Shell Command Output*" :position bottom :stick t :height 15) popwin:special-display-config)
|
("*anaconda-nav*" :position bottom :height 15 :stick t)
|
||||||
|
("^\\*Python.+\\*$" :regexp t :position bottom :height 20 :noselect t)
|
||||||
(push '("* Regexp Explain *" :position top :height 0.35) popwin:special-display-config)
|
(help-mode :height 25 :position bottom :stick t)
|
||||||
|
(compilation-mode :height 0.5 :position bottom :noselect t)
|
||||||
(push '("*anaconda-doc*" :position bottom :height 15 :noselect t) popwin:special-display-config)
|
(diff-mode :position bottom :stick t)
|
||||||
(push '("*anaconda-nav*" :position bottom :height 15 :stick t) popwin:special-display-config)
|
("*Backtrace*")
|
||||||
(push '("^\\*Python.+\\*$" :regexp t :position bottom :height 20 :noselect t) popwin:special-display-config)
|
("*Warnings*")
|
||||||
|
("*Process List*")
|
||||||
(push '(help-mode :height 0.5 :position bottom :stick t) popwin:special-display-config)
|
("*Compile-Log*" :height 0.3 :position bottom :noselect t)
|
||||||
(push '(compilation-mode :height 0.5 :position bottom :noselect t) popwin:special-display-config)
|
(" *undo-tree*" :width 0.3 :position right)
|
||||||
(push '(diff-mode :position bottom :stick t) popwin:special-display-config)
|
("^\\*scratch\\*.*" :regexp t :stick t)
|
||||||
(push '("*Backtrace*") popwin:special-display-config)
|
(image-mode)
|
||||||
(push '("*Warnings*") popwin:special-display-config)
|
("*NeoTree*" :position left :width 22 :stick t))
|
||||||
(push '("*Process List*") popwin:special-display-config)
|
popwin:special-display-config))
|
||||||
(push '("*Compile-Log*" :height 0.3 :position bottom :noselect t) popwin:special-display-config)
|
|
||||||
(push '(" *undo-tree*" :width 0.3 :position right) popwin:special-display-config)
|
|
||||||
(push '("^\\*scratch\\*.*" :regexp t :stick t) popwin:special-display-config)
|
|
||||||
(push '(image-mode) popwin:special-display-config)
|
|
||||||
|
|
||||||
(push '("*NeoTree*" :position left :width 22 :stick t) popwin:special-display-config)
|
|
||||||
|
|
||||||
(defun popwin:toggle-popup-window ()
|
(defun popwin:toggle-popup-window ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
|
|
||||||
(defvar my/dark-theme-p t)
|
|
||||||
(defvar my/cycle-font-i 0)
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun load-dark-theme()
|
|
||||||
(interactive)
|
|
||||||
(load-theme *dark-theme t))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun load-light-theme()
|
|
||||||
(interactive)
|
|
||||||
(load-theme *light-theme t))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun toggle-transparency ()
|
(defun toggle-transparency ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -22,13 +9,6 @@
|
||||||
(set-frame-parameter nil 'alpha 97)
|
(set-frame-parameter nil 'alpha 97)
|
||||||
(set-frame-parameter nil 'alpha 0))))
|
(set-frame-parameter nil 'alpha 0))))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun toggle-theme ()
|
|
||||||
(interactive)
|
|
||||||
(if my/dark-theme-p
|
|
||||||
(load-light-theme)
|
|
||||||
(load-dark-theme)))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun toggle-fullscreen ()
|
(defun toggle-fullscreen ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
|
@ -104,20 +104,6 @@ key-chord-define."
|
||||||
(set (make-local-variable 'require-final-newline) nil))
|
(set (make-local-variable 'require-final-newline) nil))
|
||||||
|
|
||||||
|
|
||||||
;; Font Defuns ;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
(defun cycle-font (&optional i)
|
|
||||||
"Cycle between fonts specified in *fonts in init.el"
|
|
||||||
(interactive)
|
|
||||||
(if (numberp i)
|
|
||||||
(setq my/cycle-font-i i)
|
|
||||||
(if (>= my/cycle-font-i (1- (length *fonts)))
|
|
||||||
(setq my/cycle-font-i 0)
|
|
||||||
(cl-incf my/cycle-font-i)))
|
|
||||||
(let ((font (nth my/cycle-font-i *fonts)))
|
|
||||||
(message "Changing font to %s" (nth 1 (font-face-attributes font)))
|
|
||||||
(set-frame-font font)))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;;
|
;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defun my--minibuffer-quit ()
|
(defun my--minibuffer-quit ()
|
||||||
"Abort recursive edit. In Delete Selection mode, if the mark is
|
"Abort recursive edit. In Delete Selection mode, if the mark is
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
(symbol-value mode))))
|
(symbol-value mode))))
|
||||||
(insert uuid)
|
(insert uuid)
|
||||||
(yas-expand-from-trigger-key)
|
(yas-expand-from-trigger-key)
|
||||||
(if (string-equal uuid (string-trim (buffer-string)))
|
(if (string-equal uuid (s-trim (buffer-string)))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(evil-insert-state 1))))
|
(evil-insert-state 1))))
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
;; (add-template "/_layouts/.+\\.html$" "%jekyll-layout%" 'web-mode)
|
;; (add-template "/_layouts/.+\\.html$" "%jekyll-layout%" 'web-mode)
|
||||||
|
|
||||||
;; ;; Javascript
|
;; ;; Javascript
|
||||||
;; (add-template "\\.lbaction/Contents/Info.plist$" "%lb6%" 'nxml-mode)
|
(add-template "\\.lbaction/Contents/Info.plist$" "%Info.plst%" 'lb6-mode)
|
||||||
;; (add-template "\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "%lb6%" 'js-mode)
|
(add-template "\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "%default.js%" 'lb6-mode)
|
||||||
;; (add-template "/package\\.json$" "%package.json%" 'json-mode)
|
;; (add-template "/package\\.json$" "%package.json%" 'json-mode)
|
||||||
;; (add-template "\\.\\(json\\|jshintrc\\)$" "%%" 'json-mode)
|
;; (add-template "\\.\\(json\\|jshintrc\\)$" "%%" 'json-mode)
|
||||||
|
|
||||||
|
@ -85,5 +85,6 @@
|
||||||
(add-template "\\.emacs\\.d/.+\\.el$" "%initfile%" 'emacs-lisp-mode)
|
(add-template "\\.emacs\\.d/.+\\.el$" "%initfile%" 'emacs-lisp-mode)
|
||||||
(add-template "\\.emacs\\.d/snippets/.+$" "%%" 'snippet-mode))
|
(add-template "\\.emacs\\.d/snippets/.+$" "%%" 'snippet-mode))
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-auto-insert)
|
(provide 'init-auto-insert)
|
||||||
;;; init-auto-insert.el ends here
|
;;; init-auto-insert.el ends here
|
||||||
|
|
|
@ -23,21 +23,15 @@
|
||||||
(progn
|
(progn
|
||||||
;; Settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(setq c-basic-offset 4
|
(setq c-basic-offset 4
|
||||||
c-tab-always-indent nil)
|
c-tab-always-indent nil
|
||||||
|
c-electric-flag nil)
|
||||||
|
|
||||||
(when is-mac
|
(when is-mac
|
||||||
(setq my--clang-includes
|
(after "flycheck"
|
||||||
'("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"
|
(setq flycheck-clang-language-standard "c++11"
|
||||||
"/usr/local/include"
|
flycheck-clang-standard-library "libc++"
|
||||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include"
|
flycheck-c/c++-clang-executable "clang++"
|
||||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include"
|
flycheck-clang-include-path '("/usr/local/include"))))
|
||||||
"/usr/include"
|
|
||||||
"/System/Library/Frameworks"
|
|
||||||
"/Library/Frameworks"))
|
|
||||||
|
|
||||||
(defun my--clang-includes () my--clang-includes)
|
|
||||||
(defun my--clang-includes-flags ()
|
|
||||||
(mapcar (lambda (item) (concat "-I" item)) my--clang-includes)))
|
|
||||||
|
|
||||||
(after "company"
|
(after "company"
|
||||||
;; TODO Clang is *really* slow in larger projects, maybe replace it with irony-mode or ycmd?
|
;; TODO Clang is *really* slow in larger projects, maybe replace it with irony-mode or ycmd?
|
||||||
|
@ -68,12 +62,6 @@
|
||||||
(define-key c-mode-map (kbd "DEL") nil))
|
(define-key c-mode-map (kbd "DEL") nil))
|
||||||
(add-hook 'c-mode-hook 'my-c/c++-settings)
|
(add-hook 'c-mode-hook 'my-c/c++-settings)
|
||||||
(add-hook 'c++-mode-hook 'my-c/c++-settings)
|
(add-hook 'c++-mode-hook 'my-c/c++-settings)
|
||||||
(after "flycheck"
|
|
||||||
(add-hook! 'c++-mode-hook
|
|
||||||
(setq flycheck-clang-language-standard "c++11"
|
|
||||||
flycheck-clang-standard-library "libc++"
|
|
||||||
flycheck-c/c++-clang-executable "clang++"
|
|
||||||
flycheck-clang-include-path (my--clang-includes))))
|
|
||||||
|
|
||||||
(progn ; Obj-C
|
(progn ; Obj-C
|
||||||
(add-to-list 'magic-mode-alist
|
(add-to-list 'magic-mode-alist
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
(use-package company
|
(use-package company
|
||||||
|
:diminish company-mode
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(global-company-mode 1)
|
(global-company-mode 1)
|
||||||
|
|
115
init/init-git.el
115
init/init-git.el
|
@ -1,115 +0,0 @@
|
||||||
(use-package git-commit-mode ;
|
|
||||||
:mode (("/COMMIT_EDITMSG\\'" . git-commit-mode)
|
|
||||||
("/NOTES_EDITMSG\\'" . git-commit-mode)
|
|
||||||
("/MERGE_MSG\\'" . git-commit-mode)
|
|
||||||
("/TAG_EDITMSG\\'" . git-commit-mode)
|
|
||||||
("/PULLREQ_EDITMSG\\'" . git-commit-mode)))
|
|
||||||
|
|
||||||
(use-package git-rebase-mode
|
|
||||||
:mode ("/git-rebase-todo\\'" . git-rebase-mode))
|
|
||||||
|
|
||||||
(use-package gitconfig-mode
|
|
||||||
:mode (("/\\.?git/?config\\'" . gitconfig-mode)
|
|
||||||
("/\\.gitmodules\\'" . gitconfig-mode))
|
|
||||||
:init (add-hook 'gitconfig-mode-hook 'flyspell-mode))
|
|
||||||
|
|
||||||
(use-package gitignore-mode
|
|
||||||
:mode (("/\\.gitignore\\'" . gitignore-mode)
|
|
||||||
("/\\.git/info/exclude\\'" . gitignore-mode)
|
|
||||||
("/git/ignore\\'" . gitignore-mode)))
|
|
||||||
;;
|
|
||||||
(use-package git-gutter-fringe+
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(global-git-gutter+-mode 1)
|
|
||||||
;; Fixes "git-gutter+-process-diff: Wrong number of arguments: nil" error
|
|
||||||
(defadvice git-gutter+-process-diff (before git-gutter+-process-diff-advice activate)
|
|
||||||
(ad-set-arg 0 (file-truename (ad-get-arg 0))))
|
|
||||||
|
|
||||||
(fringe-helper-define 'git-gutter-fr+-added nil
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......")
|
|
||||||
|
|
||||||
(fringe-helper-define 'git-gutter-fr+-deleted nil
|
|
||||||
".X......"
|
|
||||||
".XXXXXXX"
|
|
||||||
".X......"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........"
|
|
||||||
"........")
|
|
||||||
|
|
||||||
(fringe-helper-define 'git-gutter-fr+-modified nil
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......"
|
|
||||||
".X......")))
|
|
||||||
|
|
||||||
(evil-set-initial-state 'git-commit-mode 'insert)
|
|
||||||
(evil-set-initial-state 'git-rebase-mode 'insert)
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-git)
|
|
||||||
;;; init-git.el ends here
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
;; Ex-mode interface for `helm-recentf' and `helm-projectile-recentf'. If
|
||||||
|
;; `bang', then `search' is interpreted as regexp
|
||||||
|
(evil-define-command my:helm-recentf (&optional bang)
|
||||||
|
:repeat nil
|
||||||
|
(interactive "<!>")
|
||||||
|
(if bang (helm-recentf) (helm-projectile-recentf)))
|
||||||
|
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:commands (projectile-ack
|
:commands (projectile-ack
|
||||||
projectile-ag
|
projectile-ag
|
||||||
|
@ -25,6 +32,7 @@
|
||||||
helm-projectile-recentf
|
helm-projectile-recentf
|
||||||
helm-projectile-find-other-file
|
helm-projectile-find-other-file
|
||||||
helm-projectile-switch-project)
|
helm-projectile-switch-project)
|
||||||
|
:diminish projectile-mode
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq-default projectile-enable-caching t)
|
(setq-default projectile-enable-caching t)
|
||||||
|
@ -37,9 +45,10 @@
|
||||||
(add-to-list 'projectile-globally-ignored-directories "assets")
|
(add-to-list 'projectile-globally-ignored-directories "assets")
|
||||||
(add-to-list 'projectile-other-file-alist '("scss" "css"))
|
(add-to-list 'projectile-other-file-alist '("scss" "css"))
|
||||||
(add-to-list 'projectile-other-file-alist '("css" "scss"))
|
(add-to-list 'projectile-other-file-alist '("css" "scss"))
|
||||||
(projectile-global-mode +1)
|
|
||||||
|
|
||||||
(use-package helm-projectile)
|
(use-package helm-projectile)
|
||||||
|
(projectile-global-mode +1)
|
||||||
|
|
||||||
;; 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) helm-global-prompt)))
|
(defun projectile-prepend-project-name (string) helm-global-prompt)))
|
||||||
|
|
||||||
|
@ -50,11 +59,9 @@
|
||||||
helm-semantic-or-imenu
|
helm-semantic-or-imenu
|
||||||
helm-etags-select
|
helm-etags-select
|
||||||
helm-apropos
|
helm-apropos
|
||||||
helm-recentf
|
|
||||||
helm-show-kill-ring
|
helm-show-kill-ring
|
||||||
helm-bookmarks
|
helm-bookmarks
|
||||||
helm-wg
|
helm-wg)
|
||||||
my:helm-recentf)
|
|
||||||
:init
|
:init
|
||||||
(evil-set-initial-state 'helm-mode 'emacs)
|
(evil-set-initial-state 'helm-mode 'emacs)
|
||||||
:config
|
:config
|
||||||
|
@ -82,21 +89,11 @@
|
||||||
|
|
||||||
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
||||||
|
|
||||||
(require 'helm-files)
|
|
||||||
|
|
||||||
(progn ; helm hacks
|
(progn ; helm hacks
|
||||||
;; No persistent header
|
;; No persistent header
|
||||||
(defadvice helm-display-mode-line (after undisplay-header activate)
|
(defadvice helm-display-mode-line (after undisplay-header activate)
|
||||||
(setq header-line-format nil))
|
(setq header-line-format nil))
|
||||||
|
|
||||||
;; Reconfigured `helm-recentf' to use `helm', instead of `helm-other-buffer'
|
|
||||||
(defun helm-recentf ()
|
|
||||||
(interactive)
|
|
||||||
(let ((helm-ff-transformer-show-only-basename nil))
|
|
||||||
(helm :sources '(helm-source-recentf)
|
|
||||||
:buffer "*helm recentf*"
|
|
||||||
:prompt helm-global-prompt)))
|
|
||||||
|
|
||||||
;; Hide the mode-line in helm (<3 minimalism)
|
;; Hide the mode-line in helm (<3 minimalism)
|
||||||
(defun helm-display-mode-line (source &optional force)
|
(defun helm-display-mode-line (source &optional force)
|
||||||
(set (make-local-variable 'helm-mode-line-string)
|
(set (make-local-variable 'helm-mode-line-string)
|
||||||
|
@ -117,20 +114,24 @@
|
||||||
(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 ; evil
|
|
||||||
;; Ex-mode interface for `helm-recentf' and `helm-projectile-recentf'. If
|
|
||||||
;; `bang', then `search' is interpreted as regexp
|
|
||||||
(evil-define-command my:helm-recentf (&optional bang)
|
|
||||||
:repeat nil
|
|
||||||
(interactive "<!>")
|
|
||||||
(if bang (helm-recentf) (helm-projectile-recentf))))
|
|
||||||
|
|
||||||
(bind helm-map
|
(bind helm-map
|
||||||
"C-w" 'evil-delete-backward-word
|
"C-w" 'evil-delete-backward-word
|
||||||
"C-u" 'helm-delete-minibuffer-contents
|
"C-u" 'helm-delete-minibuffer-contents
|
||||||
"C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
|
"C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
|
||||||
[escape] 'helm-keyboard-quit)))
|
[escape] 'helm-keyboard-quit)))
|
||||||
|
|
||||||
|
(use-package helm-files
|
||||||
|
:commands (helm-recentf)
|
||||||
|
:config
|
||||||
|
(progn
|
||||||
|
;; Reconfigured `helm-recentf' to use `helm', instead of `helm-other-buffer'
|
||||||
|
(defun helm-recentf ()
|
||||||
|
(interactive)
|
||||||
|
(let ((helm-ff-transformer-show-only-basename nil))
|
||||||
|
(helm :sources '(helm-source-recentf)
|
||||||
|
:buffer "*helm recentf*"
|
||||||
|
:prompt helm-global-prompt)))))
|
||||||
|
|
||||||
(use-package helm-ag
|
(use-package helm-ag
|
||||||
:commands (helm-ag
|
:commands (helm-ag
|
||||||
my:helm-ag-search
|
my:helm-ag-search
|
||||||
|
@ -189,9 +190,7 @@
|
||||||
(progn
|
(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
|
|
||||||
)
|
|
||||||
|
|
||||||
;; 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
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
ido-save-directory-list-file (concat my-tmp-dir "ido.last"))
|
ido-save-directory-list-file (concat my-tmp-dir "ido.last"))
|
||||||
|
|
||||||
(add-to-list 'ido-ignore-files "\\`.DS_Store$")
|
(add-to-list 'ido-ignore-files "\\`.DS_Store$")
|
||||||
|
(add-to-list 'ido-ignore-files "Icon\\?$")
|
||||||
(setq ido-ignore-buffers
|
(setq ido-ignore-buffers
|
||||||
'("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*Help\\*" "^\\*Buffer"
|
'("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*Help\\*" "^\\*Buffer"
|
||||||
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
|
"^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
|
|
||||||
(after "emr" (use-package js2-refactor))
|
(after "emr" (use-package js2-refactor))
|
||||||
|
|
||||||
|
(rename-mode-name js2-mode "Javascript2")
|
||||||
|
|
||||||
(use-package tern
|
(use-package tern
|
||||||
|
:diminish (tern-mode . "tern")
|
||||||
:commands tern-mode
|
:commands tern-mode
|
||||||
:init
|
:init (add-hook 'js2-mode-hook 'tern-mode)
|
||||||
(progn
|
|
||||||
(add-hook 'js2-mode-hook 'tern-mode)
|
|
||||||
(after "auto-complete" (add-hook 'js2-mode-hook 'tern-ac-setup)))
|
|
||||||
:config
|
:config
|
||||||
(after "company"
|
(after "company"
|
||||||
(use-package company-tern
|
(use-package company-tern
|
||||||
|
|
303
init/init-org.el
303
init/init-org.el
|
@ -1,30 +1,33 @@
|
||||||
(use-package org
|
(use-package org
|
||||||
|
:commands (org-capture
|
||||||
|
org-capture-string
|
||||||
|
my:org-capture)
|
||||||
:mode (("\\.org$" . org-mode)
|
:mode (("\\.org$" . org-mode)
|
||||||
("\\.opml$" . org-mode))
|
("\\.opml$" . org-mode))
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
(add-hook 'org-mode-hook 'enable-tab-width-2)
|
(add-hook 'org-mode-hook 'enable-tab-width-2)
|
||||||
(add-hook 'org-mode-hook 'evil-org-mode)
|
|
||||||
(add-hook 'org-mode-hook 'turn-on-auto-fill)
|
(add-hook 'org-mode-hook 'turn-on-auto-fill)
|
||||||
(add-hook 'org-mode-hook 'iimage-mode)
|
(add-hook 'org-mode-hook 'iimage-mode)
|
||||||
|
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||||
|
(add-hook 'org-mode-hook 'evil-org-mode)
|
||||||
|
(add-hook! 'org-mode-hook (hl-line-mode -1)))
|
||||||
|
:config
|
||||||
|
(progn
|
||||||
|
(after "org-indent" (diminish 'org-indent-mode))
|
||||||
|
(after "iimage" (diminish 'iimage-mode))
|
||||||
|
|
||||||
;; Reset evil to ensure evil-org-mode's maps work
|
(setq org-directory "~/Dropbox/notes")
|
||||||
(add-hook! 'org-mode-hook (evil-mode nil) (evil-mode 1))
|
(setq org-project-directory (expand-file-name "projects" org-directory) ; custom variable
|
||||||
|
org-default-notes-file (expand-file-name "notes.org" org-directory)
|
||||||
(setq org-directory "~/Dropbox/notes"
|
org-agenda-files (append (list org-directory)
|
||||||
org-default-notes-file "~/Dropbox/notes/notes.org"
|
(f-entries org-project-directory (lambda (path) (f-ext? path "org")) t))
|
||||||
org-agenda-files '("~/Dropbox/notes"
|
org-archive-location (concat org-directory "/archive/%s::")
|
||||||
"~/Dropbox/notes/projects"
|
|
||||||
"~/Dropbox/notes/projects/dev"
|
|
||||||
"~/Dropbox/notes/projects/gamedev"
|
|
||||||
"~/Dropbox/notes/projects/webdev")
|
|
||||||
org-archive-location "~/Dropbox/notes/archive/%s::"
|
|
||||||
org-confirm-babel-evaluate nil
|
org-confirm-babel-evaluate nil
|
||||||
org-src-tab-acts-natively t
|
org-src-tab-acts-natively t
|
||||||
org-image-actual-width 300
|
org-image-actual-width 250
|
||||||
org-startup-with-inline-images t)
|
org-startup-with-inline-images t
|
||||||
|
org-completion-use-ido t
|
||||||
(setq org-completion-use-ido t
|
|
||||||
org-hidden-keywords '(title)
|
org-hidden-keywords '(title)
|
||||||
org-special-ctrl-a/e t
|
org-special-ctrl-a/e t
|
||||||
org-hide-leading-stars t
|
org-hide-leading-stars t
|
||||||
|
@ -32,14 +35,19 @@
|
||||||
org-checkbox-hierarchical-statistics t
|
org-checkbox-hierarchical-statistics t
|
||||||
org-tags-column -87
|
org-tags-column -87
|
||||||
org-log-done t
|
org-log-done t
|
||||||
org-todo-keywords
|
org-confirm-elisp-link-function nil
|
||||||
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
|
org-startup-folded 'content
|
||||||
(sequence "DOING(s)" "PENDING(p)")
|
org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
|
||||||
(sequence "|" "CANCELLED(c)")))
|
(sequence "DOING(s)" "PENDING(p)")
|
||||||
|
(sequence "|" "CANCELLED(c)"))
|
||||||
|
org-mobile-directory "~/Dropbox/Apps/MobileOrg"
|
||||||
|
org-mobile-inbox-for-pull (expand-file-name "mobile.org" org-directory))
|
||||||
|
|
||||||
(setq org-src-fontify-natively t)
|
(setq org-src-fontify-natively t
|
||||||
(setq org-blank-before-new-entry '((heading . auto) (plain-list-item . auto)))
|
org-blank-before-new-entry '((heading . auto) (plain-list-item . auto))
|
||||||
(setq org-export-backends '(ascii html latex md opml))
|
org-export-backends '(ascii html latex md opml))
|
||||||
|
|
||||||
|
(add-to-list 'org-link-frame-setup '(file . find-file))
|
||||||
|
|
||||||
(setq org-tag-alist '(("@home" . ?h)
|
(setq org-tag-alist '(("@home" . ?h)
|
||||||
("@daily" . ?d)
|
("@daily" . ?d)
|
||||||
|
@ -50,35 +58,26 @@
|
||||||
("@writing" . ?w)
|
("@writing" . ?w)
|
||||||
("@projects" . ?r)))
|
("@projects" . ?r)))
|
||||||
|
|
||||||
|
(defun project-org-filename (cat)
|
||||||
|
(interactive (list (completing-read "Choose category:"
|
||||||
|
(mapcar 'f-filename (f-directories org-project-directory)))))
|
||||||
|
(expand-file-name (concat (f-filename (project-root)) ".org")
|
||||||
|
(expand-file-name cat org-project-directory)))
|
||||||
(setq org-capture-templates
|
(setq org-capture-templates
|
||||||
'(("t" "TODO" entry (file+headline "~/Dropbox/notes/todo.org" "Inbox") "* TODO %? %u\n%i")
|
'(("t" "TODO" entry (file+headline "~/Dropbox/notes/todo.org" "Inbox") "* TODO %? %u\n%i")
|
||||||
("T" "Project TODO" entry (file+headline (concat (projectile-project-root) "/TODO.org") "Unsorted") "** %u %?\n%i" :prepend t)
|
("T" "Project TODO" entry (file+headline (project-org-filename) "Tasks") "** TODO %?\n%i" :prepend t)
|
||||||
("c" "Changelog" entry (file+headline (concat (projectile-project-root) "/CHANGELOG.org") "Unsorted") "** %u %? :unsorted:\n%i" :prepend t)
|
("N" "Project Note" entry (file+headline (project-org-filename) "Notes") "** %u %?\n%i")
|
||||||
("n" "Note" entry (file+headline org-default-notes-file "Unfiled") "** %T %?\n%i" :prepend t)
|
("c" "Changelog" entry (file+datetree (project-org-filename)) "** %<%H:%M>: %? :unsorted:\n%i" :prepend t)
|
||||||
|
("n" "Note" entry (file+datetree org-default-notes-file) "** %<%H:%M>: %?\n%i" :prepend t)
|
||||||
("j" "Journal" entry (file+datetree "~/Dropbox/notes/journal.org") "** %?%^g\nAdded: %U\n%i")
|
("j" "Journal" entry (file+datetree "~/Dropbox/notes/journal.org") "** %?%^g\nAdded: %U\n%i")
|
||||||
("a" "Trivia" entry (file "~/Dropbox/notes/trivia.org") "* %u %?\n%i" :prepend t)
|
("a" "Trivia" entry (file "~/Dropbox/notes/trivia.org") "* %u %?\n%i" :prepend t)
|
||||||
("s" "Writing Scraps" entry (file "~/Dropbox/notes/writing.org") "* %u %?\n%i" :prepend t)
|
("s" "Writing Scraps" entry (file "~/Dropbox/notes/writing.org") "* %u %?\n%i" :prepend t)
|
||||||
("v" "Vocab" entry (file "~/Dropbox/notes/vocab.org") "* %?\n%i" :prepend t)
|
("v" "Vocab" entry (file "~/Dropbox/notes/vocab.org") "* %?\n%i" :prepend t)
|
||||||
("e" "Excerpt" entry (file "~/Dropbox/notes/excerpts.org") "* %u %?\n%i" :prepend t)))
|
("e" "Excerpt" entry (file "~/Dropbox/notes/excerpts.org") "* %u %?\n%i" :prepend t)))
|
||||||
|
|
||||||
(setq org-agenda-custom-commands
|
|
||||||
'(("x" agenda)
|
|
||||||
("y" agenda*)
|
|
||||||
("w" todo "WAITING")
|
|
||||||
("W" todo-tree "WAITING")
|
|
||||||
("to" todo)
|
|
||||||
("tp" tags "+Projects")
|
|
||||||
("tg" tags-todo "+gamedev")
|
|
||||||
("tw" tags-tree "+webdev"))))
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(message "Org-mode loaded")
|
|
||||||
|
|
||||||
(setq iimage-mode-image-regex-alist
|
(setq iimage-mode-image-regex-alist
|
||||||
'(("\\(`?file://\\|\\[\\[\\|<\\|`\\)?\\([-+./_0-9a-zA-Z]+\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\)\\(\\]\\]\\|>\\|'\\)?" . 2)
|
'(("\\(`?file://\\|\\[\\[\\|<\\|`\\)?\\([-+./_0-9a-zA-Z]+\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\)\\(\\]\\]\\|>\\|'\\)?" . 2)
|
||||||
("<\\(http://.+\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\)>" . 1)))
|
("<\\(http://.+\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\)>" . 1)))
|
||||||
|
|
||||||
(push '("\\*Org.+\\*" :regexp t :width 0.3 :position bottom) popwin:special-display-config)
|
|
||||||
|
|
||||||
(org-babel-do-load-languages 'org-babel-load-languages
|
(org-babel-do-load-languages 'org-babel-load-languages
|
||||||
'((python . t)
|
'((python . t)
|
||||||
|
@ -92,54 +91,31 @@
|
||||||
(defadvice evil-force-normal-state (before evil-esc-org-remove-highlights activate)
|
(defadvice evil-force-normal-state (before evil-esc-org-remove-highlights activate)
|
||||||
(org-remove-occur-highlights))
|
(org-remove-occur-highlights))
|
||||||
|
|
||||||
;; Auto update cookies
|
|
||||||
(defun my--org-mode-update-cookies ()
|
|
||||||
(when (eq major-mode 'org-mode) (org-update-parent-todo-statistics) (org-update-statistics-cookies nil)))
|
|
||||||
(add-hook 'evil-normal-state-entry-hook 'my--org-mode-update-cookies)
|
|
||||||
|
|
||||||
(define-minor-mode evil-org-mode
|
(define-minor-mode evil-org-mode
|
||||||
:init-value nil
|
:init-value nil
|
||||||
:lighter " EvilOrg"
|
:lighter " !"
|
||||||
:keymap (make-sparse-keymap) ; defines evil-org-mode-map
|
:keymap (make-sparse-keymap) ; defines evil-org-mode-map
|
||||||
:group 'evil-org)
|
:group 'evil-org)
|
||||||
|
|
||||||
;; (use-package org-present
|
;; (progn ; opml support
|
||||||
;; :config
|
;; (defun set-buffer-file-format-to-opml ()
|
||||||
;; (progn
|
;; (when (string-match "\.opml$" (buffer-file-name))
|
||||||
;; (defun my--org-present-mode-on ()
|
;; (setq buffer-file-format '(opml))))
|
||||||
;; (org-present-big)
|
|
||||||
;; (org-display-inline-images)
|
|
||||||
;; (org-present-hide-cursor)
|
|
||||||
;; (org-present-read-only))
|
|
||||||
|
|
||||||
;; (defun my--org-present-mode-off ()
|
;; (defun my--opml-encode (begin end buffer)
|
||||||
;; (org-present-small)
|
;; "Export Org mode buffer to OPML."
|
||||||
;; (org-remove-inline-images)
|
;; (let ((org-export-show-temporary-export-buffer nil)
|
||||||
;; (org-present-show-cursor)
|
;; (name "*OPML Export Buffer*"))
|
||||||
;; (org-present-read-write))
|
;; (org-export-to-buffer 'opml name)
|
||||||
|
;; (erase-buffer)
|
||||||
|
;; (insert-buffer-substring (get-buffer name))
|
||||||
|
;; (point-max)))
|
||||||
|
|
||||||
;; (add-hook 'org-present-mode-hook 'my--org-present-mode-on)
|
;; (add-hook 'find-file-hooks 'set-buffer-file-format-to-opml)
|
||||||
;; (add-hook 'org-present-mode-quit-hook 'my--org-present-mode-off)))
|
;; (add-to-list 'format-alist '(opml "Outline Processor Markup Language"
|
||||||
|
;; "<[?]xml version=\"1.0\"[^>]*[?]>[\n]?.*[\n]?.*[\n]?<opml version=\"[1|2].0\">"
|
||||||
(progn ; opml support
|
;; "~/.emacs.d/elisp/org-opml/opml2org.py" my--opml-encode t))
|
||||||
(defun set-buffer-file-format-to-opml ()
|
;; (shut-up (load-library "ox-opml")))
|
||||||
(when (string-match "\.opml$" (buffer-file-name))
|
|
||||||
(setq buffer-file-format '(opml))))
|
|
||||||
|
|
||||||
(defun my--opml-encode (begin end buffer)
|
|
||||||
"Export Org mode buffer to OPML."
|
|
||||||
(let ((org-export-show-temporary-export-buffer nil)
|
|
||||||
(name "*OPML Export Buffer*"))
|
|
||||||
(org-export-to-buffer 'opml name)
|
|
||||||
(erase-buffer)
|
|
||||||
(insert-buffer-substring (get-buffer name))
|
|
||||||
(point-max)))
|
|
||||||
|
|
||||||
(add-hook 'find-file-hooks 'set-buffer-file-format-to-opml)
|
|
||||||
(add-to-list 'format-alist '(opml "Outline Processor Markup Language"
|
|
||||||
"<[?]xml version=\"1.0\"[^>]*[?]>[\n]?.*[\n]?.*[\n]?<opml version=\"[1|2].0\">"
|
|
||||||
"~/.emacs.d/elisp/org-opml/opml2org.py" my--opml-encode t))
|
|
||||||
(shut-up (load-library "ox-opml")))
|
|
||||||
|
|
||||||
(progn ; key bindings
|
(progn ; key bindings
|
||||||
(defun my--org-in-list-p ()
|
(defun my--org-in-list-p ()
|
||||||
|
@ -185,6 +161,42 @@
|
||||||
(t (org-insert-heading)))
|
(t (org-insert-heading)))
|
||||||
(insert "[ ] ")))
|
(insert "[ ] ")))
|
||||||
|
|
||||||
|
;; Hide properties PERMANENTLY
|
||||||
|
(defun org-cycle-hide-drawers (state)
|
||||||
|
"Re-hide all drawers after a visibility state change."
|
||||||
|
(when (and (derived-mode-p 'org-mode)
|
||||||
|
(not (memq state '(overview folded contents))))
|
||||||
|
(save-excursion
|
||||||
|
(let* ((globalp (memq state '(contents all)))
|
||||||
|
(beg (if globalp (point-min) (point)))
|
||||||
|
(end (if globalp (point-max)
|
||||||
|
(if (eq state 'children)
|
||||||
|
(save-excursion (outline-next-heading) (point))
|
||||||
|
(org-end-of-subtree t)))))
|
||||||
|
(goto-char beg)
|
||||||
|
(while (re-search-forward org-drawer-regexp end t)
|
||||||
|
(save-excursion
|
||||||
|
(beginning-of-line 1)
|
||||||
|
(backward-char 1)
|
||||||
|
(let ((b (point)))
|
||||||
|
(if (re-search-forward
|
||||||
|
"^[ \t]*:END:"
|
||||||
|
(save-excursion (outline-next-heading) (point)) t)
|
||||||
|
(outline-flag-region b (point-at-eol) t)
|
||||||
|
(user-error ":END: line missing at position %s" b)))))))))
|
||||||
|
|
||||||
|
(use-package org-agenda
|
||||||
|
:config
|
||||||
|
(setq org-agenda-restore-windows-after-quit t
|
||||||
|
org-agenda-custom-commands '(("x" agenda)
|
||||||
|
("y" agenda*)
|
||||||
|
("w" todo "WAITING")
|
||||||
|
("W" todo-tree "WAITING")
|
||||||
|
("to" todo)
|
||||||
|
("tp" tags "+Projects")
|
||||||
|
("tg" tags-todo "+gamedev")
|
||||||
|
("tw" tags-tree "+webdev"))))
|
||||||
|
|
||||||
(bind 'insert org-mode-map [remap my.inflate-space-maybe] 'self-insert-command)
|
(bind 'insert org-mode-map [remap my.inflate-space-maybe] 'self-insert-command)
|
||||||
|
|
||||||
(bind org-mode-map
|
(bind org-mode-map
|
||||||
|
@ -193,14 +205,14 @@
|
||||||
"C-k" nil)
|
"C-k" nil)
|
||||||
|
|
||||||
(bind '(normal insert) evil-org-mode-map
|
(bind '(normal insert) evil-org-mode-map
|
||||||
"¬" 'org-metaright ; M-j
|
"A-l" 'org-metaright ; M-j
|
||||||
"˙" 'org-metaleft ; M-h
|
"A-h" 'org-metaleft ; M-h
|
||||||
"˚" 'org-metaup ; M-k
|
"A-k" 'org-metaup ; M-k
|
||||||
"Δ" 'org-metadown ; M-j
|
"A-j" 'org-metadown ; M-j
|
||||||
"Ò" 'org-shiftmetaright ; M-L
|
"A-l" 'org-shiftmetaright ; M-L
|
||||||
"Ó" 'org-shiftmetaleft ; M-H
|
"A-h" 'org-shiftmetaleft ; M-H
|
||||||
"" 'org-shiftmetaup ; M-K
|
"A-k" 'org-shiftmetaup ; M-K
|
||||||
"Ô" 'org-shiftmetadown) ; M-J
|
"A-j" 'org-shiftmetadown) ; M-J
|
||||||
|
|
||||||
(bind 'insert evil-org-mode-map
|
(bind 'insert evil-org-mode-map
|
||||||
"C-e" 'org-end-of-line
|
"C-e" 'org-end-of-line
|
||||||
|
@ -215,65 +227,90 @@
|
||||||
(defun my/org-surround (delim)
|
(defun my/org-surround (delim)
|
||||||
(insert delim) (save-excursion (insert delim)))
|
(insert delim) (save-excursion (insert delim)))
|
||||||
|
|
||||||
(bind 'insert evil-org-mode-map
|
(bind evil-org-mode-map
|
||||||
|
"M-a" 'mark-whole-buffer
|
||||||
|
|
||||||
|
'insert
|
||||||
;; Add new header line before this line
|
;; Add new header line before this line
|
||||||
(kbd "<S-M-return>") 'my--org-insert-item-before
|
"<S-M-return>" 'my--org-insert-item-before
|
||||||
;; Add new header line after this line
|
;; Add new header line after this line
|
||||||
(kbd "<M-return>") 'my--org-insert-item-after
|
"<M-return>" 'my--org-insert-item-after
|
||||||
|
|
||||||
(kbd "M-b") (λ (my/org-surround "*")) ; bold
|
"M-b" (λ (my/org-surround "*")) ; bold
|
||||||
(kbd "M-u") (λ (my/org-surround "_")) ; underline
|
"M-u" (λ (my/org-surround "_")) ; underline
|
||||||
(kbd "M-i") (λ (my/org-surround "/")) ; italics
|
"M-i" (λ (my/org-surround "/")) ; italics
|
||||||
(kbd "M-`") (λ (my/org-surround "+"))) ; strikethrough
|
"M-`" (λ (my/org-surround "+")) ; strikethrough
|
||||||
(bind 'visual evil-org-mode-map
|
|
||||||
(kbd "M-b") "S*"
|
|
||||||
(kbd "M-u") "S_"
|
|
||||||
(kbd "M-i") "S/"
|
|
||||||
(kbd "M-`") "S+")
|
|
||||||
|
|
||||||
(bind '(normal visual) evil-org-mode-map
|
'visual
|
||||||
", l" 'org-insert-link)
|
"M-b" "S*"
|
||||||
|
"M-u" "S_"
|
||||||
|
"M-i" "S/"
|
||||||
|
"M-`" "S+"
|
||||||
|
|
||||||
(bind 'normal evil-org-mode-map
|
'(normal visual)
|
||||||
", +" 'org-align-all-tags
|
", l" 'org-insert-link
|
||||||
", /" 'org-sparse-tree
|
|
||||||
", ?" 'org-tags-view
|
'normal
|
||||||
", a" 'org-attach
|
",=" 'org-align-all-tags
|
||||||
", D" 'org-time-stamp-inactive
|
",/" 'org-sparse-tree
|
||||||
", T" 'org-show-todo-tree
|
",?" 'org-tags-view
|
||||||
", d" 'org-time-stamp
|
",a" 'org-attach
|
||||||
", r" 'org-refile
|
",D" 'org-time-stamp-inactive
|
||||||
", s" 'org-schedule
|
",T" 'org-show-todo-tree
|
||||||
", t" 'org-todo
|
",d" 'org-time-stamp
|
||||||
"g r" 'org-babel-execute-src-block-maybe
|
",r" 'org-refile
|
||||||
"g h" 'outline-up-heading
|
",s" 'org-schedule
|
||||||
"g j" 'org-forward-heading-same-level
|
",t" 'org-todo
|
||||||
"g k" 'org-backward-heading-same-level
|
"gr" 'org-babel-execute-src-block-maybe
|
||||||
"g l" 'outline-next-visible-heading
|
"gh" 'outline-up-heading
|
||||||
"g o" 'org-open-at-point
|
"gj" 'org-forward-heading-same-level
|
||||||
"g O" 'org-attach-open
|
"gk" 'org-backward-heading-same-level
|
||||||
"g C-o" 'org-attach-reveal
|
"gl" 'outline-next-visible-heading
|
||||||
"g i" (λ (if (> (length org-inline-image-overlays) 0)
|
"go" 'org-open-at-point
|
||||||
|
"gO" 'org-attach-open
|
||||||
|
"gC-o" 'org-attach-reveal
|
||||||
|
"gI" (λ (if (> (length org-inline-image-overlays) 0)
|
||||||
(org-remove-inline-images)
|
(org-remove-inline-images)
|
||||||
(org-display-inline-images nil t (line-beginning-position) (line-end-position))))
|
(org-display-inline-images nil t (line-beginning-position) (line-end-position))))
|
||||||
"g Q" 'org-fill-paragraph
|
"gQ" 'org-fill-paragraph
|
||||||
"g a" 'org-attach
|
"ga" 'org-attach
|
||||||
"g A" 'org-agenda
|
"gA" 'org-agenda
|
||||||
"g t" 'org-show-todo-tree
|
"gt" 'org-show-todo-tree
|
||||||
|
"]l" 'org-next-link
|
||||||
|
"[l" 'org-previous-link
|
||||||
"$" 'org-end-of-line
|
"$" 'org-end-of-line
|
||||||
"^" 'org-beginning-of-line
|
"^" 'org-beginning-of-line
|
||||||
"<" 'org-metaleft
|
"<" 'org-metaleft
|
||||||
">" 'org-metaright
|
">" 'org-metaright
|
||||||
"-" 'org-cycle-list-bullet
|
"-" 'org-cycle-list-bullet
|
||||||
", SPC" 'my--toggle-checkbox
|
",SPC" 'my--toggle-checkbox
|
||||||
", <return>" 'org-archive-subtree
|
",<return>" 'org-archive-subtree
|
||||||
"<S-M-return>" 'my--org-insert-item-before
|
"<S-M-return>" 'my--org-insert-item-before
|
||||||
"<M-return>" 'my--org-insert-item-after
|
"<M-return>" 'my--org-insert-item-after
|
||||||
"RET" (λ (cond ((org-at-item-checkbox-p)
|
"RET" (λ (cond ((org-at-item-checkbox-p)
|
||||||
(org-toggle-checkbox))
|
(org-toggle-checkbox))
|
||||||
((org-entry-is-todo-p)
|
((org-entry-is-todo-p)
|
||||||
(org-todo 'done))))
|
(org-todo 'done))))
|
||||||
[tab] 'org-cycle))
|
[tab] 'org-cycle)
|
||||||
|
|
||||||
|
(after "org-agenda"
|
||||||
|
(bind 'emacs org-agenda-mode-map
|
||||||
|
"<escape>" 'org-agenda-Quit
|
||||||
|
"C-j" 'org-agenda-next-item
|
||||||
|
"C-k" 'org-agenda-previous-item
|
||||||
|
"C-n" 'org-agenda-next-item
|
||||||
|
"C-p" 'org-agenda-previous-item)))
|
||||||
|
|
||||||
|
(evil-define-operator my:org-capture (&optional beg end)
|
||||||
|
"Send a selection to org-capture."
|
||||||
|
:move-point nil
|
||||||
|
:type inclusive
|
||||||
|
(interactive "<r><!>")
|
||||||
|
(let ((text (when (and (evil-visual-state-p) beg end)
|
||||||
|
(buffer-substring beg end))))
|
||||||
|
(if text
|
||||||
|
(org-capture-string text)
|
||||||
|
(org-capture))))
|
||||||
|
|
||||||
(evil-define-command my:org-insert-image-url (&optional image-url)
|
(evil-define-command my:org-insert-image-url (&optional image-url)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
|
|
12
init/init-present.el
Normal file
12
init/init-present.el
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
(defconst *big-font (font-spec :family "Inconsolata" :size 18 :antialias t))
|
||||||
|
|
||||||
|
(defvar big-mode nil)
|
||||||
|
(defun toggle-big-mode ()
|
||||||
|
(interactive)
|
||||||
|
(if big-mode
|
||||||
|
(set-frame-font *default-font)
|
||||||
|
(set-frame-font *big-font))
|
||||||
|
(setq big-mode (not big-mode)))
|
||||||
|
|
||||||
|
(provide 'init-present)
|
||||||
|
;;; init-present.el ends here
|
|
@ -6,28 +6,52 @@
|
||||||
(defun my-neotree-open (&optional dir)
|
(defun my-neotree-open (&optional dir)
|
||||||
(interactive)
|
(interactive)
|
||||||
(neotree-dir (or dir (project-root))))
|
(neotree-dir (or dir (project-root))))
|
||||||
|
|
||||||
(defun my-neotree-toggle ()
|
(defun my-neotree-toggle ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (neo-global--window-exists-p)
|
(if (neo-global--window-exists-p)
|
||||||
(neotree-hide)
|
(neotree-hide)
|
||||||
(my-neotree-open)))
|
(my-neotree-open)))
|
||||||
|
|
||||||
(defun my-neotree-find ()
|
(defun my-neotree-find ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-excursion (my-neotree-open))
|
(save-excursion (my-neotree-open))
|
||||||
(neotree-find)))
|
(neotree-find))
|
||||||
|
(add-hook 'neotree-mode-hook 'my-neotree-keymap))
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq neo-create-file-auto-open t
|
(setq neo-create-file-auto-open t
|
||||||
neo-mode-line-type 'neotree
|
neo-mode-line-type 'none
|
||||||
neo-persist-show t
|
neo-persist-show t
|
||||||
neo-window-width 28
|
neo-window-width 22
|
||||||
neo-show-updir-line nil
|
neo-show-updir-line nil
|
||||||
neo-auto-indent-point t)
|
neo-auto-indent-point t
|
||||||
|
neo-banner-message nil
|
||||||
|
;; requires <https://github.com/jeffplang/emacs-neotree> fork of
|
||||||
|
;; neotree (at least, until the PR is accepted). Causes neotree to
|
||||||
|
;; open in a vertical split that consumes the entire height of the
|
||||||
|
;; frame.
|
||||||
|
neo-modern-sidebar t)
|
||||||
|
|
||||||
|
;; Custom ascii theme
|
||||||
|
(defun neo-buffer--insert-fold-symbol (name)
|
||||||
|
(let ((n-insert-symbol (lambda (n)
|
||||||
|
(neo-buffer--insert-with-face
|
||||||
|
n 'neo-expand-btn-face))))
|
||||||
|
(or (and (equal name 'open) (funcall n-insert-symbol "- "))
|
||||||
|
(and (equal name 'close) (funcall n-insert-symbol "> "))
|
||||||
|
(and (equal name 'leaf) (funcall n-insert-symbol " ")))))
|
||||||
|
|
||||||
|
;; Close neotree on window changes, to prevent ensuing mindbuggery
|
||||||
|
(add-hook! 'window-configuration-change-hook
|
||||||
|
(unless (and (neo-global--window-exists-p)
|
||||||
|
(eq (current-buffer) (neo-global--get-buffer)))
|
||||||
|
(neotree-hide)))
|
||||||
|
|
||||||
|
(after "projectile"
|
||||||
|
(setq projectile-switch-project-action 'neotree-projectile-action))
|
||||||
(add-to-list 'evil-motion-state-modes 'neotree-mode)
|
(add-to-list 'evil-motion-state-modes 'neotree-mode)
|
||||||
(defun my-neotree-keymap ()
|
(defun my-neotree-keymap ()
|
||||||
(bind evil-motion-state-local-map
|
(bind evil-motion-state-local-map
|
||||||
|
"ESC" 'neotree-hide
|
||||||
"\\\\" 'neotree-hide
|
"\\\\" 'neotree-hide
|
||||||
"RET" 'neotree-enter
|
"RET" 'neotree-enter
|
||||||
"J" 'neotree-select-next-sibling-node
|
"J" 'neotree-select-next-sibling-node
|
||||||
|
@ -42,9 +66,7 @@
|
||||||
"q" 'neotree-hide
|
"q" 'neotree-hide
|
||||||
"r" 'neotree-rename-node
|
"r" 'neotree-rename-node
|
||||||
"R" 'neotree-change-root
|
"R" 'neotree-change-root
|
||||||
"?" 'neotree-))
|
"?" 'neotree-))))
|
||||||
|
|
||||||
(add-hook 'neotree-mode-hook 'my-neotree-keymap)))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-project)
|
(provide 'init-project)
|
||||||
|
|
|
@ -18,8 +18,9 @@
|
||||||
(progn
|
(progn
|
||||||
(add-hook 'python-mode-hook 'anaconda-mode)
|
(add-hook 'python-mode-hook 'anaconda-mode)
|
||||||
(add-hook 'python-mode-hook 'eldoc-mode)
|
(add-hook 'python-mode-hook 'eldoc-mode)
|
||||||
(add-hook! 'anaconda-mode-hook
|
;; (add-hook! 'anaconda-mode-hook
|
||||||
(process-buffer (python-shell-get-or-create-process python-shell-interpreter t nil))))
|
;; (process-buffer (python-shell-get-or-create-process python-shell-interpreter t nil)))
|
||||||
|
)
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(bind 'motion anaconda-mode-map "gd" 'anaconda-mode-goto-definitions)
|
(bind 'motion anaconda-mode-map "gd" 'anaconda-mode-goto-definitions)
|
||||||
|
|
120
init/init-vc.el
Normal file
120
init/init-vc.el
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
(use-package git-commit-mode ;
|
||||||
|
:mode (("/COMMIT_EDITMSG\\'" . git-commit-mode)
|
||||||
|
("/NOTES_EDITMSG\\'" . git-commit-mode)
|
||||||
|
("/MERGE_MSG\\'" . git-commit-mode)
|
||||||
|
("/TAG_EDITMSG\\'" . git-commit-mode)
|
||||||
|
("/PULLREQ_EDITMSG\\'" . git-commit-mode))
|
||||||
|
:config
|
||||||
|
(evil-set-initial-state 'git-commit-mode 'insert))
|
||||||
|
|
||||||
|
(use-package git-rebase-mode
|
||||||
|
:mode ("/git-rebase-todo\\'" . git-rebase-mode)
|
||||||
|
:config
|
||||||
|
(evil-set-initial-state 'git-rebase-mode 'insert))
|
||||||
|
|
||||||
|
(use-package gitconfig-mode
|
||||||
|
:mode (("/\\.?git/?config\\'" . gitconfig-mode)
|
||||||
|
("/\\.gitmodules\\'" . gitconfig-mode))
|
||||||
|
:init (add-hook 'gitconfig-mode-hook 'flyspell-mode))
|
||||||
|
|
||||||
|
(use-package gitignore-mode
|
||||||
|
:mode (("/\\.gitignore\\'" . gitignore-mode)
|
||||||
|
("/\\.git/info/exclude\\'" . gitignore-mode)
|
||||||
|
("/git/ignore\\'" . gitignore-mode)))
|
||||||
|
|
||||||
|
(use-package diff-hl
|
||||||
|
:config
|
||||||
|
(progn
|
||||||
|
(setq diff-hl-draw-borders nil)
|
||||||
|
(global-diff-hl-mode +1)))
|
||||||
|
|
||||||
|
;; (use-package git-gutter-fringe+
|
||||||
|
;; :diminish (git-gutter+-mode . " git")
|
||||||
|
;; :config
|
||||||
|
;; (progn
|
||||||
|
;; ;; (global-git-gutter+-mode +1)
|
||||||
|
;; (add-hooks '(text-mode-hook prog-mode-hook) 'git-gutter+-mode)
|
||||||
|
;; ;; Fixes "git-gutter+-process-diff: Wrong number of arguments: nil" error
|
||||||
|
;; (defadvice git-gutter+-process-diff (before git-gutter+-process-diff-advice activate)
|
||||||
|
;; (ad-set-arg 0 (file-truename (ad-get-arg 0))))
|
||||||
|
|
||||||
|
;; (fringe-helper-define 'git-gutter-fr+-added nil
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X....")
|
||||||
|
|
||||||
|
;; (fringe-helper-define 'git-gutter-fr+-deleted nil
|
||||||
|
;; "....X...."
|
||||||
|
;; "....XXXXX"
|
||||||
|
;; "....XXXXX"
|
||||||
|
;; "....X...."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; "........."
|
||||||
|
;; ".........")
|
||||||
|
|
||||||
|
;; (fringe-helper-define 'git-gutter-fr+-modified nil
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X...."
|
||||||
|
;; "....X....")))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'init-vc)
|
||||||
|
;;; init-vc.el ends here
|
|
@ -1,15 +1,15 @@
|
||||||
(use-package workgroups2
|
(use-package workgroups2
|
||||||
|
:diminish workgroups-mode
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq wg-session-file "~/.emacs.workgroup")
|
(setq wg-session-file "~/.emacs.workgroup"
|
||||||
(setq wg-workgroup-directory "~/.emacs.d/workgroups/")
|
wg-workgroup-directory "~/.emacs.d/workgroups/"
|
||||||
(setq wg-first-wg-name "main")
|
wg-first-wg-name "main"
|
||||||
|
wg-session-load-on-start t
|
||||||
(setq wg-session-load-on-start t)
|
wg-mode-line-display-on nil
|
||||||
|
;; What to do on Emacs exit / workgroups-mode exit?
|
||||||
;; What to do on Emacs exit / workgroups-mode exit?
|
wg-emacs-exit-save-behavior 'save ; Options: 'save 'ask nil
|
||||||
(setq wg-emacs-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
wg-workgroups-mode-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
||||||
(setq wg-workgroups-mode-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
|
||||||
|
|
||||||
(evil-define-command my:save-session (&optional bang session-name)
|
(evil-define-command my:save-session (&optional bang session-name)
|
||||||
(interactive "<!><a>")
|
(interactive "<!><a>")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
:defer t
|
:diminish (yas-minor-mode . " @")
|
||||||
:commands (yas-minor-mode yas-minor-mode-on my--init-yas-mode my:snippets)
|
:commands (yas-minor-mode yas-minor-mode-on my--init-yas-mode my:snippets)
|
||||||
:mode (("emacs\\.d/snippets/.+$" . snippet-mode))
|
:mode (("emacs\\.d/snippets/.+$" . snippet-mode))
|
||||||
:init
|
:init
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
(add-hook 'snippet-mode-hook 'yas-minor-mode-on)
|
(add-hook 'snippet-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'text-mode-hook 'yas-minor-mode-on)
|
(add-hook 'text-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'prog-mode-hook 'yas-minor-mode-on)
|
(add-hook 'prog-mode-hook 'yas-minor-mode-on)
|
||||||
|
(add-hook 'js2-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'org-mode-hook 'yas-minor-mode-on)
|
(add-hook 'org-mode-hook 'yas-minor-mode-on)
|
||||||
(add-hook 'snippet-mode-hook 'disable-final-newline))
|
(add-hook 'snippet-mode-hook 'disable-final-newline))
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
'normal
|
'normal
|
||||||
"M-o" 'ido-find-file
|
"M-o" 'ido-find-file
|
||||||
"M-O" 'my-ido-find-project-file
|
"M-O" 'my-ido-find-project-file
|
||||||
"M-d" 'dash-at-point
|
"<f1>" 'dash-at-point
|
||||||
"M-R" 'my:eval-buffer)
|
"M-R" 'my:eval-buffer)
|
||||||
|
|
||||||
(when is-mac
|
(when is-mac
|
||||||
|
@ -59,14 +59,17 @@
|
||||||
"E" 'my:init-files
|
"E" 'my:init-files
|
||||||
"g" 'git-gutter+-show-hunk
|
"g" 'git-gutter+-show-hunk
|
||||||
"h" 'helm-apropos
|
"h" 'helm-apropos
|
||||||
|
"n" 'my:notes
|
||||||
"m" 'helm-recentf
|
"m" 'helm-recentf
|
||||||
"M" 'helm-projectile-recentf ; recent PROJECT files
|
"M" 'helm-projectile-recentf ; recent PROJECT files
|
||||||
"p" 'helm-projectile-switch-project
|
"p" 'helm-projectile-switch-project
|
||||||
"r" 'emr-show-refactor-menu ; init-dev.el
|
"r" 'emr-show-refactor-menu ; init-dev.el
|
||||||
|
"x" 'my:org-capture
|
||||||
"qq" 'evil-save-and-quit
|
"qq" 'evil-save-and-quit
|
||||||
"QQ" (λ (my:kill-buffers t) (evil-quit-all))
|
"QQ" (λ (my:kill-buffers t) (evil-quit-all))
|
||||||
|
|
||||||
"oo" 'my-open-with
|
"oo" 'my-open-with
|
||||||
|
"ob" (λ (my-open-with "Google Chrome"))
|
||||||
"of" (λ (my-open-with "Finder.app" default-directory))
|
"of" (λ (my-open-with "Finder.app" default-directory))
|
||||||
"oF" (λ (my-open-with "Finder.app" (project-root)))
|
"oF" (λ (my-open-with "Finder.app" (project-root)))
|
||||||
"ou" (λ (my-open-with "Transmit"))
|
"ou" (λ (my-open-with "Transmit"))
|
||||||
|
@ -82,7 +85,7 @@
|
||||||
(bind my-localleader-map
|
(bind my-localleader-map
|
||||||
"\\" 'my-neotree-toggle
|
"\\" 'my-neotree-toggle
|
||||||
"." 'my-neotree-find
|
"." 'my-neotree-find
|
||||||
";" 'linum-mode
|
";" 'nlinum-toggle
|
||||||
"=" 'toggle-transparency
|
"=" 'toggle-transparency
|
||||||
"E" 'evil-emacs-state
|
"E" 'evil-emacs-state
|
||||||
|
|
||||||
|
@ -97,8 +100,8 @@
|
||||||
|
|
||||||
|
|
||||||
(bind 'normal
|
(bind 'normal
|
||||||
"," 'my-leader-map
|
"," 'my-leader-map
|
||||||
"\\" 'my-localleader-map
|
"\\" 'my-localleader-map
|
||||||
|
|
||||||
;; behave like D and C; yank to end of line
|
;; behave like D and C; yank to end of line
|
||||||
"Y" (λ (evil-yank (point) (point-at-eol)))
|
"Y" (λ (evil-yank (point) (point-at-eol)))
|
||||||
|
@ -117,7 +120,7 @@
|
||||||
"gy" 'evil-commentary-yank
|
"gy" 'evil-commentary-yank
|
||||||
|
|
||||||
'visual
|
'visual
|
||||||
", =" 'align-regexp
|
",=" 'align-regexp
|
||||||
|
|
||||||
;; vnoremap < <gv
|
;; vnoremap < <gv
|
||||||
"<" (λ (evil-shift-left (region-beginning) (region-end))
|
"<" (λ (evil-shift-left (region-beginning) (region-end))
|
||||||
|
@ -128,8 +131,6 @@
|
||||||
(evil-normal-state)
|
(evil-normal-state)
|
||||||
(evil-visual-restore))
|
(evil-visual-restore))
|
||||||
|
|
||||||
'normal "X" 'evil-exchange
|
|
||||||
|
|
||||||
'motion
|
'motion
|
||||||
"%" 'evilmi-jump-items
|
"%" 'evilmi-jump-items
|
||||||
[tab] 'evilmi-jump-items ; alias for %
|
[tab] 'evilmi-jump-items ; alias for %
|
||||||
|
@ -140,12 +141,14 @@
|
||||||
"]e" (λ (call-interactively (if flycheck-mode 'flycheck-next-error 'next-error)))
|
"]e" (λ (call-interactively (if flycheck-mode 'flycheck-next-error 'next-error)))
|
||||||
"[e" (λ (call-interactively (if flycheck-mode 'flycheck-previous-error 'previous-error)))
|
"[e" (λ (call-interactively (if flycheck-mode 'flycheck-previous-error 'previous-error)))
|
||||||
|
|
||||||
"]\\" 'er/expand-region
|
"C-=" 'er/expand-region
|
||||||
"[\\" 'er/contract-region
|
"C--" 'er/contract-region
|
||||||
|
|
||||||
"gl" (λ (linum-mode 1) (evil-ex "") (linum-mode -1))
|
;; "gl" (λ (nlinum-enable) (evil-ex "") (nlinum-disable))
|
||||||
"gx" 'my-scratch-buffer ; send to scratch buffer
|
"gx" 'evil-exchange
|
||||||
"gr" 'my:eval-region ; init-dev.el
|
"gr" 'my:eval-region ; init-dev.el
|
||||||
|
"g]" 'smart-down
|
||||||
|
"g[" 'smart-up
|
||||||
|
|
||||||
'insert
|
'insert
|
||||||
"<A-backspace>" 'evil-delete-backward-word
|
"<A-backspace>" 'evil-delete-backward-word
|
||||||
|
@ -213,6 +216,10 @@
|
||||||
|
|
||||||
(after "help-mode"
|
(after "help-mode"
|
||||||
(bind 'normal help-mode-map
|
(bind 'normal help-mode-map
|
||||||
|
"<escape>" (λ (kill-buffer)
|
||||||
|
(if (eq popwin:popup-buffer (current-buffer))
|
||||||
|
(popwin:close-popup-window)
|
||||||
|
(evil-window-delete)))
|
||||||
"]]" 'help-go-forward
|
"]]" 'help-go-forward
|
||||||
"[[" 'help-go-back))
|
"[[" 'help-go-back))
|
||||||
|
|
||||||
|
@ -301,10 +308,6 @@
|
||||||
((string-match "^ \\*" (buffer-name (current-buffer)))
|
((string-match "^ \\*" (buffer-name (current-buffer)))
|
||||||
(bury-buffer))))
|
(bury-buffer))))
|
||||||
|
|
||||||
(dolist (map (list evil-ex-search-keymap minibuffer-local-map))
|
|
||||||
(bind map "\C-w" 'evil-delete-backward-word))
|
|
||||||
|
|
||||||
(global-unset-key (kbd "<drag-mouse-1>"))
|
|
||||||
|
|
||||||
(provide 'my-bindings)
|
(provide 'my-bindings)
|
||||||
;;; my-bindings.el ends here
|
;;; my-bindings.el ends here
|
||||||
|
|
|
@ -6,34 +6,19 @@
|
||||||
;; Implements some helpful keymappings for emacs sub-modes
|
;; Implements some helpful keymappings for emacs sub-modes
|
||||||
(add-hook! 'ido-setup-hook
|
(add-hook! 'ido-setup-hook
|
||||||
(bind ido-completion-map
|
(bind ido-completion-map
|
||||||
(kbd "<backspace>") 'ido-delete-backward-updir
|
"<backspace>" 'ido-delete-backward-updir
|
||||||
"\C-w" 'ido-delete-backward-word-updir))
|
"C-w" 'ido-delete-backward-word-updir))
|
||||||
|
|
||||||
(bind 'emacs [escape] 'my--minibuffer-quit)
|
(bind 'emacs [escape] 'my--minibuffer-quit)
|
||||||
(bind 'normal evil-command-window-mode-map [escape] 'kill-buffer-and-window)
|
(bind 'normal evil-command-window-mode-map [escape] 'kill-buffer-and-window)
|
||||||
;; (bind evil-ex-map [escape] 'my--minibuffer-quit)
|
;; (bind evil-ex-map [escape] 'my--minibuffer-quit)
|
||||||
|
|
||||||
(dolist (map (list evil-ex-search-keymap minibuffer-local-map))
|
;; (dolist (map (list evil-ex-search-keymap minibuffer-local-map ido-common-completion-map ido-completion-map))
|
||||||
(bind map "\C-w" 'evil-delete-backward-word))
|
;; (bind map "C-w" 'evil-delete-backward-word))
|
||||||
|
|
||||||
(bind minibuffer-local-map "\C-u" 'evil-delete-whole-line)
|
(bind minibuffer-local-map "\C-u" 'evil-delete-whole-line)
|
||||||
|
|
||||||
;; Redefine to get rid of that silly delete-other-windows nonsense
|
(global-unset-key (kbd "<drag-mouse-1>"))
|
||||||
;; (defun keyboard-escape-quit ()
|
|
||||||
;; (interactive)
|
|
||||||
;; (cond ((eq last-command 'mode-exited) nil)
|
|
||||||
;; ((region-active-p)
|
|
||||||
;; (deactivate-mark))
|
|
||||||
;; ((> (minibuffer-depth) 0)
|
|
||||||
;; (abort-recursive-edit))
|
|
||||||
;; (current-prefix-arg
|
|
||||||
;; nil)
|
|
||||||
;; ((> (recursion-depth) 0)
|
|
||||||
;; (exit-recursive-edit))
|
|
||||||
;; (buffer-quit-function
|
|
||||||
;; (funcall buffer-quit-function))
|
|
||||||
;; ((string-match "^ \\*" (buffer-name (current-buffer)))
|
|
||||||
;; (bury-buffer))))
|
|
||||||
|
|
||||||
(if is-mac (global-set-key (kbd "M-q") (λ (message "Gee, I dunno Brain..."))))
|
(if is-mac (global-set-key (kbd "M-q") (λ (message "Gee, I dunno Brain..."))))
|
||||||
|
|
||||||
|
|
|
@ -25,20 +25,21 @@
|
||||||
|
|
||||||
(custom-theme-set-variables 'v0)
|
(custom-theme-set-variables 'v0)
|
||||||
|
|
||||||
(let ((background "#222222")
|
(let (;; (background "#222222")
|
||||||
|
(background "#2b303b")
|
||||||
;; (gutters "#262E34")
|
;; (gutters "#262E34")
|
||||||
(gutters "#1f252a")
|
(gutters "#1f252a")
|
||||||
(gutter-fg "#55616A")
|
(gutter-fg "#55616A")
|
||||||
(gutters-active "#2e363c")
|
;; (gutters-active "#2e363c")
|
||||||
|
(gutters-active "#1c1f26")
|
||||||
(linum "#1e262c")
|
(linum "#1e262c")
|
||||||
; (background "#11141c")
|
;; (gutter-light "#434f58")
|
||||||
; (gutters "#343d46")
|
(gutter-light "#232830")
|
||||||
(gutter-light "#434f58")
|
|
||||||
; (gutters-active "#4f5b66")
|
|
||||||
(builtin "#d08770")
|
(builtin "#d08770")
|
||||||
(foreground "#c0c5ce")
|
(foreground "#c0c5ce")
|
||||||
(invisibles "#65737e")
|
(invisibles "#65737e")
|
||||||
(lineHighlight "#353539")
|
;; (line-hl "#353539")
|
||||||
|
(line-hl "#343d46")
|
||||||
(selection "#4f5b66")
|
(selection "#4f5b66")
|
||||||
(text "#c0c5ce")
|
(text "#c0c5ce")
|
||||||
(comments "#65737e")
|
(comments "#65737e")
|
||||||
|
@ -52,10 +53,12 @@
|
||||||
(strings "#a3be8c")
|
(strings "#a3be8c")
|
||||||
(constants "#d08770")
|
(constants "#d08770")
|
||||||
(white "#ffffff")
|
(white "#ffffff")
|
||||||
|
(highlight "orange")
|
||||||
|
(dim-highlight "#556779")
|
||||||
|
|
||||||
(git-modified "#B4924E")
|
(git-modified "#55616A")
|
||||||
(git-added "#91E331")
|
(git-added "#436b3b")
|
||||||
(git-deleted "#A12121"))
|
(git-deleted "#714243"))
|
||||||
|
|
||||||
(custom-theme-set-faces
|
(custom-theme-set-faces
|
||||||
'v0
|
'v0
|
||||||
|
@ -64,28 +67,28 @@
|
||||||
;; *****************************************************************************************
|
;; *****************************************************************************************
|
||||||
|
|
||||||
`(default ((t (:foreground ,text :background ,background) )))
|
`(default ((t (:foreground ,text :background ,background) )))
|
||||||
`(hl-line ((t (:background ,lineHighlight) )))
|
`(hl-line ((t (:background ,line-hl) )))
|
||||||
`(region ((t (:background ,selection) )))
|
`(region ((t (:background ,selection) )))
|
||||||
`(cursor ((t (:background ,white) )))
|
`(cursor ((t (:background ,white) )))
|
||||||
`(fringe ((t (:background ,background :foreground ,white) )))
|
`(fringe ((t (:background ,background :foreground ,white) )))
|
||||||
`(linum ((t (:background ,background :foreground ,gutter-fg) )))
|
`(linum ((t (:background ,background :foreground ,gutter-fg :weight normal) )))
|
||||||
|
|
||||||
`(vertical-border ((t (:foreground ,gutters-active) )))
|
`(vertical-border ((t (:foreground "#000000") )))
|
||||||
|
|
||||||
`(mode-line ((t (:foreground ,white
|
`(mode-line ((t (:foreground ,white
|
||||||
:background ,gutter-light
|
:background ,gutter-light
|
||||||
:box (:line-width 3 :color ,gutter-light)
|
:box (:line-width 3 :color ,gutter-light)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
`(mode-line-inactive ((t (:foreground ,gutter-fg
|
`(mode-line-inactive ((t (:foreground ,gutter-fg
|
||||||
:background ,gutters-active
|
:background ,gutters-active
|
||||||
:box (:line-width 3 :color ,gutters-active)
|
:box (:line-width 3 :color ,gutters-active)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
`(mode-line-modified-face ((t (:foreground ,builtin))))
|
`(mode-line-modified-face ((t (:foreground ,builtin))))
|
||||||
|
|
||||||
;; `(highlight-indentation-face ((t (:background ,linum) )))
|
`(sml/folder ((t nil)))
|
||||||
;; `(highlight-indentation-current-column-face ((t (:background ,gutters-active) )))
|
`(sml/modified ((t (:foreground ,highlight))))
|
||||||
|
|
||||||
`(flyspell-incorrect ((t (:underline "#ff5555" :inherit unspecified))))
|
`(flyspell-incorrect ((t (:underline "#ff5555" :inherit unspecified))))
|
||||||
|
|
||||||
|
@ -95,6 +98,8 @@
|
||||||
;; Font lock faces
|
;; Font lock faces
|
||||||
;; *****************************************************************************************
|
;; *****************************************************************************************
|
||||||
|
|
||||||
|
`(linum-highlight-face ((t (:foreground ,text :background ,line-hl :inherit linum))))
|
||||||
|
|
||||||
`(font-lock-keyword-face ((t (:foreground ,keywords))))
|
`(font-lock-keyword-face ((t (:foreground ,keywords))))
|
||||||
`(font-lock-type-face ((t (:foreground ,punctuation))))
|
`(font-lock-type-face ((t (:foreground ,punctuation))))
|
||||||
`(font-lock-constant-face ((t (:foreground ,constants))))
|
`(font-lock-constant-face ((t (:foreground ,constants))))
|
||||||
|
@ -112,15 +117,17 @@
|
||||||
`(whitespace-newline ((t (:foreground "#444444"))))
|
`(whitespace-newline ((t (:foreground "#444444"))))
|
||||||
`(whitespace-trailing ((t (:background "#553333"))))
|
`(whitespace-trailing ((t (:background "#553333"))))
|
||||||
|
|
||||||
`(git-gutter+-modified ((t (:foreground ,git-modified))))
|
`(git-gutter+-modified ((t (:foreground ,git-modified :background nil))))
|
||||||
`(git-gutter+-added ((t (:foreground ,git-added))))
|
`(git-gutter+-added ((t (:foreground ,git-added :background nil))))
|
||||||
`(git-gutter+-deleted ((t (:foreground ,git-deleted))))
|
`(git-gutter+-deleted ((t (:foreground ,git-deleted :background nil))))
|
||||||
|
|
||||||
|
`(diff-hl-change ((t (:background ,git-modified))))
|
||||||
|
`(diff-hl-delete ((t (:background ,git-deleted))))
|
||||||
|
`(diff-hl-insert ((t (:background ,git-added))))
|
||||||
|
|
||||||
`(rainbow-delimiters-unmatched-face ((t (:inherit 'error))))
|
`(rainbow-delimiters-unmatched-face ((t (:inherit 'error))))
|
||||||
`(rainbow-delimiters-depth-1-face ((t (:foreground "#CCCCCC" :weight bold :bold t))))
|
`(rainbow-delimiters-depth-1-face ((t (:foreground "#CCCCCC" :weight bold :bold t))))
|
||||||
|
|
||||||
`(linum-highlight-face ((t (:background ,gutters-active))))
|
|
||||||
|
|
||||||
;; js2-mode
|
;; js2-mode
|
||||||
;; *****************************************************************************************
|
;; *****************************************************************************************
|
||||||
|
|
||||||
|
@ -135,8 +142,10 @@
|
||||||
`(org-level-1 ((t (:inherit outline-1 :bold t :foreground ,git-added))))
|
`(org-level-1 ((t (:inherit outline-1 :bold t :foreground ,git-added))))
|
||||||
`(org-level-2 ((t (:inherit outline-2 :bold t :foreground ,variables))))
|
`(org-level-2 ((t (:inherit outline-2 :bold t :foreground ,variables))))
|
||||||
|
|
||||||
`(evil-snipe-first-match-face ((t (:background "orange" :foreground "black" :underline nil))))
|
`(evil-snipe-first-match-face ((t (:background ,highlight :foreground "black" :underline nil))))
|
||||||
`(evil-snipe-matches-face ((t (:foreground "orange" :background "gray20" :underline t))))
|
`(evil-snipe-matches-face ((t (:foreground ,highlight :background "gray20" :underline t))))
|
||||||
|
`(isearch ((t (:foreground "black" :background ,highlight :inverse-video nil))))
|
||||||
|
`(isearch-lazy-highlight-face ((t (:foreground ,text :background ,dim-highlight))))
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue