Signed-off-by: Lee Tang <i@d0zingcat.dev>
This commit is contained in:
Lee Tang
2023-03-02 10:57:18 +08:00
parent 43a5d9fbc6
commit c2245455e5
2 changed files with 58 additions and 2 deletions

View File

@@ -1,4 +1,50 @@
-- treesitter
local ncmd = vim.api.nvim_command
require('nvim-treesitter.configs').setup({
ensure_installed = { 'rust', 'go', 'python', 'lua', 'c' }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = { 'c', 'lua', 'rust', 'go', 'python', 'zig', 'markdown', 'solidity', 'jsonnet', 'vim' },
highlight = {
enable = true,
},
playground = {
enable = true,
},
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { 'BufWrite', 'CursorHold' },
},
-- nvim-treesitter/nvim-treesitter-refactor
refactor = {
highlight_definitions = { enable = true },
smart_rename = {
enable = true,
keymaps = {
smart_rename = 'gnr',
},
},
},
indent = { enable = false },
autopairs = { enable = true },
rainbow = { enable = true },
autotag = { enable = true },
context_commentstring = { enable = true },
-- RRethy/nvim-treesitter-endwise
endwise = {
enable = true,
},
-- andymass/vim-matchup
matchup = {
enable = true,
},
-- nvim-treesitter/nvim-treesitter-textobjects
textobjects = {
select = {
enable = true,
lookahead = true,
},
},
-- yioneko/nvim-yati
yati = { enable = true },
})
ncmd('set foldmethod=expr')
ncmd('set foldexpr=nvim_treesitter#foldexpr()')

View File

@@ -145,6 +145,16 @@ return require('packer').startup(function(use)
config = function()
require('config.nvim_treesitter')
end,
requires = {
'nvim-treesitter/playground',
'nvim-treesitter/nvim-treesitter-refactor',
'nvim-treesitter/nvim-treesitter-textobjects',
'nvim-treesitter/nvim-treesitter-context',
'RRethy/nvim-treesitter-endwise',
'andymass/vim-matchup', -- extend % key
'yioneko/nvim-yati',
'm-demare/hlargs.nvim',
},
})
use({
'iamcco/markdown-preview.nvim',