From d8de28d6c789048229a92d83ca27681880421805 Mon Sep 17 00:00:00 2001 From: tungisdab Date: Wed, 4 Feb 2026 08:12:27 +0700 Subject: [PATCH 1/3] add flutter --- init.lua | 18 ++++- lua/kickstart/plugins/flutter_pancake.lua | 96 +++++++++++++++++++++++ lua/kickstart/plugins/java_setup.lua | 11 +++ 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 lua/kickstart/plugins/flutter_pancake.lua create mode 100644 lua/kickstart/plugins/java_setup.lua diff --git a/init.lua b/init.lua index 3593ca2e194..a2424bb20d2 100644 --- a/init.lua +++ b/init.lua @@ -480,11 +480,24 @@ require('lazy').setup({ }, -- LSP Plugins + { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + }, + }, + }, + { -- Main LSP Configuration 'neovim/nvim-lspconfig', dependencies = { - -- Automatically install LSPs and related tools to stdpath for Neovim + -- Autiomatically install LSPs and related tools to stdpath for Neovim -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` { @@ -819,7 +832,7 @@ require('lazy').setup({ -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'tokyonight-moon' end, }, @@ -918,6 +931,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.flutter_pancake', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. diff --git a/lua/kickstart/plugins/flutter_pancake.lua b/lua/kickstart/plugins/flutter_pancake.lua new file mode 100644 index 00000000000..f55bcefdb2c --- /dev/null +++ b/lua/kickstart/plugins/flutter_pancake.lua @@ -0,0 +1,96 @@ +return { + { + 'akinsho/flutter-tools.nvim', + lazy = false, + dependencies = { + 'nvim-lua/plenary.nvim', + 'stevearc/dressing.nvim', + }, + opts = { + dev_log = { + enabled = true, + open_cmd = '50vnew', + focus_on_open = false, + }, + flutter_lookup_cmd = 'mise where flutter', + decorations = { + statusline = { + -- set to true to be able use the 'flutter_tools_decorations.app_version' in your statusline + -- this will show the current version of the flutter app from the pubspec.yaml file + app_version = true, + -- set to true to be able use the 'flutter_tools_decorations.device' in your statusline + -- this will show the currently running device if an application was started with a specific + -- device + device = true, + -- set to true to be able use the 'flutter_tools_decorations.project_config' in your statusline + -- this will show the currently selected project configuration + project_config = true, + }, + }, + lsp = { + color = { -- show the derived colours for dart variables + enabled = true, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10 + background = false, -- highlight the background + background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},) + foreground = false, -- highlight the foreground + virtual_text = true, -- show the highlight using virtual text + virtual_text_str = '■', -- the virtual text character to highlight + }, + settings = { + -- lineLength = 120, -- max line length that the LSP will report when formatting + showTodos = true, + completeFunctionCalls = true, + renameFilesWithClasses = 'prompt', -- "always" + enableSnippets = true, + updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command. + }, + }, + }, + root_patterns = { 'mise.toml' }, + config = function(_, opts) + require('flutter-tools').setup(opts) + + local extensions = require('telescope').extensions + vim.keymap.set('n', 'fl', extensions.flutter.commands, { desc = '[F]lutter commands' }) + vim.keymap.set( + 'n', + 'fd', + 'FlutterRun -d macos --flavor dev --dart-define=FLAVOR=dev', + { desc = '[F]lutter Run [D]ev Flavor for Desktop' } + ) + vim.keymap.set('n', 'fr', 'FlutterRun --flavor dev --dart-define=FLAVOR=dev', { desc = '[F]lutter Run [D]ev Flavor' }) + vim.keymap.set( + 'n', + 'fw', + 'FlutterRun -d chrome --web-experimental-hot-reload --web-browser-flag "--disable-web-security" --web-port 5000', + { desc = '[F]lutter Run [W]eb' } + ) + vim.keymap.set('n', 'fv', extensions.flutter.fvm, { desc = '[F]lutter version manager' }) + vim.keymap.set('n', 'dl', function() + local buf = vim.fn.bufnr '__FLUTTER_DEV_LOG__' + if buf == -1 then + vim.notify('Flutter dev log buffer not found', vim.log.levels.WARN) + return + end + + local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false) + local file = io.open('/tmp/dart_debug.log', 'w') -- "a" means append + if not file then + vim.notify('Failed to open file for writing', vim.log.levels.ERROR) + return + end + + for _, line in ipairs(lines) do + file:write(line .. '\n') + end + file:close() + vim.notify('Appended Flutter dev log to /tmp/dart_debug.log', vim.log.levels.INFO) + end, { desc = 'Append Flutter dev log to file' }) + + vim.keymap.set('n', 'fc', 'FlutterLogClear', { desc = '[F]lutter Log [C]lear' }) + vim.keymap.set('n', 'fo', 'FlutterLogToggle', { desc = '[F]lutter Log T[o]ggle' }) + vim.keymap.set('n', 'fq', 'FlutterQuit', { desc = '[F]lutter [Q]uit' }) + vim.keymap.set('n', 'fs', 'FlutterRestart', { desc = '[F]lutter Re[s]tart' }) + end, + }, +} \ No newline at end of file diff --git a/lua/kickstart/plugins/java_setup.lua b/lua/kickstart/plugins/java_setup.lua new file mode 100644 index 00000000000..de977567629 --- /dev/null +++ b/lua/kickstart/plugins/java_setup.lua @@ -0,0 +1,11 @@ +return { + { + 'nvim-java/nvim-java', + dependencies = { + 'nvim-lua/plenary.nvim', + 'neovim/nvim-lspconfig', + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + }, + } +} \ No newline at end of file From c6d0a4281bca8b032b795b4dbe90c34bdb42a16d Mon Sep 17 00:00:00 2001 From: tungisdab Date: Wed, 4 Mar 2026 08:12:26 +0700 Subject: [PATCH 2/3] chore: update space --- lua/kickstart/plugins/flutter_pancake.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/kickstart/plugins/flutter_pancake.lua b/lua/kickstart/plugins/flutter_pancake.lua index f55bcefdb2c..d5d283b168f 100644 --- a/lua/kickstart/plugins/flutter_pancake.lua +++ b/lua/kickstart/plugins/flutter_pancake.lua @@ -50,6 +50,16 @@ return { config = function(_, opts) require('flutter-tools').setup(opts) + vim.api.nvim_create_autocmd("FileType", { + pattern = "dart", + callback = function() + vim.opt_local.shiftwidth = 2 + vim.opt_local.tabstop = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.expandtab = true + end, + }) + local extensions = require('telescope').extensions vim.keymap.set('n', 'fl', extensions.flutter.commands, { desc = '[F]lutter commands' }) vim.keymap.set( From faa04fb5a865fd9a909cd923e1269b149ffd39e9 Mon Sep 17 00:00:00 2001 From: tungisdab Date: Wed, 4 Mar 2026 08:41:53 +0700 Subject: [PATCH 3/3] chore: fix: Failed to run for nvim-treesitter --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a2424bb20d2..95b30a13980 100644 --- a/init.lua +++ b/init.lua @@ -891,7 +891,7 @@ require('lazy').setup({ -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } - require('nvim-treesitter').install(parsers) + require('nvim-treesitter.install').ensure_installed(parsers) vim.api.nvim_create_autocmd('FileType', { callback = function(args) local buf, filetype = args.buf, args.match