(neovim) another try of my own setup
This commit is contained in:
parent
50e0f23feb
commit
7225cf3967
54 changed files with 677 additions and 586 deletions
|
@ -1,2 +0,0 @@
|
|||
require("config")
|
||||
require("core")
|
|
@ -1,20 +0,0 @@
|
|||
return {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" },
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = {
|
||||
"vim",
|
||||
"Snacks",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = vim.tbl_deep_extend("force", {}, vim.lsp.protocol.make_client_capabilities(), {
|
||||
fileOperations = {
|
||||
didRename = true,
|
||||
willRename = true,
|
||||
},
|
||||
}),
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
cmd = { "terraform-ls", "serve" },
|
||||
filetypes = { "terraform", "hcl" },
|
||||
root_markers = { ".terraform", ".git" },
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
-- don't auto comment new line
|
||||
vim.api.nvim_create_autocmd("BufEnter", { command = [[set formatoptions-=cro]] })
|
||||
|
||||
-- resize neovim split when terminal is resized
|
||||
vim.api.nvim_command("autocmd VimResized * wincmd =")
|
||||
|
||||
-- enable spell for text files
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("spell", { clear = true }),
|
||||
pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.api.nvim_set_hl(0, "SpellBad", { bg = "#770000", fg = "#ffffff" })
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- set some colors
|
||||
vim.api.nvim_create_autocmd({ "BufReadPre" }, {
|
||||
callback = function()
|
||||
vim.api.nvim_set_hl(0, "ColorColumn", { bg = "#770000" })
|
||||
vim.api.nvim_set_hl(0, "DiffChange", { bg = "NONE", fg = "#e7c547" })
|
||||
vim.api.nvim_set_hl(0, "DiffText", { bg = "NONE", fg = "#ff8700" })
|
||||
vim.api.nvim_set_hl(0, "Visual", { bg = "#0094d8", fg = "#ffffff" })
|
||||
end,
|
||||
})
|
||||
|
||||
-- fix dimmed elements in Snacks.picker
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
Snacks.util.set_hl({
|
||||
PickerDir = { link = "Text" },
|
||||
PickerPathHidden = { link = "Text" },
|
||||
PickerPathIgnored = { link = "Comment" },
|
||||
PickerGitStatusUntracked = { link = "Special" },
|
||||
}, { prefix = "Snacks" })
|
||||
end,
|
||||
})
|
||||
|
||||
-- remember last location
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
group = vim.api.nvim_create_augroup("last-loc", { clear = true }),
|
||||
callback = function(event)
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = event.buf
|
||||
if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].my_last_loc then
|
||||
return
|
||||
end
|
||||
vim.b[buf].my_last_loc = true
|
||||
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(buf)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- lsp
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc)
|
||||
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc })
|
||||
end
|
||||
map("<leader>cd", vim.diagnostic.open_float, "diagnostic (float)")
|
||||
map("<leader>ch", vim.lsp.buf.hover, "help")
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "actions")
|
||||
map("<leader>cf", vim.lsp.buf.format, "format file")
|
||||
local function client_supports_method(client, method, bufnr)
|
||||
if vim.fn.has("nvim-0.11") == 1 then
|
||||
return client:supports_method(method, bufnr)
|
||||
else
|
||||
return client.supports_method(method, { bufnr = bufnr })
|
||||
end
|
||||
end
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if
|
||||
client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf)
|
||||
then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "lsp-highlight", buffer = event2.buf })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -1,3 +0,0 @@
|
|||
require("config.settings")
|
||||
require("config.keymaps")
|
||||
require("config.autocmds")
|
|
@ -1,3 +0,0 @@
|
|||
require("core.lazy")
|
||||
require("core.lsp")
|
||||
require("core.mason-path")
|
|
@ -1,49 +0,0 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
lazy = true,
|
||||
},
|
||||
install = {
|
||||
missing = true,
|
||||
},
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = true,
|
||||
},
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = true,
|
||||
},
|
||||
ui = {
|
||||
-- border = "rounded"
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
|
@ -1,274 +0,0 @@
|
|||
vim.lsp.enable({
|
||||
"lua",
|
||||
"terraform",
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = true,
|
||||
-- virtual_text = true,
|
||||
underline = false,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = "rounded",
|
||||
source = false,
|
||||
},
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
numhl = {
|
||||
[vim.diagnostic.severity.ERROR] = "ErrorMsg",
|
||||
[vim.diagnostic.severity.WARN] = "WarningMsg",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Extras
|
||||
|
||||
local function restart_lsp(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||
|
||||
for _, client in ipairs(clients) do
|
||||
vim.lsp.stop_client(client.id)
|
||||
end
|
||||
|
||||
vim.defer_fn(function()
|
||||
vim.cmd("edit")
|
||||
end, 100)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("LspRestart", function()
|
||||
restart_lsp()
|
||||
end, {})
|
||||
|
||||
local function lsp_status()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||
|
||||
if #clients == 0 then
|
||||
print(" No LSP clients attached")
|
||||
return
|
||||
end
|
||||
|
||||
print(" LSP Status for buffer " .. bufnr .. ":")
|
||||
print("─────────────────────────────────")
|
||||
|
||||
for i, client in ipairs(clients) do
|
||||
print(string.format(" Client %d: %s (ID: %d)", i, client.name, client.id))
|
||||
print(" Root: " .. (client.config.root_dir or "N/A"))
|
||||
print(" Filetypes: " .. table.concat(client.config.filetypes or {}, ", "))
|
||||
|
||||
-- Check capabilities
|
||||
local caps = client.server_capabilities
|
||||
local features = {}
|
||||
if caps.completionProvider then
|
||||
table.insert(features, "completion")
|
||||
end
|
||||
if caps.hoverProvider then
|
||||
table.insert(features, "hover")
|
||||
end
|
||||
if caps.definitionProvider then
|
||||
table.insert(features, "definition")
|
||||
end
|
||||
if caps.referencesProvider then
|
||||
table.insert(features, "references")
|
||||
end
|
||||
if caps.renameProvider then
|
||||
table.insert(features, "rename")
|
||||
end
|
||||
if caps.codeActionProvider then
|
||||
table.insert(features, "code_action")
|
||||
end
|
||||
if caps.documentFormattingProvider then
|
||||
table.insert(features, "formatting")
|
||||
end
|
||||
|
||||
print(" Features: " .. table.concat(features, ", "))
|
||||
print("")
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("LspStatus", lsp_status, { desc = "Show detailed LSP status" })
|
||||
|
||||
local function check_lsp_capabilities()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||
|
||||
if #clients == 0 then
|
||||
print("No LSP clients attached")
|
||||
return
|
||||
end
|
||||
|
||||
for _, client in ipairs(clients) do
|
||||
print("Capabilities for " .. client.name .. ":")
|
||||
local caps = client.server_capabilities
|
||||
|
||||
local capability_list = {
|
||||
{ "Completion", caps.completionProvider },
|
||||
{ "Hover", caps.hoverProvider },
|
||||
{ "Signature Help", caps.signatureHelpProvider },
|
||||
{ "Go to Definition", caps.definitionProvider },
|
||||
{ "Go to Declaration", caps.declarationProvider },
|
||||
{ "Go to Implementation", caps.implementationProvider },
|
||||
{ "Go to Type Definition", caps.typeDefinitionProvider },
|
||||
{ "Find References", caps.referencesProvider },
|
||||
{ "Document Highlight", caps.documentHighlightProvider },
|
||||
{ "Document Symbol", caps.documentSymbolProvider },
|
||||
{ "Workspace Symbol", caps.workspaceSymbolProvider },
|
||||
{ "Code Action", caps.codeActionProvider },
|
||||
{ "Code Lens", caps.codeLensProvider },
|
||||
{ "Document Formatting", caps.documentFormattingProvider },
|
||||
{ "Document Range Formatting", caps.documentRangeFormattingProvider },
|
||||
{ "Rename", caps.renameProvider },
|
||||
{ "Folding Range", caps.foldingRangeProvider },
|
||||
{ "Selection Range", caps.selectionRangeProvider },
|
||||
}
|
||||
|
||||
for _, cap in ipairs(capability_list) do
|
||||
local status = cap[2] and "✓" or "✗"
|
||||
print(string.format(" %s %s", status, cap[1]))
|
||||
end
|
||||
print("")
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("LspCapabilities", check_lsp_capabilities, { desc = "Show LSP capabilities" })
|
||||
|
||||
local function lsp_diagnostics_info()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local diagnostics = vim.diagnostic.get(bufnr)
|
||||
|
||||
local counts = { ERROR = 0, WARN = 0, INFO = 0, HINT = 0 }
|
||||
|
||||
for _, diagnostic in ipairs(diagnostics) do
|
||||
local severity = vim.diagnostic.severity[diagnostic.severity]
|
||||
counts[severity] = counts[severity] + 1
|
||||
end
|
||||
|
||||
print(" Diagnostics for current buffer:")
|
||||
print(" Errors: " .. counts.ERROR)
|
||||
print(" Warnings: " .. counts.WARN)
|
||||
print(" Info: " .. counts.INFO)
|
||||
print(" Hints: " .. counts.HINT)
|
||||
print(" Total: " .. #diagnostics)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("LspDiagnostics", lsp_diagnostics_info, { desc = "Show LSP diagnostics count" })
|
||||
|
||||
local function lsp_info()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||
|
||||
print("═══════════════════════════════════")
|
||||
print(" LSP INFORMATION ")
|
||||
print("═══════════════════════════════════")
|
||||
print("")
|
||||
|
||||
-- Basic info
|
||||
print(" Language client log: " .. vim.lsp.get_log_path())
|
||||
print(" Detected filetype: " .. vim.bo.filetype)
|
||||
print(" Buffer: " .. bufnr)
|
||||
print(" Root directory: " .. (vim.fn.getcwd() or "N/A"))
|
||||
print("")
|
||||
|
||||
if #clients == 0 then
|
||||
print(" No LSP clients attached to buffer " .. bufnr)
|
||||
print("")
|
||||
print("Possible reasons:")
|
||||
print(" • No language server installed for " .. vim.bo.filetype)
|
||||
print(" • Language server not configured")
|
||||
print(" • Not in a project root directory")
|
||||
print(" • File type not recognized")
|
||||
return
|
||||
end
|
||||
|
||||
print(" LSP clients attached to buffer " .. bufnr .. ":")
|
||||
print("─────────────────────────────────")
|
||||
|
||||
for i, client in ipairs(clients) do
|
||||
print(string.format(" Client %d: %s", i, client.name))
|
||||
print(" ID: " .. client.id)
|
||||
print(" Root dir: " .. (client.config.root_dir or "Not set"))
|
||||
print(" Command: " .. table.concat(client.config.cmd or {}, " "))
|
||||
print(" Filetypes: " .. table.concat(client.config.filetypes or {}, ", "))
|
||||
|
||||
-- Server status
|
||||
if client.is_stopped() then
|
||||
print(" Status: Stopped")
|
||||
else
|
||||
print(" Status: Running")
|
||||
end
|
||||
|
||||
-- Workspace folders
|
||||
if client.workspace_folders and #client.workspace_folders > 0 then
|
||||
print(" Workspace folders:")
|
||||
for _, folder in ipairs(client.workspace_folders) do
|
||||
print(" • " .. folder.name)
|
||||
end
|
||||
end
|
||||
|
||||
-- Attached buffers count
|
||||
local attached_buffers = {}
|
||||
for buf, _ in pairs(client.attached_buffers or {}) do
|
||||
table.insert(attached_buffers, buf)
|
||||
end
|
||||
print(" Attached buffers: " .. #attached_buffers)
|
||||
|
||||
-- Key capabilities
|
||||
local caps = client.server_capabilities
|
||||
local key_features = {}
|
||||
if caps.completionProvider then
|
||||
table.insert(key_features, "completion")
|
||||
end
|
||||
if caps.hoverProvider then
|
||||
table.insert(key_features, "hover")
|
||||
end
|
||||
if caps.definitionProvider then
|
||||
table.insert(key_features, "definition")
|
||||
end
|
||||
if caps.documentFormattingProvider then
|
||||
table.insert(key_features, "formatting")
|
||||
end
|
||||
if caps.codeActionProvider then
|
||||
table.insert(key_features, "code_action")
|
||||
end
|
||||
|
||||
if #key_features > 0 then
|
||||
print(" Key features: " .. table.concat(key_features, ", "))
|
||||
end
|
||||
|
||||
print("")
|
||||
end
|
||||
|
||||
-- Diagnostics summary
|
||||
local diagnostics = vim.diagnostic.get(bufnr)
|
||||
if #diagnostics > 0 then
|
||||
print(" Diagnostics Summary:")
|
||||
local counts = { ERROR = 0, WARN = 0, INFO = 0, HINT = 0 }
|
||||
|
||||
for _, diagnostic in ipairs(diagnostics) do
|
||||
local severity = vim.diagnostic.severity[diagnostic.severity]
|
||||
counts[severity] = counts[severity] + 1
|
||||
end
|
||||
|
||||
print(" Errors: " .. counts.ERROR)
|
||||
print(" Warnings: " .. counts.WARN)
|
||||
print(" Info: " .. counts.INFO)
|
||||
print(" Hints: " .. counts.HINT)
|
||||
print(" Total: " .. #diagnostics)
|
||||
else
|
||||
print(" No diagnostics")
|
||||
end
|
||||
|
||||
print("")
|
||||
print("Use :LspLog to view detailed logs")
|
||||
print("Use :LspCapabilities for full capability list")
|
||||
end
|
||||
|
||||
-- Create command
|
||||
vim.api.nvim_create_user_command("LspInfo", lsp_info, { desc = "Show comprehensive LSP information" })
|
|
@ -1,25 +0,0 @@
|
|||
local mason_bin = vim.fn.stdpath("data") .. "/mason/bin"
|
||||
local current_path = vim.env.PATH or ""
|
||||
|
||||
-- Remove any existing Mason bin entries to prevent duplicates
|
||||
local path_entries = vim.split(current_path, ":")
|
||||
local clean_path_entries = {}
|
||||
local seen = {}
|
||||
|
||||
for _, entry in ipairs(path_entries) do
|
||||
-- Skip Mason bin entries and duplicates
|
||||
if entry ~= mason_bin and entry ~= "" and not seen[entry] then
|
||||
seen[entry] = true
|
||||
table.insert(clean_path_entries, entry)
|
||||
end
|
||||
end
|
||||
|
||||
-- Add Mason bin directory at the beginning
|
||||
local new_path = mason_bin .. ":" .. table.concat(clean_path_entries, ":")
|
||||
vim.env.PATH = new_path
|
||||
|
||||
-- Verify Mason bin directory exists
|
||||
if vim.fn.isdirectory(mason_bin) == 0 then
|
||||
-- Mason not installed yet, create placeholder
|
||||
vim.fn.mkdir(mason_bin, "p")
|
||||
end
|
|
@ -1,61 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
event = "InsertEnter",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("blink.cmp").setup({
|
||||
snippets = { preset = "luasnip" },
|
||||
signature = { enabled = true },
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = false,
|
||||
nerd_font_variant = "normal",
|
||||
},
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
providers = {
|
||||
cmdline = {
|
||||
min_keyword_length = 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
["<Tab>"] = { "accept", "fallback" },
|
||||
},
|
||||
cmdline = {
|
||||
enabled = false,
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
border = nil,
|
||||
scrolloff = 1,
|
||||
scrollbar = false,
|
||||
draw = {
|
||||
columns = {
|
||||
{ "kind_icon" },
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "kind" },
|
||||
{ "source_name" },
|
||||
},
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
window = {
|
||||
border = nil,
|
||||
scrollbar = false,
|
||||
winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,EndOfBuffer:BlinkCmpDoc",
|
||||
},
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
terraform = { "terraform_fmt" },
|
||||
tf = { "terraform_fmt" },
|
||||
["terraform-vars"] = { "terraform_fmt" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "powerline",
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = {
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
info = " ",
|
||||
hint = " ",
|
||||
},
|
||||
},
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ "filename", file_status = true, path = 1 },
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"lsp_status",
|
||||
symbols = {
|
||||
spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
|
||||
done = "✓",
|
||||
separator = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "searchcount" },
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
||||
{ "location", padding = { left = 0, right = 1 } },
|
||||
},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = { "buffers" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
lazy = false,
|
||||
cmd = "Mason",
|
||||
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
|
||||
build = ":MasonUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua-language-server",
|
||||
"terraform-ls",
|
||||
"stylua",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason").setup(opts)
|
||||
local mr = require("mason-registry")
|
||||
local function ensure_installed()
|
||||
for _, tool in ipairs(opts.ensure_installed) do
|
||||
if mr.has_package(tool) then
|
||||
local p = mr.get_package(tool)
|
||||
if not p:is_installed() then
|
||||
vim.notify("Mason: Installing " .. tool .. "...", vim.log.levels.INFO)
|
||||
p:install():once("closed", function()
|
||||
if p:is_installed() then
|
||||
vim.notify("Mason: Successfully installed " .. tool, vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify("Mason: Failed to install " .. tool, vim.log.levels.ERROR)
|
||||
end
|
||||
end)
|
||||
end
|
||||
else
|
||||
vim.notify("Mason: Package '" .. tool .. "' not found", vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if mr.refresh then
|
||||
mr.refresh(ensure_installed)
|
||||
else
|
||||
ensure_installed()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
return {
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("mini.pairs").setup({
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
skip_ts = { "string" },
|
||||
skip_unbalanced = true,
|
||||
markdown = true,
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
return {
|
||||
"loctvl842/monokai-pro.nvim",
|
||||
priority = 10000,
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("monokai-pro").setup({
|
||||
filter = "classic",
|
||||
})
|
||||
vim.cmd.colorscheme("monokai-pro")
|
||||
end,
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
messages = {
|
||||
view_search = false,
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"diff",
|
||||
"gotmpl",
|
||||
"hcl",
|
||||
"helm",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"regex",
|
||||
"terraform",
|
||||
"vim",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("which-key").setup({
|
||||
preset = "helix",
|
||||
delay = 300,
|
||||
icons = {
|
||||
rules = false,
|
||||
breadcrumb = " ",
|
||||
separator = " ",
|
||||
group = " ",
|
||||
},
|
||||
plugins = {
|
||||
spelling = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
win = {
|
||||
height = {
|
||||
max = math.huge,
|
||||
},
|
||||
},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{ "<leader>b", group = "buffer" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>f", group = "find" },
|
||||
{ "<leader>h", group = "history" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
8
_saved/vim/lazyvim/.gitignore
vendored
Normal file
8
_saved/vim/lazyvim/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
15
_saved/vim/lazyvim/.neoconf.json
Normal file
15
_saved/vim/lazyvim/.neoconf.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
201
_saved/vim/lazyvim/LICENSE
Normal file
201
_saved/vim/lazyvim/LICENSE
Normal file
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
4
_saved/vim/lazyvim/README.md
Normal file
4
_saved/vim/lazyvim/README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# 💤 LazyVim
|
||||
|
||||
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
|
||||
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
|
2
_saved/vim/lazyvim/init.lua
Normal file
2
_saved/vim/lazyvim/init.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
3
_saved/vim/lazyvim/linters/global.markdownlint-cli2.yaml
Normal file
3
_saved/vim/lazyvim/linters/global.markdownlint-cli2.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
config:
|
||||
MD004: false
|
||||
MD013: false
|
37
_saved/vim/lazyvim/lua/config/autocmds.lua
Normal file
37
_saved/vim/lazyvim/lua/config/autocmds.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
-- don't auto comment new line
|
||||
vim.api.nvim_create_autocmd("BufEnter", { command = [[set formatoptions-=cro]] })
|
||||
|
||||
-- resize neovim split when terminal is resized
|
||||
vim.api.nvim_command("autocmd VimResized * wincmd =")
|
||||
|
||||
-- enable spell for text files
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("spell", { clear = true }),
|
||||
pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- set some colors
|
||||
vim.api.nvim_create_autocmd({ "BufReadPre" }, {
|
||||
callback = function()
|
||||
vim.api.nvim_set_hl(0, "ColorColumn", { bg = "#770000" })
|
||||
vim.api.nvim_set_hl(0, "DiffChange", { bg = "NONE", fg = "#e7c547" })
|
||||
vim.api.nvim_set_hl(0, "DiffText", { bg = "NONE", fg = "#ff8700" })
|
||||
vim.api.nvim_set_hl(0, "Visual", { bg = "#0094d8", fg = "#ffffff" })
|
||||
end,
|
||||
})
|
||||
|
||||
-- fix dimmed elements in Snacks.picker
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
Snacks.util.set_hl({
|
||||
PickerDir = { link = "Text" },
|
||||
PickerPathHidden = { link = "Text" },
|
||||
PickerPathIgnored = { link = "Comment" },
|
||||
PickerGitStatusUntracked = { link = "Special" },
|
||||
}, { prefix = "Snacks" })
|
||||
end,
|
||||
})
|
|
@ -1,25 +1,62 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
|
||||
local map = vim.keymap.set
|
||||
local nomap = vim.keymap.del
|
||||
|
||||
nomap("n", "<leader><space>")
|
||||
nomap("n", "<leader>,")
|
||||
nomap("n", "<leader>.")
|
||||
nomap("n", "<leader>?")
|
||||
nomap("n", "<leader>K")
|
||||
nomap("n", "<leader>l")
|
||||
nomap("n", "<leader>L")
|
||||
nomap("n", "<leader>S")
|
||||
nomap("n", "<leader>`")
|
||||
|
||||
nomap("n", "<leader>bb")
|
||||
nomap("n", "<leader>bD")
|
||||
nomap("n", "<leader>bo")
|
||||
|
||||
nomap("n", "<leader>E")
|
||||
|
||||
nomap("n", "<leader>fb")
|
||||
nomap("n", "<leader>fc")
|
||||
nomap("n", "<leader>fF")
|
||||
nomap("n", "<leader>fr")
|
||||
|
||||
nomap("n", "<leader>fB")
|
||||
nomap("n", "<leader>fe")
|
||||
nomap("n", "<leader>fE")
|
||||
nomap("n", "<leader>fn")
|
||||
nomap("n", "<leader>fp")
|
||||
nomap("n", "<leader>fR")
|
||||
nomap("n", "<leader>ft")
|
||||
nomap("n", "<leader>fT")
|
||||
|
||||
nomap("n", "<leader>gY")
|
||||
nomap("n", "<leader>gS")
|
||||
|
||||
nomap("n", "<leader>qq")
|
||||
|
||||
nomap("n", "<leader>xl")
|
||||
nomap("n", "<leader>xq")
|
||||
|
||||
map("i", "<C-a>", "<esc>I")
|
||||
map("i", "<C-e>", "<esc>A")
|
||||
|
||||
map("v", "<leader>/", "gc", { desc = "toggle comments", remap = true })
|
||||
|
||||
map("n", "<esc><cr>", "<cmd>wqa<cr>", { desc = "save and exit", remap = true })
|
||||
map("n", "<esc><esc><cr>", "<cmd>wqa<cr>", { desc = "save and exit", remap = true })
|
||||
map("n", "<tab>", "<C-w>w", { desc = "switch pane", remap = true })
|
||||
map("n", "<esc><cr>", "<esc><cmd>wq!<cr>", { desc = "Save and Exit", remap = true })
|
||||
map("n", "<tab>", "<C-w>w", { desc = "Switch Pane", remap = true })
|
||||
|
||||
map("n", "+", ":vertical resize +5<CR>")
|
||||
map("n", "_", ":vertical resize -5<CR>")
|
||||
map("n", "=", ":resize +5<CR>")
|
||||
map("n", "-", ":resize -5<CR>")
|
||||
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "split horizontally", remap = true })
|
||||
map("n", "<leader>/", "gcc", { desc = "toggle comments", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "split vertically", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split Horizontally", remap = true })
|
||||
map("n", "<leader>/", "gcc", { desc = "Toggle Comments", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split Vertically", remap = true })
|
||||
|
||||
map("n", "<leader>b[", "<cmd>bprevious<CR>", { desc = "buffer previous", remap = true })
|
||||
map("n", "<leader>b]", "<cmd>bnext<CR>", { desc = "buffer next", remap = true })
|
||||
|
@ -33,7 +70,7 @@ map("n", "<leader>bn", "<cmd>enew<CR>", { desc = "buffer create", remap = true }
|
|||
|
||||
map("n", "<leader>e", function()
|
||||
Snacks.explorer()
|
||||
end, { desc = "explorer", remap = true })
|
||||
end, { desc = "Explorer", remap = true })
|
||||
map("n", "<leader>s", "<cmd>set hlsearch!<cr>", { desc = "toggle hlsearch", remap = true })
|
||||
|
||||
map("n", "<leader>ff", function()
|
||||
|
@ -51,12 +88,6 @@ map("n", "<leader>hs", function()
|
|||
Snacks.picker.search_history()
|
||||
end, { desc = "search", remap = true })
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>m",
|
||||
'<cmd>execute "set colorcolumn=" . (&colorcolumn == "" ? "80,120" : "")<cr>',
|
||||
{ desc = "toggle columns" }
|
||||
)
|
||||
map("n", "<leader>n", function()
|
||||
vim.cmd("set number!")
|
||||
vim.cmd('execute "set signcolumn=" . (&signcolumn == "yes" ? "no" : "yes")')
|
||||
|
@ -65,10 +96,15 @@ map("n", "<leader>n", function()
|
|||
else
|
||||
Snacks.indent.enable()
|
||||
end
|
||||
end, { desc = "toggle decorations", remap = true })
|
||||
map("n", "<leader>t", function()
|
||||
end, { desc = "Toggle Decorations", remap = true })
|
||||
|
||||
map("n", "<leader>T", function()
|
||||
Snacks.terminal()
|
||||
end, { desc = "terminal", remap = true })
|
||||
end, { desc = "Terminal", remap = true })
|
||||
|
||||
map("n", "<leader>s", "<cmd>set hlsearch!<cr>", { desc = "Toggle hlsearch", remap = true })
|
||||
|
||||
map("n", "<leader>us", "<cmd>set spell!<cr>", { desc = "toggle spell", remap = true })
|
||||
map("n", "<leader>uw", "<cmd>set wrap!<cr>", { desc = "toggle wrap", remap = true })
|
||||
|
||||
map("v", "<leader>/", "gc", { desc = "Toggle Comments", remap = true })
|
55
_saved/vim/lazyvim/lua/config/lazy.lua
Normal file
55
_saved/vim/lazyvim/lua/config/lazy.lua
Normal file
|
@ -0,0 +1,55 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
}, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
rocks = {
|
||||
enabled = false,
|
||||
},
|
||||
})
|
12
_saved/vim/lazyvim/lua/plugins/blink.lua
Normal file
12
_saved/vim/lazyvim/lua/plugins/blink.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "none",
|
||||
["<Tab>"] = { "accept", "fallback" },
|
||||
},
|
||||
cmdline = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
}
|
10
_saved/vim/lazyvim/lua/plugins/conform.lua
Normal file
10
_saved/vim/lazyvim/lua/plugins/conform.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters = {
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "2", "-ci", "-bn" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
11
_saved/vim/lazyvim/lua/plugins/disabled.lua
Normal file
11
_saved/vim/lazyvim/lua/plugins/disabled.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{ "akinsho/bufferline.nvim", enabled = false },
|
||||
{ "catppuccin/nvim", enabled = false },
|
||||
{ "folke/persistence.nvim", enabled = false },
|
||||
{ "folke/tokyonight.nvim", enabled = false },
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
{ "MagickDuck/grug-far.nvim", enabled = false },
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
{ "todo-comments.nvim", enabled = false },
|
||||
{ "windwp/nvim-ts-autotag", enabled = false },
|
||||
}
|
12
_saved/vim/lazyvim/lua/plugins/linter.lua
Normal file
12
_saved/vim/lazyvim/lua/plugins/linter.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters = {
|
||||
["markdownlint-cli2"] = {
|
||||
args = { "--config", vim.fn.stdpath("config") .. "/linters/global.markdownlint-cli2.yaml" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
10
_saved/vim/lazyvim/lua/plugins/lsp.lua
Normal file
10
_saved/vim/lazyvim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua-language-server",
|
||||
"terraform-ls",
|
||||
"tflint",
|
||||
},
|
||||
},
|
||||
}
|
57
_saved/vim/lazyvim/lua/plugins/lualine.lua
Normal file
57
_saved/vim/lazyvim/lua/plugins/lualine.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = {
|
||||
theme = "powerline",
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
{ "branch" },
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
info = " ",
|
||||
hint = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ "filename", file_status = true, path = 1 },
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"lsp_status",
|
||||
symbols = {
|
||||
spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
|
||||
done = "✓",
|
||||
separator = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "searchcount" },
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
||||
{ "location", padding = { left = 0, right = 1 } },
|
||||
},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = { "buffers" },
|
||||
},
|
||||
},
|
||||
}
|
15
_saved/vim/lazyvim/lua/plugins/monokai.lua
Normal file
15
_saved/vim/lazyvim/lua/plugins/monokai.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
{
|
||||
"loctvl842/monokai-pro.nvim",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
filter = "classic",
|
||||
},
|
||||
},
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "monokai-pro",
|
||||
},
|
||||
},
|
||||
}
|
8
_saved/vim/lazyvim/lua/plugins/noice.lua
Normal file
8
_saved/vim/lazyvim/lua/plugins/noice.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
opts = {
|
||||
messages = {
|
||||
view_search = false,
|
||||
},
|
||||
},
|
||||
}
|
19
_saved/vim/lazyvim/lua/plugins/treesitter.lua
Normal file
19
_saved/vim/lazyvim/lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"diff",
|
||||
"gotmpl",
|
||||
"helm",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"regex",
|
||||
"terraform",
|
||||
"vim",
|
||||
},
|
||||
},
|
||||
}
|
39
_saved/vim/lazyvim/lua/plugins/which-key.lua
Normal file
39
_saved/vim/lazyvim/lua/plugins/which-key.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts_extend = { "spec" },
|
||||
opts = {
|
||||
preset = "helix",
|
||||
icons = {
|
||||
mappings = false,
|
||||
},
|
||||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{
|
||||
"<leader>b",
|
||||
group = "buffer",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.buf()
|
||||
end,
|
||||
},
|
||||
{ "<leader>b", group = "buffer" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>f", group = "find" },
|
||||
{ "<leader>h", group = "history" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
{ "<leader><tab>", group = "tabs", hidden = true },
|
||||
{ "<leader>d", group = "debug", hidden = true },
|
||||
{ "<leader>dp", group = "profiler", hidden = true },
|
||||
{ "<leader>gh", group = "hunks", hidden = true },
|
||||
{ "<leader>q", group = "quit/session", hidden = true },
|
||||
{ "<leader>s", group = "search", hidden = true },
|
||||
{ "<leader>t", hidden = true },
|
||||
{ "<leader>w", hidden = true },
|
||||
{ "<leader>x", group = "diagnostics/quickfix", hidden = true },
|
||||
{ "gx", desc = "Open with system app", hidden = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue