mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-27 14:23:43 -05:00
NARF v0.7.0
vcs: + +git-gutter to conf-modes; -git-gutter from evil-insert-state-exit + switch github-browse-file for browse-at-remote + fix <leader>ob; add <leader>d[./sr] vc bindings + vc-annotate bindings and initial state Workgroups2 integration: + don't mess with buffers (speeds up emacs a lot!) + unicode numbers in display + single display function + remember workgroup uid instead (and smarter :tabrename) + clean up after wg update Org-mode + give highlight precedence to links in org-mode + enable encryption + config clean up + use different font for org + exclude attachments in recentf + redo latex and inline-image config + add narf/org-open-notes + update file templates for org CRM Mode-line + polish mode-line + decouple from spaceline-segments.el + refactor narf|spaceline-env-update + add macro-recording and buffer-size indicators to mode-line + python: '2>&1' in env-command + flycheck fringe indicator: change to arrow Aesthetics + update narf-dark-theme + add narf-minibuffer-active face + change writing indicator in writing-mode Misc + fix whitespace in display-startup-echo-area-message + reset fonts for more unicode characters + custom imenu entries + helm-imenu fontification + enable yascroll-bar in REPLs + reorganize my-commands.el + force quit iedit on ESC in normal mode + update snippets submodule + remove ido init (helm handles it all) [EXPERIMENTAL] + back to Terminus(TTF) font + popwin: update config for git-gutter and vc-diff windows + highlight :g[lobal] and :al[ign] matches + decouple narf/get-buffers+narf/get-all-buffers from wg-mess-with-buffer-list + fix narf/helm-buffers-dwim (add interactive form)
This commit is contained in:
@@ -75,6 +75,17 @@
|
||||
(defmacro $expand (path)
|
||||
`(evil-ex-replace-special-filenames ,path))
|
||||
|
||||
;; buffer-local ex commands, thanks to:
|
||||
;; http://emacs.stackexchange.com/questions/13186
|
||||
(defun evil-ex-define-cmd-local (cmd function)
|
||||
"Locally binds the function FUNCTION to the command CMD."
|
||||
(unless (local-variable-p 'evil-ex-commands)
|
||||
(setq-local evil-ex-commands (copy-alist evil-ex-commands)))
|
||||
(evil-ex-define-cmd cmd function))
|
||||
;; Shortcuts for `evil-ex-define-cmd'
|
||||
(defalias 'exmap 'evil-ex-define-cmd)
|
||||
(defalias 'exmap! 'evil-ex-define-cmd-local)
|
||||
|
||||
(progn ; evil hacks
|
||||
(defadvice evil-force-normal-state (after evil-esc-quit activate)
|
||||
"Close popups, disable search highlights and quit the minibuffer if open."
|
||||
@@ -92,14 +103,6 @@
|
||||
(mapcar (lambda (i) (if (numberp i) (truncate i) i)) args))
|
||||
(advice-add 'evil-move-to-column :filter-args 'narf*evil-move-to-column-fix)
|
||||
|
||||
;; buffer-local ex commands, thanks to:
|
||||
;; http://emacs.stackexchange.com/questions/13186
|
||||
(defun evil-ex-define-cmd-local (cmd function)
|
||||
"Locally binds the function FUNCTION to the command CMD."
|
||||
(unless (local-variable-p 'evil-ex-commands)
|
||||
(setq-local evil-ex-commands (copy-alist evil-ex-commands)))
|
||||
(evil-ex-define-cmd cmd function))
|
||||
|
||||
;; Hide keystroke display while isearch is active
|
||||
(add-hook! isearch-mode (setq echo-keystrokes 0))
|
||||
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
|
||||
@@ -188,35 +191,45 @@
|
||||
"\\1" file-name t)))
|
||||
file-name))
|
||||
|
||||
;; Highlight buffer match interactive codes
|
||||
(defvar narf-buffer-match-global evil-ex-substitute-global
|
||||
"Whether or not buffer-match ex completion should add the ?g flag to searches.")
|
||||
(evil-ex-define-argument-type buffer-match
|
||||
:runner
|
||||
(lambda (flag &optional arg)
|
||||
(let ((hl-name 'evil-ex-buffer-match))
|
||||
(with-selected-window (minibuffer-selected-window)
|
||||
(narf/-ex-match-init hl-name)
|
||||
(narf/-ex-buffer-match arg hl-name (list (if narf-buffer-match-global ?g)))))))
|
||||
;; Make :g[lobal] highlight matches
|
||||
(defvar narf-buffer-match-global evil-ex-substitute-global "")
|
||||
(defun narf--ex-buffer-match (flag &optional arg)
|
||||
(let ((hl-name 'evil-ex-buffer-match))
|
||||
(with-selected-window (minibuffer-selected-window)
|
||||
(narf/-ex-match-init hl-name)
|
||||
(narf/-ex-buffer-match arg hl-name (list (if narf-buffer-match-global ?g))))))
|
||||
(defun narf--ex-global-match (flag &optional arg)
|
||||
(let ((hl-name 'evil-ex-global-match))
|
||||
(with-selected-window (minibuffer-selected-window)
|
||||
(narf/-ex-match-init hl-name)
|
||||
(let ((result (car-safe (evil-ex-parse-global arg))))
|
||||
(narf/-ex-buffer-match result hl-name nil (point-min) (point-max))))))
|
||||
|
||||
(evil-ex-define-argument-type buffer-match :runner narf--ex-buffer-match)
|
||||
(evil-ex-define-argument-type global-match :runner narf--ex-global-match)
|
||||
|
||||
(evil-define-interactive-code "<//>"
|
||||
"Ex buffer match argument."
|
||||
:ex-arg buffer-match
|
||||
(list (when (evil-ex-p) evil-ex-argument)))
|
||||
|
||||
;; Make :g[lobal] highlight matches
|
||||
(evil-ex-define-argument-type global-match
|
||||
:runner
|
||||
(lambda (flag &optional arg)
|
||||
(let ((hl-name 'evil-ex-global-match))
|
||||
(with-selected-window (minibuffer-selected-window)
|
||||
(narf/-ex-match-init hl-name)
|
||||
(let ((result (car-safe (evil-ex-parse-global arg))))
|
||||
(narf/-ex-buffer-match result hl-name nil (point-min) (point-max)))))))
|
||||
(evil-define-interactive-code "<g/>"
|
||||
"Ex global argument."
|
||||
(evil-define-interactive-code "<g//>"
|
||||
:ex-arg global-match
|
||||
(when (evil-ex-p)
|
||||
(evil-ex-parse-global evil-ex-argument))))
|
||||
(when (evil-ex-p) (evil-ex-parse-global evil-ex-argument)))
|
||||
|
||||
(evil-define-operator narf:align (&optional beg end bang pattern)
|
||||
(interactive "<r><!><//>")
|
||||
(align-regexp
|
||||
beg end
|
||||
(concat "\\(\\s-*\\)"
|
||||
(if bang
|
||||
(regexp-quote pattern)
|
||||
(rxt-pcre-to-elisp pattern)))
|
||||
1 1))
|
||||
(evil-define-operator narf:evil-ex-global (beg end pattern command &optional invert)
|
||||
:motion mark-whole-buffer
|
||||
:move-point nil
|
||||
(interactive "<r><g//><!>")
|
||||
(evil-ex-global beg end pattern command invert))
|
||||
(exmap "g[lobal]" 'narf:evil-ex-global))
|
||||
|
||||
;; evil plugins
|
||||
(use-package evil-anzu
|
||||
@@ -246,6 +259,7 @@
|
||||
:functions (iedit-current-occurrence-string iedit-restrict-region)
|
||||
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
|
||||
:config
|
||||
(advice-add 'evil-force-normal-state :after 'evil-iedit-state/quit-iedit-mode)
|
||||
(define-key evil-iedit-state-map (kbd "<escape>") 'evil-iedit-state/quit-iedit-mode)
|
||||
(define-key evil-visual-state-map (kbd "SPC") 'narf:iedit-restrict-to-region)
|
||||
(let ((map evil-iedit-state-map))
|
||||
|
Reference in New Issue
Block a user