This commit is contained in:
veypi
2024-12-02 16:57:34 +08:00
parent 7ff7f47104
commit f653915e23
7 changed files with 212 additions and 28 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ return {
write_all_buffers = false, -- write all buffers when the current one meets `condition`
noautocmd = false, -- do not execute autocmds when saving
lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
debounce_delay = 1000, -- delay after which a pending save is executed
debounce_delay = 10000, -- delay after which a pending save is executed
-- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable
debug = false,
}
+34
View File
@@ -0,0 +1,34 @@
#! /usr/bin/env lua
--
-- diff.lua
-- Copyright (C) 2024 veypi <i@veypi.com>
--
-- Distributed under terms of the GPL license.
--
return {
{
"echasnovski/mini.diff",
event = "VeryLazy",
keys = {
{
"<leader>go",
function()
require("mini.diff").toggle_overlay(0)
end,
desc = "Toggle mini.diff overlay",
},
},
opts = {
view = {
style = "sign",
signs = {
add = "",
change = "",
delete = "",
},
},
},
}
}
+57 -7
View File
@@ -1,8 +1,14 @@
-- http://www.lazyvim.org/extras/lang/vue
require("lspconfig").ts_ls.setup({
cmd = { "typescript-language-server", "--stdio" },
filetype = { "javascript" },
})
return {
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "vue", "css", "go", "gomod", "gowork", "gosum", "json5" } },
opts = { ensure_installed = { "vue", "css", "scss", "go", "gomod", "gowork", "gosum", "json5" } },
},
{
"williamboman/mason.nvim",
@@ -11,14 +17,17 @@ return {
"bash-language-server",
"css-lsp",
"html-lsp",
"typescript-language-server",
"vue-language-server",
"gopls",
"vtsls",
"typescript-language-server",
"gopls",
"helm-ls",
"json-lsp",
"marksman",
"goimports", "gofumpt", "gomodifytags", "impl", "delve"
"goimports",
"gofumpt",
"gomodifytags",
"impl",
"delve",
},
},
},
@@ -33,8 +42,49 @@ return {
},
},
},
tsserver = {
enabled = false,
},
ts_ls = {
enabled = false,
},
vtsls = {
filetypes = { "vue" }
enabled = false,
filetypes = {
"vue",
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
settings = {
complete_function_calls = true,
vtsls = {
enableMoveToFileCodeAction = true,
autoUseWorkspaceTsdk = true,
experimental = {
completion = {
enableServerSideFuzzyMatch = true,
},
},
},
typescript = {
updateImportsOnFileMove = { enabled = "always" },
suggest = {
completeFunctionCalls = true,
},
inlayHints = {
enumMemberValues = { enabled = true },
functionLikeReturnTypes = { enabled = false },
parameterNames = { enabled = false },
parameterTypes = { enabled = false },
propertyDeclarationTypes = { enabled = true },
variableTypes = { enabled = false },
},
},
},
},
},
},
@@ -52,5 +102,5 @@ return {
},
})
end,
}
},
}
+85
View File
@@ -0,0 +1,85 @@
#! /usr/bin/env lua
--
-- telescope.lua
-- Copyright (C) 2024 veypi <i@veypi.com>
--
-- Distributed under terms of the GPL license.
--
return {
"nvim-telescope/telescope.nvim",
opts = function()
local actions = require("telescope.actions")
local open_with_trouble = function(...)
return require("trouble.sources.telescope").open(...)
end
local find_files_no_ignore = function()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
LazyVim.pick("find_files", { no_ignore = true, default_text = line })()
end
local find_files_with_hidden = function()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
LazyVim.pick("find_files", { hidden = true, default_text = line })()
end
local function find_command()
if 1 == vim.fn.executable("rg") then
return { "rg", "--files", "--color", "never", "-g", "!.git" }
elseif 1 == vim.fn.executable("fd") then
return { "fd", "--type", "f", "--color", "never", "-E", ".git" }
elseif 1 == vim.fn.executable("fdfind") then
return { "fdfind", "--type", "f", "--color", "never", "-E", ".git" }
elseif 1 == vim.fn.executable("find") and vim.fn.has("win32") == 0 then
return { "find", ".", "-type", "f" }
elseif 1 == vim.fn.executable("where") then
return { "where", "/r", ".", "*" }
end
end
return {
defaults = {
file_ignore_patterns = { "public" },
prompt_prefix = "",
selection_caret = "",
-- open files in the first window that is an actual file.
-- use the current window if no other window is available.
get_selection_window = function()
local wins = vim.api.nvim_list_wins()
table.insert(wins, 1, vim.api.nvim_get_current_win())
for _, win in ipairs(wins) do
local buf = vim.api.nvim_win_get_buf(win)
if vim.bo[buf].buftype == "" then
return win
end
end
return 0
end,
mappings = {
i = {
["<c-t>"] = open_with_trouble,
["<a-t>"] = open_with_trouble,
["<a-i>"] = find_files_no_ignore,
["<a-h>"] = find_files_with_hidden,
["<C-Down>"] = actions.cycle_history_next,
["<C-Up>"] = actions.cycle_history_prev,
["<C-f>"] = actions.preview_scrolling_down,
["<C-b>"] = actions.preview_scrolling_up,
},
n = {
["q"] = actions.close,
},
},
},
pickers = {
find_files = {
find_command = find_command,
hidden = true,
},
},
}
end
}