Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,64 @@ Columns are counted from zero."
:type line
:jump t
(interactive (list (read-char)))
(evil-goto-mark char noerror)
(evil-first-non-blank))
(let ((is-global (string= "Lu"
(get-char-code-property char 'general-category))))
(evil-goto-mark char noerror)
(unless (and evil-mark-goto-buffer-not-line
is-global)
(evil-first-non-blank))))

(evil-define-command evil--goto-mark-list (marks &optional line-or-buffer)
(evil-show-marks marks)
(let* ((char (read-char))
(is-global (string= "Lu"
(get-char-code-property char 'general-category)))
(key (char-to-string char))
(entry (tabulated-list-get-entry)))
(while (and
entry
(not (string= (aref entry 0) key)))
(next-line)
(setq entry (tabulated-list-get-entry)))
(cond ((eobp) (message "Marker '%s' is not set in this buffer" key)
(evil-list-view-quit))
(t (evil-list-view-quit)
(switch-to-buffer (car (elt entry 3)))
(evil-goto-mark (string-to-char (elt entry 0)))
(when line-or-buffer
(unless (and evil-mark-goto-buffer-not-line
is-global)
(evil-first-non-blank)))))))

(evil-define-command evil-goto-mark-list (marks &optional line-or-buffer)
(interactive "<a>")
(with-timeout (0.6
(evil--goto-mark-list marks line-or-buffer))
(let* ((char (read-char))
(is-global (string= "Lu"
(get-char-code-property char 'general-category))))
(evil-goto-mark char)
(when line-or-buffer
(unless (and evil-mark-goto-buffer-not-line
is-global)
(evil-first-non-blank))))))

(evil-define-command evil-goto-mark-line-list (marks)
(interactive "<a>")
(evil-goto-mark-list marks t))

(defun evil-goto-mark-set ()
(if evil-mark-goto-buffer-not-line
'evil-goto-mark-list
'evil-goto-mark))

(defun evil-goto-mark-line-set ()
(if evil-mark-goto-buffer-not-line
'evil-goto-mark-line-list
'evil-goto-mark-line))

(setq evil-goto-mark-auto (evil-goto-mark-set))
(setq evil-goto-mark-line-auto (evil-goto-mark-line-set))

(evil-define-motion evil-jump-backward (count)
"Go to older position in jump list.
Expand Down
4 changes: 2 additions & 2 deletions evil-maps.el
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@
(define-key evil-motion-state-map "g#" 'evil-search-unbounded-word-backward)
(define-key evil-motion-state-map "$" 'evil-end-of-line)
(define-key evil-motion-state-map "%" 'evil-jump-item)
(define-key evil-motion-state-map "`" 'evil-goto-mark)
(define-key evil-motion-state-map "'" 'evil-goto-mark-line)
(define-key evil-motion-state-map "`" evil-goto-mark-auto)
(define-key evil-motion-state-map "'" evil-goto-mark-line-auto)
(define-key evil-motion-state-map "(" 'evil-backward-sentence-begin)
(define-key evil-motion-state-map ")" 'evil-forward-sentence-begin)
(define-key evil-motion-state-map "]]" 'evil-forward-section-begin)
Expand Down
7 changes: 7 additions & 0 deletions evil-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,13 @@ large accessible in insert state."
:type 'boolean
:group 'evil)

(defcustom evil-mark-goto-buffer-not-line t
"Behavior of goto mark with `''.
When `t', `'' jumps to last cursor position of the marked buffer
instead of jumping to the mark its line number."
:type 'boolean
:group 'evil)

(defcustom evil-complete-all-buffers t
"\\<evil-insert-state-map>
Whether completion looks for matches in all buffers.
Expand Down