feat(lazy): allow for hot loading plugin specs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local module_name = "core"
|
||||
vim.loader.enable()
|
||||
|
||||
local utils = require("utils")
|
||||
|
||||
@@ -15,8 +15,8 @@ for _, file in ipairs(files) do
|
||||
local pkg = "core." .. file
|
||||
local ok, err = pcall(require, pkg)
|
||||
if not ok then
|
||||
utils.err("Error while loading package " .. pkg, module_name)
|
||||
utils.err(err, module_name)
|
||||
utils.err("Error while loading package " .. pkg)
|
||||
utils.err(err)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -26,15 +26,26 @@ if vim.g.vscode then
|
||||
else
|
||||
local ok, err = pcall(require, "bootstrap")
|
||||
if not ok then
|
||||
utils.err("Error during bootstrap", module_name)
|
||||
utils.err(err:gsub("\t", " "), module_name)
|
||||
utils.err("Error during bootstrap")
|
||||
utils.err(err:gsub("\t", " "))
|
||||
return
|
||||
end
|
||||
|
||||
ok, err = pcall(require, "plugins")
|
||||
if not ok then
|
||||
utils.err("Error while loading plugins", module_name)
|
||||
utils.err(err:gsub("\t", " "), module_name)
|
||||
return
|
||||
end
|
||||
---@type LazyPluginSpec[]
|
||||
local plugins = {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = require("lsp").setup,
|
||||
},
|
||||
{ import = "plugins" },
|
||||
}
|
||||
|
||||
---@type LazyConfig
|
||||
local opts = {
|
||||
install = {
|
||||
colorscheme = { "moonfly" },
|
||||
},
|
||||
}
|
||||
|
||||
require("lazy").setup(plugins, opts)
|
||||
end
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
desc = "Use tabs for indents in Go files",
|
||||
pattern = "go",
|
||||
callback = function ()
|
||||
callback = function()
|
||||
vim.bo.expandtab = false
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost" }, {
|
||||
desc = "Return cursor to last position when re-opening a buffer",
|
||||
pattern = "*",
|
||||
command = 'silent! normal! g`"zv',
|
||||
})
|
||||
|
||||
@@ -183,6 +183,11 @@ function M:on_attach(client, bufnr)
|
||||
{ border = "single" })
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] =
|
||||
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
|
||||
|
||||
---@alias lsp.Client vim.lsp.Client
|
||||
-- require("lsp_compl").attach(client, bufnr, {
|
||||
-- server_side_fuzzy_completion = true,
|
||||
-- })
|
||||
end
|
||||
|
||||
--- Configure the LSP client
|
||||
@@ -203,6 +208,22 @@ function M:configure_client()
|
||||
capabilities = vim.tbl_deep_extend("force", capabilities,
|
||||
cmp_nvim_lsp.default_capabilities())
|
||||
end
|
||||
|
||||
-- local epo = utils.try_require("epo")
|
||||
-- if epo then
|
||||
-- capabilities = vim.tbl_deep_extend(
|
||||
-- "force",
|
||||
-- capabilities,
|
||||
-- epo.register_cap()
|
||||
-- )
|
||||
-- end
|
||||
|
||||
-- local lsp_compl = utils.try_require("lsp_compl")
|
||||
-- if lsp_compl then
|
||||
-- capabilities = vim.tbl_deep_extend("force", capabilities, lsp_compl.capabilities())
|
||||
-- end
|
||||
--
|
||||
|
||||
self.config.lspconfig.capabilities = capabilities
|
||||
self.config.lspconfig.on_attach = function(client, bufnr)
|
||||
local ok, ret = pcall(self.on_attach, self, client, bufnr)
|
||||
|
||||
-203
@@ -1,203 +0,0 @@
|
||||
vim.loader.enable()
|
||||
|
||||
---@type LazyPluginSpec[]
|
||||
local plugins = {
|
||||
{
|
||||
"bluz71/vim-moonfly-colors",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
name = "moonfly",
|
||||
config = require("plugins.moonfly"),
|
||||
},
|
||||
--[[ {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 100,
|
||||
lazy = false,
|
||||
config = require("plugins.catppuccin"),
|
||||
}, ]]
|
||||
--[[ {
|
||||
"navarasu/onedark.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
-- name = "moonfly",
|
||||
config = require("plugins.onedark"),
|
||||
}, ]]
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
priority = 900,
|
||||
lazy = false,
|
||||
config = require("plugins.notify"),
|
||||
},
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = require("plugins.luasnip"),
|
||||
-- comment out on windows and install jsregexp manually
|
||||
build = (require("utils").os_name ~= "Windows_NT" and "make install_jsregexp" or nil),
|
||||
version = "2.*",
|
||||
},
|
||||
{
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-cmdline",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = require("plugins.cmp"),
|
||||
},
|
||||
{
|
||||
"onsails/lspkind.nvim",
|
||||
config = require("plugins.lspkind"),
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = require("plugins.mason"),
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = require("lsp").setup,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
config = require("plugins.treesitter"),
|
||||
build = ":TSUpdate",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
config = require("plugins.fugitive"),
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"rbong/vim-flog",
|
||||
config = require("plugins.flog"),
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = require("plugins.lualine"),
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = require("plugins.gitsigns"),
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = require("plugins.telescope"),
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
|
||||
.. " && cmake --build build --config Release"
|
||||
.. " && cmake --install build --prefix build",
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
config = require("plugins.comment"),
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"simeji/winresizer",
|
||||
config = require("plugins.winresizer"),
|
||||
lazy = true,
|
||||
keys = { "<C-W>r" },
|
||||
},
|
||||
{
|
||||
"sindrets/winshift.nvim",
|
||||
config = require("plugins.winshift"),
|
||||
lazy = true,
|
||||
keys = { "<C-W>m" },
|
||||
},
|
||||
{
|
||||
"dstein64/vim-startuptime",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"famiu/bufdelete.nvim",
|
||||
config = require("plugins.bufdelete"),
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
config = require("plugins.treesitter-context"),
|
||||
},
|
||||
{
|
||||
"fedepujol/move.nvim",
|
||||
config = require("plugins.move"),
|
||||
},
|
||||
{
|
||||
"nvim-orgmode/orgmode",
|
||||
config = require("plugins.orgmode"),
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
},
|
||||
{
|
||||
"farmergreg/vim-lastplace",
|
||||
},
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
config = require("plugins.diffview"),
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
},
|
||||
{
|
||||
"j-hui/fidget.nvim",
|
||||
tag = "legacy",
|
||||
event = "LspAttach",
|
||||
config = require("plugins.fidget"),
|
||||
},
|
||||
{
|
||||
"lvimuser/lsp-inlayhints.nvim",
|
||||
branch = "anticonceal",
|
||||
config = require("plugins.lsp-inlayhints"),
|
||||
},
|
||||
{
|
||||
"cbochs/grapple.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = require("plugins.grapple"),
|
||||
},
|
||||
{
|
||||
"is0n/fm-nvim",
|
||||
config = require("plugins.fm-nvim"),
|
||||
},
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
config = require("plugins.nvim-colorizer"),
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
install = {
|
||||
colorscheme = { "moonfly" },
|
||||
},
|
||||
}
|
||||
|
||||
require("lazy").setup(plugins, opts)
|
||||
@@ -1,12 +1,9 @@
|
||||
-- https://github.com/famiu/bufdelete.nvim
|
||||
|
||||
local function setup()
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<C-w>q",
|
||||
vim.cmd.Bwipeout,
|
||||
{ remap = false, silent = true, }
|
||||
)
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"famiu/bufdelete.nvim",
|
||||
keys = {
|
||||
{ "<C-w>q", vim.cmd.Bwipeout, { remap = false, silent = true }, mode = "n" },
|
||||
},
|
||||
}
|
||||
|
||||
+104
-93
@@ -24,101 +24,112 @@ local function has_words_after()
|
||||
~= nil
|
||||
end
|
||||
|
||||
local function setup()
|
||||
local utils = require("utils")
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = utils.try_require("lspkind")
|
||||
|
||||
local opt = {
|
||||
preselect = cmp.PreselectMode.None,
|
||||
completion = { keyword_length = 0 },
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
build = (require("utils").os_name ~= "Windows_NT" and "make install_jsregexp" or nil),
|
||||
version = "2.*",
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
if lspkind then
|
||||
vim_item = lspkind.cmp_format({
|
||||
mode = "symbol",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
before = function(_, item)
|
||||
item.dup = 0 -- remove duplicates, see nvim-cmp #511
|
||||
return item
|
||||
end,
|
||||
})(entry, vim_item)
|
||||
end
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local utils = require("utils")
|
||||
local lspkind = utils.try_require("lspkind")
|
||||
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({
|
||||
behavior = cmp.SelectBehavior.Select,
|
||||
}),
|
||||
["<C-n>"] = cmp.mapping.select_next_item({
|
||||
behavior = cmp.SelectBehavior.Select,
|
||||
}),
|
||||
["<C-y>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace })
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<C-x><C-o>"] = cmp.mapping.complete(),
|
||||
["<C-l>"] = function(fallback)
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<C-h>"] = function(fallback)
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
-- { name = "luasnip", },
|
||||
{ name = "orgmode" },
|
||||
{ name = "path" },
|
||||
},
|
||||
}
|
||||
|
||||
if utils.try_require("moonfly") then
|
||||
local winhighlight = {
|
||||
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel",
|
||||
}
|
||||
opt.window = {
|
||||
completion = cmp.config.window.bordered(winhighlight),
|
||||
documentation = cmp.config.window.bordered(winhighlight),
|
||||
}
|
||||
end
|
||||
|
||||
cmp.setup(opt)
|
||||
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = { { name = "buffer" } },
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({ { name = "path" } }, {
|
||||
{
|
||||
name = "cmdline",
|
||||
option = { ignore_cmds = { "Man", "!" } },
|
||||
local opts = {
|
||||
preselect = cmp.PreselectMode.None,
|
||||
completion = {
|
||||
autocomplete = { "InsertEnter", "TextChanged" },
|
||||
keyword_length = 1,
|
||||
},
|
||||
}),
|
||||
})
|
||||
end
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
if lspkind then
|
||||
vim_item = lspkind.cmp_format({
|
||||
mode = "symbol",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
before = function(_, item)
|
||||
item.dup = 0 -- remove duplicates, see nvim-cmp #511
|
||||
return item
|
||||
end,
|
||||
})(entry, vim_item)
|
||||
end
|
||||
|
||||
return setup
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = {
|
||||
["<S-tab>"] = cmp.mapping.select_prev_item({
|
||||
behavior = cmp.SelectBehavior.Insert,
|
||||
}),
|
||||
["<tab>"] = cmp.mapping.select_next_item({
|
||||
behavior = cmp.SelectBehavior.Insert,
|
||||
}),
|
||||
["<C-x><C-o>"] = cmp.mapping.complete(),
|
||||
["<C-l>"] = function(fallback)
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<C-h>"] = function(fallback)
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
-- { name = "luasnip", },
|
||||
{ name = "orgmode" },
|
||||
{ name = "path" },
|
||||
},
|
||||
}
|
||||
|
||||
if utils.try_require("moonfly") then
|
||||
local winhighlight = {
|
||||
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel",
|
||||
}
|
||||
opts.window = {
|
||||
completion = cmp.config.window.bordered(winhighlight),
|
||||
documentation = cmp.config.window.bordered(winhighlight),
|
||||
}
|
||||
end
|
||||
|
||||
cmp.setup(opts)
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = { { name = "buffer" } },
|
||||
})
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({ { name = "path" } }, {
|
||||
{
|
||||
name = "cmdline",
|
||||
option = { ignore_cmds = { "Man", "!" } },
|
||||
},
|
||||
}),
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,12 +1,12 @@
|
||||
-- https://github.com/numToStr/Comment.nvim
|
||||
|
||||
local function setup()
|
||||
require("Comment").setup(
|
||||
{
|
||||
--ignore empty lines
|
||||
ignore = "^$",
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
opts = {
|
||||
--ignore empty lines
|
||||
ignore = "^$",
|
||||
},
|
||||
}
|
||||
|
||||
+74
-69
@@ -1,75 +1,80 @@
|
||||
-- https://github.com/sindrets/diffview.nvim
|
||||
|
||||
local function setup()
|
||||
local actions = require("diffview.actions")
|
||||
|
||||
require("diffview").setup({
|
||||
enhanced_diff_hl = true,
|
||||
view = {
|
||||
default = {
|
||||
layout = "diff2_horizontal",
|
||||
winbar_info = true,
|
||||
},
|
||||
merge_tool = {
|
||||
layout = "diff3_mixed",
|
||||
disable_diagnostics = true,
|
||||
winbar_info = true,
|
||||
},
|
||||
file_history = {
|
||||
layout = "diff2_horizontal",
|
||||
winbar_info = true,
|
||||
},
|
||||
},
|
||||
default_args = {
|
||||
DiffviewOpen = { "--imply-local", },
|
||||
},
|
||||
keymaps = {
|
||||
file_panel = {
|
||||
["<cr>"] = false,
|
||||
{
|
||||
"n",
|
||||
"<CR>",
|
||||
function ()
|
||||
actions.select_entry()
|
||||
vim.cmd.wincmd("l")
|
||||
end,
|
||||
{ desc = "Open the current file in diffview", },
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"sindrets/diffview.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gg", vim.cmd.DiffviewOpen, mode = "n", remap = true },
|
||||
},
|
||||
config = function()
|
||||
local actions = require("diffview.actions")
|
||||
require("diffview").setup({
|
||||
enhanced_diff_hl = true,
|
||||
view = {
|
||||
default = {
|
||||
layout = "diff2_horizontal",
|
||||
winbar_info = true,
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"s",
|
||||
actions.toggle_stage_entry,
|
||||
{ desc = "Stage / unstage the selected entry", },
|
||||
merge_tool = {
|
||||
layout = "diff3_mixed",
|
||||
disable_diagnostics = true,
|
||||
winbar_info = true,
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"u",
|
||||
actions.toggle_stage_entry,
|
||||
{ desc = "Stage / unstage the selected entry", },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"cc",
|
||||
function ()
|
||||
vim.cmd.G("commit")
|
||||
vim.cmd.wincmd("J")
|
||||
end,
|
||||
{ desc = "Commit staged changes", },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"ca",
|
||||
function ()
|
||||
vim.cmd.G("commit --amend")
|
||||
vim.cmd.wincmd("J")
|
||||
end,
|
||||
{ desc = "Amend the last commit", },
|
||||
file_history = {
|
||||
layout = "diff2_horizontal",
|
||||
winbar_info = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>gg", vim.cmd.DiffviewOpen)
|
||||
end
|
||||
|
||||
return setup
|
||||
default_args = {
|
||||
DiffviewOpen = { "--imply-local" },
|
||||
},
|
||||
keymaps = {
|
||||
file_panel = {
|
||||
["<cr>"] = false,
|
||||
{
|
||||
"n",
|
||||
"<CR>",
|
||||
function()
|
||||
actions.select_entry()
|
||||
vim.cmd.wincmd("l")
|
||||
end,
|
||||
{ desc = "Open the current file in diffview" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"s",
|
||||
actions.toggle_stage_entry,
|
||||
{ desc = "Stage / unstage the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"u",
|
||||
actions.toggle_stage_entry,
|
||||
{ desc = "Stage / unstage the selected entry" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"cc",
|
||||
function()
|
||||
vim.cmd.G("commit")
|
||||
vim.cmd.wincmd("J")
|
||||
end,
|
||||
{ desc = "Commit staged changes" },
|
||||
},
|
||||
{
|
||||
"n",
|
||||
"ca",
|
||||
function()
|
||||
vim.cmd.G("commit --amend")
|
||||
vim.cmd.wincmd("J")
|
||||
end,
|
||||
{ desc = "Amend the last commit" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
-- https://github.com/j-hui/fidget.nvim
|
||||
|
||||
local function setup()
|
||||
require("fidget").setup()
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
tag = "legacy",
|
||||
event = "LspAttach",
|
||||
config = true,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
-- https://github.com/rbong/vim-flog
|
||||
|
||||
local function setup()
|
||||
vim.keymap.set("n", "<leader>gl", vim.cmd.Flog)
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"rbong/vim-flog",
|
||||
---@type LazyKeysSpec[]
|
||||
keys = {
|
||||
{ "<leader>gl", vim.cmd.Flog, mode = "n" },
|
||||
},
|
||||
}
|
||||
|
||||
+16
-21
@@ -1,9 +1,19 @@
|
||||
-- https://github.com/is0n/fm-nvim
|
||||
|
||||
local function setup()
|
||||
local fm = require("fm-nvim")
|
||||
|
||||
fm.setup({
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"is0n/fm-nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
if file ~= "" then vim.cmd.Lf(file) else vim.cmd.Lf() end
|
||||
end,
|
||||
mode = "n",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
-- UI Options
|
||||
ui = {
|
||||
float = {
|
||||
@@ -16,20 +26,5 @@ local function setup()
|
||||
cmds = {
|
||||
nnn_cmd = "n",
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fe",
|
||||
function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
if file ~= "" then
|
||||
vim.cmd.Lf(file)
|
||||
else
|
||||
vim.cmd.Lf()
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
}
|
||||
|
||||
+19
-18
@@ -1,22 +1,23 @@
|
||||
-- https://github.com/tpope/vim-fugitive
|
||||
|
||||
local function setup()
|
||||
local function git_status_tab()
|
||||
vim.cmd.tabnew()
|
||||
vim.cmd("leftabove vertical G")
|
||||
vim.cmd("vertical resize 60")
|
||||
vim.cmd.set("wfw")
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>gd", vim.cmd.Gdiffsplit)
|
||||
vim.keymap.set("n", "<leader>gc", function () vim.cmd.G("commit") end)
|
||||
vim.keymap.set("n", "<leader>ga", function () vim.cmd.G("commit --amend") end)
|
||||
vim.keymap.set("n", "<leader>gp", function () vim.cmd.G("push") end)
|
||||
|
||||
-- Only used if diffview is not available
|
||||
if not pcall(require, "diffview") then
|
||||
vim.keymap.set("n", "<leader>gg", git_status_tab)
|
||||
end
|
||||
local function git_status_tab()
|
||||
vim.cmd.tabnew()
|
||||
vim.cmd("leftabove vertical G")
|
||||
vim.cmd("vertical resize 60")
|
||||
vim.cmd.set("wfw")
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"tpope/vim-fugitive",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
---@type LazyKeysSpec[]
|
||||
keys = {
|
||||
{ "<leader>gd", vim.cmd.Gdiffsplit, mode = "n" },
|
||||
{ "<leader>gc", function() vim.cmd.G("commit") end, mode = "n" },
|
||||
{ "<leader>ga", function() vim.cmd.G("commit --amend") end, mode = "n" },
|
||||
{ "<leader>gp", function() vim.cmd.G("push") end, mode = "n" },
|
||||
{ "<leader>gg", git_status_tab, mode = "n", remap = false },
|
||||
},
|
||||
}
|
||||
|
||||
+47
-41
@@ -1,54 +1,60 @@
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
|
||||
local function setup()
|
||||
require("gitsigns").setup({
|
||||
on_attach = function (bufnr)
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
vim.keymap.set("n", "<leader>gv", gs.select_hunk, { buffer = bufnr, })
|
||||
vim.keymap.set("n", "<leader>gs", gs.stage_hunk, { buffer = bufnr, })
|
||||
vim.keymap.set("x", "<leader>gs", function ()
|
||||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v"), })
|
||||
end,
|
||||
{ buffer = bufnr, })
|
||||
vim.keymap.set({ "n", "x", }, "<leader>gu", gs.undo_stage_hunk,
|
||||
{ buffer = bufnr, })
|
||||
vim.keymap.set("n", "<leader>gr", gs.reset_hunk, { buffer = bufnr, })
|
||||
vim.keymap.set("n", "<leader>gv", gs.select_hunk, { buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>gs", gs.stage_hunk, { buffer = bufnr })
|
||||
vim.keymap.set(
|
||||
"x",
|
||||
"<leader>gr",
|
||||
":Gitsigns reset_hunk<CR>",
|
||||
{ buffer = bufnr, }
|
||||
"<leader>gs",
|
||||
function()
|
||||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end,
|
||||
{ buffer = bufnr }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>g?", gs.preview_hunk,
|
||||
{ buffer = bufnr, })
|
||||
vim.keymap.set({ "n", "x" }, "<leader>gu", gs.undo_stage_hunk, { buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>gr", gs.reset_hunk, { buffer = bufnr })
|
||||
vim.keymap.set("x", "<leader>gr", ":Gitsigns reset_hunk<CR>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>g?", gs.preview_hunk, { buffer = bufnr })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>gb",
|
||||
function ()
|
||||
gs.blame_line { full = true, ignore_whitespace = true, }
|
||||
function()
|
||||
gs.blame_line { full = true, ignore_whitespace = true }
|
||||
end,
|
||||
{ buffer = bufnr, })
|
||||
vim.keymap.set({ "n", "x", }, "]g", function ()
|
||||
gs.next_hunk({
|
||||
wrap = true,
|
||||
navigation_message = true,
|
||||
foldopen = true,
|
||||
preview = true,
|
||||
})
|
||||
end)
|
||||
vim.keymap.set({ "n", "x", }, "[g", function ()
|
||||
gs.prev_hunk({
|
||||
wrap = true,
|
||||
navigation_message = true,
|
||||
foldopen = true,
|
||||
preview = true,
|
||||
})
|
||||
end)
|
||||
{ buffer = bufnr }
|
||||
)
|
||||
vim.keymap.set(
|
||||
{ "n", "x" },
|
||||
"]g", function()
|
||||
gs.next_hunk({
|
||||
wrap = true,
|
||||
navigation_message = true,
|
||||
foldopen = true,
|
||||
preview = true,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
{ "n", "x" },
|
||||
"[g", function()
|
||||
gs.prev_hunk({
|
||||
wrap = true,
|
||||
navigation_message = true,
|
||||
foldopen = true,
|
||||
preview = true,
|
||||
})
|
||||
end
|
||||
)
|
||||
end,
|
||||
signs = {
|
||||
untracked = { text = "│", },
|
||||
untracked = { text = "│" },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
}
|
||||
|
||||
+35
-32
@@ -1,37 +1,40 @@
|
||||
-- https://github.com/cbochs/grapple.nvim
|
||||
|
||||
local function setup()
|
||||
local grapple = require("grapple")
|
||||
grapple.setup()
|
||||
vim.keymap.set("n", "<leader>'", grapple.toggle_tags)
|
||||
vim.keymap.set("n", "<leader>mm", function ()
|
||||
if grapple.exists() then
|
||||
grapple.untag()
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, 9 do
|
||||
local opts = { name = "m" .. i, }
|
||||
if not grapple.exists(opts) then
|
||||
grapple.tag(opts)
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"cbochs/grapple.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local grapple = require("grapple")
|
||||
grapple.setup()
|
||||
vim.keymap.set("n", "<leader>'", grapple.toggle_tags)
|
||||
vim.keymap.set("n", "<leader>mm", function()
|
||||
if grapple.exists() then
|
||||
grapple.untag()
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, 9 do
|
||||
local opts = { name = "m" .. i }
|
||||
if not grapple.exists(opts) then
|
||||
grapple.tag(opts)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
grapple.tag({ name = "m0" })
|
||||
end)
|
||||
|
||||
for i = 1, 9 do
|
||||
local opts = { name = "m" .. i }
|
||||
|
||||
vim.keymap.set("n", "<leader>m" .. i, function()
|
||||
grapple.tag(opts)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>" .. i, function()
|
||||
grapple.select(opts)
|
||||
end)
|
||||
end
|
||||
|
||||
grapple.tag({ name = "m?", })
|
||||
end)
|
||||
|
||||
for i = 1, 9 do
|
||||
local opts = { name = "m" .. i, }
|
||||
|
||||
vim.keymap.set("n", "<leader>m" .. i, function ()
|
||||
grapple.tag(opts)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>" .. i, function ()
|
||||
grapple.select(opts)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
return setup
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
-- https://github.com/lvimuser/lsp-inlayhints.nvim
|
||||
|
||||
local function setup()
|
||||
require("lsp-inlayhints").setup()
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"lvimuser/lsp-inlayhints.nvim",
|
||||
branch = "anticonceal",
|
||||
config = true,
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,12 +1,12 @@
|
||||
-- https://github.com/onsails/lspkind.nvim
|
||||
|
||||
local function setup()
|
||||
local ok, _ = pcall(require, "nvim-cmp")
|
||||
if ok then
|
||||
-- configured and loaded in plugins.config.cmp
|
||||
else
|
||||
require("lspkind").init()
|
||||
end
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"onsails/lspkind.nvim",
|
||||
config = function()
|
||||
local ok, _ = pcall(require, "nvim-cmp")
|
||||
if not ok then
|
||||
require("lspkind").init()
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
+40
-36
@@ -1,41 +1,45 @@
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
|
||||
local function setup()
|
||||
local custom_moonfly = require("lualine.themes.moonfly")
|
||||
custom_moonfly.normal.c.bg = require("moonfly").palette.bg
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local custom_moonfly = require("lualine.themes.moonfly")
|
||||
custom_moonfly.normal.c.bg = require("moonfly").palette.bg
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = custom_moonfly,
|
||||
component_separators = { left = "", right = "", },
|
||||
section_separators = { left = "", right = "", },
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{ "filename", path = 1, },
|
||||
"diff",
|
||||
{ "diagnostics", sources = { "nvim_lsp", }, },
|
||||
{
|
||||
require("grapple").statusline,
|
||||
cond = require("grapple").exists,
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = custom_moonfly,
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{ "filename", path = 1 },
|
||||
{ "diff" },
|
||||
{ "diagnostics", sources = { "nvim_lsp" } },
|
||||
{ require("grapple").statusline, cond = require("grapple").exists },
|
||||
},
|
||||
lualine_x = {
|
||||
"bo:filetype",
|
||||
"encoding",
|
||||
"bo:fileformat",
|
||||
"progress",
|
||||
"location",
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
lualine_x = {
|
||||
"bo:filetype",
|
||||
"encoding",
|
||||
"bo:fileformat",
|
||||
"progress",
|
||||
"location",
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return setup
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
-- https://github.com/L3MON4D3/LuaSnip
|
||||
|
||||
local function setup()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end
|
||||
|
||||
return setup
|
||||
@@ -1,7 +1,9 @@
|
||||
-- https://github.com/williamboman/mason.nvim
|
||||
|
||||
local function setup()
|
||||
require("mason").setup()
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
config = true,
|
||||
}
|
||||
|
||||
+15
-9
@@ -1,11 +1,17 @@
|
||||
-- https://github.com/bluz71/vim-moonfly-colors
|
||||
|
||||
local function setup()
|
||||
vim.g.moonflyNormalFloat = true
|
||||
vim.g.moonflyCursorColor = true
|
||||
vim.g.moonflyWinSeparator = 2
|
||||
|
||||
vim.cmd.colorscheme("moonfly")
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"bluz71/vim-moonfly-colors",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
name = "moonfly",
|
||||
init = function()
|
||||
vim.g.moonflyNormalFloat = true
|
||||
vim.g.moonflyCursorColor = true
|
||||
vim.g.moonflyWinSeparator = 2
|
||||
end,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("moonfly")
|
||||
end,
|
||||
}
|
||||
|
||||
+17
-16
@@ -1,21 +1,22 @@
|
||||
-- https://github.com/fedepujol/move.nvim
|
||||
|
||||
local function setup()
|
||||
require("move").setup({
|
||||
-- TODO: figure out how to add "silent" to keymaps
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"fedepujol/move.nvim",
|
||||
keys = {
|
||||
{ "<A-j>", function() vim.cmd.MoveLine(1) end, mode = "n" },
|
||||
{ "<A-k>", function() vim.cmd.MoveLine(-1) end, mode = "n" },
|
||||
{ "<A-h>", function() vim.cmd.MoveHChar(-1) end, mode = "n" },
|
||||
{ "<A-l>", function() vim.cmd.MoveHChar(1) end, mode = "n" },
|
||||
{ "<A-j>", ":MoveBlock(1)<CR>", mode = "x" },
|
||||
{ "<A-k>", ":MoveBlock(-1)<CR>", mode = "x" },
|
||||
{ "<A-h>", ":MoveHBlock(-1)<CR>", mode = "x" },
|
||||
{ "<A-l>", ":MoveHBlock(1)<CR>", mode = "x" },
|
||||
},
|
||||
opts = {
|
||||
char = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
local opts = { noremap = true, silent = true, }
|
||||
vim.keymap.set("n", "<A-j>", function () vim.cmd.MoveLine(1) end, opts)
|
||||
vim.keymap.set("n", "<A-k>", function () vim.cmd.MoveLine(-1) end, opts)
|
||||
vim.keymap.set("n", "<A-h>", function () vim.cmd.MoveHChar(-1) end, opts)
|
||||
vim.keymap.set("n", "<A-l>", function () vim.cmd.MoveHChar(1) end, opts)
|
||||
vim.keymap.set("x", "<A-j>", ":MoveBlock(1)<CR>", opts)
|
||||
vim.keymap.set("x", "<A-k>", ":MoveBlock(-1)<CR>", opts)
|
||||
vim.keymap.set("x", "<A-h>", ":MoveHBlock(-1)<CR>", opts)
|
||||
vim.keymap.set("x", "<A-l>", ":MoveHBlock(1)<CR>", opts)
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
}
|
||||
|
||||
+12
-16
@@ -1,20 +1,16 @@
|
||||
-- https://github.com/rcarriga/nvim-notify
|
||||
|
||||
local function setup()
|
||||
local has_telescope, telescope = pcall(require, "telescope")
|
||||
|
||||
local notify = require("notify")
|
||||
notify.setup({
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"rcarriga/nvim-notify",
|
||||
priority = 900,
|
||||
lazy = false,
|
||||
opts = {
|
||||
render = "default",
|
||||
stages = "static",
|
||||
})
|
||||
|
||||
vim.notify = notify
|
||||
|
||||
if has_telescope then
|
||||
telescope.load_extension("notify")
|
||||
vim.keymap.set("n", "<leader>fn", telescope.extensions.notify.notify)
|
||||
end
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.notify = require("notify")
|
||||
vim.notify.setup(opts)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
local function setup()
|
||||
require("colorizer").setup({
|
||||
-- https://github.com/NvChad/nvim-colorizer.lua
|
||||
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
opts = {
|
||||
user_default_options = {
|
||||
RRGGBBAA = true,
|
||||
AARRGGBB = true,
|
||||
css = true,
|
||||
mode = "virtualtext",
|
||||
tailwind = true,
|
||||
sass = { enable = true, },
|
||||
sass = { enable = true },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
}
|
||||
|
||||
+10
-8
@@ -1,9 +1,13 @@
|
||||
-- https://github.com/nvim-orgmode/orgmode
|
||||
|
||||
local function setup()
|
||||
local orgmode = require("orgmode")
|
||||
orgmode.setup({
|
||||
org_agenda_files = { "~/Documents/org/**/*", },
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"nvim-orgmode/orgmode",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
opts = {
|
||||
org_agenda_files = { "~/Documents/org/**/*" },
|
||||
org_default_notes_file = "~/Documents/org/notes.org",
|
||||
org_todo_keywords = {
|
||||
"TODO(t)",
|
||||
@@ -28,7 +32,5 @@ local function setup()
|
||||
org_agenda_skip_scheduled_if_done = true,
|
||||
org_agenda_skip_deadline_if_done = true,
|
||||
|
||||
})
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
}
|
||||
|
||||
+107
-90
@@ -1,100 +1,117 @@
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
|
||||
local function setup()
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
n = {
|
||||
q = actions.close,
|
||||
["<C-c>"] = actions.close,
|
||||
l = actions.select_default,
|
||||
},
|
||||
},
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
|
||||
.. " && cmake --build build --config Release"
|
||||
.. " && cmake --install build --prefix build",
|
||||
},
|
||||
pickers = {
|
||||
oldfiles = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
buffers = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-d>"] = actions.delete_buffer + actions.move_to_top,
|
||||
n = {
|
||||
q = actions.close,
|
||||
["<C-c>"] = actions.close,
|
||||
l = actions.select_default,
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
initial_mode = "normal",
|
||||
pickers = {
|
||||
oldfiles = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
buffers = {
|
||||
initial_mode = "normal",
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-d>"] = actions.delete_buffer + actions.move_to_top,
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_definitions = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_type_definitions = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_implementations = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_references = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
git_status = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
},
|
||||
lsp_definitions = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_type_definitions = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_implementations = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
lsp_references = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
git_status = {
|
||||
initial_mode = "normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ff",
|
||||
function ()
|
||||
builtin.find_files({
|
||||
hidden = true,
|
||||
no_ignore = true,
|
||||
no_ignore_parent = true,
|
||||
previewer = false,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fr",
|
||||
function ()
|
||||
builtin.oldfiles({
|
||||
only_cwd = true,
|
||||
hidden = true,
|
||||
previewer = false,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>fg", function ()
|
||||
builtin.live_grep({
|
||||
additional_args = function (_)
|
||||
return {
|
||||
"--hidden",
|
||||
"--iglob=!.venv",
|
||||
"--iglob=!vendor",
|
||||
"--iglob=!.git",
|
||||
}
|
||||
end,
|
||||
previewer = false,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fb",
|
||||
function ()
|
||||
builtin.buffers({ previewer = false, sort_mru = true, })
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ff",
|
||||
function()
|
||||
builtin.find_files({
|
||||
hidden = true,
|
||||
no_ignore = true,
|
||||
no_ignore_parent = true,
|
||||
previewer = false,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fr",
|
||||
function()
|
||||
builtin.oldfiles({
|
||||
only_cwd = true,
|
||||
hidden = true,
|
||||
previewer = false,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fg",
|
||||
function()
|
||||
builtin.live_grep({
|
||||
additional_args = function(_)
|
||||
return {
|
||||
"--hidden",
|
||||
"--iglob=!.venv",
|
||||
"--iglob=!vendor",
|
||||
"--iglob=!.git",
|
||||
}
|
||||
end,
|
||||
previewer = false,
|
||||
})
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fb",
|
||||
function()
|
||||
builtin.buffers({ previewer = false, sort_mru = true })
|
||||
end
|
||||
)
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
end
|
||||
|
||||
return setup
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("notify")
|
||||
vim.keymap.set("n", "<leader>fn", telescope.extensions.notify.notify)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
-- https://github.com/folke/tokyonight.nvim
|
||||
|
||||
local function setup()
|
||||
local tokyonight = require("tokyonight")
|
||||
|
||||
tokyonight.setup({
|
||||
style = "night",
|
||||
styles = {
|
||||
comments = { italic = false, },
|
||||
keywords = { italic = false, },
|
||||
},
|
||||
lualine_bold = false,
|
||||
})
|
||||
|
||||
tokyonight.load()
|
||||
end
|
||||
|
||||
return setup
|
||||
@@ -1,10 +0,0 @@
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
|
||||
local function setup()
|
||||
require("treesitter-context").setup({
|
||||
max_lines = 1,
|
||||
min_window_height = 10,
|
||||
})
|
||||
end
|
||||
|
||||
return setup
|
||||
+51
-41
@@ -1,47 +1,57 @@
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
|
||||
local function setup()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"c", -- recommended default
|
||||
"lua", -- recommended default
|
||||
"vim", -- recommended default
|
||||
"vimdoc", -- recommended default
|
||||
"query", -- recommended default
|
||||
"luadoc",
|
||||
"phpdoc",
|
||||
"regex", -- for noice
|
||||
"bash", -- for noice
|
||||
"markdown", -- for noice
|
||||
"markdown_inline", -- for noice
|
||||
"org",
|
||||
"comment",
|
||||
---@type LazyPluginSpec[]
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"c", -- recommended default
|
||||
"lua", -- recommended default
|
||||
"vim", -- recommended default
|
||||
"vimdoc", -- recommended default
|
||||
"query", -- recommended default
|
||||
"luadoc",
|
||||
"phpdoc",
|
||||
"org",
|
||||
"comment",
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = { "org", "php" },
|
||||
},
|
||||
},
|
||||
auto_install = true,
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldenable = true
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = { "org", "php" },
|
||||
-- Disable LSP semantic highlighting for comments because it will otherwise
|
||||
-- override highlights from `comment`.
|
||||
vim.api.nvim_set_hl(0, "@lsp.type.comment", {})
|
||||
|
||||
-- To set the priority of semantic highlighting lower than treesitter (100),
|
||||
-- uncomment the line below:
|
||||
-- vim.highlight.priorities.semantic_tokens = 99
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
opts = {
|
||||
max_lines = 1,
|
||||
min_window_height = 10,
|
||||
},
|
||||
})
|
||||
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldenable = true
|
||||
|
||||
-- Disable LSP semantic highlighting for comments because it will otherwise
|
||||
-- override highlights from `comment`.
|
||||
vim.api.nvim_set_hl(0, '@lsp.type.comment', {})
|
||||
|
||||
-- To set the priority of semantic highlighting lower than treesitter (100),
|
||||
-- uncomment the line below:
|
||||
-- vim.highlight.priorities.semantic_tokens = 99
|
||||
end
|
||||
|
||||
return setup
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
-- https://github.com/Mofiqul/vscode.nvim
|
||||
|
||||
local function setup()
|
||||
local vscode = require("vscode")
|
||||
|
||||
vscode.setup({
|
||||
style = "dark",
|
||||
transparent = false,
|
||||
italic_comments = false,
|
||||
disable_nvimtree_bg = false,
|
||||
})
|
||||
|
||||
vscode.load()
|
||||
end
|
||||
|
||||
return setup
|
||||
@@ -1,11 +1,15 @@
|
||||
-- https://github.com/simeji/winresizer
|
||||
|
||||
local function setup()
|
||||
vim.g.winresizer_vert_resize = "5"
|
||||
vim.g.winresizer_horiz_resize = "5"
|
||||
vim.g.winresizer_start_key = ""
|
||||
|
||||
vim.keymap.set("n", "<C-W>r", vim.cmd.WinResizerStartResize)
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"simeji/winresizer",
|
||||
lazy = true,
|
||||
keys = {
|
||||
{ "<C-W>r", vim.cmd.WinResizerStartResize, mode = "n" },
|
||||
},
|
||||
init = function()
|
||||
vim.g.winresizer_vert_resize = "5"
|
||||
vim.g.winresizer_horiz_resize = "5"
|
||||
vim.g.winresizer_start_key = ""
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
-- https://github.com/sindrets/winshift.nvim
|
||||
|
||||
local function setup()
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<C-W>m",
|
||||
vim.cmd.WinShift
|
||||
)
|
||||
end
|
||||
|
||||
return setup
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"sindrets/winshift.nvim",
|
||||
lazy = true,
|
||||
keys = {
|
||||
{ "<C-W>m", vim.cmd.WinShift, mode = "n" },
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user