@@ -86,75 +86,58 @@ Like in movement, swapping in markdown operates against headings.
86
86
87
87
## Installation
88
88
89
- #### [ Lazy] ( https://github.com/folke/lazy.nvim )
90
89
``` lua
90
+ -- Treewalker Options
91
+
92
+ -- Treewalker aims for sane defaults.
93
+ -- But you can modify some behavior via the options below, which are each optional.
94
+
95
+ -- The following options are the defaults:
96
+ opts = {
97
+ -- Whether to briefly highlight the node after jumping to it
98
+ highlight = true ,
99
+
100
+ -- How long should above highlight last (in ms)
101
+ highlight_duration = 250 ,
102
+
103
+ -- The color of the above highlight. Must be a valid vim highlight group.
104
+ -- (see :h highlight-group for options)
105
+ highlight_group = ' CursorLine' ,
106
+
107
+ -- Whether to create a visual selection after a movement to a node.
108
+ -- If true, highlight is disabled and a visual selection is made in
109
+ -- its place.
110
+ select = false ,
111
+
112
+ -- Whether to notify via vim.notify in the case of missing parsers
113
+ parser_notifications = true ,
114
+
115
+ -- Whether to notify via vim.notify in the case of incorrect options provided
116
+ opt_notifications = true ,
117
+
118
+ -- Whether the plugin adds movements to the jumplist -- true | false | 'left'
119
+ -- true: All movements more than 1 line are added to the jumplist. This is the default,
120
+ -- and is meant to cover most use cases. It's modeled on how { and } natively add
121
+ -- to the jumplist.
122
+ -- false: Treewalker does not add to the jumplist at all
123
+ -- "left": Treewalker only adds :Treewalker Left to the jumplist. This is usually the most
124
+ -- likely one to be confusing, so it has its own mode.
125
+ jumplist = true ,
126
+ }
127
+
128
+ -- Lazy (https://github.com/folke/lazy.nvim)
91
129
{
92
130
' aaronik/treewalker.nvim' ,
93
131
94
- -- The following options are the defaults.
95
- -- Treewalker aims for sane defaults, so these are each individually optional,
96
- -- and setup() does not need to be called, so the whole opts block is optional as well.
97
- opts = {
98
- -- Whether to briefly highlight the node after jumping to it
99
- highlight = true ,
100
-
101
- -- How long should above highlight last (in ms)
102
- highlight_duration = 250 ,
103
-
104
- -- The color of the above highlight. Must be a valid vim highlight group.
105
- -- (see :h highlight-group for options)
106
- highlight_group = ' CursorLine' ,
107
-
108
- -- Whether to create a visual selection after a movement to a node.
109
- -- If true, highlight is disabled and a visual selection is made in
110
- -- its place.
111
- select = false ,
112
-
113
- -- Whether the plugin adds movements to the jumplist -- true | false | 'left'
114
- -- true: All movements more than 1 line are added to the jumplist. This is the default,
115
- -- and is meant to cover most use cases. It's modeled on how { and } natively add
116
- -- to the jumplist.
117
- -- false: Treewalker does not add to the jumplist at all
118
- -- "left": Treewalker only adds :Treewalker Left to the jumplist. This is usually the most
119
- -- likely one to be confusing, so it has its own mode.
120
- jumplist = true ,
121
- }
122
132
}
123
- ```
124
133
125
- #### [ Packer] ( https://github.com/wbthomason/packer.nvim )
126
- ``` lua
127
134
use {
128
135
' aaronik/treewalker.nvim' ,
129
136
130
137
-- The setup function is optional, defaults are meant to be sane
131
138
-- and setup does not need to be called
132
139
setup = function ()
133
- require (' treewalker' ).setup ({
134
- -- Whether to briefly highlight the node after jumping to it
135
- highlight = true ,
136
-
137
- -- How long should above highlight last (in ms)
138
- highlight_duration = 250 ,
139
-
140
- -- The color of the above highlight. Must be a valid vim highlight group.
141
- -- (see :h highlight-group for options)
142
- highlight_group = ' CursorLine' ,
143
-
144
- -- Whether to create a visual selection after a movement to a node.
145
- -- If true, highlight is disabled and a visual selection is made in
146
- -- its place.
147
- select = false ,
148
-
149
- -- Whether the plugin adds movements to the jumplist -- true | false | 'left'
150
- -- true: All movements more than 1 line are added to the jumplist. This is the default,
151
- -- and is meant to cover most use cases. It's modeled on how { and } natively add
152
- -- to the jumplist.
153
- -- false: Treewalker does not add to the jumplist at all
154
- -- "left": Treewalker only adds :Treewalker Left to the jumplist. This is usually the most
155
- -- likely one to be confusing, so it has its own mode.
156
- jumplist = true ,
157
- })
140
+ require (' treewalker' ).setup ({ ... })
158
141
end
159
142
}
160
143
```
@@ -163,8 +146,8 @@ use {
163
146
``` vimscript
164
147
Plug 'aaronik/treewalker.nvim'
165
148
166
- " This line is optional
167
- :lua require('treewalker').setup({ highlight = true, highlight_duration = 250, highlight_group = 'CursorLine', select = false, jumplist = true })
149
+ " Optionally
150
+ :lua require('treewalker').setup({ ... })
168
151
```
169
152
170
153
---
0 commit comments