pubspec.lua (476B)
1 local group = vim.api.nvim_create_augroup('tms-dart-pubspec', {}) 2 vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { 3 group = group, 4 callback = function() 5 if #vim.fs.find('pubspec.yaml', { upward = true, type = 'file' }) == 0 then 6 return 7 end 8 vim.keymap.set('n', '<leader>an', require 'tms.ft.dart.analyze'.qf2131, { buffer = true, desc = 'Dart Analyze' }) 9 end, 10 }) 11 12 if pcall(require, 'pubspec-assist') then 13 require 'pubspec-assist'.setup() 14 end