feat(nvim): add smoothscrolling to the options if nvim nightly is present
This commit is contained in:
1 parent
880ce25631
commit
d5a3c23f80
44 files changed
+243
-126
No files matched your search
@@ -39,6 +39,7 @@ return {
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local icon = require("lazyvim.config").icons.kinds.Codeium
|
||||
local function show_codeium_status()
|
||||
|
||||
@@ -27,6 +27,7 @@ return {
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local function is_active()
|
||||
local ok, hydra = pcall(require, "hydra.statusline")
|
||||
|
||||
@@ -26,6 +26,7 @@ return {
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 1, require("recorder").displaySlots)
|
||||
end,
|
||||
|
||||
File renamed without changes.
+3
-2
@@ -17,6 +17,7 @@ return {
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, require("arrow.statusline").text_for_statusline_with_icons())
|
||||
end,
|
||||
@@ -26,7 +27,7 @@ return {
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
-- stylua: ignore
|
||||
local button = dashboard.button("m", " " .. " Marks", function() require("arrow.ui").openMenu() end)
|
||||
local button = dashboard.button("m", " " .. " Marks", function() require("arrow.ui").openMenu() end)
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
@@ -40,7 +41,7 @@ return {
|
||||
local arrow = {
|
||||
action = function() require("arrow.ui").openMenu() end,
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
local keys = {}
|
||||
|
||||
-- stylua: ignore start
|
||||
for i = 1, 9 do
|
||||
table.insert(keys, { "<leader><cr>" .. i, "<cmd>Grapple select index=" .. i .. "<CR>", desc = "File " .. i })
|
||||
end
|
||||
|
||||
table.insert(keys, { "<leader><cr>a", "<cmd>Grapple tag<CR>", desc = "Add Mark" })
|
||||
table.insert(keys, { "<leader><cr><cr>", "<cmd>Grapple toggle_tags<CR>", desc = "Marks" })
|
||||
table.insert(keys, { "<leader><cr>t", "<cmd>Telescope grapple tags<CR>", desc = "Marks (Telescope)" })
|
||||
table.insert(keys, { "<leader><cr>C", "<cmd>Grapple reset<CR>", desc = "Clear all Marks" })
|
||||
table.insert(keys, { "<leader><cr>c", "<cmd>Grapple untag<CR>", desc = "Clear current Mark" })
|
||||
table.insert(keys, { "<leader><cr>s", "<cmd>Grapple toggle_scopes<CR>", desc = "Scopes" })
|
||||
table.insert(keys, { "<leader><cr>S", "<cmd>Grapple toggle_loaded<CR>", desc = "Loaded Scopes" })
|
||||
|
||||
table.insert(keys, { "]<cr>", "<cmd>Grapple cycle forward<CR>", desc = "Next Mark" })
|
||||
table.insert(keys, { "[<cr>", "<cmd>Grapple cycle backward<CR>", desc = "Prev Mark" })
|
||||
|
||||
table.insert(keys, { "<C-A-l>", "<cmd>Grapple cycle forward<CR>", desc = "Next Mark" })
|
||||
table.insert(keys, { "<C-A-h>", "<cmd>Grapple cycle backward<CR>", desc = "Prev Mark" })
|
||||
-- stylua: ignore end
|
||||
|
||||
return {
|
||||
{
|
||||
"cbochs/grapple.nvim",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
cmd = { "Grapple" },
|
||||
keys = keys,
|
||||
config = function()
|
||||
require("grapple").setup()
|
||||
require("lazyvim.util").on_load("telescope.nvim", function()
|
||||
require("telescope").load_extension("grapple")
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("m", " " .. " Marks", "<cmd>Grapple toggle_tags<CR>")
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local grapple = {
|
||||
action = "Grapple toggle_tags",
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
grapple.desc = grapple.desc .. string.rep(" ", 43 - #grapple.desc)
|
||||
grapple.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 5, grapple)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_c, { require("grapple").statusline, cond = require("grapple").exists })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader><cr>"] = { name = " marks" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
+12
-10
@@ -7,14 +7,14 @@ end
|
||||
|
||||
table.insert(keys, { "<leader><cr>a", function() require("harpoon"):list():append() end, desc = "Add Mark" })
|
||||
table.insert(keys, { "<leader><cr><cr>", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end, desc = "Marks" })
|
||||
table.insert(keys, { "<leader><cr>t", "<cmd>Telescope harpoon marks<CR>", desc = "Files (Telescope)" })
|
||||
table.insert(keys, { "<leader><cr>c", function() require("harpoon"):list():clear() end, desc = "Clear all Files" })
|
||||
table.insert(keys, { "<leader><cr>t", "<cmd>Telescope harpoon marks<CR>", desc = "Marks (Telescope)" })
|
||||
table.insert(keys, { "<leader><cr>c", function() require("harpoon"):list():clear() end, desc = "Clear all Marks" })
|
||||
|
||||
table.insert(keys, { "]<cr>", function() require("harpoon"):list():next() end, desc = "Next Mark File" })
|
||||
table.insert(keys, { "[<cr>", function() require("harpoon"):list():prev() end, desc = "Prev Mark File" })
|
||||
table.insert(keys, { "]<cr>", function() require("harpoon"):list():next() end, desc = "Next Mark" })
|
||||
table.insert(keys, { "[<cr>", function() require("harpoon"):list():prev() end, desc = "Prev Mark" })
|
||||
|
||||
table.insert(keys, { "<C-A-l>", function() require("harpoon"):list():next() end, desc = "Next Mark File" })
|
||||
table.insert(keys, { "<C-A-h>", function() require("harpoon"):list():prev() end, desc = "Prev Mark File" })
|
||||
table.insert(keys, { "<C-A-l>", function() require("harpoon"):list():next() end, desc = "Next Mark" })
|
||||
table.insert(keys, { "<C-A-h>", function() require("harpoon"):list():prev() end, desc = "Prev Mark" })
|
||||
-- stylua: ignore end
|
||||
|
||||
return {
|
||||
@@ -55,7 +55,8 @@ return {
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("m", " " .. " Marks", "<cmd>Telescope harpoon marks<CR>")
|
||||
-- stylua: ignore
|
||||
local button = dashboard.button("m", " " .. " Marks", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end)
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 5, button)
|
||||
@@ -66,9 +67,10 @@ return {
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local harpoon = {
|
||||
action = "Telescope harpoon marks",
|
||||
-- stylua: ignore
|
||||
action = function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end,
|
||||
desc = " Marks",
|
||||
icon = " ",
|
||||
icon = " ",
|
||||
key = "m",
|
||||
}
|
||||
|
||||
@@ -82,7 +84,7 @@ return {
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader><cr>"] = { name = " marks" },
|
||||
["<leader><cr>"] = { name = " marks" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1,5 +1,6 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"backdround/tabscope.nvim",
|
||||
opts = {},
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
config = function()
|
||||
require("lazyvim.util").on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
file_browser = {
|
||||
hijack_netrw = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("file_browser")
|
||||
end)
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>'", "<cmd>Telescope file_browser<cr>", desc = "Telescope File Browser (root dir)" },
|
||||
{ '<leader>"', "<cmd>Telescope file_browser path=%:p:h select_buffer=true<cr>", desc = "Telescope File Browser (cwd)" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
local keys = {}
|
||||
|
||||
-- stylua: ignore start
|
||||
for i = 1, 9 do
|
||||
table.insert(keys, { "<leader>b" .. i, "<cmd>BufferLineGoToBuffer " .. i .. "<cr>", desc = "Buffer " .. i })
|
||||
end
|
||||
|
||||
table.insert(keys, { "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" })
|
||||
table.insert(keys, { "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" })
|
||||
table.insert(keys, { "<leader>.", "<Cmd>BufferLinePick<CR>", desc = "Pick Buffer" })
|
||||
|
||||
table.insert(keys, { "<leader>bS", "<Cmd>BufferLineSortByDirectory<CR>", desc = "Sort By Directory" })
|
||||
table.insert(keys, { "<leader>bs", "<Cmd>BufferLineSortByExtension<CR>", desc = "Sort By Extensions" })
|
||||
-- stylua: ignore end
|
||||
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
keys = keys,
|
||||
opts = {
|
||||
options = {
|
||||
modified_icon = "",
|
||||
color_icons = true,
|
||||
separator_style = "slope",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
local cmp = require("cmp")
|
||||
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>ciC", "<cmd>CmpStatus<CR>", desc = "Cmp Status" },
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.mapping = cmp.mapping.preset.insert({
|
||||
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
})
|
||||
|
||||
opts.window = {
|
||||
completion = {
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
scrollbar = false,
|
||||
col_offset = -3,
|
||||
side_padding = 1,
|
||||
},
|
||||
documentation = {
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None",
|
||||
scrollbar = false,
|
||||
},
|
||||
}
|
||||
|
||||
opts.performance = {
|
||||
debounce = 20,
|
||||
throttle = 20,
|
||||
fetching_timeout = 20,
|
||||
confirm_resolve_timeout = 20,
|
||||
async_budget = 1,
|
||||
max_view_entries = 50,
|
||||
}
|
||||
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline({
|
||||
["<C-j>"] = {
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
["<C-k>"] = {
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
"nvimdev/dashboard-nvim",
|
||||
opts = function(_, opts)
|
||||
vim.api.nvim_create_autocmd("TabNewEntered", { command = "Dashboard" })
|
||||
|
||||
local logo = [[
|
||||
|
||||
████ ██████ █████ ██
|
||||
███████████ █████
|
||||
█████████ ███████████████████ ███ ███████████
|
||||
█████████ ███ █████████████ █████ ██████████████
|
||||
█████████ ██████████ █████████ █████ █████ ████ █████
|
||||
███████████ ███ ███ █████████ █████ █████ ████ █████
|
||||
██████ █████████████████████ ████ █████ █████ ████ ██████
|
||||
]]
|
||||
|
||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||
opts.config.header = vim.split(logo, "\n")
|
||||
return opts
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>fd", "<cmd>Dash<cr>", desc = "Dashboard" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
keys = {
|
||||
-- stylua: ignore
|
||||
{
|
||||
"s",
|
||||
mode = { "n", "x", "o" },
|
||||
function() require("flash").jump({ search = { mode = function(str) return "\\<" .. str end } }) end,
|
||||
desc = "Flash",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
yadm = { enable = true },
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 5,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
-- stylua: ignore
|
||||
{ "<leader>uB", "<cmd>Gitsigns toggle_current_line_blame<CR>", desc = "Toggle Line Blame" },
|
||||
{ "<leader>ghe", "<cmd>Gitsigns toggle_deleted<CR>", desc = "Deletions Inline" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
local nvim_0_10 = vim.fn.has("nvim-0.10")
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
|
||||
keys[#keys + 1] = { "<leader>cl", false }
|
||||
keys[#keys + 1] = { "<leader>cil", "<cmd>LspInfo<cr>", desc = "Lsp" }
|
||||
keys[#keys + 1] = { "<leader>clr", "<cmd>LspRestart<cr>", desc = "Restart Lsp" }
|
||||
keys[#keys + 1] = { "<leader>cls", "<cmd>LspStart<cr>", desc = "Start Lsp" }
|
||||
keys[#keys + 1] = { "<leader>clS", "<cmd>LspStop<cr>", desc = "Stop Lsp" }
|
||||
|
||||
-- stylua: ignore start
|
||||
keys[#keys + 1] = { "<leader>clr", function() vim.lsp.buf.remove_workspace_folder() end, desc = "Remove workspace" }
|
||||
keys[#keys + 1] = { "<leader>cla", function() vim.lsp.buf.add_workspace_folder() end, desc = "Add workspace" }
|
||||
-- stylua: ignore end
|
||||
end,
|
||||
opts = {
|
||||
diagnostics = {
|
||||
virtual_text = {
|
||||
float = {
|
||||
border = {
|
||||
{ "┌", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "┐", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "┘", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "└", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
inlay_hints = {
|
||||
enabled = nvim_0_10,
|
||||
},
|
||||
codelens = {
|
||||
enabled = nvim_0_10,
|
||||
},
|
||||
servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
hint = {
|
||||
enable = nvim_0_10,
|
||||
setType = nvim_0_10,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>cL"] = { name = "lsp" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
local util = require("lazyvim.util")
|
||||
|
||||
-- Format and pretty_path extracted from https://github.com/LazyVim/LazyVim/discussions/2605
|
||||
local function format(component, text, hl_group)
|
||||
if not hl_group then
|
||||
return text
|
||||
end
|
||||
|
||||
---@type table<string, string>
|
||||
component.hl_cache = component.hl_cache or {}
|
||||
local lualine_hl_group = component.hl_cache[hl_group]
|
||||
if not lualine_hl_group then
|
||||
local utils = require("lualine.utils.utils")
|
||||
local mygui = function()
|
||||
local mybold = utils.extract_highlight_colors(hl_group, "bold") and "bold"
|
||||
local myitalic = utils.extract_highlight_colors(hl_group, "italic") and "italic"
|
||||
if mybold and myitalic then
|
||||
return mybold .. "," .. myitalic
|
||||
elseif mybold then
|
||||
return mybold
|
||||
elseif myitalic then
|
||||
return myitalic
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
lualine_hl_group = component:create_hl({
|
||||
fg = utils.extract_highlight_colors(hl_group, "fg"),
|
||||
gui = mygui(),
|
||||
}, "LV_" .. hl_group)
|
||||
component.hl_cache[hl_group] = lualine_hl_group
|
||||
end
|
||||
return component:format_hl(lualine_hl_group) .. text .. component:get_default_hl()
|
||||
end
|
||||
|
||||
local function pretty_path(opts)
|
||||
opts = vim.tbl_extend("force", {
|
||||
relative = "cwd",
|
||||
modified_hl = "NeogitGraphBoldYellow",
|
||||
filename_hl = "NeogitGraphBoldWhite",
|
||||
dirpath_hl = "Conceal",
|
||||
}, opts or {})
|
||||
|
||||
return function(self)
|
||||
local path = vim.fn.expand("%:p") --[[@as string]]
|
||||
if path == "" then
|
||||
return ""
|
||||
end
|
||||
|
||||
local root = util.root.get({ normalize = true })
|
||||
local cwd = util.root.cwd()
|
||||
|
||||
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
|
||||
path = path:sub(#cwd + 2)
|
||||
else
|
||||
path = path:sub(#root + 2)
|
||||
end
|
||||
|
||||
local sep = package.config:sub(1, 1)
|
||||
local parts = vim.split(path, "[\\/]")
|
||||
|
||||
if #parts > 3 then
|
||||
parts = { parts[1], "…", parts[#parts - 1], parts[#parts] }
|
||||
end
|
||||
|
||||
if opts.modified_hl and vim.bo.modified then
|
||||
parts[#parts] = format(self, parts[#parts], opts.modified_hl)
|
||||
else
|
||||
parts[#parts] = format(self, parts[#parts], opts.filename_hl)
|
||||
end
|
||||
|
||||
local dirpath = ""
|
||||
if #parts > 1 then
|
||||
dirpath = table.concat({ unpack(parts, 1, #parts - 1) }, sep)
|
||||
dirpath = format(self, dirpath .. sep, opts.dirpath_hl)
|
||||
end
|
||||
return dirpath .. parts[#parts]
|
||||
end
|
||||
end
|
||||
|
||||
local lsp = function()
|
||||
local buf_clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
if #buf_clients == 0 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return " "
|
||||
end
|
||||
|
||||
local formatter = function()
|
||||
local formatters = require("conform").list_formatters(0)
|
||||
if #formatters == 0 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return " "
|
||||
end
|
||||
|
||||
local linter = function()
|
||||
local linters = require("lint").linters_by_ft[vim.bo.filetype]
|
||||
if #linters == 0 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return " "
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.options.component_separators = { left = "", right = "" }
|
||||
opts.options.section_separators = { left = "", right = "" }
|
||||
|
||||
opts.sections.lualine_a = { { "mode", icon = "" } }
|
||||
opts.sections.lualine_c[4] = { pretty_path({ filename_hl = "Bold", modified_hl = "MatchParen" }) }
|
||||
|
||||
table.insert(opts.sections.lualine_x, 2, lsp)
|
||||
table.insert(opts.sections.lualine_x, 2, formatter)
|
||||
table.insert(opts.sections.lualine_x, 2, linter)
|
||||
opts.sections.lualine_y = { "progress" }
|
||||
opts.sections.lualine_z = {
|
||||
{ "location", separator = "" },
|
||||
{
|
||||
function()
|
||||
return ""
|
||||
end,
|
||||
padding = { left = 0, right = 1 },
|
||||
},
|
||||
}
|
||||
opts.extensions = {
|
||||
"lazy",
|
||||
"man",
|
||||
"mason",
|
||||
"nvim-dap-ui",
|
||||
"overseer",
|
||||
"quickfix",
|
||||
"toggleterm",
|
||||
"trouble",
|
||||
"neo-tree",
|
||||
"symbols-outline",
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip").filetype_extend("typescript", { "tsdoc" })
|
||||
require("luasnip").filetype_extend("typescript", { "next-ts" })
|
||||
require("luasnip").filetype_extend("javascript", { "jsdoc" })
|
||||
require("luasnip").filetype_extend("javascript", { "next" })
|
||||
require("luasnip").filetype_extend("lua", { "luadoc" })
|
||||
require("luasnip").filetype_extend("python", { "pydoc" })
|
||||
require("luasnip").filetype_extend("rust", { "rustdoc" })
|
||||
require("luasnip").filetype_extend("cs", { "csharpdoc" })
|
||||
require("luasnip").filetype_extend("java", { "javadoc" })
|
||||
require("luasnip").filetype_extend("c", { "cdoc" })
|
||||
require("luasnip").filetype_extend("cpp", { "cppdoc" })
|
||||
require("luasnip").filetype_extend("php", { "phpdoc" })
|
||||
require("luasnip").filetype_extend("kotlin", { "kdoc" })
|
||||
require("luasnip").filetype_extend("ruby", { "rdoc" })
|
||||
require("luasnip").filetype_extend("sh", { "shelldoc" })
|
||||
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
keys = {
|
||||
{ "<leader>cm", false },
|
||||
{ "<leader>cim", "<cmd>Mason<cr>", desc = "Mason" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
close_if_last_window = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["l"] = "open",
|
||||
["e"] = function()
|
||||
vim.api.nvim_exec("Neotree focus filesystem left", true)
|
||||
end,
|
||||
["b"] = function()
|
||||
vim.api.nvim_exec("Neotree focus buffers left", true)
|
||||
end,
|
||||
["g"] = function()
|
||||
vim.api.nvim_exec("Neotree focus git_status left", true)
|
||||
end,
|
||||
["h"] = "close_node",
|
||||
["<c-/>"] = "fuzzy_finder_directory",
|
||||
["D"] = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local log = require("neo-tree.log")
|
||||
state.clipboard = state.clipboard or {}
|
||||
if diff_Node and diff_Node ~= tostring(node.id) then
|
||||
local current_Diff = node.id
|
||||
require("neo-tree.utils").open_file(state, diff_Node, open)
|
||||
vim.cmd("vert diffs " .. current_Diff)
|
||||
log.info("Diffing " .. diff_Name .. " against " .. node.name)
|
||||
diff_Node = nil
|
||||
current_Diff = nil
|
||||
state.clipboard = {}
|
||||
require("neo-tree.ui.renderer").redraw(state)
|
||||
else
|
||||
local existing = state.clipboard[node.id]
|
||||
if existing and existing.action == "diff" then
|
||||
state.clipboard[node.id] = nil
|
||||
diff_Node = nil
|
||||
require("neo-tree.ui.renderer").redraw(state)
|
||||
else
|
||||
state.clipboard[node.id] = { action = "diff", node = node }
|
||||
diff_Name = state.clipboard[node.id].node.name
|
||||
diff_Node = tostring(state.clipboard[node.id].node.id)
|
||||
log.info("Diff source file " .. diff_Name)
|
||||
require("neo-tree.ui.renderer").redraw(state)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_default",
|
||||
window = {
|
||||
mappings = {
|
||||
["O"] = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local path = node:get_id()
|
||||
vim.fn.jobstart({ "xdg-open", path }, { detach = true })
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.routes, {
|
||||
filter = {
|
||||
event = "notify",
|
||||
find = "No information available",
|
||||
},
|
||||
opts = {
|
||||
skip = true,
|
||||
},
|
||||
})
|
||||
opts.presets.lsp_doc_border = true
|
||||
opts.presets.bottom_search = false
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"rcarriga/nvim-notify",
|
||||
opts = {
|
||||
fps = 75,
|
||||
stages = "slide",
|
||||
render = "wrapped-compact",
|
||||
timeout = 2000,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
local isActive = true
|
||||
local p = require("persistence")
|
||||
|
||||
return {
|
||||
"folke/persistence.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>qS",
|
||||
function()
|
||||
p.save()
|
||||
vim.notify("Session saved", vim.log.levels.INFO, { title = "Persistence" })
|
||||
end,
|
||||
desc = "Save Session",
|
||||
},
|
||||
-- stylua: ignore start
|
||||
{ "<leader>qt",
|
||||
function()
|
||||
if isActive then
|
||||
p.stop()
|
||||
isActive = false
|
||||
vim.notify("Stopped session recording", vim.log.levels.INFO, { title = "Persistence" })
|
||||
else
|
||||
p.start()
|
||||
isActive = true
|
||||
vim.notify("Started session recording", vim.log.levels.INFO, { title = "Persistence" })
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Current Session Recording"
|
||||
},
|
||||
-- stylua: ignore end
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
cmd = "Spectre",
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>srg", function() require("spectre").toggle() end, desc = "Globally" },
|
||||
{ "<leader>srG", mode = { "n" }, function() require("spectre").open_visual({ select_word = true }) end, desc = "Word Globally" },
|
||||
{ "<leader>srG", mode = { "v" }, function() require("spectre").open_visual() end, desc = "Word Globally" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>sr"] = { name = "replace" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
local Util = require("lazyvim.util")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<leader>ssa",
|
||||
Util.telescope("lsp_document_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }),
|
||||
desc = "All",
|
||||
},
|
||||
{ "<leader>ssc", Util.telescope("lsp_document_symbols", { symbols = { "Class" } }), desc = "Class" },
|
||||
{ "<leader>ssf", Util.telescope("lsp_document_symbols", { symbols = { "Function" } }), desc = "Function" },
|
||||
{ "<leader>ssm", Util.telescope("lsp_document_symbols", { symbols = { "Method" } }), desc = "Method" },
|
||||
{ "<leader>ssC", Util.telescope("lsp_document_symbols", { symbols = { "Constructor" } }), desc = "Constructor" },
|
||||
{ "<leader>sse", Util.telescope("lsp_document_symbols", { symbols = { "Enum" } }), desc = "Enum" },
|
||||
{ "<leader>ssi", Util.telescope("lsp_document_symbols", { symbols = { "Interface" } }), desc = "Interface" },
|
||||
{ "<leader>ssM", Util.telescope("lsp_document_symbols", { symbols = { "Module" } }), desc = "Module" },
|
||||
{ "<leader>sss", Util.telescope("lsp_document_symbols", { symbols = { "Struct" } }), desc = "Struct" },
|
||||
{ "<leader>sst", Util.telescope("lsp_document_symbols", { symbols = { "Trait" } }), desc = "Trait" },
|
||||
{ "<leader>ssF", Util.telescope("lsp_document_symbols", { symbols = { "Field" } }), desc = "Field" },
|
||||
{ "<leader>ssp", Util.telescope("lsp_document_symbols", { symbols = { "Property" } }), desc = "Property" },
|
||||
{ "<leader>ssv", Util.telescope("lsp_document_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" },
|
||||
{
|
||||
"<leader>sSa",
|
||||
Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }),
|
||||
desc = "All",
|
||||
},
|
||||
{ "<leader>sSc", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Class" } }), desc = "Class" },
|
||||
{ "<leader>sSf", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Function" } }), desc = "Function" },
|
||||
{ "<leader>sSm", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Method" } }), desc = "Method" },
|
||||
{ "<leader>sSC", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Constructor" } }), desc = "Constructor" },
|
||||
{ "<leader>sSe", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Enum" } }), desc = "Enum" },
|
||||
{ "<leader>sSi", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Interface" } }), desc = "Interface" },
|
||||
{ "<leader>sSM", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Module" } }), desc = "Module" },
|
||||
{ "<leader>sSs", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Struct" } }), desc = "Struct" },
|
||||
{ "<leader>sSt", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Trait" } }), desc = "Trait" },
|
||||
{ "<leader>sSF", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Field" } }), desc = "Field" },
|
||||
{ "<leader>sSp", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Property" } }), desc = "Property" },
|
||||
{ "<leader>sSv", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" },
|
||||
{ "<leader>sA", Util.telescope("treesitter"), desc = "Treesitter Symbols" },
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-r>"] = actions.delete_buffer,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<S-esc>"] = actions.close,
|
||||
["<C-p>"] = require("telescope.actions.layout").toggle_preview,
|
||||
["<C-Down>"] = actions.cycle_history_next,
|
||||
["<C-Up>"] = actions.cycle_history_prev,
|
||||
},
|
||||
},
|
||||
file_ignore_patterns = {
|
||||
".gitignore",
|
||||
"node_modules",
|
||||
"build",
|
||||
"dist",
|
||||
"yarn.lock",
|
||||
"*.git/*",
|
||||
"*/tmp/*",
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = false,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({}),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>sS"] = { name = "Goto Symbols (Workspace)" },
|
||||
["<leader>ss"] = { name = "Goto Symbols" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
icons = {
|
||||
group = "",
|
||||
},
|
||||
layout = {
|
||||
align = "center",
|
||||
},
|
||||
defaults = {
|
||||
["<leader>ci"] = { name = "info" },
|
||||
["<leader><tab>"] = { name = " tabs" },
|
||||
["<leader>b"] = { name = " buffer" },
|
||||
["<leader>c"] = { name = " code" },
|
||||
["<leader>f"] = { name = " file/find" },
|
||||
["<leader>g"] = { name = " git" },
|
||||
["<leader>l"] = { name = " lazy" },
|
||||
["<leader>q"] = { name = " quit/session" },
|
||||
["<leader>s"] = { name = " search" },
|
||||
["<leader>u"] = { name = " ui" },
|
||||
["<leader>w"] = { name = " windows" },
|
||||
["<leader>x"] = { name = " diagnostics/quickfix" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -34,6 +34,9 @@ return {
|
||||
["typescript"] = { "biome" },
|
||||
["typescriptreact"] = { "biome" },
|
||||
["javascriptreact"] = { "biome" },
|
||||
["astro"] = { "biome" },
|
||||
["svelte"] = { "biome" },
|
||||
["vue"] = { "biome" },
|
||||
})
|
||||
|
||||
opts.formatters = {
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "cspell" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft["*"] = opts.linters_by_ft["*"] or {}
|
||||
table.insert(opts.linters_by_ft["*"], "cspell")
|
||||
|
||||
opts.linters.cspell = {
|
||||
condition = function(ctx)
|
||||
if vim.fs.find({ "cspell.json" }, { path = ctx.filename, upward = true })[1] then
|
||||
-- stylua: ignore
|
||||
vim.keymap.set("n", "<leader>!", function() require("util.cspell").addWordToDictionary() end, { desc = "Add Word to Dictionary", silent = true })
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"antosha417/nvim-lsp-file-operations",
|
||||
opts = {},
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"j-hui/fidget.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
lsp = {
|
||||
progress = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
return {
|
||||
{
|
||||
|
||||
"luukvbaal/statuscol.nvim",
|
||||
event = { "LazyFile" },
|
||||
opts = function()
|
||||
|
||||
Reference in new issue
Block a user