parent
3127fff909
commit
13fd77df6a
|
@ -77,6 +77,7 @@
|
|||
- [Key bindings](#key-bindings)
|
||||
- [Staying in insert state](#staying-in-insert-state)
|
||||
- [Bookmarks](#bookmarks)
|
||||
- [DocView mode](#docview-mode)
|
||||
- [Searching](#searching)
|
||||
- [Project Searching](#project-searching)
|
||||
- [Persistent highlighting](#persistent-highlighting)
|
||||
|
@ -1209,6 +1210,36 @@ Key Binding | Description
|
|||
|
||||
To save a new bookmark, just type the name of the bookmark and press `RET`.
|
||||
|
||||
### DocView mode
|
||||
|
||||
`doc-view-mode` is a built-in major mode to view DVI, PostScript (PS), PDF,
|
||||
OpenDocument, and Microsoft Office documents.
|
||||
|
||||
Key Binding | Description
|
||||
-------------------|----------------------------------------------------------------
|
||||
<kbd>/</kbd> | search forward
|
||||
<kbd>?</kbd> | search backward
|
||||
<kbd>+</kbd> | enlarge
|
||||
<kbd>-</kbd> | shrink
|
||||
<kbd>gg</kbd> | go to first page
|
||||
<kbd>G</kbd> | go to last page
|
||||
<kbd>h</kbd> | previous page
|
||||
<kbd>H</kbd> | adjust to height
|
||||
<kbd>j</kbd> | next line
|
||||
<kbd>k</kbd> | previous line
|
||||
<kbd>K</kbd> | kill proc and buffer
|
||||
<kbd>l</kbd> | next page
|
||||
<kbd>n</kbd> | go to next search occurrence
|
||||
<kbd>N</kbd> | go to previous search occurrence
|
||||
<kbd>P</kbd> | fit page to window
|
||||
<kbd>r</kbd> | revert
|
||||
<kbd>W</kbd> | adjust to width
|
||||
<kbd>C-d</kbd> | scroll down
|
||||
<kbd>C-k</kbd> | kill proc
|
||||
<kbd>C-u</kbd> | scroll up
|
||||
<kbd>C-c C-c</kbd> | toggle display text and image display
|
||||
<kbd>C-c C-t</kbd> | open new buffer with doc's text contents
|
||||
|
||||
## Searching
|
||||
|
||||
### Project Searching
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
dash
|
||||
diminish
|
||||
dired+
|
||||
doc-view
|
||||
elisp-slime-nav
|
||||
eldoc
|
||||
evil
|
||||
|
@ -445,6 +446,51 @@ which require an initialization must be listed explicitly in the list.")
|
|||
(use-package dired+
|
||||
:defer t))
|
||||
|
||||
(defun spacemacs/init-doc-view ()
|
||||
(use-package doc-view
|
||||
:defer t
|
||||
:config
|
||||
(progn
|
||||
(add-to-list 'evil-emacs-state-modes 'doc-view-mode)
|
||||
|
||||
(defun spacemacs/doc-view-search-new-query ()
|
||||
"Initiate a new query."
|
||||
(interactive)
|
||||
(doc-view-search 'newquery))
|
||||
|
||||
(defun spacemacs/doc-view-search-new-query-backward ()
|
||||
"Initiate a new query."
|
||||
(interactive)
|
||||
(doc-view-search 'newquery t))
|
||||
|
||||
;; fixed a weird issue where toggling display does not
|
||||
;; swtich to text mode
|
||||
(defadvice doc-view-toggle-display
|
||||
(around spacemacs/doc-view-toggle-display activate)
|
||||
(if (eq major-mode 'doc-view-mode)
|
||||
(progn
|
||||
ad-do-it
|
||||
(text-mode)
|
||||
(doc-view-minor-mode))
|
||||
ad-do-it))
|
||||
|
||||
(spacemacs|evilify doc-view-mode-map
|
||||
"/" 'spacemacs/doc-view-search-new-query
|
||||
"?" 'spacemacs/doc-view-search-new-query-backward
|
||||
"gg" 'doc-view-first-page
|
||||
"G" 'doc-view-last-page
|
||||
"h" 'doc-view-previous-page
|
||||
"j" 'doc-view-next-line-or-next-page
|
||||
"k" 'doc-view-previous-line-or-previous-page
|
||||
"K" 'doc-view-kill-proc-and-buffer
|
||||
"l" 'doc-view-next-page
|
||||
"n" 'doc-view-search
|
||||
"N" 'doc-view-search-backward
|
||||
(kbd "C-d") 'doc-view-scroll-up-or-next-page
|
||||
(kbd "C-k") 'doc-view-kill-proc
|
||||
(kbd "C-u") 'doc-view-scroll-down-or-previous-page)
|
||||
(spacemacs/activate-evil-leader-for-map 'doc-view-mode-map))))
|
||||
|
||||
(defun spacemacs/init-elisp-slime-nav ()
|
||||
;; Elisp go-to-definition with M-. and back again with M-,
|
||||
(use-package elisp-slime-nav
|
||||
|
|
Loading…
Reference in a new issue