forked from colonelpanic/dotfiles
Theme update on the hour. ace-jump-mode-char binding.
This commit is contained in:
parent
395b9ce1c8
commit
a591a818ae
44
init.el
44
init.el
@ -99,11 +99,11 @@ Return a list of installed packages or nil for every package not installed."
|
|||||||
|
|
||||||
;; Evvvillll
|
;; Evvvillll
|
||||||
(setq use-dialog-box nil)
|
(setq use-dialog-box nil)
|
||||||
|
(remove-hook 'prog-mode-hook 'turn-on-hl-line-mode)
|
||||||
|
|
||||||
;; Set the default font for emacs.
|
;; Set the default font for emacs.
|
||||||
;;(set-face-attribute 'default t :font "Deja Vu")
|
;;(set-face-attribute 'default t :font "Deja Vu")
|
||||||
;;(set-frame-font "Deja Vu Sans Mono" t t)
|
(set-frame-font "Monaco 11" t t)
|
||||||
|
|
||||||
;;(set-face-attribute 'default nil :height 80)
|
;;(set-face-attribute 'default nil :height 80)
|
||||||
|
|
||||||
@ -154,11 +154,13 @@ Return a list of installed packages or nil for every package not installed."
|
|||||||
|
|
||||||
(add-hook 'prog-mode-hook 'no-auto-fill-hook)
|
(add-hook 'prog-mode-hook 'no-auto-fill-hook)
|
||||||
(add-hook 'prog-mode-hook (lambda () (subword-mode 1)))
|
(add-hook 'prog-mode-hook (lambda () (subword-mode 1)))
|
||||||
(add-hook 'js-mode (lambda () (subword-mode 1)))
|
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
|
||||||
|
(add-hook 'prog-mode-hook 'auto-complete-mode)
|
||||||
|
(add-hook 'lisp-mode-hook (lambda () (local-set-key (kbd "C-c C-r") #'esk-eval-and-replace)))
|
||||||
|
|
||||||
;; disabled hooks
|
;; disabled hooks
|
||||||
;; (add-hook 'prog-mode-hook (lambda () (highlight-lines-matching-regexp
|
;; (add-hook 'prog-mode-hook (lambda () (highlight-lines-matching-regexp
|
||||||
;; ".\\{81\\}" 'hi-blue)))
|
;; ".\\{81\\}" 'hi-blue)))
|
||||||
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
|
|
||||||
|
|
||||||
|
|
||||||
(setq flyspell-issue-welcome-flag nil)
|
(setq flyspell-issue-welcome-flag nil)
|
||||||
@ -196,6 +198,9 @@ Return a list of installed packages or nil for every package not installed."
|
|||||||
(interactive "r")
|
(interactive "r")
|
||||||
(shell-command-on-region b e "source ~/.zshrc; cat | smart_copy"))
|
(shell-command-on-region b e "source ~/.zshrc; cat | smart_copy"))
|
||||||
|
|
||||||
|
(defun os-copy-string (string-to-copy)
|
||||||
|
)
|
||||||
|
|
||||||
(defun os-paste ()
|
(defun os-paste ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(insert (shell-command-to-string "source ~/.zshrc; ospaste")))
|
(insert (shell-command-to-string "source ~/.zshrc; ospaste")))
|
||||||
@ -304,7 +309,8 @@ Return a list of installed packages or nil for every package not installed."
|
|||||||
|
|
||||||
;; Miscellaneous
|
;; Miscellaneous
|
||||||
(global-unset-key (kbd "C-o")) ;; Avoid collision with tmux binding.
|
(global-unset-key (kbd "C-o")) ;; Avoid collision with tmux binding.
|
||||||
(global-set-key (kbd "C-;") 'ace-jump-mode)
|
(global-set-key (kbd "C-c j") 'ace-jump-mode)
|
||||||
|
(global-set-key (kbd "C-;") 'ace-jump-char-mode)
|
||||||
(global-set-key (kbd "C-x C-b") 'buffer-menu)
|
(global-set-key (kbd "C-x C-b") 'buffer-menu)
|
||||||
(global-set-key (kbd "C-x w") 'whitespace-mode)
|
(global-set-key (kbd "C-x w") 'whitespace-mode)
|
||||||
(global-set-key (kbd "C-x C-r") (lambda () (interactive) (revert-buffer t t)))
|
(global-set-key (kbd "C-x C-r") (lambda () (interactive) (revert-buffer t t)))
|
||||||
@ -317,7 +323,7 @@ Return a list of installed packages or nil for every package not installed."
|
|||||||
(global-set-key (kbd "C-x C-c") 'kill-emacs)
|
(global-set-key (kbd "C-x C-c") 'kill-emacs)
|
||||||
(global-set-key (kbd "C-c +") 'message-buffer-name)
|
(global-set-key (kbd "C-c +") 'message-buffer-name)
|
||||||
|
|
||||||
(global-set-key "\C-cg" 'jedi:goto-definition)
|
(global-set-key (kbd "C-c g") 'jedi:goto-definition)
|
||||||
|
|
||||||
(global-unset-key (kbd "C-o"))
|
(global-unset-key (kbd "C-o"))
|
||||||
|
|
||||||
@ -347,28 +353,34 @@ Return a list of installed packages or nil for every package not installed."
|
|||||||
;; =============================================================================
|
;; =============================================================================
|
||||||
|
|
||||||
;; Choose random theme:
|
;; Choose random theme:
|
||||||
;; (defvar my-themes '(monokai solarized-dark zenburn base16-default))
|
(defvar dark-themes '(monokai solarized-dark base16-default))
|
||||||
;; (defvar my-theme (nth (random (length my-themes)) my-themes))
|
(defvar light-themes '(zenburn solarized-light))
|
||||||
|
|
||||||
(defun get-appropriate-solarized-theme ()
|
(defun random-choice (choices)
|
||||||
|
(nth (random (length choices)) choices))
|
||||||
|
|
||||||
|
(defun get-appropriate-theme ()
|
||||||
(let ((hour
|
(let ((hour
|
||||||
(string-to-number (format-time-string "%H"))))
|
(string-to-number (format-time-string "%H"))))
|
||||||
(if (or (< hour 6) (> hour 20))
|
(if (or (< hour 6) (> hour 18))
|
||||||
'solarized-dark 'solarized-light)))
|
(random-choice dark-themes) (random-choice light-theme))))
|
||||||
|
|
||||||
(setq current-theme nil)
|
(setq current-theme nil)
|
||||||
|
|
||||||
(defun set-solarized-theme ()
|
(defun set-theme ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((appropriate-theme (get-appropriate-solarized-theme)))
|
(let ((appropriate-theme (get-appropriate-theme)))
|
||||||
(if (eq appropriate-theme current-theme)
|
(if (eq appropriate-theme current-theme)
|
||||||
nil
|
nil
|
||||||
(progn (load-theme appropriate-theme t)
|
(progn (load-theme-no-hl-line appropriate-theme)
|
||||||
(setq current-theme appropriate-theme)))))
|
(setq current-theme appropriate-theme)))))
|
||||||
|
|
||||||
|
(defun load-theme-no-hl-line (theme)
|
||||||
|
(load-theme theme t)
|
||||||
|
(setq hl-line-mode nil))
|
||||||
|
|
||||||
;; enable to set theme based on time of day.
|
;; enable to set theme based on time of day.
|
||||||
;; (run-at-time "12:00" 3600 'set-solarized-theme)
|
(run-at-time "12:00" 3600 'set-theme)
|
||||||
(load-theme 'monokai t)
|
|
||||||
|
|
||||||
(require 'smart-mode-line)
|
(require 'smart-mode-line)
|
||||||
(sml/setup)
|
(sml/setup)
|
||||||
|
Loading…
Reference in New Issue
Block a user