General cleanup
This commit is contained in:
parent
0db56ccdb4
commit
87c2dc84f6
11 changed files with 69 additions and 65 deletions
|
@ -30,7 +30,7 @@
|
|||
whitespace-style '(face tabs tab-mark newline newline-mark
|
||||
trailing indentation lines-tail)
|
||||
whitespace-display-mappings
|
||||
'((tab-mark ?\t [?> ?\t])
|
||||
'((tab-mark ?\t [?> ?\t])
|
||||
(newline-mark 10 [36 10])))
|
||||
|
||||
;; Save point across sessions
|
||||
|
@ -182,17 +182,17 @@ enable multiple minor modes for the same regexp.")
|
|||
;; Plugins
|
||||
;;
|
||||
|
||||
(use-package avy
|
||||
:commands (avy-goto-char-2 avy-goto-line)
|
||||
:config (setq avy-all-windows nil
|
||||
avy-background t))
|
||||
|
||||
(use-package ace-window
|
||||
:commands ace-window
|
||||
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
||||
aw-scope 'frame
|
||||
aw-background t))
|
||||
|
||||
(use-package avy
|
||||
:commands (avy-goto-char-2 avy-goto-line)
|
||||
:config (setq avy-all-windows nil
|
||||
avy-background t))
|
||||
|
||||
(use-package editorconfig
|
||||
:config
|
||||
;; Don't affect lisp indentation (just `tab-width')
|
||||
|
|
|
@ -256,9 +256,7 @@
|
|||
(define-key evil-outer-text-objects-map "a" #'evil-outer-arg))
|
||||
|
||||
(use-package evil-commentary
|
||||
:commands (evil-commentary
|
||||
evil-commentary-yank
|
||||
evil-commentary-line)
|
||||
:commands (evil-commentary evil-commentary-yank evil-commentary-line)
|
||||
:config (evil-commentary-mode 1))
|
||||
|
||||
(use-package evil-exchange
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
(use-package helm
|
||||
:commands (helm helm-other-buffer helm-mode)
|
||||
:init
|
||||
(defvar helm-global-prompt ":: ")
|
||||
(defvar helm-global-prompt "›")
|
||||
(setq-default
|
||||
helm-quick-update t
|
||||
helm-reuse-last-window-split-state t
|
||||
|
@ -98,7 +98,7 @@
|
|||
"TAB" 'helm-execute-persistent-action)
|
||||
|
||||
(mapc (lambda (r) (add-to-list 'helm-boring-file-regexp-list r))
|
||||
(list "\\.projects$" "\\.DS_Store$" "\\.cask")))
|
||||
(list "\\.projects$" "\\.DS_Store$")))
|
||||
|
||||
(use-package helm-ag
|
||||
:commands (helm-ag
|
||||
|
|
|
@ -89,13 +89,13 @@
|
|||
neo-auto-indent-point t
|
||||
neo-mode-line-type 'none
|
||||
neo-persist-show nil
|
||||
neo-window-width 27
|
||||
neo-window-width 26
|
||||
neo-show-updir-line nil
|
||||
neo-auto-indent-point t
|
||||
neo-banner-message nil)
|
||||
:config
|
||||
(evil-set-initial-state 'neotree-mode 'motion)
|
||||
(add-hook! neotree-mode 'narf|neotree-init-keymap)
|
||||
(add-hook 'neotree-mode-hook 'narf|neotree-init-keymap)
|
||||
(defun narf|neotree-init-keymap ()
|
||||
(map! :map evil-motion-state-local-map
|
||||
"ESC" 'neotree-hide
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
:init
|
||||
(defun narf|nlinum-enable ()
|
||||
(nlinum-mode +1)
|
||||
(add-hook 'post-command-hook 'narf|nlinum-hl-line t))
|
||||
(add-hook 'post-command-hook 'narf|nlinum-hl-line))
|
||||
|
||||
(add-hook!
|
||||
(markdown-mode prog-mode scss-mode web-mode conf-mode)
|
||||
|
@ -334,7 +334,6 @@ See `define-env-command!' to define one for a mode."
|
|||
:skip-alternate t
|
||||
:tight-right t)
|
||||
|
||||
|
||||
;; search indicators
|
||||
(defface mode-line-count-face nil "")
|
||||
(make-variable-buffer-local 'anzu--state)
|
||||
|
@ -390,9 +389,10 @@ anzu to be enabled."
|
|||
|
||||
(spaceline-define-segment *macro-recording
|
||||
"Show when recording macro"
|
||||
(format "%s ▶" (char-to-string evil-this-macro))
|
||||
(format " %s ▶ " (char-to-string evil-this-macro))
|
||||
:when (and active defining-kbd-macro)
|
||||
:face highlight-face
|
||||
:tight t
|
||||
:skip-alternate t)
|
||||
|
||||
(spaceline-define-segment *buffer-encoding-abbrev
|
||||
|
@ -481,11 +481,16 @@ Supports both Emacs and Evil cursor conventions."
|
|||
(powerline-hud (if active 'spaceline-highlight-face 'region) line-face 1)
|
||||
:tight-right t)
|
||||
|
||||
(spaceline-define-segment *buffer-size
|
||||
(powerline-buffer-size)
|
||||
:tight-right t
|
||||
:skip-alternate t)
|
||||
|
||||
(defun narf-spaceline-init ()
|
||||
(spaceline-install
|
||||
;; Left side
|
||||
'(*macro-recording
|
||||
(*anzu *iedit *evil-substitute *flycheck)
|
||||
'(((*macro-recording *anzu *iedit *evil-substitute *flycheck)
|
||||
:fallback *buffer-size)
|
||||
(*buffer-path *remote-host)
|
||||
*buffer-modified
|
||||
*vc
|
||||
|
|
|
@ -130,6 +130,8 @@ gets killed.")
|
|||
;; Bootstrap
|
||||
;;
|
||||
|
||||
(autoload 'awhen "anaphora" "" nil 'macro)
|
||||
(autoload 'aif "anaphora" "" nil 'macro)
|
||||
(autoload 'use-package "use-package" "" nil 'macro)
|
||||
(unless (require 'autoloads nil t)
|
||||
(load (concat narf-emacs-dir "/scripts/generate-autoloads.el"))
|
||||
|
|
|
@ -48,37 +48,40 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun narf/add-whitespace (&optional start end)
|
||||
"Maintain indentation whitespace in buffer. Used so that highlight-indentation will
|
||||
display consistent guides. Whitespace is stripped out on save, so this doesn't affect the
|
||||
end file."
|
||||
(interactive (progn (barf-if-buffer-read-only)
|
||||
(if (use-region-p)
|
||||
(list (region-beginning) (region-end))
|
||||
(list nil nil))))
|
||||
(save-match-data
|
||||
(save-excursion
|
||||
(let ((end-marker (copy-marker (or end (point-max))))
|
||||
(start (or start (point-min))))
|
||||
(goto-char start)
|
||||
(while (and (re-search-forward "^$" end-marker t) (not (>= (point) end-marker)))
|
||||
(let (line-start line-end
|
||||
next-start next-end)
|
||||
(save-excursion
|
||||
;; Check previous line indent
|
||||
(forward-line -1)
|
||||
(setq line-start (point)
|
||||
line-end (save-excursion (back-to-indentation) (point)))
|
||||
;; Check next line indent
|
||||
(forward-line 2)
|
||||
(setq next-start (point)
|
||||
next-end (save-excursion (back-to-indentation) (point)))
|
||||
;; Back to origin
|
||||
(forward-line -1)
|
||||
;; Adjust indent
|
||||
(let ((line-indent (- line-end line-start))
|
||||
(next-indent (- next-end next-start))
|
||||
indent)
|
||||
(setq indent (min line-indent next-indent))
|
||||
(insert (make-string indent 32)))))
|
||||
(forward-line 1)))))
|
||||
(set-buffer-modified-p nil)
|
||||
(unless indent-tabs-mode
|
||||
(save-match-data
|
||||
(save-excursion
|
||||
(let ((end-marker (copy-marker (or end (point-max))))
|
||||
(start (or start (point-min))))
|
||||
(goto-char start)
|
||||
(while (and (re-search-forward "^$" end-marker t) (not (>= (point) end-marker)))
|
||||
(let (line-start line-end
|
||||
next-start next-end)
|
||||
(save-excursion
|
||||
;; Check previous line indent
|
||||
(forward-line -1)
|
||||
(setq line-start (point)
|
||||
line-end (save-excursion (back-to-indentation) (point)))
|
||||
;; Check next line indent
|
||||
(forward-line 2)
|
||||
(setq next-start (point)
|
||||
next-end (save-excursion (back-to-indentation) (point)))
|
||||
;; Back to origin
|
||||
(forward-line -1)
|
||||
;; Adjust indent
|
||||
(let* ((line-indent (- line-end line-start))
|
||||
(next-indent (- next-end next-start))
|
||||
(indent (min line-indent next-indent)))
|
||||
(insert (make-string indent ? )))))
|
||||
(forward-line 1)))))
|
||||
(set-buffer-modified-p nil))
|
||||
nil)
|
||||
|
||||
;;;###autoload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue