chore: save config
This commit is contained in:
parent
cb2ff3574e
commit
59fa9c7d7f
125
init.lua
125
init.lua
|
@ -71,6 +71,7 @@ require('lazy').setup({
|
||||||
'tpope/vim-fugitive',
|
'tpope/vim-fugitive',
|
||||||
'tpope/vim-rhubarb',
|
'tpope/vim-rhubarb',
|
||||||
|
|
||||||
|
|
||||||
-- Detect tabstop and shiftwidth automatically
|
-- Detect tabstop and shiftwidth automatically
|
||||||
'tpope/vim-sleuth',
|
'tpope/vim-sleuth',
|
||||||
|
|
||||||
|
@ -149,35 +150,13 @@ require('lazy').setup({
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||||
-- See `:help indent_blankline.txt`
|
-- See `:help indent_blankline.txt`
|
||||||
opts = {
|
main = 'ibl',
|
||||||
char = '┊',
|
opts = {},
|
||||||
show_trailing_blankline_indent = false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
-- "gc" to comment visual regions/lines
|
-- "gc" to comment visual regions/lines
|
||||||
{ 'numToStr/Comment.nvim', opts = {} },
|
{ 'numToStr/Comment.nvim', opts = {} },
|
||||||
|
|
||||||
-- Fuzzy Finder (files, lsp, etc)
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
branch = '0.1.x',
|
|
||||||
dependencies = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
|
||||||
-- Only load if `make` is available. Make sure you have the system
|
|
||||||
-- requirements installed.
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope-fzf-native.nvim',
|
|
||||||
-- NOTE: If you are having trouble with this installation,
|
|
||||||
-- refer to the README for telescope-fzf-native for more instructions.
|
|
||||||
build = 'make',
|
|
||||||
cond = function()
|
|
||||||
return vim.fn.executable 'make' == 1
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
-- Highlight, edit, and navigate code
|
-- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
@ -239,7 +218,7 @@ vim.o.smartcase = true
|
||||||
vim.wo.signcolumn = 'yes'
|
vim.wo.signcolumn = 'yes'
|
||||||
|
|
||||||
-- Decrease update time
|
-- Decrease update time
|
||||||
vim.o.updatetime = 250
|
vim.o.updatetime = 100
|
||||||
vim.o.timeoutlen = 300
|
vim.o.timeoutlen = 300
|
||||||
|
|
||||||
-- Set completeopt to have a better completion experience
|
-- Set completeopt to have a better completion experience
|
||||||
|
@ -277,49 +256,18 @@ vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- [[ Configure Telescope ]]
|
vim.filetype.add({
|
||||||
-- See `:help telescope` and `:help telescope.setup()`
|
extension = {
|
||||||
require('telescope').setup {
|
arb = "json",
|
||||||
defaults = {
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
['<C-u>'] = false,
|
|
||||||
['<C-d>'] = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
-- Enable telescope fzf native, if installed
|
|
||||||
pcall(require('telescope').load_extension, 'fzf')
|
|
||||||
|
|
||||||
-- See `:help telescope.builtin`
|
|
||||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
|
|
||||||
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
|
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
|
||||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
|
||||||
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
|
||||||
winblend = 10,
|
|
||||||
previewer = false,
|
|
||||||
})
|
|
||||||
end, { desc = '[/] Fuzzily search in current buffer' })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
|
|
||||||
vim.keymap.set('n', '<leader>gs', require('telescope.builtin').git_status, { desc = 'Search [G]it [S]tatus' })
|
|
||||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
|
|
||||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
|
|
||||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
|
|
||||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
|
|
||||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
|
||||||
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
|
|
||||||
|
|
||||||
|
|
||||||
-- [[ Configure Treesitter ]]
|
-- [[ Configure Treesitter ]]
|
||||||
-- See `:help nvim-treesitter`
|
-- See `:help nvim-treesitter`
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
-- Add languages to be installed here that you want installed for treesitter
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim',
|
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim',
|
||||||
'dart', 'prisma', 'graphql' },
|
'dart', 'prisma', 'graphql', 'json' },
|
||||||
|
|
||||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||||
auto_install = false,
|
auto_install = false,
|
||||||
|
@ -396,6 +344,7 @@ vim.keymap.set("n", "<leader>n", '<Cmd>bnext<CR>', { desc = "[N]ext buffer" })
|
||||||
vim.keymap.set("n", "<leader>p", '<Cmd>bprevious<CR>', { desc = "[P]revious buffer" })
|
vim.keymap.set("n", "<leader>p", '<Cmd>bprevious<CR>', { desc = "[P]revious buffer" })
|
||||||
vim.keymap.set("n", "<leader>d", '<Cmd>bdelete<CR>', { desc = "[D]elete buffer" })
|
vim.keymap.set("n", "<leader>d", '<Cmd>bdelete<CR>', { desc = "[D]elete buffer" })
|
||||||
vim.keymap.set("n", "<leader>ot", "<Cmd>20split | te<CR>", { desc = "[O]pen [T]erminal below" })
|
vim.keymap.set("n", "<leader>ot", "<Cmd>20split | te<CR>", { desc = "[O]pen [T]erminal below" })
|
||||||
|
vim.keymap.set("n", "<leader>vs", "<Cmd>vs<CR>", { desc = "[V]ertical [S]plit" })
|
||||||
|
|
||||||
-- Save file
|
-- Save file
|
||||||
vim.keymap.set("n", "<leader>s", '<Cmd>w<CR>', { desc = "[S]ave file" })
|
vim.keymap.set("n", "<leader>s", '<Cmd>w<CR>', { desc = "[S]ave file" })
|
||||||
|
@ -462,6 +411,7 @@ local servers = {
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
prismals = {},
|
prismals = {},
|
||||||
graphql = {},
|
graphql = {},
|
||||||
|
clangd = {},
|
||||||
-- prettierd = {},
|
-- prettierd = {},
|
||||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} }
|
-- html = { filetypes = { 'html', 'twig', 'hbs'} }
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
|
@ -519,6 +469,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
|
||||||
-- Ensure the servers above are installed
|
-- Ensure the servers above are installed
|
||||||
local mason_lspconfig = require 'mason-lspconfig'
|
local mason_lspconfig = require 'mason-lspconfig'
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
mason_lspconfig.setup {
|
mason_lspconfig.setup {
|
||||||
ensure_installed = vim.tbl_keys(servers),
|
ensure_installed = vim.tbl_keys(servers),
|
||||||
|
@ -526,7 +477,7 @@ mason_lspconfig.setup {
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers {
|
mason_lspconfig.setup_handlers {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require('lspconfig')[server_name].setup {
|
lspconfig[server_name].setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = servers[server_name],
|
settings = servers[server_name],
|
||||||
|
@ -535,32 +486,26 @@ mason_lspconfig.setup_handlers {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-- Setup language servers.
|
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
lspconfig.dartls.setup({
|
-- lspconfig.dartls.setup({
|
||||||
cmd = { "dart", "language-server", "--protocol=lsp" },
|
-- cmd = { "dart", "language-server", "--protocol=lsp" },
|
||||||
filetypes = { "dart" },
|
-- filetypes = { "dart" },
|
||||||
init_options = {
|
-- init_options = {
|
||||||
closingLabels = true,
|
-- closingLabels = true,
|
||||||
flutterOutline = true,
|
-- flutterOutline = true,
|
||||||
onlyAnalyzeProjectsWithOpenFiles = true,
|
-- onlyAnalyzeProjectsWithOpenFiles = true,
|
||||||
outline = true,
|
-- outline = true,
|
||||||
suggestFromUnimportedLibraries = true,
|
-- suggestFromUnimportedLibraries = true,
|
||||||
},
|
-- },
|
||||||
capabilities = capabilities,
|
-- capabilities = capabilities,
|
||||||
-- root_dir = root_pattern("pubspec.yaml"),
|
-- -- root_dir = root_pattern("pubspec.yaml"),
|
||||||
settings = {
|
-- settings = {
|
||||||
dart = {
|
-- dart = {
|
||||||
completeFunctionCalls = true,
|
-- completeFunctionCalls = true,
|
||||||
showTodos = true,
|
-- showTodos = true,
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
})
|
-- })
|
||||||
|
|
||||||
require("telescope").load_extension("flutter")
|
|
||||||
|
|
||||||
-- [[ Configure nvim-cmp ]]
|
-- [[ Configure nvim-cmp ]]
|
||||||
-- See `:help cmp`
|
-- See `:help cmp`
|
||||||
|
@ -576,10 +521,13 @@ cmp.setup {
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
completion = {
|
||||||
|
completeopt = 'menu,menuone,noinsert',
|
||||||
|
},
|
||||||
mapping = cmp.mapping.preset.insert {
|
mapping = cmp.mapping.preset.insert {
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete {},
|
['<C-Space>'] = cmp.mapping.complete {},
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
['<CR>'] = cmp.mapping.confirm {
|
||||||
|
@ -608,6 +556,7 @@ cmp.setup {
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
return {
|
||||||
|
"asiryk/auto-hlsearch.nvim",
|
||||||
|
dependencies = { "asiryk/auto-hlsearch.nvim", tag = "1.1.0" },
|
||||||
|
config = function()
|
||||||
|
require("auto-hlsearch").setup()
|
||||||
|
end,
|
||||||
|
}
|
|
@ -3,6 +3,8 @@ return {
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.copilot_no_tab_map = true
|
vim.g.copilot_no_tab_map = true
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CopilotSuggestion", { fg = "#83a598", italic = true })
|
||||||
|
vim.api.nvim_set_hl(0, "CopilotAnnotation", { fg = "#83a598", italic = true })
|
||||||
vim.keymap.set("i", "<C-x>", 'copilot#Accept("")', {
|
vim.keymap.set("i", "<C-x>", 'copilot#Accept("")', {
|
||||||
expr = true,
|
expr = true,
|
||||||
silent = true,
|
silent = true,
|
||||||
|
|
|
@ -71,13 +71,14 @@ return {
|
||||||
config.specificThingIDontWant = false
|
config.specificThingIDontWant = false
|
||||||
return config
|
return config
|
||||||
end,
|
end,
|
||||||
|
analysisExcludedFolders = { "./fvm/" },
|
||||||
-- see the link below for details on each option:
|
-- 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
|
-- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration
|
||||||
settings = {
|
settings = {
|
||||||
showTodos = true,
|
showTodos = true,
|
||||||
completeFunctionCalls = true,
|
completeFunctionCalls = true,
|
||||||
renameFilesWithClasses = "prompt", -- "always"
|
renameFilesWithClasses = "prompt", -- "always"
|
||||||
enableSnippets = true,
|
-- enableSnippets = true,
|
||||||
updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command.
|
updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,6 +90,11 @@ return {
|
||||||
vim.cmd('te fvm flutter packages pub run build_runner build --delete-conflicting-outputs')
|
vim.cmd('te fvm flutter packages pub run build_runner build --delete-conflicting-outputs')
|
||||||
vim.cmd('2sleep | normal G')
|
vim.cmd('2sleep | normal G')
|
||||||
end)
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>bt', function()
|
||||||
|
vim.cmd('20new')
|
||||||
|
vim.cmd('te sh scripts/create_clean_lcov_and_generate_html.sh')
|
||||||
|
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> | $')
|
-- '<Cmd>20new | te fvm flutter pub get && fvm flutter packages pub run build_runner build --delete-conflicting-outputs<CR> | $')
|
||||||
end
|
end
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
return {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
tag = '0.1.5',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||||
|
-- Only load if `make` is available. Make sure you have the system
|
||||||
|
-- requirements installed.
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
|
-- NOTE: If you are having trouble with this installation,
|
||||||
|
-- refer to the README for telescope-fzf-native for more instructions.
|
||||||
|
build = 'make',
|
||||||
|
cond = function()
|
||||||
|
return vim.fn.executable 'make' == 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('telescope').setup {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
['<C-u>'] = false,
|
||||||
|
['<C-d>'] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Enable telescope fzf native, if installed
|
||||||
|
pcall(require('telescope').load_extension, 'fzf')
|
||||||
|
pcall(require('telescope').load_extension, 'flutter')
|
||||||
|
|
||||||
|
-- See `:help telescope.builtin`
|
||||||
|
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
|
||||||
|
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
|
||||||
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
|
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||||
|
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
||||||
|
winblend = 10,
|
||||||
|
previewer = false,
|
||||||
|
})
|
||||||
|
end, { desc = '[/] Fuzzily search in current buffer' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
|
||||||
|
vim.keymap.set('n', '<leader>gs', require('telescope.builtin').git_status, { desc = 'Search [G]it [S]tatus' })
|
||||||
|
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
|
||||||
|
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
|
||||||
|
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
|
||||||
|
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
|
||||||
|
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||||
|
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
|
||||||
|
end
|
||||||
|
}
|
|
@ -18,5 +18,19 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local neotest = require('neotest')
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>tu', function()
|
||||||
|
neotest.summary.toggle()
|
||||||
|
end, { desc = 'Test: [T]oggle [S]ummary unit tests' })
|
||||||
|
vim.keymap.set('n', '<leader>to', function()
|
||||||
|
neotest.output.open()
|
||||||
|
end, { desc = 'Test: [T]oggle [O]utput' })
|
||||||
|
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>rt', function()
|
||||||
|
neotest.run.run()
|
||||||
|
end, { desc = 'Test: [R]un [T]ests' })
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ return {
|
||||||
commands = {},
|
commands = {},
|
||||||
window = {
|
window = {
|
||||||
position = "left",
|
position = "left",
|
||||||
width = 40,
|
width = 60,
|
||||||
mapping_options = {
|
mapping_options = {
|
||||||
noremap = true,
|
noremap = true,
|
||||||
nowait = true,
|
nowait = true,
|
||||||
|
|
|
@ -53,6 +53,7 @@ return {
|
||||||
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||||
end, { desc = 'Debug: Set Breakpoint' })
|
end, { desc = 'Debug: Set Breakpoint' })
|
||||||
|
|
||||||
|
|
||||||
-- Dap UI setup
|
-- Dap UI setup
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
-- For more information, see |:help nvim-dap-ui|
|
||||||
dapui.setup {
|
dapui.setup {
|
||||||
|
|
|
@ -8,3 +8,7 @@
|
||||||
#
|
#
|
||||||
snippet tmt "Theme textTheme"
|
snippet tmt "Theme textTheme"
|
||||||
Theme.of(context).textTheme.$1
|
Theme.of(context).textTheme.$1
|
||||||
|
snippet phr "AppLocalizations"
|
||||||
|
AppLocalizations.of(context)!.$1
|
||||||
|
snippet imploc "Import AppLocalizations"
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
Loading…
Reference in New Issue