Commit 8fc65b90 authored by David Sveningsson's avatar David Sveningsson
Browse files

emacs: some restructure

parent a4e4cd04
......@@ -82,10 +82,11 @@
solarized-high-contrast-mode-line t
solarized-scale-org-headlines nil))
#+END_SRC
* Swiper / Ivy / Counsel
* Editor
** Swiper / Ivy / Counsel
Swiper gives us a really efficient incremental search with regular expressions
and Ivy / Counsel replace a lot of ido or helms completion functionality
** Counsel
*** Counsel
#+BEGIN_SRC emacs-lisp
(use-package counsel
:ensure t
......@@ -106,7 +107,7 @@
"\\|\\(?:\\`.+?[#~]\\'\\)"))) ;; File names ending with # or ~
#+END_SRC
** Ivy
*** Ivy
#+BEGIN_SRC emacs-lisp
(use-package ivy
:ensure t
......@@ -121,7 +122,7 @@
ivy-count-format "%d/%d "
ivy-display-style 'fancy))
#+END_SRC
** Swiper
*** Swiper
#+BEGIN_SRC emacs-lisp
(use-package swiper
:ensure t
......@@ -138,8 +139,31 @@
(define-key read-expression-map (kbd "C-r") 'counsel-expression-history)
))
#+END_SRC
* Navigation
** Avy
** Mode-line: minions / moody
*** Minions
A minor-mode menu for the mode line.
#+BEGIN_SRC emacs-lisp
(use-package minions
:if window-system
:ensure t
:init (minions-mode)
:config
(setq x-underline-at-descent-line t)
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
#+END_SRC
*** Moody
Tabs and ribbons for the mode line.
#+BEGIN_SRC emacs-lisp
(use-package moody
:if window-system
:ensure t
:config
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
#+END_SRC
** Navigation
*** Avy
Navigate by searching for a letter on the screen and jumping to it.
See https://github.com/abo-abo/avy for more info
#+BEGIN_SRC emacs-lisp
......@@ -148,7 +172,7 @@
:bind
("M-s" . avy-goto-word-1))
#+END_SRC
** Ace-window
*** Ace-window
Quickly switch windows in Emacs
See https://github.com/abo-abo/ace-window for more info
#+BEGIN_SRC emacs-lisp
......@@ -158,19 +182,33 @@
(progn
(global-set-key [remap other-window] 'ace-window)))
#+END_SRC
* Cua
** Cua
#+BEGIN_SRC emacs-lisp
; Activate CUA by default (without C-z as it interferes with suspend)
(setq cua-remap-control-z 'nil)
(setq cua-auto-tabify-rectangles nil)
(cua-mode 1)
#+END_SRC
* Editorconfig
** String inflection
Cycle camelCase, snake_case etc.
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-c C-u") 'ext/string-inflection-all-cycle)
(defvar ext/string-inflection-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-u") 'ext/string-inflection-all-cycle)
map))
(defun ext/string-inflection-all-cycle ()
(interactive)
(string-inflection-all-cycle)
(set-transient-map ext/string-inflection-map t))
#+END_SRC
* Development
** Editorconfig
#+BEGIN_SRC emacs-lisp
(use-package editorconfig
:ensure t)
#+END_SRC
* Flycheck
** Flycheck
Syntax checking. https://www.flycheck.org/en/latest/
#+BEGIN_SRC emacs-lisp
(use-package flycheck
......@@ -186,8 +224,18 @@ Jump to errors with ~avy~. ~C-c ! g~.
:ensure t
:hook (global-flycheck-mode . avy-flycheck-setup))
#+END_SRC
* Javascript
** add-node-modules-path
* Project management
** Projectile
#+BEGIN_SRC emacs-lisp
(use-package projectile
:init
(projectile-mode +1)
:config
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))
#+END_SRC
* Languages
** Javascript
*** add-node-modules-path
Adds the ~node_modules/.bin~ directory to exec_path.
See https://github.com/codesuki/add-node-modules-path for more info.
#+BEGIN_SRC emacs-lisp
......@@ -196,7 +244,7 @@ Jump to errors with ~avy~. ~C-c ! g~.
:hook
((typescript-mode js2-mode) . 'add-node-modules-path))
#+END_SRC
** tide - Typescript IDE
*** tide - Typescript IDE
#+BEGIN_SRC emacs-lisp
(use-package tide
:ensure t
......@@ -214,7 +262,7 @@ Jump to errors with ~avy~. ~C-c ! g~.
:hook
((typescript-mode js2-mode) . 'ext/setup-tide-mode))
#+END_SRC
** js2-mode
*** js2-mode
#+BEGIN_SRC emacs-lisp
(use-package js2-mode
:mode "\\.js\\'"
......@@ -230,8 +278,8 @@ Jump to errors with ~avy~. ~C-c ! g~.
(setq-default js2-basic-offset 2)
(setq-default js2-mode-show-strict-warnings nil))
#+END_SRC
* Web
** web-mode
** Web
*** web-mode
#+BEGIN_SRC emacs-lisp
(use-package web-mode
:ensure t
......@@ -270,7 +318,7 @@ Jump to errors with ~avy~. ~C-c ! g~.
:demand t
:after web-mode)
#+END_SRC
** Emmet
*** Emmet
#+BEGIN_SRC emacs-lisp
(use-package emmet-mode
:ensure t
......@@ -280,7 +328,7 @@ Jump to errors with ~avy~. ~C-c ! g~.
:config
(setq emmet-self-closing-tag-style ""))
#+END_SRC
* Markdown
** Markdown
#+BEGIN_SRC emacs-lisp
(use-package markdown-mode
:ensure t
......@@ -338,15 +386,6 @@ _p_rev _u_pper _=_: upper/lower _r_esolve
(use-package hydra
:ensure hydra)
#+END_SRC
* Project management
** Projectile
#+BEGIN_SRC emacs-lisp
(use-package projectile
:init
(projectile-mode +1)
:config
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))
#+END_SRC
* Org mode
** Pin repo
#+BEGIN_SRC emacs-lisp
......@@ -446,37 +485,6 @@ Default configuration.
:after treemacs magit
:ensure t)
#+END_SRC
* Minions / moody
#+BEGIN_SRC emacs-lisp
(use-package minions
:if window-system
:ensure t
:init (minions-mode)
:config
(setq x-underline-at-descent-line t)
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
(use-package moody
:if window-system
:ensure t
:config
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
#+END_SRC
* String inflection
cycle camelCase, snake_case etc
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-c C-u") 'ext/string-inflection-all-cycle)
(defvar ext/string-inflection-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-u") 'ext/string-inflection-all-cycle)
map))
(defun ext/string-inflection-all-cycle ()
(interactive)
(string-inflection-all-cycle)
(set-transient-map ext/string-inflection-map t))
#+END_SRC
* Custom functions
** inhibit-dtw
Customized ~delete-trailing-whitespace~ which can be toggled on/off.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment