⚙️ config(nvim): deleted all the copy pasted options that i didnt changed from plugins of lazyvim to avoid substitution
This commit is contained in:
parent
8bdeb25cf8
commit
063cf3c98b
7 changed files with 44 additions and 398 deletions
|
@ -2,14 +2,6 @@ local macchiato = require("catppuccin.palettes").get_palette("macchiato")
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"catppuccin",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
|
|
||||||
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
|
|
||||||
},
|
|
||||||
opts = {
|
opts = {
|
||||||
highlights = require("catppuccin.groups.integrations.bufferline").get({
|
highlights = require("catppuccin.groups.integrations.bufferline").get({
|
||||||
styles = { "italic", "bold" },
|
styles = { "italic", "bold" },
|
||||||
|
@ -25,31 +17,7 @@ return {
|
||||||
modified_icon = "",
|
modified_icon = "",
|
||||||
close_icon = "",
|
close_icon = "",
|
||||||
color_icons = true,
|
color_icons = true,
|
||||||
close_command = function(n)
|
|
||||||
require("mini.bufremove").delete(n, false)
|
|
||||||
end,
|
|
||||||
separator_style = "slope",
|
separator_style = "slope",
|
||||||
right_mouse_command = function(n)
|
|
||||||
require("mini.bufremove").delete(n, false)
|
|
||||||
end,
|
|
||||||
themable = true,
|
|
||||||
view = "multiwindow",
|
|
||||||
diagnostics = "nvim_lsp",
|
|
||||||
always_show_bufferline = false,
|
|
||||||
diagnostics_indicator = function(_, _, diag)
|
|
||||||
local icons = require("lazyvim.config").icons.diagnostics
|
|
||||||
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
|
|
||||||
.. (diag.warning and icons.Warn .. diag.warning or "")
|
|
||||||
return vim.trim(ret)
|
|
||||||
end,
|
|
||||||
offsets = {
|
|
||||||
{
|
|
||||||
filetype = "neo-tree",
|
|
||||||
text = "Neo-tree",
|
|
||||||
highlight = "Directory",
|
|
||||||
text_align = "left",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,27 +1,9 @@
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
version = false, -- last release is way too old
|
opts = {
|
||||||
event = "InsertEnter",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
},
|
|
||||||
opts = function()
|
|
||||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local defaults = require("cmp.config.default")()
|
|
||||||
return {
|
|
||||||
completion = {
|
|
||||||
completeopt = "menu,menuone,noinsert",
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
@ -39,33 +21,10 @@ return {
|
||||||
fallback()
|
fallback()
|
||||||
end,
|
end,
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "path" },
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
formatting = {
|
|
||||||
format = function(_, item)
|
|
||||||
local icons = require("lazyvim.config").icons.kinds
|
|
||||||
if icons[item.kind] then
|
|
||||||
item.kind = icons[item.kind] .. item.kind
|
|
||||||
end
|
|
||||||
return item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = {
|
|
||||||
hl_group = "CmpGhostText",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sorting = defaults.sorting,
|
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
dependencies = { "mason.nvim" },
|
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>cC",
|
"<leader>cC",
|
||||||
|
@ -30,23 +29,7 @@ return {
|
||||||
scss = { { "prettierd", "prettier", "stylelint" } },
|
scss = { { "prettierd", "prettier", "stylelint" } },
|
||||||
less = { { "prettierd", "prettier", "stylelint" } },
|
less = { { "prettierd", "prettier", "stylelint" } },
|
||||||
markdown = { { "prettierd", "prettier" } },
|
markdown = { { "prettierd", "prettier" } },
|
||||||
},
|
toml = { "taplo" },
|
||||||
-- LazyVim will merge the options you set here with builtin formatters.
|
|
||||||
-- You can also define any custom formatters here.
|
|
||||||
---@type table<string,table>
|
|
||||||
formatters = {
|
|
||||||
injected = { options = { ignore_errors = true } },
|
|
||||||
-- -- Example of using dprint only when a dprint.json file is present
|
|
||||||
-- dprint = {
|
|
||||||
-- condition = function(ctx)
|
|
||||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
taplo = {
|
|
||||||
condition = function(ctx)
|
|
||||||
return vim.fs.find({ "Cargo.toml" }, { path = ctx.filename, upward = true })[1]
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
opts = {
|
opts = {
|
||||||
signs = {
|
|
||||||
add = { text = "▎" },
|
|
||||||
change = { text = "▎" },
|
|
||||||
delete = { text = "" },
|
|
||||||
topdelete = { text = "" },
|
|
||||||
changedelete = { text = "▎" },
|
|
||||||
untracked = { text = "▎" },
|
|
||||||
},
|
|
||||||
yadm = { enable = true },
|
yadm = { enable = true },
|
||||||
current_line_blame = true,
|
current_line_blame = true,
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
|
@ -30,6 +21,7 @@ return {
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||||
|
map("n", "<leader>ub", "<cmd>Gitsigns toggle_current_line_blame<CR>", "Toggle Line Blame")
|
||||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||||
|
|
|
@ -12,15 +12,7 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
-- options for vim.diagnostic.config()
|
-- options for vim.diagnostic.config()
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
underline = true,
|
|
||||||
update_in_insert = false,
|
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
spacing = 4,
|
|
||||||
source = "if_many",
|
|
||||||
prefix = "●",
|
|
||||||
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
|
||||||
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
|
||||||
-- prefix = "icons",
|
|
||||||
float = {
|
float = {
|
||||||
border = {
|
border = {
|
||||||
{ "┌", "FloatBorder" },
|
{ "┌", "FloatBorder" },
|
||||||
|
@ -34,59 +26,6 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
severity_sort = true,
|
|
||||||
},
|
|
||||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
|
||||||
-- Be aware that you also will need to properly configure your LSP server to
|
|
||||||
-- provide the inlay hints.
|
|
||||||
inlay_hints = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
-- add any global capabilities here
|
|
||||||
capabilities = {},
|
|
||||||
-- Enable this to show formatters used in a notification
|
|
||||||
-- Useful for debugging formatter issues
|
|
||||||
format_notify = false,
|
|
||||||
-- options for vim.lsp.buf.format
|
|
||||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
|
||||||
-- but can be also overridden when specified
|
|
||||||
format = {
|
|
||||||
formatting_options = nil,
|
|
||||||
timeout_ms = nil,
|
|
||||||
},
|
|
||||||
-- LSP Server Settings
|
|
||||||
---@type lspconfig.options
|
|
||||||
servers = {
|
|
||||||
jsonls = {},
|
|
||||||
lua_ls = {
|
|
||||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
|
||||||
-- Use this to add any additional keymaps
|
|
||||||
-- for specific lsp servers
|
|
||||||
---@type LazyKeys[]
|
|
||||||
-- keys = {},
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
},
|
|
||||||
completion = {
|
|
||||||
callSnippet = "Replace",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- you can do any additional lsp server setup here
|
|
||||||
-- return true if you don't want this server to be setup with lspconfig
|
|
||||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
|
||||||
setup = {
|
|
||||||
-- example to setup with typescript.nvim
|
|
||||||
-- tsserver = function(_, opts)
|
|
||||||
-- require("typescript").setup({ server = opts })
|
|
||||||
-- return true
|
|
||||||
-- end,
|
|
||||||
-- Specify * to use this function as a fallback for any server
|
|
||||||
-- ["*"] = function(server, opts) end,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,27 +1,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
|
||||||
init = function()
|
|
||||||
vim.g.lualine_laststatus = vim.o.laststatus
|
|
||||||
if vim.fn.argc(-1) > 0 then
|
|
||||||
-- set an empty statusline till lualine loads
|
|
||||||
vim.o.statusline = " "
|
|
||||||
else
|
|
||||||
-- hide the statusline on the starter page
|
|
||||||
vim.o.laststatus = 0
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
opts = function()
|
opts = function()
|
||||||
-- PERF: we don't need this lualine require madness 🤷
|
|
||||||
local lualine_require = require("lualine_require")
|
|
||||||
lualine_require.require = require
|
|
||||||
|
|
||||||
local icons = require("lazyvim.config").icons
|
|
||||||
local Util = require("lazyvim.util")
|
|
||||||
|
|
||||||
vim.o.laststatus = vim.g.lualine_laststatus
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
options = {
|
options = {
|
||||||
theme = "catppuccin",
|
theme = "catppuccin",
|
||||||
|
@ -31,74 +11,6 @@ return {
|
||||||
section_separators = { left = "", right = "" },
|
section_separators = { left = "", right = "" },
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
|
||||||
lualine_b = { "branch" },
|
|
||||||
lualine_c = {
|
|
||||||
Util.lualine.root_dir(),
|
|
||||||
{
|
|
||||||
"diagnostics",
|
|
||||||
symbols = {
|
|
||||||
error = icons.diagnostics.Error,
|
|
||||||
warn = icons.diagnostics.Warn,
|
|
||||||
info = icons.diagnostics.Info,
|
|
||||||
hint = icons.diagnostics.Hint,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
|
||||||
{
|
|
||||||
Util.lualine.pretty_path(),
|
|
||||||
},
|
|
||||||
-- stylua: ignore
|
|
||||||
{
|
|
||||||
function()
|
|
||||||
local ok, m = pcall(require, "better_escape")
|
|
||||||
return ok and m.waiting and "✺" or ""
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lualine_x = {
|
|
||||||
-- stylua: ignore
|
|
||||||
{
|
|
||||||
function() return require("noice").api.status.command.get() end,
|
|
||||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
|
||||||
color = Util.ui.fg("Statement"),
|
|
||||||
},
|
|
||||||
-- stylua: ignore
|
|
||||||
{
|
|
||||||
function() return require("noice").api.status.mode.get() end,
|
|
||||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
|
||||||
color = Util.ui.fg("Constant"),
|
|
||||||
},
|
|
||||||
-- stylua: ignore
|
|
||||||
{
|
|
||||||
function() return " " .. require("dap").status() end,
|
|
||||||
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
|
|
||||||
color = Util.ui.fg("Debug"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
require("lazy.status").updates,
|
|
||||||
cond = require("lazy.status").has_updates,
|
|
||||||
color = Util.ui.fg("Special"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"diff",
|
|
||||||
symbols = {
|
|
||||||
added = icons.git.added,
|
|
||||||
modified = icons.git.modified,
|
|
||||||
removed = icons.git.removed,
|
|
||||||
},
|
|
||||||
source = function()
|
|
||||||
local gitsigns = vim.b.gitsigns_status_dict
|
|
||||||
if gitsigns then
|
|
||||||
return {
|
|
||||||
added = gitsigns.added,
|
|
||||||
modified = gitsigns.changed,
|
|
||||||
removed = gitsigns.removed,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
{ "progress", separator = " ", padding = { left = 1, right = 1 } },
|
{ "progress", separator = " ", padding = { left = 1, right = 1 } },
|
||||||
},
|
},
|
||||||
|
@ -106,7 +18,6 @@ return {
|
||||||
{ "location", padding = { left = 1, right = 1 } },
|
{ "location", padding = { left = 1, right = 1 } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
extensions = { "neo-tree", "lazy" },
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,118 +1,12 @@
|
||||||
local Util = require("lazyvim.util")
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
|
||||||
cmd = "Neotree",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>fe",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
|
|
||||||
end,
|
|
||||||
desc = "Explorer NeoTree (root dir)",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>fE",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
|
|
||||||
end,
|
|
||||||
desc = "Explorer NeoTree (cwd)",
|
|
||||||
},
|
|
||||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
|
||||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
|
||||||
{
|
|
||||||
"<leader>ge",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
|
||||||
end,
|
|
||||||
desc = "Git explorer",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>be",
|
|
||||||
function()
|
|
||||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
|
||||||
end,
|
|
||||||
desc = "Buffer explorer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
deactivate = function()
|
|
||||||
vim.cmd([[Neotree close]])
|
|
||||||
end,
|
|
||||||
init = function()
|
|
||||||
if vim.fn.argc() == 1 then
|
|
||||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
|
||||||
if stat and stat.type == "directory" then
|
|
||||||
require("neo-tree")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
opts = {
|
opts = {
|
||||||
sources = { "filesystem", "git_status", "buffers", "document_symbols" },
|
|
||||||
-- source_selector = {
|
|
||||||
-- winbar = true,
|
|
||||||
-- statusline = true,
|
|
||||||
-- },
|
|
||||||
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
|
|
||||||
enable_git_status = true,
|
|
||||||
enable_diagnostics = true,
|
|
||||||
filesystem = {
|
|
||||||
bind_to_cwd = false,
|
|
||||||
follow_current_file = { enabled = true },
|
|
||||||
use_libuv_file_watcher = true,
|
|
||||||
},
|
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
["<space>"] = "none",
|
|
||||||
["e"] = "open",
|
["e"] = "open",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default_component_configs = {
|
|
||||||
indent = {
|
|
||||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
|
||||||
expander_collapsed = "",
|
|
||||||
expander_expanded = "",
|
|
||||||
expander_highlight = "NeoTreeExpander",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
opts.event_handlers = opts.event_handlers or {}
|
|
||||||
|
|
||||||
local function on_move(data)
|
|
||||||
local clients = vim.lsp.get_active_clients()
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
if client:supports_method("workspace/willRenameFiles") then
|
|
||||||
local resp = client.request_sync("workspace/willRenameFiles", {
|
|
||||||
files = {
|
|
||||||
{
|
|
||||||
oldUri = vim.uri_from_fname(data.source),
|
|
||||||
newUri = vim.uri_from_fname(data.destination),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, 1000)
|
|
||||||
if resp and resp.result ~= nil then
|
|
||||||
vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local events = require("neo-tree.events")
|
|
||||||
vim.list_extend(opts.event_handlers, {
|
|
||||||
{ event = events.FILE_MOVED, handler = on_move },
|
|
||||||
{ event = events.FILE_RENAMED, handler = on_move },
|
|
||||||
})
|
|
||||||
require("neo-tree").setup(opts)
|
|
||||||
vim.api.nvim_create_autocmd("TermClose", {
|
|
||||||
pattern = "*lazygit",
|
|
||||||
callback = function()
|
|
||||||
if package.loaded["neo-tree.sources.git_status"] then
|
|
||||||
require("neo-tree.sources.git_status").refresh()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue