-
Notifications
You must be signed in to change notification settings - Fork 6
/
syntax.lua
131 lines (122 loc) · 3.63 KB
/
syntax.lua
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
----------------------
-- Syntax Highlighting
----------------------
return function(use)
-- Better Folding
use {
"kevinhwang91/nvim-ufo",
event = { "BufRead" },
wants = { "promise-async" },
requires = "kevinhwang91/promise-async",
config = function()
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return { 'treesitter' }
end
})
vim.opt.foldcolumn = "0"
vim.opt.foldlevel = 99
vim.opt.foldlevelstart = 99
vim.opt.foldenable = true
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds)
vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0)
vim.keymap.set('n', 'z<space>', require('ufo').peekFoldedLinesUnderCursor)
end
}
use {
'anuvyklack/pretty-fold.nvim',
config = function()
require('pretty-fold').setup()
end
}
-- autoclose and autorename tags
use {
'windwp/nvim-ts-autotag',
}
-- for developing highlights
use {
'nvim-treesitter/nvim-treesitter',
-- '~/Development/OpenSource/nvim-treesitter',
run = function()
require("nvim-treesitter.install").prefer_git = true
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
ts_update()
end,
config = function()
require("nvim-treesitter.install").prefer_git = true
require 'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
filetypes = {
"html",
"javascript", "typescript",
"typescript.glimmer", "javascript.glimmer",
"javascriptreact", "typescriptreact",
"markdown",
"glimmer", "handlebars", "hbs", "svelte", "vue"
}
},
ensure_installed = {
-- Web Languages
"javascript", "typescript",
"html", "css", "regex",
-- Web Framework Languages
"glimmer", "glimmer_javascript", "glimmer_typescript",
"svelte",
-- Web Transport Languages
"graphql",
-- Documentation Languages
"markdown", "markdown_inline",
-- "help", -- missing?
-- "comment", -- slow?
"jsdoc",
-- Configuration Languages
"toml", "jsonc", "yaml",
"dockerfile",
"lua", "vim", "hyprlang",
-- Scripting Languages
"commonlisp",
"bash",
"jq",
-- Systems Languages
"c", "cmake",
"rust",
"go",
-- Specifically for the treesitter AST
"query",
-- Utility Syntaxes
"diff",
"jq",
"git_rebase", "gitcommit", "gitignore"
},
ignore_install = {
"json" -- jsonc is better
},
highlight = {
enable = true,
},
indent = {
enable = true
},
}
require('ts_context_commentstring').setup({})
vim.g.skip_ts_context_commentstring_module = true
vim.treesitter.language.register('html', 'html.edge')
vim.filetype.add({
pattern = { [".*/hypr/.*%.conf"] = "hyprlang" },
})
end
}
-- Useful for large functions or in unfamiliar code
use 'nvim-treesitter/nvim-treesitter-context'
-- Comments in embedded languages via treesitter
use { 'JoosepAlviste/nvim-ts-context-commentstring',
config = function()
require('ts_context_commentstring').setup {
enable_autocmd = false,
}
end
}
end