Browse Source

Exposed data folder, reformatted

* Data dir is exposed as a variable for searching
* Add dsvn diff marked
* Web Mode is always required
* Web Mode has proper theme-generated highlighting
master
Macoy Madson 2 years ago
parent
commit
1f94b4e5ea
  1. 4
      Emacs/search.el
  2. 4
      Emacs/source-control.el
  3. 57
      Emacs/syntaxes.el
  4. 50
      Emacs/visual-late.el

4
Emacs/search.el

@ -70,7 +70,7 @@ If there's a string at point, offer that as a default."
'macoy-codesearch-search-src)))
;; Codesearch data
(define-key map (kbd "d") (lambda () (interactive) (macoy-select-do-search
'macoy-codesearch-search-with-filter-directory "D:/Magic/data")))
'macoy-codesearch-search-with-filter-directory macoy-codesearch-search-data-dir)))
;; Swiper all
(define-key map (kbd "s") (lambda () (interactive) (macoy-select-do-search
'swiper-all)))
@ -160,6 +160,7 @@ If there's a string at point, offer that as a default."
(setq codesearch-dir-to-index "f:/CJUNCTIONS/src")
(setq codesearch-index-file "~/.csearchindex")
(setq codesearch-temp-file "c:/.temp-codesearch.txt")
(setq macoy-codesearch-search-data-dir "D:/Magic/data")
)
(when (string-equal (user-login-name) "macoy")
@ -168,6 +169,7 @@ If there's a string at point, offer that as a default."
(setq codesearch-dir-to-index "/home/macoy/Development/code/repositories")
(setq codesearch-index-file "~/.csearchindex")
(setq codesearch-temp-file "~/.temp-codesearch.txt")
(setq macoy-codesearch-search-data-dir nil)
)
;; TODO: Rename compilation buffer and add a finished message?

4
Emacs/source-control.el

@ -61,3 +61,7 @@
;; dsvn
(when (derived-mode-p 'log-edit-mode)
(call-interactively 'log-edit-done)))
(defun macoy-dsvn-diff-marked ()
(interactive)
(svn-diff-file t))

57
Emacs/syntaxes.el

@ -5,12 +5,19 @@
;; This is for better syntax highlighting when editing templated web files (e.g. files with Nunjucks)
;; Only enabled at work because I only need web mode for template stuff
(when (and (string-equal (user-login-name) "mmadson") (require 'web-mode))
(when (require 'web-mode)
;; TODO: Customize colors (see http://web-mode.org/ "Syntax highlighting")
;; I like to manually enable rainbow-mode if I want to see colors (this might not work...)
(setq web-mode-enable-css-colorization nil)
;; (set-face-foreground 'web-mode-html-attr-custom-face (face-foreground 'font-lock-variable-name-face))
;; (set-face-foreground 'web-mode-html-attr-name-face (face-foreground 'font-lock-variable-name-face))
(set-face-foreground 'web-mode-html-attr-custom-face (face-foreground 'default))
(set-face-foreground 'web-mode-html-attr-name-face (face-foreground 'default))
(set-face-foreground 'web-mode-html-tag-bracket-face (face-foreground 'default))
(set-face-foreground 'web-mode-html-tag-face (face-foreground 'font-lock-function-name-face))
;; Associate web files with web-mode
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js?\\'" . web-mode))
@ -18,11 +25,9 @@
;; I use Nunjucks which is in the Django family
(setq web-mode-engines-alist
'(("django" . "\\.html\\'")
("django" . "\\.js\\.")
("django" . "\\.css\\.")
)
)
'(("django" . "\\.html\\'")
("django" . "\\.js\\.")
("django" . "\\.css\\.")))
)
;; Doesn't work because these args aren't the right command
@ -30,8 +35,8 @@
;; ;; Override this function so I can customize args. Why did they make it defconst...
;; (defconst macoy-web-beautify-args '("-f" "-t" "-"))
;; (defun web-beautify-get-shell-command (program)
;; "Join PROGRAM with the constant js-beautify args."
;; (mapconcat 'identity (append (list program) macoy-web-beautify-args) " "))
;; "Join PROGRAM with the constant js-beautify args."
;; (mapconcat 'identity (append (list program) macoy-web-beautify-args) " "))
;; )
;; Jam
@ -47,19 +52,19 @@
'("#")
;; Keywords
'(
"End" "Name"
)
"End" "Name"
)
;; Font locks
'(
;; Numerical constants
("\\_<[\-0-9e\.]+\\_>" . font-lock-constant-face)
;; Generic "Key Value" match (I'm proud of this :) )
;; I use variable here because it's setting a variable on the struct with match's name
;; (plus it looks different in a way that I like)
("^[[:blank:]]*+[[:alnum:]]+[[:blank:]]+*+" . font-lock-variable-name-face)
;; Functions. The 1 here means only highlight the first group
("\\([[:alnum:]]*\\)\(" 1 font-lock-function-name-face)
)
;; Numerical constants
("\\_<[\-0-9e\.]+\\_>" . font-lock-constant-face)
;; Generic "Key Value" match (I'm proud of this :) )
;; I use variable here because it's setting a variable on the struct with match's name
;; (plus it looks different in a way that I like)
("^[[:blank:]]*+[[:alnum:]]+[[:blank:]]+*+" . font-lock-variable-name-face)
;; Functions. The 1 here means only highlight the first group
("\\([[:alnum:]]*\\)\(" 1 font-lock-function-name-face)
)
;; Files to use this mode
'(".ExampleExtension\\'")
@ -72,4 +77,16 @@
(setq lua-indent-level 4))
(when (require 'smart-tabs-mode
(smart-tabs-insinuate 'c 'c++)))
(smart-tabs-insinuate 'c 'c++)))
;; Highlight function calls
;; (font-lock-remove-keywords 'c-mode
;; '(("\\(\\w+\\)\\s-*\("
;; (1 font-lock-string-face)))
;; )
;; (font-lock-remove-keywords 'c++-mode
;; '(("\\(\\w+\\)\\s-*\("
;; (1 font-lock-string-face)))
;; )

50
Emacs/visual-late.el

@ -17,26 +17,26 @@
;; Note that names need to be unique (they should be anyways)
(setq macoy-transparency-list (list
;; '("Jam (current directory)" build-universal-jam)
'(80 70)
'(85 70)
'(90 70)
'(100 100)
)
)
;; '("Jam (current directory)" build-universal-jam)
'(70 60)
'(80 70)
'(85 70)
'(90 70)
'(100 100)
))
(setq macoy-transparency-index 0)
(defun macoy-cycle-transparency (&optional index)
(interactive)
(if index
(setq macoy-transparency-index index)
(setq macoy-transparency-index (+ macoy-transparency-index 1)))
(setq macoy-transparency-index index)
(setq macoy-transparency-index (+ macoy-transparency-index 1)))
;; Loop around
(unless (< macoy-transparency-index (safe-length macoy-transparency-list))
(setq macoy-transparency-index 0))
(setq macoy-transparency-index 0))
(let ((transparency-settings (nth macoy-transparency-index macoy-transparency-list)))
(set-frame-parameter (selected-frame) 'alpha transparency-settings)
(message "Transparency now %s" transparency-settings)))
(set-frame-parameter (selected-frame) 'alpha transparency-settings)
(message "Transparency now %s" transparency-settings)))
;; Set default transparency
(macoy-cycle-transparency 0)
@ -128,17 +128,17 @@
;; Make magit's diff look similar/the same as diff-mode
(when (require 'magit)
(set-face-attribute 'magit-diff-added-highlight nil
:foreground (face-foreground 'diff-added)
:background "#2c4a27")
:foreground (face-foreground 'diff-added)
:background "#2c4a27")
(set-face-attribute 'magit-diff-removed-highlight nil
:foreground (face-foreground 'diff-added)
:background "#4a2727")
:foreground (face-foreground 'diff-added)
:background "#4a2727")
(set-face-attribute 'magit-diff-added nil
:foreground (face-foreground 'diff-added)
:background "#21381e")
:foreground (face-foreground 'diff-added)
:background "#21381e")
(set-face-attribute 'magit-diff-removed nil
:foreground (face-foreground 'diff-added)
:background "#381e1e")
:foreground (face-foreground 'diff-added)
:background "#381e1e")
)
;; Get rid of the strange light gray background
@ -174,11 +174,11 @@
(set-face-underline 'org-link t)
;; Don't use the default block face for code
(setq org-src-block-faces '(("C" 'default)
("python" 'default)
("C++" 'default)
("emacs-lisp" 'default)
("lisp" 'default)
("sh" 'default)))
("python" 'default)
("C++" 'default)
("emacs-lisp" 'default)
("lisp" 'default)
("sh" 'default)))
)
;; Hide these modes completely (for a more minimal look)

Loading…
Cancel
Save