mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 11:06:17 +00:00
[emacs] Various improvements
This commit is contained in:
parent
f0deb1b398
commit
d464261192
1 changed files with 85 additions and 31 deletions
|
@ -8,12 +8,50 @@
|
||||||
(setq inhibit-startup-screen +1)
|
(setq inhibit-startup-screen +1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* UI
|
* UI
|
||||||
|
** Powerline
|
||||||
|
Make the mode line prettier.
|
||||||
|
#+name: look-and-feel
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package powerline
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
|
||||||
|
(powerline-default-theme))
|
||||||
|
#+END_SRC
|
||||||
|
** Nyan-mode
|
||||||
|
Visualize the current position within the buffer in the modeline with nyancat!
|
||||||
|
#+name: look-and-feel
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package nyan-mode
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(nyan-mode)
|
||||||
|
(nyan-start-animation))
|
||||||
|
#+END_SRC
|
||||||
** Theme
|
** Theme
|
||||||
#+name: look-and-feel
|
#+name: look-and-feel
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package solarized-theme
|
(use-package moe-theme
|
||||||
:ensure t
|
:ensure t
|
||||||
:init (load-theme 'solarized-dark 't))
|
:config
|
||||||
|
|
||||||
|
(setq moe-theme-resize-markdown-title '(1.5 1.4 1.3 1.2 1.0 1.0))
|
||||||
|
(setq moe-theme-resize-org-title '(1.5 1.4 1.3 1.2 1.1 1.0 1.0 1.0 1.0))
|
||||||
|
(setq moe-theme-resize-rst-title '(1.5 1.4 1.3 1.2 1.1 1.0))
|
||||||
|
|
||||||
|
(setq moe-theme-highlight-buffer-id t)
|
||||||
|
(moe-theme-set-color 'cyan)
|
||||||
|
(powerline-moe-theme)
|
||||||
|
(moe-light))
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
** Major mode icons
|
||||||
|
Display major-mode names as icons in the mode line when possible.
|
||||||
|
#+name: look-and-feel
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package mode-icons
|
||||||
|
:ensure t
|
||||||
|
:config (mode-icons-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Helm
|
** Helm
|
||||||
#+name: packages
|
#+name: packages
|
||||||
|
@ -48,9 +86,9 @@
|
||||||
Helm search plugin for [[Ag%20(The%20Silver%20Searcher)][Ag (The Silver Searcher)]]
|
Helm search plugin for [[Ag%20(The%20Silver%20Searcher)][Ag (The Silver Searcher)]]
|
||||||
#+name: packages
|
#+name: packages
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package helm-ag
|
(use-package helm-ag
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer 1)
|
:commands (helm-ag))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** helm-flyspell
|
*** helm-flyspell
|
||||||
#+name: packages
|
#+name: packages
|
||||||
|
@ -65,12 +103,26 @@ Helm search plugin for [[Ag%20(The%20Silver%20Searcher)][Ag (The Silver Searcher
|
||||||
|
|
||||||
Replace isearch-forward with helm-swoop for a nicer experience.
|
Replace isearch-forward with helm-swoop for a nicer experience.
|
||||||
|
|
||||||
|
#+BEGIN_NOTES
|
||||||
|
Quite usefully, using prefix arguments expands the lines of context
|
||||||
|
shown around the search results.
|
||||||
|
#+END_NOTES
|
||||||
|
|
||||||
#+name: packages
|
#+name: packages
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package helm-swoop
|
(use-package helm-swoop
|
||||||
:ensure t
|
:ensure t
|
||||||
:commands (helm-swoop)
|
:commands (helm-swoop)
|
||||||
:bind (("C-s" . helm-swoop)))
|
:bind (("C-s" . helm-swoop))
|
||||||
|
:config
|
||||||
|
;; Defaults to (lambda () (thing-at-point 'symbol)).
|
||||||
|
;; Setting it to return nil, as I find it tends to be more annoying than useful.
|
||||||
|
(setq helm-swoop-pre-input-function (lambda () nil))
|
||||||
|
;; Enable syntax highlighting. It makes it easier for my eyes to
|
||||||
|
;; parse the results, and doesn't seem to slow things down
|
||||||
|
;; measurably.
|
||||||
|
(setq helm-swoop-speed-or-color t)
|
||||||
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Coding
|
* Coding
|
||||||
** Languages
|
** Languages
|
||||||
|
@ -94,13 +146,17 @@ Replace isearch-forward with helm-swoop for a nicer experience.
|
||||||
(setq inferior-lisp-program "clisp")
|
(setq inferior-lisp-program "clisp")
|
||||||
|
|
||||||
(use-package paredit
|
(use-package paredit
|
||||||
:ensure t)
|
:ensure t
|
||||||
|
:commands (paredit-mode)
|
||||||
|
:diminish " ❨❩")
|
||||||
|
|
||||||
(use-package rainbow-identifiers
|
(use-package rainbow-identifiers
|
||||||
:ensure t)
|
:ensure t
|
||||||
|
:commands (rainbow-identifiers-mode))
|
||||||
|
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:ensure t)
|
:ensure t
|
||||||
|
:commands (rainbow-delimiters-mode))
|
||||||
|
|
||||||
(let ((lisp-mode-hooks
|
(let ((lisp-mode-hooks
|
||||||
(mapcar (lambda (lisp)
|
(mapcar (lambda (lisp)
|
||||||
|
@ -346,23 +402,16 @@ Configure jedi and company-mode to provide auto-completion for python.
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** PlantUML
|
*** PlantUML
|
||||||
|
|
||||||
Install [[https://github.com/skuro/puml-mode][puml-mode]] and alias it as plantuml-mode so it plays nice with
|
|
||||||
org documents and ob-plantuml.
|
|
||||||
|
|
||||||
#+name: programming
|
#+name: programming
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package puml-mode
|
(use-package plantuml-mode
|
||||||
:ensure t
|
:ensure t
|
||||||
:mode "\\.plantuml\\'"
|
:mode "\\.plantuml\\'"
|
||||||
:commands puml-mode
|
:commands plantuml-mode)
|
||||||
:init
|
|
||||||
|
|
||||||
(define-derived-mode plantuml-mode
|
|
||||||
puml-mode "PlantUML Mode"))
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Don't forget to configure =org-plantuml-jar-path= and
|
Don't forget to configure =org-plantuml-jar-path= and
|
||||||
=puml-plantuml-jar-path= to point to a version of plantuml.jar on your
|
=plantuml-jar-path= to point to a version of plantuml.jar on your
|
||||||
system.
|
system.
|
||||||
** Tools
|
** Tools
|
||||||
*** Projectile
|
*** Projectile
|
||||||
|
@ -370,13 +419,13 @@ system.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer 1
|
:diminish " 📁"
|
||||||
:config
|
:init
|
||||||
|
|
||||||
(projectile-mode t)
|
|
||||||
(use-package helm-projectile
|
(use-package helm-projectile
|
||||||
:ensure t
|
:ensure t
|
||||||
:config (helm-projectile-on)))
|
:config (helm-projectile-on))
|
||||||
|
:config
|
||||||
|
(projectile-mode t))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Autocomplete
|
*** Autocomplete
|
||||||
**** Company
|
**** Company
|
||||||
|
@ -387,6 +436,7 @@ Install and configure Company for auto-completion.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package company
|
(use-package company
|
||||||
:ensure t
|
:ensure t
|
||||||
|
:commands (company-mode)
|
||||||
:config (progn
|
:config (progn
|
||||||
(add-hook 'prog-mode-hook 'company-mode)
|
(add-hook 'prog-mode-hook 'company-mode)
|
||||||
|
|
||||||
|
@ -401,7 +451,8 @@ require it.
|
||||||
#+name: autocomplete
|
#+name: autocomplete
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package auto-complete
|
(use-package auto-complete
|
||||||
:ensure t)
|
:ensure t
|
||||||
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Flycheck
|
*** Flycheck
|
||||||
|
@ -409,6 +460,7 @@ require it.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:ensure t
|
:ensure t
|
||||||
|
:diminish " ✓"
|
||||||
:init
|
:init
|
||||||
(add-hook 'after-init-hook #'global-flycheck-mode))
|
(add-hook 'after-init-hook #'global-flycheck-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -454,7 +506,7 @@ magnitude faster.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ag
|
(use-package ag
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer 1)
|
:commands (ag))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Expand Region
|
*** Expand Region
|
||||||
Increase selected region by semantic units.
|
Increase selected region by semantic units.
|
||||||
|
@ -537,7 +589,8 @@ names.
|
||||||
#+name: packages
|
#+name: packages
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ob-http
|
(use-package ob-http
|
||||||
:ensure t)
|
:ensure t
|
||||||
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
***** Language evaluation
|
***** Language evaluation
|
||||||
|
|
||||||
|
@ -664,7 +717,8 @@ Taken from [[http://pragmaticemacs.com/emacs/wrap-text-in-an-org-mode-block/][Pr
|
||||||
#+name: packages
|
#+name: packages
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package tex-site
|
(use-package tex-site
|
||||||
:ensure auctex)
|
:ensure auctex
|
||||||
|
:mode ("\\.tex$" . TeX-latex-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
**** LaTeX-Extra
|
**** LaTeX-Extra
|
||||||
#+name: packages
|
#+name: packages
|
||||||
|
@ -796,7 +850,7 @@ Taken from http://groups.google.com/group/gnu.emacs.gnus/browse_thread/thread/a6
|
||||||
activate compile preactivate)
|
activate compile preactivate)
|
||||||
"Disable git-gutter when running ediff"
|
"Disable git-gutter when running ediff"
|
||||||
(global-git-gutter-mode 0))
|
(global-git-gutter-mode 0))
|
||||||
|
|
||||||
(add-hook 'ediff-cleanup-hook
|
(add-hook 'ediff-cleanup-hook
|
||||||
'(lambda ()
|
'(lambda ()
|
||||||
(global-git-gutter-mode t)))))
|
(global-git-gutter-mode t)))))
|
||||||
|
@ -822,7 +876,7 @@ Taken from http://groups.google.com/group/gnu.emacs.gnus/browse_thread/thread/a6
|
||||||
(window-configuration-to-register :magit-fullscreen)
|
(window-configuration-to-register :magit-fullscreen)
|
||||||
ad-do-it
|
ad-do-it
|
||||||
(delete-other-windows))
|
(delete-other-windows))
|
||||||
|
|
||||||
(defadvice magit-quit-window (around magit-restore-screen activate)
|
(defadvice magit-quit-window (around magit-restore-screen activate)
|
||||||
ad-do-it
|
ad-do-it
|
||||||
(jump-to-register :magit-fullscreen))))
|
(jump-to-register :magit-fullscreen))))
|
||||||
|
@ -914,7 +968,7 @@ Taken from [[http://www.emacswiki.org/TrampMode#toc32][EmacsWiki]]
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((my-file-name) ; fill this with the file to open
|
(let ((my-file-name) ; fill this with the file to open
|
||||||
(position)) ; if the file is already open save position
|
(position)) ; if the file is already open save position
|
||||||
(if (equal major-mode 'dired-mode) ; test if we are in dired-mode
|
(if (equal major-mode 'dired-mode) ; test if we are in dired-mode
|
||||||
(progn
|
(progn
|
||||||
(setq my-file-name (dired-get-file-for-visit))
|
(setq my-file-name (dired-get-file-for-visit))
|
||||||
(find-alternate-file (prepare-tramp-sudo-string my-file-name)))
|
(find-alternate-file (prepare-tramp-sudo-string my-file-name)))
|
||||||
|
|
Loading…
Reference in a new issue