diff --git a/lua/plugins/flutter.lua b/lua/plugins/flutter.lua index 709c40d..3cbef80 100644 --- a/lua/plugins/flutter.lua +++ b/lua/plugins/flutter.lua @@ -9,6 +9,19 @@ return { config = function() vim.opt.termguicolors = true -- vim.env.FLUTTER_FORCE_COLOR = "1" + local project_root = vim.fn.getcwd() + local analysis_excluded_folders = { + project_root .. "/.dart_tool", + project_root .. "/build", + project_root .. "/ios/Pods", + project_root .. "/android/.gradle", + } + local flutter_bin = vim.fn.exepath("flutter") + if flutter_bin ~= "" then + local flutter_sdk = vim.fn.fnamemodify(vim.fn.resolve(flutter_bin), ":h:h") + table.insert(analysis_excluded_folders, flutter_sdk .. "/packages") + table.insert(analysis_excluded_folders, flutter_sdk .. "/.pub-cache") + end -- Auto scroll & Color logs when new logs appear vim.api.nvim_create_autocmd({ "TextChanged", "BufWinEnter" }, { @@ -45,12 +58,16 @@ return { end, settings = { showTodos = true, - completeFunctionCalls = true, + completeFunctionCalls = false, updateImportsOnRename = true, + analysisExcludedFolders = analysis_excluded_folders, }, }, widget_guides = { - enabled = true, + enabled = false, + }, + closing_tags = { + enabled = false, }, dev_log = { enabled = true, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 0189a2b..63f915b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -114,7 +114,6 @@ return { else fallback() end - fallback() end, }), [""] = cmp.mapping(function(fallback) @@ -126,11 +125,11 @@ return { end, { "i", "s" }), }), sources = cmp.config.sources({ - { name = "nvim_lsp", keyword_length = 1 }, - { name = "luasnip", keyword_length = 1 }, + { name = "nvim_lsp", keyword_length = 2 }, + { name = "luasnip", keyword_length = 2 }, { name = "buffer", - keyword_length = 2, + keyword_length = 3, -- Limit indexing to only the active visible buffer to stop lag on Enter option = { get_bufnrs = function()