~kota/wiki-ft.vim

wiki-ft.vim/doc/wiki-ft.txt -rw-r--r-- 6.5 KiB
e170bd36Dakota Walsh change default text object binds 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
*wiki-ft.txt*    A simple `.wiki` filetype plugin for Vim
*wiki-ft*

Author:  Karl Yngve Lervåg <karl.yngve@gmail.com>
License: MIT license {{{

  Copyright (c) 2020 Karl Yngve Lervåg

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  sell copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  IN THE SOFTWARE.

}}}

==============================================================================
CONTENTS                                                     *wiki-ft-contents*

  Introduction                                  |wiki-ft-intro|
  Syntax highlighting                           |wiki-ft-syntax|
    Common elements                             |wiki-ft-syntax-common|
    Links                                       |wiki-ft-syntax-links|
    Code blocks                                 |wiki-ft-syntax-code|
  Syntax highlighting                           |wiki-ft-mappings|
    Text objects                                |wiki-ft-mappings-text-obj|
    Default mappings                            |wiki-ft-mappings-default|

==============================================================================
INTRODUCTION                                                    *wiki-ft-intro*

This is a simple filetype plugin for `.wiki` files that adds some syntax
highlighting and very simple folding functions. It depends on |wiki.vim|
(https://github.com/lervag/wiki.vim) for proper highlighting of links.

The folding function simply adds folds according to section depth.

Installation~

If you use |vim-plug| (https://github.com/junegunn/vim-plug), then add the
following lines to your `vimrc` file: >

  Plug 'lervag/wiki.vim'
  Plug 'lervag/wiki-ft.vim'

  " If you do not want to use the wiki.vim plugin:
  let g:wiki_loaded = 1

==============================================================================
SYNTAX HIGHLIGHTING                                            *wiki-ft-syntax*

This plugin supports a relatively standard type of simple Markdown syntax.

------------------------------------------------------------------------------
COMMON ELEMENTS                                         *wiki-ft-syntax-common*

The following listing shows the set of common syntax elements that are
currently supported: >

  # Level 1 headings

  ## Level 2 headings

  Text formatting and math:
  - *bold text*
  - _italic text_
  - `inline code`
  - $f(x) = 1$

  Tables:
  |-----+-----------|
  | ID  | Value     |
  |-----+-----------|
  | 1   | Entry 1   |
  | 2   | Entry 2   |
  | ... | Entry ... |
  | 12  | Entry 12  |
  |-----+-----------|

  Check lists:
  - [ ] List item 1
  - [.] List item 2
  - [o] List item 3
  - [x] List item 4

  Quotes:
  > Blocks of text like this are highlighted as quotes.
  > Continued line of quote.

  > Blocks of text like this are highlighted as quotes even if
  the continued lines do not start with the initial quote symbol.

------------------------------------------------------------------------------
LINKS                                                    *wiki-ft-syntax-links*

A link typically consists of an url and a description, although the
description may be ignored.  The links will be highlighted and the |+conceal|
feature is used to only display the descriptions if they are present.

The following listing shows some examples of links. >

  [[Link]]
  [[Link|With description]]

  [Description](Link)

  Inline numbered links like this is also supported [0]. The link is supplied
  below.

  [0]: Link
<
URLs are also highlighted directly, e.g.: >

  journal:2013-04-05
  http://www.google.com
  doi:10.1002%2Fandp.19053220607
  file:/path/to/file

------------------------------------------------------------------------------
CODE BLOCKS                                               *wiki-ft-syntax-code*

Code blocks are blocks like the following: >

  ```sh
  ls ~
  echo "hello world"
  ```

If the code block has a language specifier, then the block will be highlighted
accordingly.

Note: The file is parsed when opened for code blocks, and only the languages
      detected are highlighted. Thus, if one adds a new code block with a new
      language, one may need to reload the file to get the appropriate
      highlighting.

==============================================================================
MAPPINGS                                                     *wiki-ft-mappings*

Here we describe the mappings provided by the wiki plugin, as well as the
default maps.

------------------------------------------------------------------------------
TEXT OBJECTS                                        *wiki-ft-mappings-text-obj*

The following mappings are available as visual mode and operator mode
mappings, i.e. |xmap| and |omap|.

*<plug>(wiki-ac)*
*<plug>(wiki-ic)*
  Text object for code blocks.

------------------------------------------------------------------------------
DEFAULT MAPPINGS                                     *wiki-ft-mappings-default*

This is a list of default mappings. For a more detailed description of each
mapping, read the documentation of the `<plug>(wiki-[name])` form of the
mapping. The mode specifier is a single letter which indicates which mode the
mapping is valid in. See e.g. |nmap|, |imap|, |omap| or |xmap| for more
information about the different modes.

  ---------------------------------------------------------------------~
   MODE  LHS                 RHS~
  ---------------------------------------------------------------------~
   `ox`    ac                  |<plug>(wiki-ac)|
   `ox`    ic                  |<plug>(wiki-ic)|
  ---------------------------------------------------------------------~

==============================================================================
 vim:tw=78:ts=8:ft=help:norl: