nvim: update plugin set

This commit is contained in:
Gabriel Arazas 2025-01-24 13:38:27 +08:00
parent 9854576ddc
commit 500647c9c1
6 changed files with 206 additions and 18 deletions

View File

@ -12,18 +12,27 @@
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" },
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
"neorg": { "branch": "main", "commit": "ed43ed58116caa0a17bbbc7aa663e32bf94bc531" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" },
"nvim-lspconfig": { "branch": "master", "commit": "14b5a806c928390fac9ff4a5630d20eb902afad8" },
"nvim-treesitter": { "branch": "master", "commit": "4423f3053964461656c7432fd33f205ef88a6168" },
"nvim-lspconfig": { "branch": "master", "commit": "c31abb8e7cde38b8d664338b39d9c8d51ccd28e7" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "master", "commit": "6587a5886873cce8698a47477224c30578b33a24" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
"oil.nvim": { "branch": "master", "commit": "7a782c9a9cb7a16ec52199e55a1e892262c5dbbc" },
"pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"snacks.nvim": { "branch": "main", "commit": "611df4b3ad0a52fa7fa145e757169e92ec979bbf" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
"vim-airline": { "branch": "master", "commit": "7a552f415c48aed33bf7eaa3c50e78504d417913" },
"vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" },
"vim-nix": { "branch": "master", "commit": "e25cd0f2e5922f1f4d3cd969f92e35a9a327ffb0" },
"vimspector": { "branch": "master", "commit": "5e24df822e278ee79abfc8c7110089a5322d1a3c" },
"which-key.nvim": { "branch": "main", "commit": "6cebd86917df559a88de0f806b2989799c6e6423" },
"zig.vim": { "branch": "master", "commit": "f023e86b042c0d5bef68b9f0651144a6bf6d642e" }
}

View File

@ -13,8 +13,50 @@ return {
end,
},
-- More useful status bar
"vim-airline/vim-airline",
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
icons_enabled = true,
always_divide_middle = true,
globalstatus = true,
-- Disable the section separators.
section_separators = {
left = "",
right = "",
},
sections = {
lualine_a = { "mode" },
lualine_c = {
{
"filename",
newline_status = true,
shorting_target = 10,
path = 1,
},
},
lualine_z = { "location" },
},
},
},
-- Remember your keys.
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
},
-- Colorize common color strings
{

View File

@ -108,7 +108,7 @@ return {
"clangd",
"rust_analyzer",
"pyright",
"tsserver",
"ts_ls",
"nixd",
"lua_ls",
"rubocop",

View File

@ -10,6 +10,13 @@ return {
config = function()
local telescope = require("telescope")
telescope.setup({
defaults = {
layout_config = {
height = 0.95,
width = 0.9,
anchor_padding = 0,
},
},
extensions = {
project = {
base_dirs = {
@ -30,23 +37,26 @@ return {
end
end
vim.keymap.set("n", "<leader>ff", get_builtin("find_files", { hidden = true }), opts)
vim.keymap.set("n", "<leader>ff", get_builtin("find_files", { hidden = true, preview = false }), {
noremap = true,
desc = "Find files in project",
})
vim.keymap.set("n", "<leader>fF", function()
builtins.find_files({
cwd = require("telescope.utils").buffer_dir(),
hidden = true,
preview = false,
})
end, opts)
end, { noremap = true, desc = "Find files in current directory" })
vim.keymap.set("n", "<leader>fg", get_builtin("grep_string"), opts)
vim.keymap.set("n", "<leader>fG", get_builtin("live_grep"), opts)
vim.keymap.set("n", "<leader>fb", get_builtin("buffers"), opts)
vim.keymap.set("n", "<leader>fh", get_builtin("help_tags"), opts)
vim.keymap.set("n", "<leader>ft", get_builtin("treesitter"), opts)
vim.keymap.set("n", "<leader>fb", get_builtin("buffers"), opts)
vim.keymap.set("n", "<leader>fM", get_builtin("man_pages"), opts)
vim.keymap.set("n", "<leader>fg", get_builtin("grep_string"), { noremap = true, desc = "Grep for string in cursor" })
vim.keymap.set("n", "<leader>fG", get_builtin("live_grep"), { noremap = true, desc = "Grep for string in project" })
vim.keymap.set("n", "<leader>fb", get_builtin("buffers"), { noremap = true, desc = "Search currently opened buffers" })
vim.keymap.set("n", "<leader>fh", get_builtin("help_tags"), { noremap = true, desc = "Search help pages" })
vim.keymap.set("n", "<leader>ft", get_builtin("treesitter"), { noremap = true, desc = "Search treesitter objects" })
vim.keymap.set("n", "<leader>fM", get_builtin("man_pages"), { noremap = true, desc = "Search manpages" })
vim.keymap.set("n", "<leader>fA", get_builtin("resume"), opts)
vim.keymap.set("n", "<leader>fA", get_builtin("resume"), { noremap = true, desc = "Return last search" })
-- Ekeymap.set
vim.keymap.set("n", "<leader>fp", [[<cmd>lua require("telescope").extensions.project.project({})<cr>]], opts)
@ -57,7 +67,7 @@ return {
{
"ThePrimeagen/harpoon",
config = function()
vim.keymap.set("n", "<leader>fm", "<cmd>lua require('harpoon.mark').add_file()<cr>", {})
vim.keymap.set("n", "<leader>fm", "<cmd>lua require('harpoon.mark').add_file()<cr>", { desc = "Add mark to file" })
local has_telescope, telescope = pcall("telescope")
if has_telescope then

View File

@ -0,0 +1,39 @@
local function get_note(subfolder)
return vim.fn.expand("~/Documents/Notes/") .. subfolder
end
return {
{
"nvim-neorg/neorg",
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
version = "*", -- Pin Neorg to the latest stable release
config = true,
opts = {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.completion"] = {
config = {
engine = "nvim-cmp",
},
},
["core.journal"] = {
config = {
strategy = "flat",
},
},
["core.summary"] = {},
["core.ui.calendar"] = {},
["core.dirman"] = {
config = {
workspaces = {
personal = get_note("Personal"),
work = get_note("Work"),
wiki = get_note("Wiki"),
},
},
},
},
},
}
}

88
nvim/lua/plugins/qol.lua Normal file
View File

@ -0,0 +1,88 @@
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
indent = {
enabled = true,
char = "",
scope = {
underline = true,
},
chunk = {
enabled = true,
},
},
input = { enabled = true },
notifier = { enabled = true },
git = { enabled = true, },
lazygit = {
enabled = vim.fn.executable("lazygit") == 1,
},
quickfile = { enabled = true },
rename = { enabled = true },
scope = { enabled = true },
statuscolumn = { enabled = true },
toggle = {
enabled = true,
which_key = pcall(require, "which-key"),
},
words = { enabled = true },
},
keys = {
{ "<leader>gb", function() Snacks.git.blame_line() end, desc = "Open blame lines for current file" },
{ "<leader>gg", function() Snacks.lazygit() end, desc = "Open lazygit" },
{ "<leader>gf", function() Snacks.lazygit.log_file() end, desc = "Open current file history in lazygit" },
},
init = function()
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
-- Setup some globals for debugging (lazy-loaded)
_G.dd = function(...)
Snacks.debug.inspect(...)
end
_G.bt = function()
Snacks.debug.backtrace()
end
vim.print = _G.dd -- Override print to use snacks for `:=` command
-- Create some toggle mappings
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
Snacks.toggle.option("relativenumber", { name = "Relative number" }):map("<leader>uL")
Snacks.toggle.diagnostics():map("<leader>ud")
Snacks.toggle.line_number():map("<leader>ul")
Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map("<leader>uc")
Snacks.toggle.treesitter():map("<leader>uT")
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark style" }):map("<leader>ub")
Snacks.toggle.inlay_hints():map("<leader>uh")
Snacks.toggle.indent():map("<leader>ug")
Snacks.toggle.dim():map("<leader>uD")
end,
})
end,
},
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
default_file_explorer = true,
columns = { "icon", "permissions" },
view_options = {
hidden = true,
},
},
keys = {
{ "-", "<cmd>Oil<CR>", { desc = "Open parent directory in file explorer" } },
},
},
}