chore(nvim): a lot
format, fix nvim-tree startup, update telescope, drop unused plugins
This commit is contained in:
@@ -6,4 +6,3 @@ require("langs.langs-setup")
|
||||
require("plugins.plugins-setup")
|
||||
|
||||
require("core.autostart")
|
||||
|
||||
|
||||
@@ -36,77 +36,77 @@ function G.switch_input_method(req)
|
||||
return input_status
|
||||
end
|
||||
|
||||
|
||||
function G.buf_kill(kill_command, bufnr, force)
|
||||
kill_command = kill_command or "bd"
|
||||
kill_command = kill_command or "bd"
|
||||
|
||||
local bo = vim.bo
|
||||
local api = vim.api
|
||||
local fmt = string.format
|
||||
local fn = vim.fn
|
||||
local bo = vim.bo
|
||||
local api = vim.api
|
||||
local fmt = string.format
|
||||
local fn = vim.fn
|
||||
|
||||
if bufnr == 0 or bufnr == nil then
|
||||
bufnr = api.nvim_get_current_buf()
|
||||
end
|
||||
if bufnr == 0 or bufnr == nil then
|
||||
bufnr = api.nvim_get_current_buf()
|
||||
end
|
||||
|
||||
local bufname = api.nvim_buf_get_name(bufnr)
|
||||
local bufname = api.nvim_buf_get_name(bufnr)
|
||||
|
||||
if not force then
|
||||
local choice
|
||||
if bo[bufnr].modified then
|
||||
choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then
|
||||
vim.api.nvim_buf_call(bufnr, function()
|
||||
vim.cmd("w")
|
||||
end)
|
||||
elseif choice == 2 then
|
||||
force = true
|
||||
else return
|
||||
end
|
||||
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then
|
||||
choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then
|
||||
force = true
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
if not force then
|
||||
local choice
|
||||
if bo[bufnr].modified then
|
||||
choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then
|
||||
vim.api.nvim_buf_call(bufnr, function()
|
||||
vim.cmd("w")
|
||||
end)
|
||||
elseif choice == 2 then
|
||||
force = true
|
||||
else
|
||||
return
|
||||
end
|
||||
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then
|
||||
choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then
|
||||
force = true
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Get list of windows IDs with the buffer to close
|
||||
local windows = vim.tbl_filter(function(win)
|
||||
return api.nvim_win_get_buf(win) == bufnr
|
||||
end, api.nvim_list_wins())
|
||||
-- Get list of windows IDs with the buffer to close
|
||||
local windows = vim.tbl_filter(function(win)
|
||||
return api.nvim_win_get_buf(win) == bufnr
|
||||
end, api.nvim_list_wins())
|
||||
|
||||
if force then
|
||||
kill_command = kill_command .. "!"
|
||||
end
|
||||
if force then
|
||||
kill_command = kill_command .. "!"
|
||||
end
|
||||
|
||||
-- Get list of active buffers
|
||||
local buffers = vim.tbl_filter(function(buf)
|
||||
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
|
||||
end, api.nvim_list_bufs())
|
||||
-- Get list of active buffers
|
||||
local buffers = vim.tbl_filter(function(buf)
|
||||
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
|
||||
end, api.nvim_list_bufs())
|
||||
|
||||
-- If there is only one buffer (which has to be the current one), vim will
|
||||
-- create a new buffer on :bd.
|
||||
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
|
||||
if #buffers > 1 and #windows > 0 then
|
||||
for i, v in ipairs(buffers) do
|
||||
if v == bufnr then
|
||||
local prev_buf_idx = i == 1 and #buffers or (i - 1)
|
||||
local prev_buffer = buffers[prev_buf_idx]
|
||||
for _, win in ipairs(windows) do
|
||||
api.nvim_win_set_buf(win, prev_buffer)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- If there is only one buffer (which has to be the current one), vim will
|
||||
-- create a new buffer on :bd.
|
||||
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
|
||||
if #buffers > 1 and #windows > 0 then
|
||||
for i, v in ipairs(buffers) do
|
||||
if v == bufnr then
|
||||
local prev_buf_idx = i == 1 and #buffers or (i - 1)
|
||||
local prev_buffer = buffers[prev_buf_idx]
|
||||
for _, win in ipairs(windows) do
|
||||
api.nvim_win_set_buf(win, prev_buffer)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if buffer still exists, to ensure the target buffer wasn't killed
|
||||
-- due to options like bufhidden=wipe.
|
||||
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
|
||||
vim.cmd(string.format("%s %d", kill_command, bufnr))
|
||||
end
|
||||
-- Check if buffer still exists, to ensure the target buffer wasn't killed
|
||||
-- due to options like bufhidden=wipe.
|
||||
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
|
||||
vim.cmd(string.format("%s %d", kill_command, bufnr))
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -39,7 +39,9 @@ keymap.set("n", "<leader>ww", ":w<CR>", opt)
|
||||
keymap.set("n", "<leader>so", ":so<CR>", opt)
|
||||
keymap.set("n", "<leader>qq", ":q<CR>", opt)
|
||||
keymap.set("n", "<leader>qa", ":qa<CR>", opt)
|
||||
keymap.set("n", "<leader>c", function () buf_kill("bd", nil, false) end, opt)
|
||||
keymap.set("n", "<leader>c", function()
|
||||
buf_kill("bd", nil, false)
|
||||
end, opt)
|
||||
|
||||
keymap.set("n", "<C-up>", ":resize +5<CR>", opt)
|
||||
keymap.set("n", "<C-down>", ":resize -5<CR>", opt)
|
||||
@@ -63,9 +65,8 @@ keymap.set("n", "<leader>wr", ":WorkspacesRemove<CR>", opt)
|
||||
|
||||
-- Neovide config
|
||||
if vim.g.neovide then
|
||||
keymap.set("v", "<C-C>", "\"+y", opt)
|
||||
keymap.set("n", "<C-V>", "\"+P", opt)
|
||||
keymap.set("i", "<C-V>", "<ESC>l\"+Pli", opt)
|
||||
keymap.set("v", "<C-C>", '"+y', opt)
|
||||
keymap.set("n", "<C-V>", '"+P', opt)
|
||||
keymap.set("i", "<C-V>", '<ESC>l"+Pli', opt)
|
||||
keymap.set("c", "<C-V>", "<C-R>+", opt)
|
||||
end
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ vim.g.autoread = true
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
|
||||
-- Hightlight on yank
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
@@ -62,7 +62,7 @@ vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
callback = function()
|
||||
Last_input_method = require("core.globals").switch_input_method(1)
|
||||
end,
|
||||
group = "AutoInputMethod"
|
||||
group = "AutoInputMethod",
|
||||
})
|
||||
vim.api.nvim_create_autocmd("CmdlineLeave", {
|
||||
pattern = "*",
|
||||
@@ -70,7 +70,7 @@ vim.api.nvim_create_autocmd("CmdlineLeave", {
|
||||
callback = function()
|
||||
require("core.globals").switch_input_method(1)
|
||||
end,
|
||||
group = "AutoInputMethod"
|
||||
group = "AutoInputMethod",
|
||||
})
|
||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
pattern = "*",
|
||||
@@ -78,7 +78,7 @@ vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
callback = function()
|
||||
require("core.globals").switch_input_method(Last_input_method)
|
||||
end,
|
||||
group = "AutoInputMethod"
|
||||
group = "AutoInputMethod",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
@@ -89,8 +89,8 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
-- credit: https://github.com/sam4llis/nvim-lua-gf
|
||||
vim.opt_local.include = [[\v<((do|load)file|require|reload)[^''"]*[''"]\zs[^''"]+]]
|
||||
vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
|
||||
vim.opt_local.suffixesadd:prepend ".lua"
|
||||
vim.opt_local.suffixesadd:prepend "init.lua"
|
||||
vim.opt_local.suffixesadd:prepend(".lua")
|
||||
vim.opt_local.suffixesadd:prepend("init.lua")
|
||||
|
||||
for _, path in pairs(vim.api.nvim_list_runtime_paths()) do
|
||||
vim.opt_local.path:append(path .. "/lua")
|
||||
|
||||
@@ -10,4 +10,3 @@ vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
end,
|
||||
group = "Go",
|
||||
})
|
||||
|
||||
|
||||
@@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", {
|
||||
end,
|
||||
group = "Lua",
|
||||
})
|
||||
|
||||
|
||||
@@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", {
|
||||
end,
|
||||
group = "Markdown",
|
||||
})
|
||||
|
||||
|
||||
@@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", {
|
||||
end,
|
||||
group = "Nix",
|
||||
})
|
||||
|
||||
|
||||
@@ -8,4 +8,3 @@ vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
end,
|
||||
group = "Rust",
|
||||
})
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ M = {
|
||||
javascript = { "string", "template_string" },
|
||||
},
|
||||
fast_wrap = {
|
||||
map = '<M-e>',
|
||||
chars = { '{', '[', '(', '"', "'" },
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = [=[[%'%"%)%>%]%)%}%,]]=],
|
||||
end_key = '$',
|
||||
keys = 'qwertyuiopzxcvbnmasdfghjkl',
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = 'Search',
|
||||
highlight_grey='Comment'
|
||||
highlight = "Search",
|
||||
highlight_grey = "Comment",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -23,4 +23,3 @@ if ok then
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
local buf_kill = require("core.globals").buf_kill
|
||||
|
||||
M = {
|
||||
highlights = {
|
||||
buffer_selected = {
|
||||
bold = true
|
||||
}
|
||||
},
|
||||
options = {
|
||||
diagnostics = "nvim_lsp",
|
||||
offsets = {
|
||||
highlights = {
|
||||
buffer_selected = {
|
||||
bold = true,
|
||||
},
|
||||
},
|
||||
options = {
|
||||
diagnostics = "nvim_lsp",
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "center"
|
||||
text_align = "center",
|
||||
},
|
||||
},
|
||||
close_command = function (bufnr)
|
||||
buf_kill("bd", bufnr, false)
|
||||
end,
|
||||
right_mouse_command = function (bufnr)
|
||||
buf_kill("bd", bufnr, true)
|
||||
end
|
||||
}
|
||||
close_command = function(bufnr)
|
||||
buf_kill("bd", bufnr, false)
|
||||
end,
|
||||
right_mouse_command = function(bufnr)
|
||||
buf_kill("bd", bufnr, true)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -3,21 +3,21 @@ local cmp = require("cmp")
|
||||
M = {
|
||||
window = {
|
||||
completion = {
|
||||
border = 'rounded',
|
||||
scrollbar = '║',
|
||||
border = "rounded",
|
||||
scrollbar = "║",
|
||||
},
|
||||
documentation = {
|
||||
border = 'rounded',
|
||||
scrollbar = '║',
|
||||
border = "rounded",
|
||||
scrollbar = "║",
|
||||
},
|
||||
},
|
||||
formatting = {
|
||||
format = require('lspkind').cmp_format({
|
||||
format = require("lspkind").cmp_format({
|
||||
mode = "symbol",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = '...',
|
||||
symbol_map = { Codeium = "", }
|
||||
})
|
||||
ellipsis_char = "...",
|
||||
symbol_map = { Codeium = "" },
|
||||
}),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
@@ -29,7 +29,7 @@ M = {
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<Escape>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Up>"] = cmp.mapping(function (fallback)
|
||||
["<Up>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
@@ -37,9 +37,9 @@ M = {
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s"
|
||||
"s",
|
||||
}),
|
||||
["<Down>"] = cmp.mapping(function (fallback)
|
||||
["<Down>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
@@ -47,22 +47,20 @@ M = {
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s"
|
||||
"s",
|
||||
}),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
-- { name = "codeium" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
})
|
||||
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
}
|
||||
|
||||
vim.o.wildmenu = true
|
||||
vim.o.pumheight = 10
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,34 +1,30 @@
|
||||
M = {
|
||||
sources = {
|
||||
friendly_snippets = true
|
||||
friendly_snippets = true,
|
||||
},
|
||||
history = true,
|
||||
updateevents = { "TextChanged", "TextChangedI" }
|
||||
updateevents = { "TextChanged", "TextChangedI" },
|
||||
}
|
||||
|
||||
-- vscode format
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
|
||||
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.g.vscode_snippets_path or "" })
|
||||
|
||||
-- snipmate format
|
||||
require("luasnip.loaders.from_snipmate").load()
|
||||
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
|
||||
require("luasnip.loaders.from_snipmate").lazy_load({ paths = vim.g.snipmate_snippets_path or "" })
|
||||
|
||||
-- lua format
|
||||
require("luasnip.loaders.from_lua").load()
|
||||
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
|
||||
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.g.lua_snippets_path or "" })
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
callback = function()
|
||||
if
|
||||
luasnip.session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||
and not luasnip.session.jump_active
|
||||
then
|
||||
if luasnip.session.current_nodes[vim.api.nvim_get_current_buf()] and not luasnip.session.jump_active then
|
||||
luasnip.unlink_current()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
M = {}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
M = {
|
||||
signs = {
|
||||
add = { text = '▎', color = "green" },
|
||||
change = { text = '▎', color = "blue" },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
signs = {
|
||||
add = { text = "▎", color = "green" },
|
||||
change = { text = "▎", color = "blue" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol',
|
||||
virt_text_pos = "eol",
|
||||
delay = 0,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
M = {
|
||||
enabled = true,
|
||||
indent = {
|
||||
tab_char = "▎"
|
||||
tab_char = "▎",
|
||||
},
|
||||
scope = {
|
||||
enabled = true,
|
||||
show_start = false,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
vim.opt.list = true
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
M = {}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -20,24 +20,24 @@ local extra_config = {
|
||||
vim.api.nvim_get_runtime_file("", true),
|
||||
"${3rd}/luv/library",
|
||||
"${3rd}/luassert/library",
|
||||
}
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
globals = {
|
||||
"vim"
|
||||
}
|
||||
"vim",
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace"
|
||||
}
|
||||
}
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
rust_analyzer = {
|
||||
check = {
|
||||
command = "clippy"
|
||||
command = "clippy",
|
||||
},
|
||||
diagnostics = {
|
||||
experimental = true,
|
||||
@@ -45,7 +45,7 @@ local extra_config = {
|
||||
formatting = {
|
||||
command = { "rustfmt" },
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
nixd = {
|
||||
@@ -56,12 +56,12 @@ local extra_config = {
|
||||
},
|
||||
options = {
|
||||
nixos = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
@@ -74,7 +74,7 @@ local lspconfig = require("lspconfig")
|
||||
for _, server in ipairs(servers) do
|
||||
local extra = extra_config[server] or {}
|
||||
local config = {
|
||||
capabilities = capabilities
|
||||
capabilities = capabilities,
|
||||
}
|
||||
for k, v in pairs(extra) do
|
||||
config[k] = v
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
M = {
|
||||
-- ensure_installed = require("plugins.lsp.servers")
|
||||
ensure_installed = {}
|
||||
ensure_installed = {},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -3,10 +3,9 @@ M = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ local opt = require("core.globals").keymap_opt
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opt)
|
||||
vim.keymap.set("n", "<leader>lR", vim.lsp.buf.rename, opt)
|
||||
|
||||
local icons = { }
|
||||
local icons = {}
|
||||
local sev = vim.diagnostic.severity
|
||||
local signs = {
|
||||
[sev.ERROR] = " ",
|
||||
[sev.WARN] = " ",
|
||||
[sev.HINT] = " ",
|
||||
[sev.INFO] = " "
|
||||
[sev.INFO] = " ",
|
||||
}
|
||||
for type, icon in pairs(icons) do
|
||||
local hl = vim.diagnostic.severity[type]
|
||||
@@ -18,7 +18,7 @@ for type, icon in pairs(icons) do
|
||||
end
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
text = signs
|
||||
text = signs,
|
||||
},
|
||||
underline = true,
|
||||
update_in_insert = true,
|
||||
@@ -26,7 +26,7 @@ vim.diagnostic.config({
|
||||
})
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "single",
|
||||
border = "single",
|
||||
})
|
||||
|
||||
local diag_config1 = {
|
||||
@@ -35,7 +35,7 @@ local diag_config1 = {
|
||||
max = vim.diagnostic.severity.WARN,
|
||||
},
|
||||
spacing = 4,
|
||||
prefix = "●"
|
||||
prefix = "●",
|
||||
},
|
||||
virtual_lines = {
|
||||
severity = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
M = {
|
||||
symbols = {
|
||||
icon_source = "lspkind"
|
||||
}
|
||||
icon_source = "lspkind",
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>", { desc = "Toggle Outline" })
|
||||
|
||||
@@ -12,4 +12,3 @@ M = {
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
M = {
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = "rounded"
|
||||
border = "rounded",
|
||||
},
|
||||
hint_prefix = "^ ",
|
||||
toggle_key = "<C-k>",
|
||||
}
|
||||
|
||||
vim.keymap.set({ 'n' }, '<leader>k', require('lsp_signature').toggle_float_win,
|
||||
{ silent = true, noremap = true, desc = 'toggle signature' })
|
||||
vim.keymap.set(
|
||||
{ "n" },
|
||||
"<leader>k",
|
||||
require("lsp_signature").toggle_float_win,
|
||||
{ silent = true, noremap = true, desc = "toggle signature" }
|
||||
)
|
||||
|
||||
vim.keymap.set({ 'n' }, 'K', vim.lsp.buf.signature_help,
|
||||
{ silent = true, noremap = true, desc = 'toggle signature' })
|
||||
vim.keymap.set({ "n" }, "K", vim.lsp.buf.signature_help, { silent = true, noremap = true, desc = "toggle signature" })
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
M = {
|
||||
options = {
|
||||
theme = "tokyonight"
|
||||
theme = "tokyonight",
|
||||
},
|
||||
sections = {
|
||||
lualine_y = {
|
||||
'encoding', 'fileformat', 'filetype',
|
||||
"encoding",
|
||||
"fileformat",
|
||||
"filetype",
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
M = {}
|
||||
|
||||
vim.api.nvim_create_augroup("MarkdownPreviewAuto", {})
|
||||
|
||||
vim.api.nvim_create_user_command("MarkdownPreviewAutoEnable", function()
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = "MarkdownPreviewAuto",
|
||||
pattern = { "*.md" },
|
||||
desc = "Auto enable MarkdownPreview",
|
||||
callback = function()
|
||||
vim.cmd("MarkdownPreview")
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufLeave", {
|
||||
group = "MarkdownPreviewAuto",
|
||||
pattern = { "*.md" },
|
||||
desc = "Auto disable MarkdownPreview",
|
||||
callback = function()
|
||||
vim.cmd("MarkdownPreviewStop")
|
||||
end,
|
||||
})
|
||||
end, { desc = "Auto enable MarkdownPreview" })
|
||||
|
||||
vim.api.nvim_create_user_command("MarkdownPreviewAutoDisable",
|
||||
function()
|
||||
vim.api.nvim_clear_autocmds({ group = "MarkdownPreviewAuto" })
|
||||
end, {}
|
||||
)
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
M = {}
|
||||
|
||||
return M
|
||||
|
||||
@@ -3,11 +3,11 @@ M = {
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
debounce_delay = 50,
|
||||
show_on_dirs = true
|
||||
show_on_dirs = true,
|
||||
},
|
||||
filters = {
|
||||
git_ignored = false
|
||||
}
|
||||
git_ignored = false,
|
||||
},
|
||||
}
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
@@ -18,4 +18,3 @@ vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", opt)
|
||||
vim.keymap.set("n", "<leader>te", ":NvimTreeFocus<CR>", opt)
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ if not vim.loop.fs_stat(lazypath) then
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
lazypath
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
@@ -18,7 +18,7 @@ local plugins = {
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("tokyonight-storm")
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
@@ -26,41 +26,41 @@ local plugins = {
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
|
||||
config = function()
|
||||
require("lualine").setup(require("plugins.lualine"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("nvim-tree").setup(require("plugins.nvim-tree"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"nushell/tree-sitter-nu"
|
||||
"nushell/tree-sitter-nu",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup(require("plugins.treesitter"))
|
||||
end,
|
||||
build = ":TSUpdate"
|
||||
build = ":TSUpdate",
|
||||
},
|
||||
{
|
||||
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("plugins.rainbow-delimiters")
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("ibl").setup(require("plugins.indent-blankline"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
@@ -69,7 +69,7 @@ local plugins = {
|
||||
config = function()
|
||||
require("plugins.lsp.lspconfig")
|
||||
require("plugins.lsp.others")
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
@@ -107,7 +107,7 @@ local plugins = {
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
},
|
||||
opts = {}
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"MysticalDevil/inlay-hints.nvim",
|
||||
@@ -115,7 +115,7 @@ local plugins = {
|
||||
dependencies = { "neovim/nvim-lspconfig" },
|
||||
config = function()
|
||||
require("inlay-hints").setup()
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hedyhli/outline.nvim",
|
||||
@@ -131,7 +131,7 @@ local plugins = {
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
require("luasnip").setup(require("plugins.cmp.luasnip"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
@@ -141,19 +141,19 @@ local plugins = {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
"hrsh7th/cmp-path",
|
||||
"onsails/lspkind.nvim"
|
||||
"onsails/lspkind.nvim",
|
||||
},
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("cmp").setup(require("plugins.cmp.cmp"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("Comment").setup(require("plugins.comment"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
@@ -161,20 +161,20 @@ local plugins = {
|
||||
dependencies = { "hrsh7th/nvim-cmp" },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup(require("plugins.autopairs"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
config = function()
|
||||
require("bufferline").setup(require("plugins.bufferline"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("gitsigns").setup(require("plugins.gitsigns"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
@@ -182,46 +182,18 @@ local plugins = {
|
||||
dependencies = { "nvim-lua/plenary.nvim", "BurntSushi/ripgrep" },
|
||||
config = function()
|
||||
require("telescope").setup(require("plugins.telescope"))
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-tmux-navigation").setup(require("plugins.tmuxnav"))
|
||||
end
|
||||
},
|
||||
{
|
||||
"natecraddock/workspaces.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-telescope/telescope.nvim", "natecraddock/sessions.nvim" },
|
||||
config = function()
|
||||
require("workspaces").setup(require("plugins.workspaces"))
|
||||
require("telescope").load_extension("workspaces")
|
||||
end
|
||||
},
|
||||
--[[ {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewAutoEnable", "MarkdownPreviewAutoDisable" },
|
||||
ft = { "markdown" },
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
config = function()
|
||||
require("plugins.markdown-preview")
|
||||
end
|
||||
}, ]]
|
||||
--[[ {
|
||||
"dhruvasagar/vim-table-mode",
|
||||
lazy = true,
|
||||
event = "BufEnter *.md",
|
||||
config = function()
|
||||
require("plugins.table-mode")
|
||||
end
|
||||
}, ]]
|
||||
},
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
@@ -236,15 +208,15 @@ local plugins = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"voldikss/vim-floaterm",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.floaterm")
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
@@ -256,27 +228,21 @@ local plugins = {
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("osc52").setup({
|
||||
tmux_passthrough = true
|
||||
tmux_passthrough = true,
|
||||
})
|
||||
local function copy()
|
||||
if vim.v.event.operator == "y" and vim.v.event.regname == "+" then
|
||||
require("osc52").copy_register("+")
|
||||
end
|
||||
end
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {callback = copy})
|
||||
end
|
||||
vim.api.nvim_create_autocmd("TextYankPost", { callback = copy })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pest-parser/pest.vim",
|
||||
ft = "pest",
|
||||
opts = {}
|
||||
}
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
rocks = {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
require("lazy").setup(plugins, opts)
|
||||
require("lazy").setup(plugins, {})
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
local rainbow_delimiters = require("rainbow-delimiters")
|
||||
vim.g.rainbow_delimiters = {
|
||||
strategy = {
|
||||
[''] = rainbow_delimiters.strategy['global'],
|
||||
vim = rainbow_delimiters.strategy['local'],
|
||||
[""] = rainbow_delimiters.strategy["global"],
|
||||
vim = rainbow_delimiters.strategy["local"],
|
||||
},
|
||||
query = {
|
||||
[''] = 'rainbow-delimiters',
|
||||
lua = 'rainbow-blocks',
|
||||
[""] = "rainbow-delimiters",
|
||||
lua = "rainbow-blocks",
|
||||
},
|
||||
highlight = {
|
||||
'RainbowDelimiterRed',
|
||||
'RainbowDelimiterYellow',
|
||||
'RainbowDelimiterBlue',
|
||||
'RainbowDelimiterOrange',
|
||||
'RainbowDelimiterGreen',
|
||||
'RainbowDelimiterViolet',
|
||||
'RainbowDelimiterCyan',
|
||||
"RainbowDelimiterRed",
|
||||
"RainbowDelimiterYellow",
|
||||
"RainbowDelimiterBlue",
|
||||
"RainbowDelimiterOrange",
|
||||
"RainbowDelimiterGreen",
|
||||
"RainbowDelimiterViolet",
|
||||
"RainbowDelimiterCyan",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
M = {}
|
||||
|
||||
vim.g.table_mode_corner = "|"
|
||||
|
||||
vim.api.nvim_create_augroup("TableModeAuto", {})
|
||||
|
||||
vim.api.nvim_create_user_command("TableModeAutoEnable", function()
|
||||
vim.api.nvim_clear_autocmds({ group = "TableModeAuto" })
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = "TableModeAuto",
|
||||
pattern = { "*.md" },
|
||||
desc = "Auto enable TableMode",
|
||||
callback = function()
|
||||
vim.cmd("TableModeEnable")
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWrite", {
|
||||
group = "TableModeAuto",
|
||||
pattern = { "*.md" },
|
||||
desc = "Auto enable TableMode",
|
||||
callback = function()
|
||||
vim.cmd("TableModeRealign")
|
||||
end,
|
||||
})
|
||||
end, { desc = "Auto enable TableMode" })
|
||||
|
||||
vim.api.nvim_create_user_command("TableModeAutoDisable",
|
||||
function()
|
||||
vim.api.nvim_clear_autocmds({ group = "TableModeAuto" })
|
||||
end, {}
|
||||
)
|
||||
|
||||
return M
|
||||
|
||||
@@ -3,13 +3,13 @@ M = {
|
||||
winblend = 50,
|
||||
path_display = {
|
||||
"smart",
|
||||
shorten = 3
|
||||
}
|
||||
shorten = 3,
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
lsp_definitions = {
|
||||
theme = "cursor",
|
||||
layout_config = { width = 0.6, height = 0.3},
|
||||
layout_config = { width = 0.6, height = 0.3 },
|
||||
},
|
||||
lsp_references = {
|
||||
theme = "cursor",
|
||||
@@ -17,29 +17,28 @@ M = {
|
||||
},
|
||||
current_buffer_fuzzy_find = {
|
||||
theme = "dropdown",
|
||||
layout_config = { height = 0.7, width = 0.55, preview_cutoff = 0 ,prompt_position = "top" }
|
||||
layout_config = { height = 0.7, width = 0.55, preview_cutoff = 0, prompt_position = "top" },
|
||||
},
|
||||
lsp_document_symbols = {
|
||||
theme = "ivy",
|
||||
layout_config = { height = 0.25 }
|
||||
}
|
||||
layout_config = { height = 0.25 },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local opt = require("core.globals").keymap_opt
|
||||
local keymap = vim.keymap
|
||||
local builtin = require('telescope.builtin')
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
keymap.set('n', '<leader>ff', builtin.find_files, opt)
|
||||
keymap.set('n', '<leader>gf', builtin.git_files, opt)
|
||||
keymap.set('n', '<leader>fg', builtin.live_grep, opt)
|
||||
keymap.set('n', '<leader>fb', builtin.buffers, opt)
|
||||
keymap.set('n', '<leader>fh', builtin.help_tags, opt)
|
||||
keymap.set("n", "<leader>ff", builtin.find_files, opt)
|
||||
keymap.set("n", "<leader>gf", builtin.git_files, opt)
|
||||
keymap.set("n", "<leader>fg", builtin.live_grep, opt)
|
||||
keymap.set("n", "<leader>fb", builtin.buffers, opt)
|
||||
keymap.set("n", "<leader>fh", builtin.help_tags, opt)
|
||||
-- keymap.set('n', '<leader>lD', builtin.diagnostics, opt)
|
||||
keymap.set('n', '<leader>ld', builtin.lsp_definitions, opt)
|
||||
keymap.set('n', '<leader>lr', builtin.lsp_references, opt)
|
||||
keymap.set('n', '<leader>ls', builtin.lsp_document_symbols, opt)
|
||||
keymap.set('n', '<leader>/', builtin.current_buffer_fuzzy_find, opt)
|
||||
keymap.set("n", "<leader>ld", builtin.lsp_definitions, opt)
|
||||
keymap.set("n", "<leader>lr", builtin.lsp_references, opt)
|
||||
keymap.set("n", "<leader>ls", builtin.lsp_document_symbols, opt)
|
||||
keymap.set("n", "<leader>/", builtin.current_buffer_fuzzy_find, opt)
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -11,4 +11,3 @@ keymap.set("n", "<C-\\>", tmuxnav.NvimTmuxNavigateLastActive)
|
||||
keymap.set("n", "<C-Space>", tmuxnav.NvimTmuxNavigateNext)
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -6,15 +6,14 @@ M = {
|
||||
ignore_install = {},
|
||||
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true }
|
||||
indent = { enable = true },
|
||||
}
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
||||
[".*%.hl"] = "hyprlang"
|
||||
[".*%.hl"] = "hyprlang",
|
||||
},
|
||||
})
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
M = {
|
||||
hooks = {
|
||||
open = function ()
|
||||
require("core.globals").close_empty_buffer()
|
||||
vim.cmd("enew")
|
||||
vim.cmd("bufdo bd")
|
||||
require("sessions").load(nil, { silent = true })
|
||||
vim.cmd("NvimTreeFocus")
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user