chore: update config
This commit is contained in:
parent
584ba6e536
commit
cb2ff3574e
13 changed files with 270 additions and 204 deletions
12
lua/custom/plugins/copilot.lua
Normal file
12
lua/custom/plugins/copilot.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
"github/copilot.vim",
|
||||
init = function()
|
||||
vim.g.copilot_no_tab_map = true
|
||||
|
||||
vim.keymap.set("i", "<C-x>", 'copilot#Accept("")', {
|
||||
expr = true,
|
||||
silent = true,
|
||||
replace_keycodes = false,
|
||||
})
|
||||
end,
|
||||
}
|
||||
19
lua/custom/plugins/dignostics.lua
Normal file
19
lua/custom/plugins/dignostics.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>xx", function() require("trouble").toggle() end)
|
||||
vim.keymap.set("n", "<leader>xw", function() require("trouble").toggle("workspace_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xd", function() require("trouble").toggle("document_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end)
|
||||
vim.keymap.set("n", "<leader>xl", function() require("trouble").toggle("loclist") end)
|
||||
vim.keymap.set("n", "<leader>xn", function() require("trouble").next({ skip_groups = true, jump = true }) end)
|
||||
vim.keymap.set("n", "<leader>xb", function() require("trouble").previous({ skip_groups = true, jump = true }) end)
|
||||
vim.keymap.set("n", "gR", function() require("trouble").toggle("lsp_references") end)
|
||||
end
|
||||
}
|
||||
94
lua/custom/plugins/flutter.lua
Normal file
94
lua/custom/plugins/flutter.lua
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
return {
|
||||
'akinsho/flutter-tools.nvim',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'stevearc/dressing.nvim', -- optional for vim.ui.select
|
||||
},
|
||||
config = function()
|
||||
local flutterConfig = require("flutter-tools")
|
||||
|
||||
flutterConfig.setup {
|
||||
ui = {
|
||||
border = "rounded",
|
||||
notification_style = 'native'
|
||||
},
|
||||
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,
|
||||
}
|
||||
},
|
||||
debugger = { -- integrate with nvim dap + install dart code debugger
|
||||
enabled = false,
|
||||
run_via_dap = false, -- use dap instead of a plenary job to run flutter apps
|
||||
-- if empty dap will not stop on any exceptions, otherwise it will stop on those specified
|
||||
-- see |:help dap.set_exception_breakpoints()| for more info
|
||||
exception_breakpoints = {}
|
||||
},
|
||||
root_patterns = { ".git", "pubspec.yaml" }, -- patterns to find the root of your flutter project
|
||||
fvm = true, -- takes priority over path, uses <workspace>/.fvm/flutter_sdk if enabled
|
||||
widget_guides = {
|
||||
enabled = false,
|
||||
},
|
||||
closing_tags = {
|
||||
highlight = "Comment", -- highlight for the closing tag
|
||||
prefix = "//", -- character to use for close tag e.g. > Widget
|
||||
enabled = true -- set to false to disable
|
||||
},
|
||||
dev_log = {
|
||||
enabled = true,
|
||||
notify_errors = false, -- if there is an error whilst running then notify the user
|
||||
open_cmd = "tabedit", -- command to us
|
||||
},
|
||||
dev_tools = {
|
||||
autostart = false, -- autostart devtools server if not detected
|
||||
auto_open_browser = false, -- Automatically opens devtools in the browser
|
||||
},
|
||||
outline = {
|
||||
open_cmd = "30vnew", -- command to use to open the outline buffer
|
||||
auto_open = false -- if true this will open the outline automatically when it is first populated
|
||||
},
|
||||
lsp = {
|
||||
color = { -- show the derived colours for dart variables
|
||||
enabled = false, -- 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
|
||||
},
|
||||
--- OR you can specify a function to deactivate or change or control how the config is created
|
||||
capabilities = function(config)
|
||||
config.specificThingIDontWant = false
|
||||
return config
|
||||
end,
|
||||
-- see the link below for details on each option:
|
||||
-- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration
|
||||
settings = {
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
-- [[ Configure Flutter tools]]
|
||||
vim.keymap.set('n', '<leader>r', require('telescope').extensions.flutter.commands, { desc = 'Open command Flutter' })
|
||||
vim.keymap.set('n', '<leader>br', function()
|
||||
vim.cmd('20new')
|
||||
vim.cmd('te fvm flutter packages pub run build_runner build --delete-conflicting-outputs')
|
||||
vim.cmd('2sleep | normal G')
|
||||
end)
|
||||
-- '<Cmd>20new | te fvm flutter pub get && fvm flutter packages pub run build_runner build --delete-conflicting-outputs<CR> | $')
|
||||
end
|
||||
};
|
||||
36
lua/custom/plugins/formaters.lua
Normal file
36
lua/custom/plugins/formaters.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
'mhartington/formatter.nvim',
|
||||
config = function()
|
||||
vim.cmd([[
|
||||
augroup FormatAutogroup
|
||||
autocmd!
|
||||
autocmd BufWritePost * :silent FormatWrite
|
||||
augroup END
|
||||
]])
|
||||
local util = require "formatter.util"
|
||||
|
||||
local prettierd = require("formatter.defaults.prettierd")
|
||||
|
||||
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
||||
require("formatter").setup {
|
||||
-- Enable or disable logging
|
||||
logging = true,
|
||||
-- Set the log level
|
||||
log_level = vim.log.levels.WARN,
|
||||
-- All formatter configurations are opt-in
|
||||
filetype = {
|
||||
-- Formatter configurations for filetype "lua" go here
|
||||
-- and will be executed in order
|
||||
javascript = prettierd,
|
||||
typescript = prettierd,
|
||||
typescriptreact = prettierd,
|
||||
javascriptreact = prettierd,
|
||||
css = prettierd,
|
||||
json = prettierd,
|
||||
html = prettierd,
|
||||
graphql = prettierd,
|
||||
lua = require("formatter.filetypes.lua").stylua,
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
16
lua/custom/plugins/lsp.lua
Normal file
16
lua/custom/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
-- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Useful status updates for LSP
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
'folke/neodev.nvim',
|
||||
},
|
||||
};
|
||||
22
lua/custom/plugins/tests.lua
Normal file
22
lua/custom/plugins/tests.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"sidlatau/neotest-dart"
|
||||
},
|
||||
config = function()
|
||||
require('neotest').setup({
|
||||
adapters = {
|
||||
require('neotest-dart') {
|
||||
command = 'fvm flutter', -- Command being used to run tests. Defaults to `flutter`
|
||||
-- Change it to `fvm flutter` if using FVM
|
||||
-- change it to `dart` for Dart only tests
|
||||
use_lsp = true, -- When set Flutter outline information is used when constructing test name.
|
||||
-- Useful when using custom test names with @isTest annotation
|
||||
custom_test_method_names = {},
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
27
lua/custom/plugins/theme.lua
Normal file
27
lua/custom/plugins/theme.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
-- Theme inspired by Atom
|
||||
'navarasu/onedark.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme 'onedark'
|
||||
local onedark = require('onedark')
|
||||
onedark.setup {
|
||||
colors = {
|
||||
bright_orange = "#ff8800", -- define a new color
|
||||
green = '#00ffaa', -- redefine an existing color
|
||||
},
|
||||
highlights = {
|
||||
["@string"] = { fmt = 'bold,italic', fg = '$orange' },
|
||||
["@function"] = { sp = '$yellow' },
|
||||
["@function.builtin"] = { fg = '#0059ff' },
|
||||
["@parameter"] = { fg = '$cyan' },
|
||||
["@variable.builtin"] = { fg = '$cyan' },
|
||||
["@type.builtin"] = { fg = '#00ffff' },
|
||||
["@lsp.type.parameter"] = { fg = "$cyan" },
|
||||
["@lsp.typemod.function.defaultLibrary"] = { fg = "$yellow" }
|
||||
}
|
||||
}
|
||||
|
||||
onedark.load()
|
||||
end,
|
||||
};
|
||||
|
|
@ -296,5 +296,8 @@ return {
|
|||
}
|
||||
}
|
||||
}
|
||||
vim.keymap.set('n', '<leader>tt', '<Cmd>Neotree toggle<CR>', { desc = "Neo[T]ree [T]oggle" })
|
||||
vim.keymap.set('n', '<leader>tr', '<Cmd>Neotree reveal<CR>', { desc = "Neo[T]ree [R]eveal" })
|
||||
vim.keymap.set('n', '<leader>ts', '<Cmd>Neotree git_status<CR>', { desc = "Neo[T]ree git [S]tatus" })
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
}
|
||||
|
|
@ -39,6 +39,7 @@ return {
|
|||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
'delve',
|
||||
'dart',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue