mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #6632 from justinmk/doc
This commit is contained in:
commit
efea8a66b1
@ -151,6 +151,31 @@ function! s:put_page(page) abort
|
||||
setlocal filetype=man
|
||||
endfunction
|
||||
|
||||
function! man#show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
while lnum && lnum < last_line
|
||||
let text = getline(lnum)
|
||||
if text =~# '^\%( \{3\}\)\=\S.*$'
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Man TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
" attempt to extract the name and sect out of 'name(sect)'
|
||||
" otherwise just return the largest string of valid characters in ref
|
||||
function! man#extract_sect_and_name_ref(ref) abort
|
||||
|
@ -11,6 +11,8 @@ via |msgpack-rpc|, Lua and VimL (|eval-api|).
|
||||
|
||||
Applications can also embed libnvim to work with the C API directly.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
API Types *api-types*
|
||||
|
||||
|
@ -8,17 +8,7 @@ Automatic commands *autocommand*
|
||||
|
||||
For a basic explanation, see section |40.3| in the user manual.
|
||||
|
||||
1. Introduction |autocmd-intro|
|
||||
2. Defining autocommands |autocmd-define|
|
||||
3. Removing autocommands |autocmd-remove|
|
||||
4. Listing autocommands |autocmd-list|
|
||||
5. Events |autocmd-events|
|
||||
6. Patterns |autocmd-patterns|
|
||||
7. Buffer-local autocommands |autocmd-buflocal|
|
||||
8. Groups |autocmd-groups|
|
||||
9. Executing autocommands |autocmd-execute|
|
||||
10. Using autocommands |autocmd-use|
|
||||
11. Disabling autocommands |autocmd-disable|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *autocmd-intro*
|
||||
|
@ -9,20 +9,10 @@ changing text means deleting the text and replacing it with other text using
|
||||
one command. You can undo all of these commands. You can repeat the non-Ex
|
||||
commands with the "." command.
|
||||
|
||||
1. Deleting text |deleting|
|
||||
2. Delete and insert |delete-insert|
|
||||
3. Simple changes |simple-change| *changing*
|
||||
4. Complex changes |complex-change|
|
||||
4.1 Filter commands |filter|
|
||||
4.2 Substitute |:substitute|
|
||||
4.3 Search and replace |search-replace|
|
||||
4.4 Changing tabs |change-tabs|
|
||||
5. Copying and moving text |copy-move|
|
||||
6. Formatting text |formatting|
|
||||
7. Sorting text |sorting|
|
||||
|
||||
For inserting text see |insert.txt|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Deleting text *deleting* *E470*
|
||||
|
||||
@ -259,7 +249,7 @@ Or use "caw" (see |aw|).
|
||||
command is executed.
|
||||
|
||||
==============================================================================
|
||||
3. Simple changes *simple-change*
|
||||
3. Simple changes *simple-change* *changing*
|
||||
|
||||
*r*
|
||||
r{char} Replace the character under the cursor with {char}.
|
||||
@ -398,11 +388,6 @@ CTRL-X Subtract [count] from the number or alphabetic
|
||||
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. {not in Vi}
|
||||
|
||||
On MS-Windows, this is mapped to cut Visual text
|
||||
|dos-standard-mappings|. If you want to disable the
|
||||
mapping, use this: >
|
||||
silent! vunmap <C-X>
|
||||
<
|
||||
*v_g_CTRL-X*
|
||||
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. If several lines
|
||||
|
@ -13,13 +13,7 @@ Command-line mode is used to enter Ex commands (":"), search patterns
|
||||
Basic command line editing is explained in chapter 20 of the user manual
|
||||
|usr_20.txt|.
|
||||
|
||||
1. Command-line editing |cmdline-editing|
|
||||
2. Command-line completion |cmdline-completion|
|
||||
3. Ex command-lines |cmdline-lines|
|
||||
4. Ex command-line ranges |cmdline-ranges|
|
||||
5. Ex command-line flags |ex-flags|
|
||||
6. Ex special characters |cmdline-special|
|
||||
7. Command-line window |cmdline-window|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Command-line editing *cmdline-editing*
|
||||
|
@ -9,9 +9,7 @@ Debugging Vim *debug-vim*
|
||||
This is for debugging Vim itself, when it doesn't work properly.
|
||||
For debugging Vim scripts, functions, etc. see |debug-scripts|
|
||||
|
||||
1. Location of a crash, using gcc and gdb |debug-gcc|
|
||||
2. Locating memory leaks |debug-leaks|
|
||||
3. Windows Bug Reporting |debug-win32|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
|
||||
|
@ -6,14 +6,13 @@
|
||||
|
||||
Development of Nvim. *development*
|
||||
|
||||
1. Design goals |design-goals|
|
||||
2. Developer guidelines |dev-help|
|
||||
|
||||
Nvim is open source software. Everybody is encouraged to contribute.
|
||||
https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md
|
||||
|
||||
See src/nvim/README.md for an overview of the source code.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Design goals *design-goals*
|
||||
|
||||
|
@ -10,11 +10,7 @@ eight versions of the same file.
|
||||
|
||||
The basics are explained in section |08.7| of the user manual.
|
||||
|
||||
1. Starting diff mode |diff-mode|
|
||||
2. Viewing diffs |view-diffs|
|
||||
3. Jumping to diffs |jumpto-diffs|
|
||||
4. Copying diffs |copy-diffs|
|
||||
5. Diff options |diff-options|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Starting diff mode
|
||||
|
@ -14,9 +14,7 @@ with CTRL-V (see |i_CTRL-V|).
|
||||
There is a brief introduction on digraphs in the user manual: |24.9|
|
||||
An alternative is using the 'keymap' option.
|
||||
|
||||
1. Defining digraphs |digraphs-define|
|
||||
2. Using digraphs |digraphs-use|
|
||||
3. Default digraphs |digraphs-default|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Defining digraphs *digraphs-define*
|
||||
|
@ -6,17 +6,7 @@
|
||||
|
||||
Editing files *edit-files*
|
||||
|
||||
1. Introduction |edit-intro|
|
||||
2. Editing a file |edit-a-file|
|
||||
3. The argument list |argument-list|
|
||||
4. Writing |writing|
|
||||
5. Writing and quitting |write-quit|
|
||||
6. Dialogs |edit-dialogs|
|
||||
7. The current directory |current-directory|
|
||||
8. Editing binary files |edit-binary|
|
||||
9. Encryption |encryption|
|
||||
10. Timestamps |timestamps|
|
||||
11. File Searching |file-searching|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *edit-intro*
|
||||
|
@ -12,23 +12,7 @@ Note: Expression evaluation can be disabled at compile time. If this has been
|
||||
done, the features in this document are not available. See |+eval| and
|
||||
|no-eval-feature|.
|
||||
|
||||
1. Variables |variables|
|
||||
1.1 Variable types
|
||||
1.2 Function references |Funcref|
|
||||
1.3 Lists |Lists|
|
||||
1.4 Dictionaries |Dictionaries|
|
||||
1.5 More about variables |more-variables|
|
||||
2. Expression syntax |expression-syntax|
|
||||
3. Internal variable |internal-variables|
|
||||
4. Builtin Functions |functions|
|
||||
5. Defining functions |user-functions|
|
||||
6. Curly braces names |curly-braces-names|
|
||||
7. Commands |expression-commands|
|
||||
8. Exception handling |exception-handling|
|
||||
9. Examples |eval-examples|
|
||||
10. No +eval feature |no-eval-feature|
|
||||
11. The sandbox |eval-sandbox|
|
||||
12. Textlock |textlock|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Variables *variables*
|
||||
|
@ -6,12 +6,10 @@
|
||||
|
||||
Filetypes *filetype* *file-type*
|
||||
|
||||
1. Filetypes |filetypes|
|
||||
2. Filetype plugin |filetype-plugins|
|
||||
3. Docs for the default filetype plugins. |ftplugin-docs|
|
||||
|
||||
Also see |autocmd.txt|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Filetypes *filetypes* *file-types*
|
||||
|
||||
@ -542,6 +540,7 @@ K or CTRL-] Jump to the manpage for the <cWORD> under the
|
||||
cursor. Takes a count for the section.
|
||||
CTRL-T Jump back to the location that the manpage was
|
||||
opened from.
|
||||
META-] Show the manpage outline in the |location-list|.
|
||||
q :quit if invoked as $MANPAGER, otherwise :close.
|
||||
|
||||
Variables:
|
||||
|
@ -9,10 +9,7 @@ Folding *Folding* *folding* *folds*
|
||||
You can find an introduction on folding in chapter 28 of the user manual.
|
||||
|usr_28.txt|
|
||||
|
||||
1. Fold methods |fold-methods|
|
||||
2. Fold commands |fold-commands|
|
||||
3. Fold options |fold-options|
|
||||
4. Behavior of folds |fold-behavior|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Fold methods *fold-methods*
|
||||
|
@ -6,12 +6,7 @@
|
||||
|
||||
Vim's Graphical User Interface *gui* *GUI*
|
||||
|
||||
1. Starting the GUI |gui-start|
|
||||
2. Scrollbars |gui-scrollbars|
|
||||
3. Mouse Control |gui-mouse|
|
||||
4. Making GUI Selections |gui-selections|
|
||||
5. Menus |menus|
|
||||
6. Extras |gui-extras|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *gui-start* *E229* *E233*
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
Help on help files *helphelp*
|
||||
|
||||
1. Help commands |online-help|
|
||||
2. Translated help files |help-translated|
|
||||
3. Writing help files |help-writing|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Help commands *online-help*
|
||||
@ -25,6 +23,8 @@ Help on help files *helphelp*
|
||||
The 'helplang' option is used to select a language, if
|
||||
the main help file is available in several languages.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
*{subject}* *E149* *E661*
|
||||
:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
|
||||
For example: >
|
||||
|
@ -12,15 +12,7 @@ a cscope query is just like jumping to any tag; it is saved on the tag stack
|
||||
so that with the right keyboard mappings, you can jump back and forth between
|
||||
functions as you normally would with |tags|.
|
||||
|
||||
1. Cscope introduction |cscope-intro|
|
||||
2. Cscope related commands |cscope-commands|
|
||||
3. Cscope options |cscope-options|
|
||||
4. How to use cscope in Vim |cscope-howtouse|
|
||||
5. Limitations |cscope-limitations|
|
||||
6. Suggested usage |cscope-suggestions|
|
||||
7. Availability & Information |cscope-info|
|
||||
|
||||
This is currently for Unix and Win32 only.
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Cscope introduction *cscope-intro*
|
||||
|
@ -6,18 +6,10 @@
|
||||
|
||||
The Python Interface to Vim *python* *Python*
|
||||
|
||||
1. Commands |python-commands|
|
||||
2. The vim module |python-vim|
|
||||
3. Buffer objects |python-buffer|
|
||||
4. Range objects |python-range|
|
||||
5. Window objects |python-window|
|
||||
6. Tab page objects |python-tabpage|
|
||||
7. vim.bindeval objects |python-bindeval-objects|
|
||||
8. pyeval(), py3eval() Vim functions |python-pyeval|
|
||||
9. Python 3 |python3|
|
||||
|
||||
See |provider-python| for more information. {Nvim}
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *python-commands*
|
||||
|
||||
|
@ -5,18 +5,13 @@
|
||||
|
||||
The Ruby Interface to Vim *ruby* *Ruby*
|
||||
|
||||
|
||||
1. Commands |ruby-commands|
|
||||
2. The VIM module |ruby-vim|
|
||||
3. VIM::Buffer objects |ruby-buffer|
|
||||
4. VIM::Window objects |ruby-window|
|
||||
5. Global variables |ruby-globals|
|
||||
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
|
||||
The home page for ruby is http://www.ruby-lang.org/. You can find links for
|
||||
downloading Ruby there.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *ruby-commands*
|
||||
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
This file is about indenting C programs and other files.
|
||||
|
||||
1. Indenting C style programs |C-indenting|
|
||||
2. Indenting by expression |indent-expression|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Indenting C style programs *C-indenting*
|
||||
|
@ -10,22 +10,13 @@ short description. The lists are sorted on ASCII value.
|
||||
Tip: When looking for certain functionality, use a search command. E.g.,
|
||||
to look for deleting something, use: "/delete".
|
||||
|
||||
1. Insert mode |insert-index|
|
||||
2. Normal mode |normal-index|
|
||||
2.1. Text objects |objects|
|
||||
2.2. Window commands |CTRL-W|
|
||||
2.3. Square bracket commands |[|
|
||||
2.4. Commands starting with 'g' |g|
|
||||
2.5. Commands starting with 'z' |z|
|
||||
3. Visual mode |visual-index|
|
||||
4. Command-line editing |ex-edit-index|
|
||||
5. EX commands |ex-cmd-index|
|
||||
|
||||
For an overview of options see help.txt |option-list|.
|
||||
For an overview of built-in functions see |functions|.
|
||||
For a list of Vim variables see |vim-variable|.
|
||||
For a complete listing of all help items see |help-tags|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Insert mode *insert-index*
|
||||
|
||||
|
@ -13,20 +13,11 @@ commands for inserting text in other ways.
|
||||
An overview of the most often used commands can be found in chapter 24 of the
|
||||
user manual |usr_24.txt|.
|
||||
|
||||
1. Special keys |ins-special-keys|
|
||||
2. Special special keys |ins-special-special|
|
||||
3. 'textwidth' and 'wrapmargin' options |ins-textwidth|
|
||||
4. 'expandtab', 'smarttab' and 'softtabstop' options |ins-expandtab|
|
||||
5. Replace mode |Replace-mode|
|
||||
6. Virtual Replace mode |Virtual-Replace-mode|
|
||||
7. Insert mode completion |ins-completion|
|
||||
8. Insert mode commands |inserting|
|
||||
9. Ex insert commands |inserting-ex|
|
||||
10. Inserting a file |inserting-file|
|
||||
|
||||
Also see 'virtualedit', for moving the cursor to positions where there is no
|
||||
character. Useful for editing a table.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Special keys *ins-special-keys*
|
||||
|
||||
|
@ -6,14 +6,7 @@
|
||||
|
||||
Introduction to Vim *ref* *reference*
|
||||
|
||||
1. Introduction |intro|
|
||||
2. Vim on the internet |internet|
|
||||
3. Credits |credits|
|
||||
4. Notation |notation|
|
||||
5. Modes, introduction |vim-modes-intro|
|
||||
6. Switching from mode to mode |mode-switching|
|
||||
7. The window contents |window-contents|
|
||||
8. Definitions |definitions|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *intro*
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
Nvim's facilities for job control *job-control*
|
||||
|
||||
1. Introduction |job-control-intro|
|
||||
2. Usage |job-control-usage|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *job-control-intro*
|
||||
|
@ -9,21 +9,7 @@ Key mapping, abbreviations and user-defined commands.
|
||||
This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
|
||||
manual.
|
||||
|
||||
1. Key mapping |key-mapping|
|
||||
1.1 MAP COMMANDS |:map-commands|
|
||||
1.2 Special arguments |:map-arguments|
|
||||
1.3 Mapping and modes |:map-modes|
|
||||
1.4 Listing mappings |map-listing|
|
||||
1.5 Mapping special keys |:map-special-keys|
|
||||
1.6 Special characters |:map-special-chars|
|
||||
1.7 What keys to map |map-which-keys|
|
||||
1.8 Examples |map-examples|
|
||||
1.9 Using mappings |map-typing|
|
||||
1.10 Mapping alt-keys |:map-alt-keys|
|
||||
1.11 Mapping an operator |:map-operator|
|
||||
2. Abbreviations |abbreviations|
|
||||
3. Local mappings and functions |script-local|
|
||||
4. User-defined commands |user-commands|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Key mapping *key-mapping* *mapping* *macro*
|
||||
|
@ -14,6 +14,8 @@ For an introduction to the most common features, see |usr_45.txt| in the user
|
||||
manual.
|
||||
For changing the language of messages and menus see |mlang.txt|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Getting started *mbyte-first*
|
||||
|
||||
|
@ -8,9 +8,7 @@ This file contains an alphabetical list of messages and error messages that
|
||||
Vim produces. You can use this if you don't understand what the message
|
||||
means. It is not complete though.
|
||||
|
||||
1. Old messages |:messages|
|
||||
2. Error messages |error-messages|
|
||||
3. Messages |messages|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Old messages *:messages* *:mes* *message-history*
|
||||
|
@ -11,11 +11,7 @@ multi-byte text see |multibyte|.
|
||||
|
||||
The basics are explained in the user manual: |usr_45.txt|.
|
||||
|
||||
1. Messages |multilang-messages|
|
||||
2. Menus |multilang-menus|
|
||||
3. Scripts |multilang-scripts|
|
||||
|
||||
Also see |help-translated| for multi-language help.
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Messages *multilang-messages*
|
||||
|
@ -10,16 +10,6 @@ These commands move the cursor position. If the new position is off of the
|
||||
screen, the screen is scrolled to show the cursor (see also 'scrolljump' and
|
||||
'scrolloff' options).
|
||||
|
||||
1. Motions and operators |operator|
|
||||
2. Left-right motions |left-right-motions|
|
||||
3. Up-down motions |up-down-motions|
|
||||
4. Word motions |word-motions|
|
||||
5. Text object motions |object-motions|
|
||||
6. Text object selection |object-select|
|
||||
7. Marks |mark-motions|
|
||||
8. Jumps |jump-motions|
|
||||
9. Various motions |various-motions|
|
||||
|
||||
General remarks:
|
||||
|
||||
If you want to know where you are in the file use the "CTRL-G" command
|
||||
@ -36,6 +26,8 @@ The 'virtualedit' option can be set to make it possible to move the cursor to
|
||||
positions where there is no character or within a multi-column character (like
|
||||
a tab).
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Motions and operators *operator*
|
||||
|
||||
|
@ -6,12 +6,7 @@
|
||||
|
||||
RPC API for Nvim *RPC* *rpc* *msgpack-rpc*
|
||||
|
||||
1. Introduction |rpc-intro|
|
||||
2. API mapping |rpc-api|
|
||||
3. Connecting |rpc-connecting|
|
||||
4. Clients |rpc-api-client|
|
||||
5. Types |rpc-types|
|
||||
6. Remote UIs |rpc-remote-ui|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *rpc-intro*
|
||||
@ -33,7 +28,7 @@ programs can:
|
||||
The RPC API is like a more powerful version of Vim's `clientserver` feature.
|
||||
|
||||
==============================================================================
|
||||
2. API mapping *rpc-api*
|
||||
2. API mapping *rpc-api*
|
||||
|
||||
The Nvim C |API| is automatically exposed to the RPC API by the build system,
|
||||
which parses headers at src/nvim/api/*. A dispatch function is generated which
|
||||
|
@ -4,15 +4,17 @@
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Nvim *nvim* *nvim-intro*
|
||||
Nvim *nvim* *nvim-intro*
|
||||
|
||||
If you are new to Vim (and Nvim) see |help.txt| or type ":Tutor".
|
||||
If you already use Vim (but not Nvim) see |nvim-from-vim| for a quickstart.
|
||||
If you are new to Vim see |help.txt|, or type ":Tutor".
|
||||
If you already use Vim see |nvim-from-vim| for a quickstart.
|
||||
|
||||
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is
|
||||
maintained where possible. See |vim_diff.txt| for the complete reference of
|
||||
differences from Vim.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Transitioning from Vim *nvim-from-vim*
|
||||
|
||||
|
@ -15,6 +15,8 @@ Terminal buffers behave mostly like normal 'nomodifiable' buffers, except:
|
||||
- 'scrollback' controls how many off-screen lines are kept.
|
||||
- Terminal output is followed if the cursor is on the last line.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Spawning *terminal-emulator-spawning*
|
||||
|
||||
|
@ -6,10 +6,6 @@
|
||||
|
||||
Options *options*
|
||||
|
||||
1. Setting options |set-option|
|
||||
2. Automatically setting options |auto-setting|
|
||||
3. Options summary |option-summary|
|
||||
|
||||
For an overview of options see quickref.txt |option-list|.
|
||||
|
||||
Vim has a number of internal variables and switches which can be set to
|
||||
@ -18,6 +14,8 @@ achieve special effects. These options come in three forms:
|
||||
number has a numeric value
|
||||
string has a string value
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Setting options *set-option* *E764*
|
||||
|
||||
|
@ -1,38 +1,11 @@
|
||||
*os_win32.txt* Nvim
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
*win32* *Win32* *MS-Windows*
|
||||
This file documents the idiosyncrasies of the Win32 version of Vim.
|
||||
|
||||
The Win32 version of Vim works on Windows XP, Vista and Windows 7.
|
||||
There are both console and GUI versions.
|
||||
|
||||
The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
|
||||
1. Known problems |win32-problems|
|
||||
2. Startup |win32-startup|
|
||||
3. Using the mouse |win32-mouse|
|
||||
4. Win32 mini FAQ |win32-faq|
|
||||
|
||||
Additionally, there are a number of common Win32 and DOS items:
|
||||
File locations |dos-locations|
|
||||
Using backslashes |dos-backslash|
|
||||
Standard mappings |dos-standard-mappings|
|
||||
Screen output and colors |dos-colors|
|
||||
File formats |dos-file-formats|
|
||||
:cd command |dos-:cd|
|
||||
Interrupting |dos-CTRL-Break|
|
||||
Temp files |dos-temp-files|
|
||||
Shell option default |dos-shell|
|
||||
|
||||
Win32 GUI |gui-w32|
|
||||
|
||||
Credits:
|
||||
The Win32 version was written by George V. Reilly <george@reilly.org>.
|
||||
The GUI version was made by George V. Reilly and Robert Webb.
|
||||
This file documents the Win32 version of Nvim.
|
||||
|
||||
==============================================================================
|
||||
1. Known problems *win32-problems*
|
||||
|
@ -9,16 +9,7 @@ Patterns and search commands *pattern-searches*
|
||||
The very basics can be found in section |03.9| of the user manual. A few more
|
||||
explanations are in chapter 27 |usr_27.txt|.
|
||||
|
||||
1. Search commands |search-commands|
|
||||
2. The definition of a pattern |search-pattern|
|
||||
3. Magic |/magic|
|
||||
4. Overview of pattern items |pattern-overview|
|
||||
5. Multi items |pattern-multi-items|
|
||||
6. Ordinary atoms |pattern-atoms|
|
||||
7. Ignoring case in a pattern |/ignorecase|
|
||||
8. Composing characters |patterns-composing|
|
||||
9. Compare with Perl patterns |perl-patterns|
|
||||
10. Highlighting matches |match-highlight|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Search commands *search-commands*
|
||||
@ -130,8 +121,7 @@ gD Goto global Declaration. When the cursor is on a
|
||||
ends before the cursor position.
|
||||
|
||||
*CTRL-C*
|
||||
CTRL-C Interrupt current (search) command. Use CTRL-Break on
|
||||
Windows |dos-CTRL-Break|.
|
||||
CTRL-C Interrupt current (search) command.
|
||||
In Normal mode, any pending command is aborted.
|
||||
|
||||
*:noh* *:nohlsearch*
|
||||
|
@ -2,10 +2,7 @@
|
||||
|
||||
Author: TJ DeVries <devries.timothyj@gmail.com>
|
||||
|
||||
==============================================================================
|
||||
1. Introduction |health.vim-intro|
|
||||
2. Commands and functions |health.vim-manual|
|
||||
3. Create a healthcheck |health.vim-dev|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Introduction *healthcheck* *health.vim-intro*
|
||||
@ -100,15 +97,12 @@ health#{plugin}#check() function in autoload/health/{plugin}.vim.
|
||||
|:CheckHealth| automatically finds and invokes such functions.
|
||||
|
||||
If your plugin is named "jslint", then its healthcheck function must be >
|
||||
|
||||
health#jslint#check()
|
||||
<
|
||||
|
||||
defined in this file on 'runtimepath': >
|
||||
|
||||
autoload/health/jslint.vim
|
||||
<
|
||||
Here's a sample to get started: >
|
||||
|
||||
Here's a sample to get started: >
|
||||
function! health#jslint#check() abort
|
||||
call health#report_start('sanity checks')
|
||||
" perform arbitrary checks
|
||||
@ -121,7 +115,7 @@ Here's a sample to get started: >
|
||||
\ ['npm install --save jslint'])
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
|
||||
vim:tw=78:ts=8:ft=help:fdm=marker
|
||||
|
@ -6,14 +6,7 @@
|
||||
|
||||
Printing *printing*
|
||||
|
||||
1. Introduction |print-intro|
|
||||
2. Print options |print-options|
|
||||
3. PostScript Printing |postscript-printing|
|
||||
4. PostScript Printing Encoding |postscript-print-encoding|
|
||||
5. PostScript CJK Printing |postscript-cjk-printing|
|
||||
6. PostScript Printing Troubleshooting |postscript-print-trouble|
|
||||
7. PostScript Utilities |postscript-print-util|
|
||||
8. Formfeed Characters |printing-formfeed|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *print-intro*
|
||||
|
@ -8,6 +8,8 @@ Providers *provider*
|
||||
|
||||
Nvim delegates some features to dynamic "providers".
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Python integration *provider-python*
|
||||
|
||||
|
@ -6,15 +6,7 @@
|
||||
|
||||
This subject is introduced in section |30.1| of the user manual.
|
||||
|
||||
1. Using QuickFix commands |quickfix|
|
||||
2. The error window |quickfix-window|
|
||||
3. Using more than one list of errors |quickfix-error-lists|
|
||||
4. Using :make |:make_makeprg|
|
||||
5. Using :grep |grep|
|
||||
6. Selecting a compiler |compiler-select|
|
||||
7. The error format |error-file-format|
|
||||
8. The directory stack |quickfix-directory-stack|
|
||||
9. Specific error file formats |errorformats|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
=============================================================================
|
||||
1. Using QuickFix commands *quickfix* *Quickfix* *E42*
|
||||
|
@ -988,7 +988,6 @@ Short explanation of each option: *option-list*
|
||||
|g_CTRL-G| g CTRL-G show cursor column, line, and character
|
||||
position
|
||||
|CTRL-C| CTRL-C during searches: Interrupt the search
|
||||
|dos-CTRL-Break| CTRL-Break Windows: during searches: Interrupt the search
|
||||
|<Del>| <Del> while entering a count: delete last character
|
||||
|:version| :ve[rsion] show version information
|
||||
|:normal| :norm[al][!] {commands}
|
||||
|
@ -15,8 +15,7 @@ You can recover most of your changes from the files that Vim uses to store
|
||||
the contents of the file. Mostly you can recover your work with one command:
|
||||
vim -r filename
|
||||
|
||||
1. The swap file |swap-file|
|
||||
2. Recovery |recovery|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. The swap file *swap-file*
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
Vim client-server communication *client-server*
|
||||
|
||||
1. Common functionality |clientserver|
|
||||
2. X11 specific items |x11-clientserver|
|
||||
3. MS-Windows specific items |w32-clientserver|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Common functionality *clientserver*
|
||||
|
@ -6,10 +6,7 @@
|
||||
|
||||
Nvim support for remote plugins *remote-plugin*
|
||||
|
||||
1. Introduction |remote-plugin-intro|
|
||||
2. Plugin hosts |remote-plugin-hosts|
|
||||
3. Example |remote-plugin-example|
|
||||
4. Plugin manifest |remote-plugin-manifest|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *remote-plugin-intro*
|
||||
|
@ -8,14 +8,7 @@ Repeating commands, Vim scripts and debugging *repeating*
|
||||
|
||||
Chapter 26 of the user manual introduces repeating |usr_26.txt|.
|
||||
|
||||
1. Single repeats |single-repeat|
|
||||
2. Multiple repeats |multi-repeat|
|
||||
3. Complex repeats |complex-repeat|
|
||||
4. Using Vim scripts |using-scripts|
|
||||
5. Using Vim packages |packages|
|
||||
6. Creating Vim packages |package-create|
|
||||
7. Debugging scripts |debug-scripts|
|
||||
8. Profiling |profiling|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Single repeats *single-repeat*
|
||||
|
@ -6,10 +6,7 @@
|
||||
|
||||
Russian language localization and support in Vim *russian* *Russian*
|
||||
|
||||
1. Introduction |russian-intro|
|
||||
2. Russian keymaps |russian-keymap|
|
||||
3. Localization |russian-l18n|
|
||||
4. Known issues |russian-issues|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
===============================================================================
|
||||
1. Introduction *russian-intro*
|
||||
|
@ -16,12 +16,7 @@ upwards in the buffer, the text in the window moves downwards on your screen.
|
||||
|
||||
See section |03.7| of the user manual for an introduction.
|
||||
|
||||
1. Scrolling downwards |scroll-down|
|
||||
2. Scrolling upwards |scroll-up|
|
||||
3. Scrolling relative to cursor |scroll-cursor|
|
||||
4. Scrolling horizontally |scroll-horizontal|
|
||||
5. Scrolling synchronously |scroll-binding|
|
||||
6. Scrolling with a mouse wheel |scroll-mouse-wheel|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Scrolling downwards *scroll-down*
|
||||
|
@ -7,8 +7,7 @@
|
||||
|
||||
Sign Support Features *sign-support*
|
||||
|
||||
1. Introduction |sign-intro|
|
||||
2. Commands |sign-commands|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *sign-intro* *signs*
|
||||
|
@ -6,10 +6,7 @@
|
||||
|
||||
Spell checking *spell*
|
||||
|
||||
1. Quick start |spell-quickstart|
|
||||
2. Remarks on spell checking |spell-remarks|
|
||||
3. Generating a spell file |spell-mkspell|
|
||||
4. Spell file format |spell-file-format|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Quick start *spell-quickstart* *E756*
|
||||
|
@ -6,15 +6,7 @@
|
||||
|
||||
Starting Vim *starting*
|
||||
|
||||
1. Vim arguments |vim-arguments|
|
||||
2. Initialization |initialization|
|
||||
3. $VIM and $VIMRUNTIME |$VIM|
|
||||
4. Suspending |suspend|
|
||||
5. Exiting |exiting|
|
||||
6. Saving settings |save-settings|
|
||||
7. Views and Sessions |views-sessions|
|
||||
8. The ShaDa file |shada-file|
|
||||
9. Base Directories |base-directories|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Vim arguments *vim-arguments*
|
||||
|
@ -20,24 +20,7 @@ In the User Manual:
|
||||
|usr_06.txt| introduces syntax highlighting.
|
||||
|usr_44.txt| introduces writing a syntax file.
|
||||
|
||||
1. Quick start |:syn-qstart|
|
||||
2. Syntax files |:syn-files|
|
||||
3. Syntax loading procedure |syntax-loading|
|
||||
4. Syntax file remarks |:syn-file-remarks|
|
||||
5. Defining a syntax |:syn-define|
|
||||
6. :syntax arguments |:syn-arguments|
|
||||
7. Syntax patterns |:syn-pattern|
|
||||
8. Syntax clusters |:syn-cluster|
|
||||
9. Including syntax files |:syn-include|
|
||||
10. Synchronizing |:syn-sync|
|
||||
11. Listing syntax items |:syntax|
|
||||
12. Highlight command |:highlight|
|
||||
13. Linking groups |:highlight-link|
|
||||
14. Cleaning up |:syn-clear|
|
||||
15. Highlighting tags |tag-highlight|
|
||||
16. Window-local syntax |:ownsyntax|
|
||||
17. Color xterms |xterm-color|
|
||||
18. When syntax is slow |:syntime|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Quick start *:syn-qstart*
|
||||
|
@ -10,11 +10,7 @@ The commands which have been added to use multiple tab pages are explained
|
||||
here. Additionally, there are explanations for commands that work differently
|
||||
when used in combination with more than one tab page.
|
||||
|
||||
1. Introduction |tab-page-intro|
|
||||
2. Commands |tab-page-commands|
|
||||
3. Other items |tab-page-other|
|
||||
4. Setting 'tabline' |setting-tabline|
|
||||
5. Setting 'guitablabel' |setting-guitablabel|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *tab-page-intro*
|
||||
|
@ -8,12 +8,7 @@ Tags and special searches *tags-and-searches*
|
||||
|
||||
See section |29.1| of the user manual for an introduction.
|
||||
|
||||
1. Jump to a tag |tag-commands|
|
||||
2. Tag stack |tag-stack|
|
||||
3. Tag match list |tag-matchlist|
|
||||
4. Tags details |tag-details|
|
||||
5. Tags file format |tags-file-format|
|
||||
6. Include file searches |include-search|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Jump to a tag *tag-commands*
|
||||
|
@ -4,7 +4,7 @@
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Terminal information *terminal-info*
|
||||
Terminal information
|
||||
|
||||
Vim uses information about the terminal you are using to fill the screen and
|
||||
recognize what keys you hit. If this information is not correct, the screen
|
||||
@ -12,6 +12,8 @@ may be messed up or keys may not be recognized. The actions which have to be
|
||||
performed on the screen are accomplished by outputting a string of
|
||||
characters.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Startup *startup-terminal*
|
||||
|
||||
|
@ -13,21 +13,7 @@ http://www.vim.org
|
||||
Don't forget to browse the user manual, it also contains lots of useful tips
|
||||
|usr_toc.txt|.
|
||||
|
||||
Editing C programs |C-editing|
|
||||
Finding where identifiers are used |ident-search|
|
||||
Scrolling in Insert mode |scroll-insert|
|
||||
Smooth scrolling |scroll-smooth|
|
||||
Correcting common typing mistakes |type-mistakes|
|
||||
Counting words, lines, etc. |count-items|
|
||||
Restoring the cursor position |restore-position|
|
||||
Renaming files |rename-files|
|
||||
Change a name in multiple files |change-name|
|
||||
Speeding up external commands |speed-up|
|
||||
Useful mappings |useful-mappings|
|
||||
Compressing the help files |gzip-helpfile|
|
||||
Hex editing |hex-editing|
|
||||
Using <> notation in autocommands |autocmd-<>|
|
||||
Highlighting matching parens |match-parens|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Editing C programs *C-editing*
|
||||
|
@ -8,12 +8,7 @@ Undo and redo *undo-redo*
|
||||
|
||||
The basics are explained in section |02.5| of the user manual.
|
||||
|
||||
1. Undo and redo commands |undo-commands|
|
||||
2. Two ways of undo |undo-two-ways|
|
||||
3. Undo blocks |undo-blocks|
|
||||
4. Undo branches |undo-branches|
|
||||
5. Undo persistence |undo-persistence|
|
||||
6. Remarks about undo |undo-remarks|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Undo and redo commands *undo-commands*
|
||||
|
@ -48,9 +48,8 @@ Tuning Vim
|
||||
Reference manual
|
||||
|reference_toc| More detailed information for all commands
|
||||
|
||||
The user manual is available as a single, ready to print HTML and PDF file
|
||||
here:
|
||||
http://vimdoc.sf.net
|
||||
The user manual is online:
|
||||
https://neovim.io/doc/user
|
||||
|
||||
==============================================================================
|
||||
Getting Started ~
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
Various commands *various*
|
||||
|
||||
1. Various commands |various-cmds|
|
||||
2. Using Vim like less or more |less|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Various commands *various-cmds*
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
Differences between Vim and Vi *vi-differences*
|
||||
|
||||
1. Limits |limits|
|
||||
2. The most interesting additions |vim-additions|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Limits *limits*
|
||||
|
@ -10,13 +10,7 @@ Throughout the help files, differences between Nvim and Vim are indicated via
|
||||
the "{Nvim}" tag. This document is a complete and centralized list of all
|
||||
these differences.
|
||||
|
||||
1. Configuration |nvim-configuration|
|
||||
2. Defaults |nvim-defaults|
|
||||
3. New features |nvim-features|
|
||||
4. Changed features |nvim-features-changed|
|
||||
5. Missing legacy features |nvim-features-missing|
|
||||
6. Removed features |nvim-features-removed|
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Configuration *nvim-configuration*
|
||||
@ -65,7 +59,6 @@ these differences.
|
||||
==============================================================================
|
||||
3. New Features *nvim-features*
|
||||
|
||||
|
||||
MAJOR COMPONENTS ~
|
||||
|
||||
Embedded terminal emulator |terminal-emulator|
|
||||
@ -77,7 +70,6 @@ Remote plugins |remote-plugin|
|
||||
Python plugins |provider-python|
|
||||
Clipboard integration |provider-clipboard|
|
||||
|
||||
|
||||
USER EXPERIENCE ~
|
||||
|
||||
Working intuitively and consistently is a major goal of Nvim. Examples:
|
||||
@ -100,6 +92,8 @@ editor. Even "legacy" Python and Ruby plugins which use the old Vim interfaces
|
||||
|
||||
FEATURES ~
|
||||
|
||||
"Outline": Type <M-]> in |:Man| and |:help| pages to see a document outline.
|
||||
|
||||
|META| (ALT) chords are recognized, even in the terminal. Any |<M-| mapping
|
||||
will work. Some examples: <M-1>, <M-2>, <M-BS>, <M-Del>, <M-Ins>, <M-/>,
|
||||
<M-\>, <M-Space>, <M-Enter>, <M-=>, <M-->, <M-?>, <M-$>, ...
|
||||
|
@ -11,14 +11,7 @@ operator. It is the only way to select a block of text.
|
||||
|
||||
This is introduced in section |04.4| of the user manual.
|
||||
|
||||
1. Using Visual mode |visual-use|
|
||||
2. Starting and stopping Visual mode |visual-start|
|
||||
3. Changing the Visual area |visual-change|
|
||||
4. Operating on the Visual area |visual-operators|
|
||||
5. Blockwise operators |blockwise-operators|
|
||||
6. Repeating |visual-repeat|
|
||||
7. Examples |visual-examples|
|
||||
8. Select mode |Select-mode|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Using Visual mode *visual-use*
|
||||
|
@ -13,18 +13,7 @@ differently when used in combination with more than one window.
|
||||
The basics are explained in chapter 7 and 8 of the user manual |usr_07.txt|
|
||||
|usr_08.txt|.
|
||||
|
||||
1. Introduction |windows-intro|
|
||||
2. Starting Vim |windows-starting|
|
||||
3. Opening and closing a window |opening-window|
|
||||
4. Moving cursor to other windows |window-move-cursor|
|
||||
5. Moving windows around |window-moving|
|
||||
6. Window resizing |window-resize|
|
||||
7. Argument and buffer list commands |buffer-list|
|
||||
8. Do a command in all buffers or windows |list-repeat|
|
||||
9. Tag or file name under the cursor |window-tag|
|
||||
10. The preview window |preview-window|
|
||||
11. Using hidden buffers |buffer-hidden|
|
||||
12. Special kinds of buffers |special-buffers|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *windows-intro* *window*
|
||||
|
@ -18,5 +18,77 @@ if has("conceal")
|
||||
setlocal cole=2 cocu=nc
|
||||
endif
|
||||
|
||||
if !exists('g:no_plugin_maps')
|
||||
function! s:show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
let last_added = 0
|
||||
let has_section = 0
|
||||
let has_sub_section = 0
|
||||
|
||||
while lnum && lnum <= last_line
|
||||
let level = 0
|
||||
let add_text = ''
|
||||
let text = getline(lnum)
|
||||
|
||||
if text =~# '^=\+$' && lnum + 1 < last_line
|
||||
" A de-facto section heading. Other headings are inferred.
|
||||
let has_section = 1
|
||||
let has_sub_section = 0
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let text = getline(lnum)
|
||||
let add_text = text
|
||||
while add_text =~# '\*[^*]\+\*\s*$'
|
||||
let add_text = matchstr(add_text, '.*\ze\*[^*]\+\*\s*$')
|
||||
endwhile
|
||||
elseif text =~# '^[A-Z0-9][-A-ZA-Z0-9 .][-A-Z0-9 .():]*\%([ \t]\+\*.\+\*\)\?$'
|
||||
" Any line that's yelling is important.
|
||||
let has_sub_section = 1
|
||||
let level = has_section
|
||||
let add_text = matchstr(text, '.\{-}\ze\s*\%([ \t]\+\*.\+\*\)\?$')
|
||||
elseif text =~# '\~$'
|
||||
\ && matchstr(text, '^\s*\zs.\{-}\ze\s*\~$') !~# '\t\|\s\{2,}'
|
||||
\ && getline(lnum - 1) =~# '^\s*<\?$\|^\s*\*.*\*$'
|
||||
\ && getline(lnum + 1) =~# '^\s*>\?$\|^\s*\*.*\*$'
|
||||
" These lines could be headers or code examples. We only want the
|
||||
" ones that have subsequent lines at the same indent or more.
|
||||
let l = nextnonblank(lnum + 1)
|
||||
if getline(l) =~# '\*[^*]\+\*$'
|
||||
" Ignore tag lines
|
||||
let l = nextnonblank(l + 1)
|
||||
endif
|
||||
|
||||
if indent(lnum) <= indent(l)
|
||||
let level = has_section + has_sub_section
|
||||
let add_text = matchstr(text, '\S.*')
|
||||
endif
|
||||
endif
|
||||
|
||||
let add_text = substitute(add_text, '\s\+$', '', 'g')
|
||||
if !empty(add_text) && last_added != lnum
|
||||
let last_added = lnum
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum,
|
||||
\ 'text': repeat(' ', level) . add_text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Help TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
nnoremap <silent><buffer> <M-]> :call <sid>show_toc()<cr>
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
@ -31,13 +31,14 @@ setlocal nolist
|
||||
setlocal nofoldenable
|
||||
|
||||
if !exists('g:no_plugin_maps') && !exists('g:no_man_maps')
|
||||
nnoremap <silent> <buffer> <M-]> :call man#show_toc()<CR>
|
||||
nnoremap <silent> <buffer> <C-]> :Man<CR>
|
||||
nnoremap <silent> <buffer> K :Man<CR>
|
||||
nnoremap <silent> <buffer> <C-T> :call man#pop_tag()<CR>
|
||||
if s:pager
|
||||
nnoremap <silent> <buffer> <nowait> q :q<CR>
|
||||
nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR>
|
||||
else
|
||||
nnoremap <silent> <buffer> <nowait> q <C-W>c
|
||||
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -14,3 +14,26 @@ let b:undo_ftplugin = "set stl<"
|
||||
|
||||
" Display the command that produced the list in the quickfix window:
|
||||
setlocal stl=%t%{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P
|
||||
|
||||
function! s:setup_toc() abort
|
||||
if get(w:, 'quickfix_title') !~# '\<TOC$' || &syntax != 'qf'
|
||||
return
|
||||
endif
|
||||
|
||||
let list = getloclist(0)
|
||||
if empty(list)
|
||||
return
|
||||
endif
|
||||
|
||||
let bufnr = list[0].bufnr
|
||||
setlocal modifiable
|
||||
silent %delete _
|
||||
call setline(1, map(list, 'v:val.text'))
|
||||
setlocal nomodifiable nomodified
|
||||
let &syntax = getbufvar(bufnr, '&syntax')
|
||||
endfunction
|
||||
|
||||
augroup qf_toc
|
||||
autocmd!
|
||||
autocmd Syntax <buffer> call s:setup_toc()
|
||||
augroup END
|
||||
|
@ -87,6 +87,8 @@ syn match helpSpecial "CTRL-PageDown"
|
||||
syn match helpSpecial "CTRL-Insert"
|
||||
syn match helpSpecial "CTRL-Del"
|
||||
syn match helpSpecial "CTRL-{char}"
|
||||
syn match helpSpecial "META-."
|
||||
syn match helpSpecial "ALT-."
|
||||
|
||||
" Highlight group items in their own color.
|
||||
syn match helpComment "\t[* ]Comment\t\+[a-z].*"
|
||||
|
@ -18,6 +18,11 @@ highlight default link manOptionDesc Constant
|
||||
highlight default link manReference PreProc
|
||||
highlight default link manSubHeading Function
|
||||
|
||||
if &filetype != 'man'
|
||||
" May have been included by some other filetype.
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('b:man_sect')
|
||||
call man#init_pager()
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user