20
20
### Requirements
21
21
22
22
* Neovim 0.9.2 or later
23
- * [ nvim-treesitter] ( https://github.com/nvim-treesitter/nvim-treesitter )
24
23
25
24
### Installation
26
25
@@ -33,39 +32,31 @@ Use your favourite package manager:
33
32
``` lua
34
33
{
35
34
' nvim-orgmode/orgmode' ,
36
- dependencies = {
37
- { ' nvim-treesitter/nvim-treesitter' , lazy = true },
38
- },
39
35
event = ' VeryLazy' ,
40
36
config = function ()
41
- -- Load treesitter grammar for org
42
- require (' orgmode' ).setup_ts_grammar ()
43
-
44
- -- Setup treesitter
45
- require (' nvim-treesitter.configs' ).setup ({
46
- highlight = {
47
- enable = true ,
48
- },
49
- ensure_installed = { ' org' },
50
- })
51
-
52
37
-- Setup orgmode
53
38
require (' orgmode' ).setup ({
54
39
org_agenda_files = ' ~/orgfiles/**/*' ,
55
40
org_default_notes_file = ' ~/orgfiles/refile.org' ,
56
41
})
42
+
43
+ -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option
44
+ -- add `org` to ignore_install
45
+ -- require('nvim-treesitter.configs').setup({
46
+ -- ensure_installed = 'all',
47
+ -- ignore_install = { 'org' },
48
+ -- })
57
49
end ,
58
50
}
59
51
```
60
52
61
53
</details >
62
54
63
- <details open >
55
+ <details >
64
56
<summary ><b ><a href =" https://github.com/wbthomason/packer.nvim " >packer.nvim</a ></b ></summary >
65
57
</br >
66
58
67
59
``` lua
68
- use {' nvim-treesitter/nvim-treesitter' }
69
60
use {' nvim-orgmode/orgmode' , config = function ()
70
61
require (' orgmode' ).setup {}
71
62
end
79
70
</br >
80
71
81
72
``` vim
82
- Plug 'nvim-treesitter/nvim-treesitter'
83
73
Plug 'nvim-orgmode/orgmode'
84
74
```
85
75
@@ -90,7 +80,6 @@ Plug 'nvim-orgmode/orgmode'
90
80
</br >
91
81
92
82
``` vim
93
- call dein#add('nvim-treesitter/nvim-treesitter')
94
83
call dein#add('nvim-orgmode/orgmode')
95
84
```
96
85
@@ -104,29 +93,27 @@ since instructions above covers full setup
104
93
``` lua
105
94
-- init.lua
106
95
107
- -- Load custom treesitter grammar for org filetype
108
- require (' orgmode' ).setup_ts_grammar ()
109
-
110
- -- Treesitter configuration
111
- require (' nvim-treesitter.configs' ).setup {
112
- highlight = {
113
- enable = true ,
114
- },
115
- ensure_installed = {' org' }, -- Or run :TSUpdate org
116
- }
117
-
118
96
require (' orgmode' ).setup ({
119
97
org_agenda_files = {' ~/Dropbox/org/*' , ' ~/my-orgs/**/*' },
120
98
org_default_notes_file = ' ~/Dropbox/org/refile.org' ,
121
99
})
122
- ```
100
+
101
+ -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option
102
+ -- add `org` to ignore_install
103
+ -- require('nvim-treesitter.configs').setup({
104
+ -- ensure_installed = 'all',
105
+ -- ignore_install = { 'org' },
106
+ -- })
123
107
124
108
Or if you are using ` init.vim` , wrap the above snippet like so :
125
109
` ` ` vim
126
110
" init.vim
127
111
lua << EOF
128
112
129
- require('orgmode').setup_ts_grammar() ...
113
+ require (' orgmode' ).setup ({
114
+ org_agenda_files = {' ~/Dropbox/org/*' , ' ~/my-orgs/**/*' },
115
+ org_default_notes_file = ' ~/Dropbox/org/refile.org' ,
116
+ })
130
117
131
118
EOF
132
119
```
@@ -191,29 +178,17 @@ or a hands-on [tutorial](https://github.com/nvim-orgmode/orgmode/wiki/Getting-St
191
178
192
179
## Treesitter Info
193
180
The built-in treesitter parser is used for parsing the org files.
194
- Highlights are experimental and partially supported.
195
-
196
- ### Advantages of treesitter over built in parsing/syntax:
197
- * More reliable, since parsing is done with a proper parsing tool
198
- * Better highlighting (Experimental, still requires improvements)
199
- * Future features will be easier to implement because the grammar already parses some things that were not parsed before (tables, latex, etc.)
200
- * Allows for easier hacking (custom motions that can work with TS nodes, etc.)
201
181
202
182
### Known highlighting issues and limitations
203
183
* LaTex is still highlighted through syntax file
204
184
205
- ### Improvements over Vim's syntax highlighting
206
- * Better highlighting of certain parts (tags, deadline/schedule/closed dates)
207
- * [ Treesitter highlight injections] ( https://github.com/nvim-treesitter/nvim-treesitter/blob/4f2265632becabcd2c5b1791fa31ef278f1e496c/CONTRIBUTING.md#injections ) through ` #BEGIN_SRC filetype ` blocks
208
- * Headline markup highlighting (https://github.com/nvim-orgmode/orgmode/issues/67 )
209
-
210
185
## Troubleshoot
211
186
### Indentation is not working
212
187
Make sure you are not overriding indentexpr in Org buffers with [ nvim-treesitter indentation] ( https://github.com/nvim-treesitter/nvim-treesitter#indentation )
213
188
214
189
### I get ` treesitter/query.lua ` errors when opening agenda/capture prompt or org files
215
- Make sure you are using latest changes from [ tree-sitter-org ] ( https://github.com/milisims/tree-sitter-org ) grammar.< br />
216
- by running ` :TSUpdate org ` and restarting the editor .
190
+ Tree-sitter parser might not be installed.
191
+ Try running ` :lua require('orgmode.config'):reinstall_grammar() ` to reinstall it .
217
192
218
193
### Dates are not in English
219
194
Dates are generated with Lua native date support, and it reads your current locale when creating them.<br />
0 commit comments