Added flutter-tools plugin
This commit is contained in:
parent
bbdb00f57e
commit
ece7cee8f1
|
|
@ -6,6 +6,7 @@
|
||||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
||||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||||
|
"flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "54669c347fe94d5be41322bd5526095f3e528713" },
|
"fzf-lua": { "branch": "main", "commit": "54669c347fe94d5be41322bd5526095f3e528713" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
|
"gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
|
||||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
-- Make sure to install fvm in yout system for this to work
|
||||||
|
return {
|
||||||
|
'nvim-flutter/flutter-tools.nvim',
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'folke/snacks.nvim', -- optional for vim.ui.select
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
fvm = true,
|
||||||
|
},
|
||||||
|
config = function(_, config_opts)
|
||||||
|
local root_patterns = { '.fvm' }
|
||||||
|
local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true })[1])
|
||||||
|
if not root_dir then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require('flutter-tools').setup(config_opts)
|
||||||
|
local commands = {
|
||||||
|
-- Commands
|
||||||
|
'FlutterRun',
|
||||||
|
'FlutterDebug',
|
||||||
|
'FlutterLspRestart',
|
||||||
|
'FlutterAttach',
|
||||||
|
'FlutterDetach',
|
||||||
|
'FlutterReload',
|
||||||
|
'FlutterRestart',
|
||||||
|
'FlutterQuit',
|
||||||
|
'FlutterVisualDebug',
|
||||||
|
'FlutterChangeTargetPlatform',
|
||||||
|
'FlutterToggleBrightness',
|
||||||
|
-- Lists
|
||||||
|
'FlutterDevices',
|
||||||
|
'FlutterEmulators',
|
||||||
|
--- Outline
|
||||||
|
'FlutterOutlineOpen',
|
||||||
|
'FlutterOutlineToggle',
|
||||||
|
--- Dev tools
|
||||||
|
'FlutterDevTools',
|
||||||
|
'FlutterDevToolsActivate',
|
||||||
|
'FlutterCopyProfilerUrl',
|
||||||
|
'FlutterOpenDevTools',
|
||||||
|
'FlutterInspectWidget',
|
||||||
|
'FlutterPubGet',
|
||||||
|
'FlutterPubUpgrade',
|
||||||
|
--- Log
|
||||||
|
'FlutterLogClear',
|
||||||
|
'FlutterLogToggle',
|
||||||
|
--- LSP
|
||||||
|
'FlutterSuper',
|
||||||
|
'FlutterReanalyze',
|
||||||
|
'FlutterRename',
|
||||||
|
}
|
||||||
|
|
||||||
|
local opts = {}
|
||||||
|
opts.prompt = 'Flutter Tools> '
|
||||||
|
opts.actions = {
|
||||||
|
['default'] = function(selected)
|
||||||
|
vim.cmd(selected)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
|
callback = function()
|
||||||
|
vim.keymap.set('n', '<leader>F', function()
|
||||||
|
require('fzf-lua').fzf_exec(commands, opts)
|
||||||
|
end, { desc = 'Flutter Tools Commands' })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -40,6 +40,7 @@ require('lazy').setup({
|
||||||
require 'custom/plugins/theme',
|
require 'custom/plugins/theme',
|
||||||
require 'custom/plugins/indent-blankline',
|
require 'custom/plugins/indent-blankline',
|
||||||
-- require 'custom/plugins/leetcode',
|
-- require 'custom/plugins/leetcode',
|
||||||
|
require 'custom/plugins/flutter-tools',
|
||||||
}, {
|
}, {
|
||||||
ui = {
|
ui = {
|
||||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue