fix: neovim

This commit is contained in:
Ryan Yin
2023-07-11 02:22:00 +08:00
parent 21b3d4ad37
commit 7cc49c29f1
62 changed files with 1998 additions and 2600 deletions
@@ -0,0 +1,26 @@
local config = {}
function config.nvim_treesitter()
vim.api.nvim_command('set foldmethod=expr')
vim.api.nvim_command('set foldexpr=nvim_treesitter#foldexpr()')
require('nvim-treesitter.configs').setup({
ensure_installed = 'all',
ignore_install = { 'phpdoc' },
highlight = {
enable = true,
},
textobjects = {
select = {
enable = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
},
})
end
return config
@@ -0,0 +1,12 @@
local package = require('core.pack').package
local conf = require('modules.editor.config')
package({
'nvim-treesitter/nvim-treesitter',
event = 'BufRead',
run = ':TSUpdate',
config = conf.nvim_treesitter,
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
})