nvim: Use lazy instead of vim.pack
This commit is contained in:
parent
24fd231176
commit
b951634ce6
@ -1,3 +1,30 @@
|
|||||||
require('set')
|
require('set')
|
||||||
require('plugins')
|
|
||||||
require('keymaps')
|
require('keymaps')
|
||||||
|
require('lsp')
|
||||||
|
|
||||||
|
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
checker = { enabled = true },
|
||||||
|
change_detection = {
|
||||||
|
enabled = false
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|||||||
30
nvim/.config/nvim/lazy-lock.json
Normal file
30
nvim/.config/nvim/lazy-lock.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" },
|
||||||
|
"auto-session": { "branch": "main", "commit": "292492ab7af4bd8b9e37e28508bc8ce995722fd5" },
|
||||||
|
"copilot.lua": { "branch": "master", "commit": "5bde2cfe01f049f522eeb8b52c5c723407db8bdf" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
|
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||||
|
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
|
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "81aec1e45d58b587fa055a938cd6642c6b94ba4d" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||||
|
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||||
|
"outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "0294ae3eafe662c438addb8692d9c98ef73a983e" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
||||||
|
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||||
|
"vim-flog": { "branch": "master", "commit": "665b16ac8915f746bc43c9572b4581a5e9047216" },
|
||||||
|
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||||
|
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
}
|
||||||
@ -1,3 +1,10 @@
|
|||||||
|
--
|
||||||
|
--
|
||||||
|
-- Completion config
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
vim.o.completeopt = "menu,menuone,noinsert,fuzzy"
|
vim.o.completeopt = "menu,menuone,noinsert,fuzzy"
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("i", "<C-Space>", "<C-x><C-o>", { noremap = true })
|
vim.api.nvim_set_keymap("i", "<C-Space>", "<C-x><C-o>", { noremap = true })
|
||||||
@ -49,3 +56,38 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, { desc = "Go to definition" })
|
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, { desc = "Go to definition" })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- Diagnostics config
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = true,
|
||||||
|
severity_sort = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
|
callback = function()
|
||||||
|
local width = vim.api.nvim_win_get_width(0);
|
||||||
|
|
||||||
|
vim.diagnostic.open_float(nil, {
|
||||||
|
scope = "cursor",
|
||||||
|
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||||
|
source = true,
|
||||||
|
relative = "editor",
|
||||||
|
width = 40,
|
||||||
|
focusable = false,
|
||||||
|
focused = false,
|
||||||
|
border = "rounded",
|
||||||
|
title = "Diagnostics",
|
||||||
|
header = "",
|
||||||
|
title_pos = "center",
|
||||||
|
offset_x = width,
|
||||||
|
offset_y = -1,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
@ -85,8 +85,10 @@ end
|
|||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
|
||||||
vim.pack.add({ "https://github.com/goolord/alpha-nvim" })
|
return {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
local dashboard = require("alpha.themes.dashboard")
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
dashboard.section.header.val = get_random_image()
|
dashboard.section.header.val = get_random_image()
|
||||||
dashboard.section.buttons.val = {
|
dashboard.section.buttons.val = {
|
||||||
@ -100,3 +102,5 @@ dashboard.section.buttons.val = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
require("alpha").setup(dashboard.opts)
|
require("alpha").setup(dashboard.opts)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|||||||
@ -1,13 +1,20 @@
|
|||||||
vim.pack.add({
|
return {
|
||||||
-- dependencies
|
"https://github.com/rmagatti/auto-session",
|
||||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
-- TODO: This forces telescope to be loaded non-lazily. Fix this
|
||||||
{ src = "https://github.com/nvim-telescope/telescope.nvim" },
|
dependencies = {
|
||||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
"https://github.com/nvim-lua/plenary.nvim",
|
||||||
-- plugin
|
"https://github.com/nvim-telescope/telescope.nvim",
|
||||||
{ src = "https://github.com/rmagatti/auto-session" }
|
"https://github.com/nvim-lualine/lualine.nvim"
|
||||||
})
|
},
|
||||||
|
init = function()
|
||||||
require("auto-session").setup({
|
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ '<leader>ss', '<cmd>AutoSession save<CR>', desc = "Save" },
|
||||||
|
{ '<leader>sd', '<cmd>AutoSession delete<CR>', desc = "Delete" },
|
||||||
|
{ '<leader>fs', '<cmd>Telescope session-lens<CR>', desc = "Session" }
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||||
log_level = "error",
|
log_level = "error",
|
||||||
auto_save_enabled = false,
|
auto_save_enabled = false,
|
||||||
@ -19,12 +26,7 @@ require("auto-session").setup({
|
|||||||
alternate_session = { "i", "<C-s>" },
|
alternate_session = { "i", "<C-s>" },
|
||||||
copy_session = { "i", "<C-y>" },
|
copy_session = { "i", "<C-y>" },
|
||||||
},
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
lazy = false,
|
||||||
|
}
|
||||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ss', '<cmd>AutoSession save<CR>', { desc = "Save" })
|
|
||||||
vim.keymap.set('n', '<leader>sd', '<cmd>AutoSession delete<CR>', { desc = "Delete" })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>fs', '<cmd>Telescope session-lens<CR>', { desc = "Session-lens" })
|
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
-- vim.pack.add({ "https://github.com/zbirenbaum/copilot.lua" })
|
return {
|
||||||
--
|
"zbirenbaum/copilot.lua",
|
||||||
-- require("copilot").setup({
|
cmd = "Copilot",
|
||||||
-- suggestion = {
|
opts = {
|
||||||
-- auto_trigger = true,
|
suggestion = {
|
||||||
-- keymap = {
|
enabled = true,
|
||||||
-- accept = "<C-l>",
|
auto_trigger = true,
|
||||||
-- }
|
keymap = {
|
||||||
-- }
|
accept = "<C-l>"
|
||||||
-- })
|
}
|
||||||
--
|
}
|
||||||
-- -- TODO: Disable on startup. For some reason the below line gives an error
|
}
|
||||||
-- -- vim.cmd(':Copilot disable')
|
}
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
vim.pack.add({
|
return {
|
||||||
{ src = "https://github.com/tpope/vim-fugitive" },
|
{
|
||||||
{ src = "https://github.com/rbong/vim-flog" }
|
"https://github.com/tpope/vim-fugitive",
|
||||||
})
|
keys = { { "<leader>gs", vim.cmd.Git } }
|
||||||
|
},
|
||||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
{
|
||||||
|
"https://github.com/rbong/vim-flog",
|
||||||
|
dependencies = {
|
||||||
|
"https://github.com/tpope/vim-fugitive"
|
||||||
|
},
|
||||||
|
cmd = "Flog"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,21 +1,37 @@
|
|||||||
vim.pack.add({
|
return
|
||||||
{
|
{
|
||||||
src = "https://github.com/nvim-lua/plenary.nvim"
|
"ThePrimeagen/harpoon",
|
||||||
|
branch = "harpoon2",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
keys = {
|
||||||
|
{ "<leader>a", function() require("harpoon"):list():add() end },
|
||||||
|
{ "<C-e>", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end },
|
||||||
|
{ "<C-h>", function() require("harpoon"):list():select(1) end },
|
||||||
|
{ "<C-t>", function() require("harpoon"):list():select(2) end },
|
||||||
|
{ "<C-n>", function() require("harpoon"):list():select(3) end },
|
||||||
|
{ "<C-s>", function() require("harpoon"):list():select(4) end },
|
||||||
},
|
},
|
||||||
{
|
config = true
|
||||||
src = "https://github.com/ThePrimeagen/harpoon",
|
|
||||||
version = "harpoon2",
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
local harpoon = require("harpoon")
|
-- vim.pack.add({
|
||||||
|
-- {
|
||||||
harpoon:setup()
|
-- src = "https://github.com/nvim-lua/plenary.nvim"
|
||||||
|
-- },
|
||||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
-- {
|
||||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
-- src = "https://github.com/ThePrimeagen/harpoon",
|
||||||
|
-- version = "harpoon2",
|
||||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
-- }
|
||||||
vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end)
|
-- })
|
||||||
vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
|
--
|
||||||
vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
|
-- local harpoon = require("harpoon")
|
||||||
|
--
|
||||||
|
-- harpoon:setup()
|
||||||
|
--
|
||||||
|
-- vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||||
|
-- vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||||
|
--
|
||||||
|
-- vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||||
|
-- vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end)
|
||||||
|
-- vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
|
||||||
|
-- vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
local plugin_dir = vim.fn.stdpath('config') .. '/lua/plugins'
|
|
||||||
local plugin_files = vim.fn.glob(plugin_dir .. '/*', false, true)
|
|
||||||
|
|
||||||
for _, file in ipairs(plugin_files) do
|
|
||||||
local plugin_name = vim.fn.fnamemodify(file, ':t:r')
|
|
||||||
|
|
||||||
if plugin_name ~= "init" then
|
|
||||||
require('plugins.' .. plugin_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = true,
|
|
||||||
severity_sort = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("CursorHold", {
|
|
||||||
callback = function()
|
|
||||||
local width = vim.api.nvim_win_get_width(0);
|
|
||||||
|
|
||||||
vim.diagnostic.open_float(nil, {
|
|
||||||
scope = "cursor",
|
|
||||||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
|
||||||
source = true,
|
|
||||||
relative = "editor",
|
|
||||||
width = 40,
|
|
||||||
focusable = false,
|
|
||||||
focused = false,
|
|
||||||
border = "rounded",
|
|
||||||
title = "Diagnostics",
|
|
||||||
header = "",
|
|
||||||
title_pos = "center",
|
|
||||||
offset_x = width,
|
|
||||||
offset_y = -1,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
require("plugins.lsp.completion")
|
|
||||||
require("plugins.lsp.diagnostics")
|
|
||||||
require("plugins.lsp.plugin")
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
vim.pack.add({
|
|
||||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
|
||||||
{ src = "https://github.com/mason-org/mason-lspconfig.nvim" },
|
|
||||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
|
||||||
})
|
|
||||||
|
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup()
|
|
||||||
@ -1,9 +1,8 @@
|
|||||||
vim.pack.add({
|
return {
|
||||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
'nvim-lualine/lualine.nvim',
|
||||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" }
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
})
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
require("lualine").setup({
|
|
||||||
options = { theme = 'gruvbox_dark' },
|
options = { theme = 'gruvbox_dark' },
|
||||||
extensions = {
|
extensions = {
|
||||||
'mason',
|
'mason',
|
||||||
@ -33,4 +32,5 @@ require("lualine").setup({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,2 +1,21 @@
|
|||||||
require("plugins.luasnip.plugin")
|
return {
|
||||||
require("plugins.luasnip.completion-integration")
|
"https://github.com/rafamadriz/friendly-snippets",
|
||||||
|
dependencies = { "https://github.com/L3MON4D3/LuaSnip" },
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = function()
|
||||||
|
local loader = require("luasnip.loaders.from_lua")
|
||||||
|
loader.lazy_load({ paths = { "./snippets" } })
|
||||||
|
|
||||||
|
-- TODO: Find out how to enable autosnippets without having the status line disappear
|
||||||
|
require("luasnip").config.set_config({
|
||||||
|
-- enable_autosnippets = true,
|
||||||
|
store_selection_keys = "<leader>v"
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set({ "i", "s" }, "<c-j>", function() require("luasnip").jump(1) end, { silent = true })
|
||||||
|
vim.keymap.set({ "i", "s" }, "<c-k>", function() require("luasnip").jump(-1) end, { silent = true })
|
||||||
|
|
||||||
|
-- TODO: Is this keymap used?
|
||||||
|
vim.keymap.set({ "i" }, "<c-j>", function() require("luasnip").expand() end, { silent = true })
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
vim.pack.add({
|
|
||||||
{ src = "https://github.com/rafamadriz/friendly-snippets" },
|
|
||||||
{ src = "https://github.com/L3MON4D3/LuaSnip" }
|
|
||||||
})
|
|
||||||
|
|
||||||
local loader = require("luasnip.loaders.from_lua")
|
|
||||||
loader.lazy_load({ paths = { "./snippets" } })
|
|
||||||
|
|
||||||
-- TODO: Find out how to enable autosnippets without having the status line disappear
|
|
||||||
require("luasnip").config.set_config({
|
|
||||||
-- enable_autosnippets = true,
|
|
||||||
store_selection_keys = "<leader>v"
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set({ "i", "s" }, "<c-j>", function() require("luasnip").jump(1) end, { silent = true })
|
|
||||||
vim.keymap.set({ "i", "s" }, "<c-k>", function() require("luasnip").jump(-1) end, { silent = true })
|
|
||||||
|
|
||||||
-- TODO: Is this keymap used?
|
|
||||||
vim.keymap.set({ "i" }, "<c-j>", function() require("luasnip").expand() end, { silent = true })
|
|
||||||
9
nvim/.config/nvim/lua/plugins/mason.lua
Normal file
9
nvim/.config/nvim/lua/plugins/mason.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "mason-org/mason.nvim", config = true },
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
},
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = true,
|
||||||
|
}
|
||||||
@ -1,10 +1,8 @@
|
|||||||
vim.pack.add({
|
return {
|
||||||
{ src = "https://github.com/MunifTanjim/nui.nvim" },
|
"https://github.com/folke/noice.nvim",
|
||||||
{ src = "https://github.com/folke/noice.nvim" }
|
dependencies = { "https://github.com/MunifTanjim/nui.nvim" },
|
||||||
})
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
|
||||||
require("noice").setup({
|
|
||||||
messages = { enabled = false },
|
messages = { enabled = false },
|
||||||
views = {
|
views = {
|
||||||
history = {
|
history = {
|
||||||
@ -29,7 +27,7 @@ require("noice").setup({
|
|||||||
mini = {
|
mini = {
|
||||||
border = { style = "rounded" },
|
border = { style = "rounded" },
|
||||||
position = {
|
position = {
|
||||||
row = -3,
|
row = -2,
|
||||||
col = "100%",
|
col = "100%",
|
||||||
},
|
},
|
||||||
size = {
|
size = {
|
||||||
@ -38,4 +36,5 @@ require("noice").setup({
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,4 +1,11 @@
|
|||||||
vim.pack.add({"https://github.com/stevearc/oil.nvim"})
|
return {
|
||||||
require("oil").setup()
|
"stevearc/oil.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons"
|
||||||
|
},
|
||||||
|
lazy = false, -- Make sure oil is available for, e.g., `nvim .`
|
||||||
|
init = function()
|
||||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
end,
|
||||||
|
config = true
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
vim.pack.add({ "https://github.com/hedyhli/outline.nvim" })
|
return {
|
||||||
require("outline").setup({
|
"https://github.com/hedyhli/outline.nvim",
|
||||||
|
keys = {
|
||||||
|
{ "<leader>l", "<cmd>Outline<CR>", desc = "Toggle Outline" }
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
outline_window = {
|
outline_window = {
|
||||||
focus_on_open = false,
|
focus_on_open = false,
|
||||||
},
|
},
|
||||||
@ -7,6 +11,5 @@ require("outline").setup({
|
|||||||
autofold_depth = 3,
|
autofold_depth = 3,
|
||||||
markers = { '', '' },
|
markers = { '', '' },
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
}
|
||||||
vim.keymap.set("n", "<leader>l", "<cmd>Outline<CR>", { desc = "Toggle Outline" })
|
|
||||||
|
|||||||
@ -1 +1,4 @@
|
|||||||
vim.pack.add({"https://github.com/tpope/vim-surround"})
|
return {
|
||||||
|
"https://github.com/tpope/vim-surround",
|
||||||
|
event = "InsertEnter"
|
||||||
|
}
|
||||||
|
|||||||
@ -1,19 +1,18 @@
|
|||||||
vim.pack.add({
|
return {
|
||||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
"https://github.com/nvim-telescope/telescope.nvim",
|
||||||
{ src = "https://github.com/nvim-telescope/telescope.nvim" },
|
dependencies = {
|
||||||
{ src = "https://github.com/nvim-telescope/telescope-ui-select.nvim" }
|
"https://github.com/nvim-lua/plenary.nvim",
|
||||||
})
|
"https://github.com/nvim-telescope/telescope-ui-select.nvim",
|
||||||
|
},
|
||||||
vim.pack.add({})
|
cmd = { "Telescope" },
|
||||||
|
keys = {
|
||||||
vim.keymap.set('n', '<leader>ff', function() require("telescope.builtin").find_files() end, { desc = "Files" })
|
{ "<leader>ff", function() require("telescope.builtin").find_files() end, desc = "Files" },
|
||||||
vim.keymap.set('n', '<leader>fg', function() require("telescope.builtin").live_grep() end, { desc = "grep" })
|
{ "<leader>fg", function() require("telescope.builtin").live_grep() end, desc = "grep" },
|
||||||
vim.keymap.set('n', '<leader>fa', function() require("telescope.builtin").find_files({ hidden = true }) end,
|
{ "<leader>fa", function() require("telescope.builtin").find_files({ hidden = true }) end, desc = "All files" },
|
||||||
{ desc = "All files" })
|
{ "<leader>fb", function() require("telescope.builtin").buffers() end, desc = "Buffers" },
|
||||||
|
{ "<leader>fh", function() require("telescope.builtin").help_tags() end, desc = "Help tags" }
|
||||||
vim.keymap.set('n', '<leader>fb', function() require("telescope.builtin").buffers() end, { desc = "Buffers" })
|
},
|
||||||
vim.keymap.set('n', '<leader>fh', function() require("telescope.builtin").help_tags() end, { desc = "Help tags" })
|
config = function()
|
||||||
|
|
||||||
require("telescope").setup {
|
require("telescope").setup {
|
||||||
extensions = {
|
extensions = {
|
||||||
["ui-select"] = {
|
["ui-select"] = {
|
||||||
@ -21,5 +20,5 @@ require("telescope").setup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
end
|
||||||
require("telescope").load_extension("ui-select")
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
vim.pack.add({"https://github.com/ellisonleao/gruvbox.nvim"})
|
return {
|
||||||
|
"ellisonleao/gruvbox.nvim",
|
||||||
require("gruvbox").setup({
|
priority = 1000,
|
||||||
|
opts = {
|
||||||
contrast = "hard",
|
contrast = "hard",
|
||||||
transparent_mode = true,
|
transparent_mode = true
|
||||||
})
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("gruvbox").setup(opts)
|
||||||
vim.cmd("colorscheme gruvbox")
|
vim.cmd("colorscheme gruvbox")
|
||||||
|
end
|
||||||
-- TODO: Is this necessary?
|
}
|
||||||
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
vim.pack.add({
|
return {
|
||||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
"folke/todo-comments.nvim",
|
||||||
{ src = "https://github.com/folke/todo-comments.nvim" }
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
})
|
event = "BufEnter",
|
||||||
|
keys = {
|
||||||
require("todo-comments").setup()
|
{"<leader>ft", ":TodoTelescope<CR>", desc = "TODOs"}
|
||||||
|
},
|
||||||
vim.keymap.set("n", "<leader>ft", ":TodoTelescope<CR>")
|
config = true
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
vim.pack.add({ "https://github.com/akinsho/toggleterm.nvim" })
|
return {
|
||||||
|
"https://github.com/akinsho/toggleterm.nvim",
|
||||||
require("toggleterm").setup({
|
keys = {
|
||||||
|
"<c-\\>"
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
size = 30,
|
size = 30,
|
||||||
open_mapping = [[<c-\>]]
|
open_mapping = "<c-\\>"
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,18 +1,23 @@
|
|||||||
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
require("nvim-treesitter.configs").setup({
|
branch = 'main',
|
||||||
|
lazy = false, -- This plugin does not support lazy loading
|
||||||
|
build = ":TSUpdate",
|
||||||
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"cpp",
|
"cpp",
|
||||||
"c",
|
"c",
|
||||||
|
"python",
|
||||||
|
"rust",
|
||||||
"lua",
|
"lua",
|
||||||
"vim",
|
"markdown",
|
||||||
"vimdoc",
|
"vimdoc",
|
||||||
"query"
|
|
||||||
},
|
},
|
||||||
sync_install = false,
|
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = { "latex" }
|
-- TODO: Is this required?
|
||||||
|
additional_vim_regex_highlighting = { "latex" } -- Required for vimtex
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
vim.pack.add({"https://github.com/mbbill/undotree"})
|
return {
|
||||||
|
"https://github.com/mbbill/undotree",
|
||||||
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<CR>", { desc = "Undotree" })
|
keys = {
|
||||||
|
{ "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Undotree" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
vim.pack.add({ "https://github.com/folke/which-key.nvim" })
|
return {
|
||||||
|
"https://github.com/folke/which-key.nvim",
|
||||||
|
init = function()
|
||||||
vim.o.timeout = true
|
vim.o.timeout = true
|
||||||
vim.o.timeoutlen = 300
|
vim.o.timeoutlen = 300
|
||||||
|
end,
|
||||||
-- TODO: Add names for other nameless keymaps
|
event = "VeryLazy",
|
||||||
require("which-key").setup({
|
opts = {
|
||||||
|
-- TODO: Add names for other nameless keymaps, e.g.,
|
||||||
-- defaults = {
|
-- defaults = {
|
||||||
-- ["<leader>x"] = { name = "+Trouble" }
|
-- ["<leader>x"] = { name = "+Trouble" }
|
||||||
-- }
|
-- }
|
||||||
})
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("which-key").setup(opts)
|
||||||
|
|
||||||
require("which-key").add({
|
require("which-key").add({
|
||||||
{ "<leader>d", group = "Debug" },
|
{ "<leader>d", group = "Debug" },
|
||||||
@ -18,3 +22,5 @@ require("which-key").add({
|
|||||||
{ "<leader>s", group = "Session" },
|
{ "<leader>s", group = "Session" },
|
||||||
{ "<leader>x", group = "Trouble" }
|
{ "<leader>x", group = "Trouble" }
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
|
|||||||
@ -1,146 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": {
|
|
||||||
"LuaSnip": {
|
|
||||||
"rev": "3732756",
|
|
||||||
"src": "https://github.com/L3MON4D3/LuaSnip"
|
|
||||||
},
|
|
||||||
"alpha-nvim": {
|
|
||||||
"rev": "3979b01",
|
|
||||||
"src": "https://github.com/goolord/alpha-nvim"
|
|
||||||
},
|
|
||||||
"auto-session": {
|
|
||||||
"rev": "292492a",
|
|
||||||
"src": "https://github.com/rmagatti/auto-session"
|
|
||||||
},
|
|
||||||
"copilot.lua": {
|
|
||||||
"rev": "5bde2cf",
|
|
||||||
"src": "https://github.com/zbirenbaum/copilot.lua"
|
|
||||||
},
|
|
||||||
"dressing.nvim": {
|
|
||||||
"rev": "2d7c2db",
|
|
||||||
"src": "https://github.com/stevearc/dressing.nvim"
|
|
||||||
},
|
|
||||||
"friendly-snippets": {
|
|
||||||
"rev": "572f566",
|
|
||||||
"src": "https://github.com/rafamadriz/friendly-snippets"
|
|
||||||
},
|
|
||||||
"gruvbox.nvim": {
|
|
||||||
"rev": "5e0a460",
|
|
||||||
"src": "https://github.com/ellisonleao/gruvbox.nvim"
|
|
||||||
},
|
|
||||||
"harpoon": {
|
|
||||||
"rev": "87b1a35",
|
|
||||||
"src": "https://github.com/ThePrimeagen/harpoon",
|
|
||||||
"version": "'harpoon2'"
|
|
||||||
},
|
|
||||||
"lualine.nvim": {
|
|
||||||
"rev": "3946f01",
|
|
||||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
|
||||||
},
|
|
||||||
"mason-lspconfig.nvim": {
|
|
||||||
"rev": "d7b5feb",
|
|
||||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
|
||||||
},
|
|
||||||
"mason.nvim": {
|
|
||||||
"rev": "ad7146a",
|
|
||||||
"src": "https://github.com/mason-org/mason.nvim"
|
|
||||||
},
|
|
||||||
"noice.nvim": {
|
|
||||||
"rev": "7bfd942",
|
|
||||||
"src": "https://github.com/folke/noice.nvim"
|
|
||||||
},
|
|
||||||
"nui.nvim": {
|
|
||||||
"rev": "de74099",
|
|
||||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
|
||||||
},
|
|
||||||
"nvim-lspconfig": {
|
|
||||||
"rev": "2010fc6",
|
|
||||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
|
||||||
},
|
|
||||||
"nvim-notify": {
|
|
||||||
"rev": "8701bec",
|
|
||||||
"src": "https://github.com/rcarriga/nvim-notify"
|
|
||||||
},
|
|
||||||
"nvim-treesitter": {
|
|
||||||
"rev": "42fc28ba",
|
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
|
||||||
},
|
|
||||||
"nvim-web-devicons": {
|
|
||||||
"rev": "8dcb311",
|
|
||||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
|
||||||
},
|
|
||||||
"oil.nvim": {
|
|
||||||
"rev": "7e1cd77",
|
|
||||||
"src": "https://github.com/stevearc/oil.nvim"
|
|
||||||
},
|
|
||||||
"outline.nvim": {
|
|
||||||
"rev": "6b62f73",
|
|
||||||
"src": "https://github.com/hedyhli/outline.nvim"
|
|
||||||
},
|
|
||||||
"overseer.nvim": {
|
|
||||||
"rev": "c77c78b",
|
|
||||||
"src": "https://github.com/stevearc/overseer.nvim",
|
|
||||||
"version": "'v1.6.0'"
|
|
||||||
},
|
|
||||||
"plenary.nvim": {
|
|
||||||
"rev": "b9fd522",
|
|
||||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
|
||||||
},
|
|
||||||
"quicker.nvim": {
|
|
||||||
"rev": "12a2291",
|
|
||||||
"src": "https://github.com/stevearc/quicker.nvim"
|
|
||||||
},
|
|
||||||
"session-lens": {
|
|
||||||
"rev": "eae46b4",
|
|
||||||
"src": "https://github.com/rmagatti/session-lens"
|
|
||||||
},
|
|
||||||
"snacks.nvim": {
|
|
||||||
"rev": "9a15b31",
|
|
||||||
"src": "https://github.com/folke/snacks.nvim"
|
|
||||||
},
|
|
||||||
"sqlite.nvim": {
|
|
||||||
"rev": "a8466c8",
|
|
||||||
"src": "https://github.com/3rd/sqlite.nvim"
|
|
||||||
},
|
|
||||||
"telescope-ui-select.nvim": {
|
|
||||||
"rev": "6e51d7d",
|
|
||||||
"src": "https://github.com/nvim-telescope/telescope-ui-select.nvim"
|
|
||||||
},
|
|
||||||
"telescope.nvim": {
|
|
||||||
"rev": "0294ae3",
|
|
||||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
|
||||||
},
|
|
||||||
"time-tracker.nvim": {
|
|
||||||
"rev": "4127c4b",
|
|
||||||
"src": "https://github.com/3rd/time-tracker.nvim"
|
|
||||||
},
|
|
||||||
"todo-comments.nvim": {
|
|
||||||
"rev": "411503d",
|
|
||||||
"src": "https://github.com/folke/todo-comments.nvim"
|
|
||||||
},
|
|
||||||
"toggleterm.nvim": {
|
|
||||||
"rev": "9a88eae",
|
|
||||||
"src": "https://github.com/akinsho/toggleterm.nvim"
|
|
||||||
},
|
|
||||||
"undotree": {
|
|
||||||
"rev": "0f1c981",
|
|
||||||
"src": "https://github.com/mbbill/undotree"
|
|
||||||
},
|
|
||||||
"vim-flog": {
|
|
||||||
"rev": "665b16a",
|
|
||||||
"src": "https://github.com/rbong/vim-flog"
|
|
||||||
},
|
|
||||||
"vim-fugitive": {
|
|
||||||
"rev": "61b51c0",
|
|
||||||
"src": "https://github.com/tpope/vim-fugitive"
|
|
||||||
},
|
|
||||||
"vim-surround": {
|
|
||||||
"rev": "3d188ed",
|
|
||||||
"src": "https://github.com/tpope/vim-surround"
|
|
||||||
},
|
|
||||||
"which-key.nvim": {
|
|
||||||
"rev": "3aab214",
|
|
||||||
"src": "https://github.com/folke/which-key.nvim"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user