feat: use mini.safely for file events
This commit is contained in:
+11
-9
@@ -17,11 +17,12 @@ Config.now_if_args(function()
|
||||
'json', 'xml', 'toml', 'sh', 'bash', 'zsh', 'just', 'gitcommit', 'diff', 'regex', 'http'
|
||||
}
|
||||
|
||||
Config.autocmd('FileType', filetypes, function(ev)
|
||||
if pcall(vim.treesitter.start, ev.buf) and vim.bo[ev.buf].filetype == 'php' then
|
||||
vim.bo[ev.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
Config.on_filetype(table.concat(filetypes, ','), function()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
if pcall(vim.treesitter.start, buf) and vim.bo[buf].filetype == 'php' then
|
||||
vim.bo[buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end
|
||||
end, 'Start tree-sitter')
|
||||
end)
|
||||
|
||||
Config.later(function()
|
||||
require('nvim-treesitter').install(vim.tbl_map(function(ft)
|
||||
@@ -73,16 +74,17 @@ Config.later(function()
|
||||
require("dap").adapters.go = { type = "server", host = "127.0.0.1", port = "${port}" }
|
||||
end)
|
||||
|
||||
-- Kulala & Flutter
|
||||
Config.autocmd('FileType', { 'http' }, function()
|
||||
-- Kulala
|
||||
Config.on_filetype('http', function()
|
||||
vim.pack.add({ "https://github.com/mistweaverco/kulala.nvim" })
|
||||
require("kulala").setup({ default_env = "dev" })
|
||||
end, "Setup Kulala", true)
|
||||
end)
|
||||
|
||||
Config.autocmd('FileType', 'dart', function()
|
||||
-- Flutter
|
||||
Config.on_filetype('dart', function()
|
||||
vim.pack.add({
|
||||
"https://github.com/nvim-lua/plenary.nvim",
|
||||
"https://github.com/nvim-flutter/flutter-tools.nvim",
|
||||
})
|
||||
require("flutter-tools").setup({ lsp = { color_capabilities = true } })
|
||||
end, "Setup Flutter", true)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user