refactor: split into individual files

This commit is contained in:
Dinesh Salunke 2025-01-01 09:08:27 +05:30
parent 81b0f8593e
commit 0758db6327
41 changed files with 1025 additions and 913 deletions

View File

@ -2,56 +2,55 @@
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"bufferline.nvim": { "branch": "main", "commit": "261a72b90d6db4ed8014f7bda976bcdc9dd7ce76" },
"catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
"bufferline.nvim": { "branch": "main", "commit": "9f0826ae6adfd836a23bf8a4910e3c07450211f4" },
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8" },
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
"conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" },
"copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" },
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
"lazy.nvim": { "branch": "main", "commit": "014d1d6d78df4e58f962158e6e00261d8632612c" },
"lazygit.nvim": { "branch": "main", "commit": "02a7a2789fe9e660ef72bec27df342b15bcca6b7" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" },
"lsp-zero.nvim": { "branch": "v2.x", "commit": "9a686513eaaa13d737d0fec8956a18268ead8b29" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mdx.nvim": { "branch": "main", "commit": "ae83959b61a9fec8da228ebb5d6b045fd532d2cc" },
"mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" },
"mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" },
"mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" },
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
"mini.surround": { "branch": "main", "commit": "48a9795c9d352c771e1ab5dedab6063c0a2df037" },
"mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"noice.nvim": { "branch": "main", "commit": "7b1960c48078a8b2fb44a89db82f4fa637b2d7c8" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" },
"noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-lspconfig": { "branch": "master", "commit": "47f236c058f0511702286a21ba53bbf42abbd8a8" },
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
"nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" },
"nvim-notify": { "branch": "master", "commit": "c3797193536711b5d8983975791c4b11dc35ab3a" },
"nvim-spectre": { "branch": "master", "commit": "08be31c104df3b4b049607694ebb2b6ced4f928b" },
"nvim-treesitter": { "branch": "master", "commit": "b6492f41c46d9c3bc3550ecfb10c3f261e73cba6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-web-devicons": { "branch": "master", "commit": "87c34abe5d1dc7c1c0a95aaaf888059c614c68ac" },
"oil.nvim": { "branch": "master", "commit": "9a59256c8e88b29d2150e99b5960b2f111e51f75" },
"nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"smart-splits.nvim": { "branch": "master", "commit": "264e865589389409f1ac1da7673b1b732b1e8963" },
"smart-splits.nvim": { "branch": "master", "commit": "d2da32b76b89126609f4142bd55279c8723cb050" },
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" },
"typescript-tools.nvim": { "branch": "master", "commit": "35e397ce467bedbbbb5bfcd0aa79727b59a08d4a" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" },
"zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" },
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }
}

8
lua/plugins/Comment.lua Normal file
View File

@ -0,0 +1,8 @@
return {
{
"numToStr/Comment.nvim",
event = "VeryLazy",
opts = {},
},
}

58
lua/plugins/alpha.lua Normal file
View File

@ -0,0 +1,58 @@
return {
{
"goolord/alpha-nvim",
event = "VimEnter",
opts = function()
local dashboard = require("alpha.themes.dashboard")
local logo = [[
]]
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
dashboard.button("f", "" .. " Find file", ":Telescope find_files <CR>"),
dashboard.button("n", "" .. " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", "" .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("g", "" .. " Find text", ":Telescope live_grep <CR>"),
dashboard.button("c", "" .. " Config", ":e $MYVIMRC <CR>"),
dashboard.button("s", "" .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy<CR>"),
dashboard.button("q", "" .. " Quit", ":qa<CR>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end,
config = function(_, dashboard)
local lazy = require("lazy")
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
callback = function()
lazy.show()
end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
callback = function()
local stats = lazy.stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
},
}

16
lua/plugins/autotag.lua Normal file
View File

@ -0,0 +1,16 @@
return {
{
"windwp/nvim-ts-autotag",
config = function(_, _)
local autotag = require("nvim-ts-autotag")
autotag.setup({
opts = {
enable_rename = true,
enable_close = true,
enable_close_on_slash = true,
},
})
end,
},
}

View File

@ -0,0 +1,19 @@
return {
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
},
opts = {
options = {
offsets = {
{
filetype = "neo-tree",
},
},
},
},
},
}

10
lua/plugins/bufremove.lua Normal file
View File

@ -0,0 +1,10 @@
return {
{
"echasnovski/mini.bufremove",
-- stylua: ignore
keys = {
{ "<leader>bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" },
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
},
},
}

View File

@ -1,207 +0,0 @@
return {
{
"L3MON4D3/LuaSnip",
version = "2.*",
build = (not jit.os:find("Windows"))
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
opts = {
history = true,
delete_check_events = "TextChanged",
},
config = function(_, opts)
local ls = require("luasnip")
ls.setup({
history = true,
delete_check_events = "TextChanged",
})
require("luasnip.loaders.from_lua").load({ paths = "~/snippets" })
end,
dependencies = {
"hrsh7th/nvim-cmp",
},
-- stylua: ignore
},
{
"hrsh7th/nvim-cmp",
version = false,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp-signature-help",
"onsails/lspkind.nvim",
},
opts = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local luasnip = require("luasnip")
local cmp = require("cmp")
local border_opts = {
border = {
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
},
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
}
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
return {
formatting = {
fields = {
"abbr",
"kind",
"menu",
},
format = require("lspkind").cmp_format({
mode = "symbol_text",
maxwidth = 150,
ellipsis_char = "...",
before = function(entry, vim_item)
vim_item.menu = ({
nvim_lsp = "[LSP]",
buffer = "[Buffer]",
})[entry.source.name]
return vim_item
end,
}),
},
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ behavior = cmp.SelectBehavior.Replace, select = true }),
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- -- they way you will only jump inside the snippet region
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- elseif has_words_before() then
-- cmp.complete()
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- elseif luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
window = {
scrollbar = false,
completion = cmp.config.window.bordered(border_opts),
documentation = cmp.config.window.bordered(border_opts),
},
}
end,
},
{
"stevearc/conform.nvim",
opts = {},
config = function()
local confrom = require("conform")
confrom.setup({
log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettierd", "eslint_d" },
typescript = { "prettierd", "eslint_d" },
typescriptreact = { "prettierd", "eslint_d" },
json = { "prettierd" },
jsonc = { "prettierd" },
go = { "gofumpt", "goimports" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
end,
},
{
"echasnovski/mini.pairs",
event = "VeryLazy",
opts = {},
},
{
"numToStr/Comment.nvim",
event = "VeryLazy",
opts = {},
},
{
"echasnovski/mini.surround",
opts = {},
},
{
"folke/zen-mode.nvim",
keys = {
{
"<leader>zm",
function()
require("zen-mode").toggle({
window = {
width = 0.85,
},
})
end,
},
},
opts = {
plugins = {
twilight = { enabled = true },
},
},
},
{
"folke/twilight.nvim",
opts = {},
},
{
"davidmh/mdx.nvim",
config = true,
dependencies = { "nvim-treesitter/nvim-treesitter" },
},
}

View File

@ -15,7 +15,7 @@ return {
dark = "mocha",
light = "latte",
},
transparent_background = true,
transparent_background = false,
})
vim.cmd.colorscheme("catppuccin")
end,

25
lua/plugins/conform.lua Normal file
View File

@ -0,0 +1,25 @@
return {
{
"stevearc/conform.nvim",
opts = {},
config = function()
local confrom = require("conform")
confrom.setup({
log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettierd", "eslint_d" },
typescript = { "prettierd", "eslint_d" },
typescriptreact = { "prettierd", "eslint_d" },
json = { "prettierd" },
jsonc = { "prettierd" },
go = { "gofumpt", "goimports" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
end,
},
}

57
lua/plugins/copilot.lua Normal file
View File

@ -0,0 +1,57 @@
-- Copilot.
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
opts = {
-- I don't find the panel useful.
panel = { enabled = false },
suggestion = {
auto_trigger = true,
-- Use alt to interact with Copilot.
keymap = {
-- Disable the built-in mapping, we'll configure it in nvim-cmp.
accept = false,
accept_word = "<M-w>",
accept_line = "<M-l>",
next = "<M-]>",
prev = "<M-[>",
dismiss = "/",
},
},
filetypes = { markdown = true, lua = true, python = true, typescript = true, javascript = true },
},
config = function(_, opts)
local cmp = require("cmp")
local copilot = require("copilot.suggestion")
local luasnip = require("luasnip")
require("copilot").setup(opts)
local function set_trigger(trigger)
vim.b.copilot_suggestion_auto_trigger = trigger
vim.b.copilot_suggestion_hidden = not trigger
end
-- Hide suggestions when the completion menu is open.
cmp.event:on("menu_opened", function()
if copilot.is_visible() then
copilot.dismiss()
end
set_trigger(false)
end)
-- Disable suggestions when inside a snippet.
cmp.event:on("menu_closed", function()
set_trigger(not luasnip.expand_or_locally_jumpable())
end)
vim.api.nvim_create_autocmd("User", {
pattern = { "LuasnipInsertNodeEnter", "LuasnipInsertNodeLeave" },
callback = function()
set_trigger(not luasnip.expand_or_locally_jumpable())
end,
})
end,
},
}

17
lua/plugins/dressing.lua Normal file
View File

@ -0,0 +1,17 @@
return {
{
"stevearc/dressing.nvim",
opts = {
select = {
enabled = true,
backend = {
"telescope",
"fzf",
"builtin",
"nui",
},
telescope = require("telescope.themes").get_ivy(),
},
},
},
}

View File

@ -1,445 +0,0 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
cmd = "Neotree",
branch = "v2.x",
dependencies = {
"MunifTanjim/nui.nvim",
},
opts = {
close_if_last_window = true,
sources = {
"filesystem",
"buffers",
"git_status",
},
source_selector = {
winbar = true,
content_layout = "center",
sources = {
{ source = "filesystem", display_name = require("config.icons").FolderClosed .. " File" },
{ source = "buffers", display_name = require("config.icons").DefaultFile .. " Bufs" },
{ source = "git_status", display_name = require("config.icons").Git .. " Git" },
{ source = "diagnostics", display_name = require("config.icons").Diagnostic .. " Diagnostic" },
},
},
default_component_configs = {
indent = {
padding = 0,
},
icon = {
folder_closed = require("config.icons").FolderClosed,
folder_open = require("config.icons").FolderOpen,
folder_empty = require("config.icons").FolderEmpty,
folder_empty_open = require("config.icons").FolderEmpty,
default = require("config.icons").DefaultFile,
},
},
filesystem = {
follow_current_file = true,
hijack_netrw_behavior = "open_current",
use_libuv_file_watcher = true,
},
},
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({
toggle = true,
})
end,
},
},
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
cmd = "Telescope",
keys = {
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "[ F ]ind files",
},
{
"<leader>fF",
function()
require("telescope.builtin").find_files({ hidden = true, no_ignore = true })
end,
desc = "[ F ]ind [ F ]iles",
},
{
"<leader>lg",
function()
require("telescope.builtin").live_grep()
end,
desc = "Live grep",
},
{
"<leader>gf",
function()
require("telescope.builtin").git_files()
end,
desc = "Live grep",
},
{
"<leader>gs",
function()
require("telescope.builtin").git_status()
end,
desc = "Live grep",
},
{
"<leader>fc",
function()
require("telescope.builtin").git_commits()
end,
desc = "Git Commits",
},
{
"<leader>of",
function()
require("telescope.builtin").oldfiles()
end,
desc = "[ O ]ld [ F ]iles",
},
{
"<leader>ds",
function()
require("telescope.builtin").lsp_document_symbols()
end,
desc = "[ D ]ocument [ S ]ymbols",
},
{
"<leader>wss",
function()
require("telescope.builtin").lsp_dynamic_workspace_symbols()
end,
desc = "[ W ]orkspace [ S ]ymbol[ s ]",
remap = true,
},
{
"<leader>lr",
function()
require("telescope.builtin").lsp_references()
end,
desc = "[L]ist [R]erefrences",
},
{
"<leader>ld",
function()
require("telescope.builtin").diagnostics()
end,
desc = "[ L ]ist [ D ]iagnostics",
},
{
"<leader>li",
function()
require("telescope.builtin").lsp_implementations()
end,
desc = "[ L ]ist [ I ]mplementation",
},
{
"<leader>ldi",
function()
require("telescope.builtin").lsp_definitions()
end,
desc = "[ L ]ist [ D ]ef[ i ]nitions",
},
},
opts = {
defaults = {
prompt_prefix = "",
selection_caret = "",
sorting_strategy = "ascending",
path_display = {
"smart",
},
layout_config = {
horizontal = {
prompt_position = "top",
width = 0.75,
height = 0.65,
preview_width = 0.6,
},
},
mappings = {
i = {
["<C-k>"] = function(...)
require("telescope.actions").move_selection_previous(...)
end,
["<C-j>"] = function(...)
require("telescope.actions").move_selection_next(...)
end,
["<c-t>"] = function(...)
require("trouble.providers.telescope").open_with_trouble(...)
end,
},
n = {
q = function(...)
require("telescope.actions").close(...)
end,
["<c-t>"] = function(...)
require("trouble.providers.telescope").open_with_trouble(...)
end,
},
},
},
},
},
{
"folke/flash.nvim",
event = "VeryLazy",
vscode = true,
keys = {
{
"s",
mode = { "n", "x", "o" },
function()
require("flash").jump()
end,
desc = "Flash",
},
{
"S",
mode = { "n", "o", "x" },
function()
require("flash").treesitter()
end,
desc = "Flash Treesitter",
},
{
"r",
mode = "o",
function()
require("flash").remote()
end,
desc = "Remote Flash",
},
{
"R",
mode = { "o", "x" },
function()
require("flash").treesitter_search()
end,
desc = "Treesitter Search",
},
{
"<c-s>",
mode = { "c" },
function()
require("flash").toggle()
end,
desc = "Toggle Flash Search",
},
},
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = {
spelling = true,
},
},
},
{
"lewis6991/gitsigns.nvim",
event = {
"BufReadPre",
"BufNewFile",
},
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
},
},
{
"RRethy/vim-illuminate",
event = {
"BufReadPost",
"BufNewFile",
},
opts = {
delay = 200,
},
config = function(_, opts)
require("illuminate").configure(opts)
end,
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
{
"echasnovski/mini.bufremove",
-- stylua: ignore
keys = {
{ "<leader>bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" },
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
},
},
{
"folke/trouble.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
keys = {
{
"<leader>xx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leadr>xb",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>xL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>xQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
opts = {},
},
{
"kdheepak/lazygit.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
keys = {
{
"<leader>gg",
function()
require("lazygit").lazygit()
end,
desc = "Lazygit",
},
},
config = function()
require("telescope").load_extension("lazygit")
end,
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
opts = {
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
routes = {
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
views = {
cmdline_popup = {
position = {
row = 5,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
popupmenu = {
relative = "editor",
position = {
row = 8,
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
},
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
},
},
{
"psliwka/vim-smoothie",
},
{
"mrjones2014/smart-splits.nvim",
opts = {},
},
{
"nvim-pack/nvim-spectre",
opts = {},
},
}

49
lua/plugins/flash.lua Normal file
View File

@ -0,0 +1,49 @@
return {
{
"folke/flash.nvim",
event = "VeryLazy",
vscode = true,
keys = {
{
"s",
mode = { "n", "x", "o" },
function()
require("flash").jump()
end,
desc = "Flash",
},
{
"S",
mode = { "n", "o", "x" },
function()
require("flash").treesitter()
end,
desc = "Flash Treesitter",
},
{
"r",
mode = "o",
function()
require("flash").remote()
end,
desc = "Remote Flash",
},
{
"R",
mode = { "o", "x" },
function()
require("flash").treesitter_search()
end,
desc = "Treesitter Search",
},
{
"<c-s>",
mode = { "c" },
function()
require("flash").toggle()
end,
desc = "Toggle Flash Search",
},
},
},
}

19
lua/plugins/gitsigns.lua Normal file
View File

@ -0,0 +1,19 @@
return {
{
"lewis6991/gitsigns.nvim",
event = {
"BufReadPre",
"BufNewFile",
},
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
},
},
}

View File

@ -0,0 +1,19 @@
return {
{
"RRethy/vim-illuminate",
event = {
"BufReadPost",
"BufNewFile",
},
opts = {
delay = 200,
},
config = function(_, opts)
require("illuminate").configure(opts)
end,
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
}

View File

@ -0,0 +1,32 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPost", "BufNewFile" },
main = "ibl",
opts = {
indent = {
char = "",
},
whitespace = {
highlight = {
"CursorColumn",
"Whitespace",
},
},
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
},
},
}

View File

@ -0,0 +1,32 @@
return {
-- active indent guide and indent text objects
{
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
event = { "BufReadPre", "BufNewFile" },
opts = {
-- symbol = "▏",
symbol = "",
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
}

21
lua/plugins/lazygit.lua Normal file
View File

@ -0,0 +1,21 @@
return {
{
"kdheepak/lazygit.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
keys = {
{
"<leader>gg",
function()
require("lazygit").lazygit()
end,
desc = "Lazygit",
},
},
config = function()
require("telescope").load_extension("lazygit")
end,
},
}

View File

@ -1,12 +1,4 @@
return {
{
"VonHeikemen/lsp-zero.nvim",
branch = "v2.x",
lazy = true,
config = function()
require("lsp-zero.settings").preset({})
end,
},
{
"neovim/nvim-lspconfig",
@ -46,7 +38,7 @@ return {
"lua_ls",
"gopls",
"yamlls",
"ruby-lsp",
"ruby_lsp",
})
local lspconfig = require("lspconfig")
@ -68,28 +60,4 @@ return {
lsp.setup()
end,
},
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
config = function()
require("typescript-tools").setup({
single_file_support = true,
settings = {
single_file_support = true,
},
})
vim.keymap.set(
"n",
"<leader>toi",
"<CMD>TSToolsOrganizeImports<CR>",
{ desc = "[T]ypescript [O]rganize [I]mports" }
)
end,
},
{
"folke/neodev.nvim",
opts = {},
},
}

10
lua/plugins/lspzero.lua Normal file
View File

@ -0,0 +1,10 @@
return {
{
"VonHeikemen/lsp-zero.nvim",
branch = "v2.x",
lazy = true,
config = function()
require("lsp-zero.settings").preset({})
end,
},
}

35
lua/plugins/lualine.lua Normal file
View File

@ -0,0 +1,35 @@
return {
{
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
options = {
theme = "catppuccin",
globalstatus = true,
disabled_filetypes = {
statusline = {
"dashboard",
"alpha",
},
},
section_separators = "",
component_separators = "",
},
sections = {
lualine_a = {
{ "mode", icons_enabled = true },
},
lualine_b = {
"branch",
"diff",
"diagnostics",
},
lualine_c = {
{ "filename", path = 1 },
},
},
},
},
}

26
lua/plugins/luasnip.lua Normal file
View File

@ -0,0 +1,26 @@
return {
{
"L3MON4D3/LuaSnip",
version = "2.*",
build = (not jit.os:find("Windows"))
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
opts = {
history = true,
delete_check_events = "TextChanged",
},
config = function(_, opts)
local ls = require("luasnip")
ls.setup({
history = true,
delete_check_events = "TextChanged",
})
require("luasnip.loaders.from_lua").load({ paths = "~/snippets" })
end,
dependencies = {
"hrsh7th/nvim-cmp",
},
-- stylua: ignore
},
}

7
lua/plugins/mdx.lua Normal file
View File

@ -0,0 +1,7 @@
return {
{
"davidmh/mdx.nvim",
config = true,
dependencies = { "nvim-treesitter/nvim-treesitter" },
},
}

View File

@ -0,0 +1,8 @@
return {
{
"echasnovski/mini.pairs",
event = "VeryLazy",
opts = {},
},
}

View File

@ -0,0 +1,7 @@
return {
{
"echasnovski/mini.surround",
opts = {},
},
}

7
lua/plugins/neodev.lua Normal file
View File

@ -0,0 +1,7 @@
return {
{
"folke/neodev.nvim",
opts = {},
},
}

56
lua/plugins/neotree.lua Normal file
View File

@ -0,0 +1,56 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
cmd = "Neotree",
branch = "v2.x",
dependencies = {
"MunifTanjim/nui.nvim",
},
opts = {
close_if_last_window = true,
sources = {
"filesystem",
"buffers",
"git_status",
},
source_selector = {
winbar = true,
content_layout = "center",
sources = {
{ source = "filesystem", display_name = require("config.icons").FolderClosed .. " File" },
{ source = "buffers", display_name = require("config.icons").DefaultFile .. " Bufs" },
{ source = "git_status", display_name = require("config.icons").Git .. " Git" },
{ source = "diagnostics", display_name = require("config.icons").Diagnostic .. " Diagnostic" },
},
},
default_component_configs = {
indent = {
padding = 0,
},
icon = {
folder_closed = require("config.icons").FolderClosed,
folder_open = require("config.icons").FolderOpen,
folder_empty = require("config.icons").FolderEmpty,
folder_empty_open = require("config.icons").FolderEmpty,
default = require("config.icons").DefaultFile,
},
},
filesystem = {
follow_current_file = true,
hijack_netrw_behavior = "open_current",
use_libuv_file_watcher = true,
},
},
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({
toggle = true,
})
end,
},
},
},
}

68
lua/plugins/noice.lua Normal file
View File

@ -0,0 +1,68 @@
return {
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
opts = {
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
routes = {
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
views = {
cmdline_popup = {
position = {
row = 5,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
popupmenu = {
relative = "editor",
position = {
row = 8,
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = "rounded",
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
},
},
},
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
},
},
}

11
lua/plugins/notify.lua Normal file
View File

@ -0,0 +1,11 @@
return {
{
"rcarriga/nvim-notify",
config = function(_, opts)
local notify = require("notify")
notify.setup(vim.tbl_extend("keep", {
background_colour = "#000000",
}, opts))
end,
},
}

120
lua/plugins/nvim-cmp.lua Normal file
View File

@ -0,0 +1,120 @@
return {
{
"hrsh7th/nvim-cmp",
version = false,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp-signature-help",
"onsails/lspkind.nvim",
},
config = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local luasnip = require("luasnip")
local cmp = require("cmp")
local border_opts = {
border = {
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
{ "", "CmpDocBorder" },
},
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
}
---@diagnostic disable: missing-fields
cmp.setup({
formatting = {
preselect = cmp.PreselectMode.None,
fields = {
"abbr",
"kind",
"menu",
},
format = require("lspkind").cmp_format({
mode = "symbol_text",
maxwidth = 150,
ellipsis_char = "...",
before = function(entry, vim_item)
vim_item.menu = ({
nvim_lsp = "[LSP]",
buffer = "[Buffer]",
})[entry.source.name]
return vim_item
end,
}),
},
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
view = {
docs = {
auto_open = false,
},
},
mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ behavior = cmp.SelectBehavior.Replace, select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
local copilot = require("copilot.suggestion")
if copilot.is_visible() then
copilot.accept_line()
elseif cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.expand_or_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
["<C-d>"] = function()
if cmp.visible_docs() then
cmp.close_docs()
else
cmp.open_docs()
end
end,
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
window = {
scrollbar = false,
completion = cmp.config.window.bordered(border_opts),
documentation = cmp.config.window.bordered(border_opts),
},
})
---@diagnostic enable: missing-fields
end,
},
}

View File

@ -0,0 +1,6 @@
return {
{
"mrjones2014/smart-splits.nvim",
opts = {},
},
}

5
lua/plugins/smoothie.lua Normal file
View File

@ -0,0 +1,5 @@
return {
{
"psliwka/vim-smoothie",
},
}

6
lua/plugins/spectre.lua Normal file
View File

@ -0,0 +1,6 @@
return {
{
"nvim-pack/nvim-spectre",
opts = {},
},
}

147
lua/plugins/telescope.lua Normal file
View File

@ -0,0 +1,147 @@
return {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
cmd = "Telescope",
keys = {
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "[ F ]ind files",
},
{
"<leader>fF",
function()
require("telescope.builtin").find_files({ hidden = true, no_ignore = true })
end,
desc = "[ F ]ind [ F ]iles",
},
{
"<leader>lg",
function()
require("telescope.builtin").live_grep()
end,
desc = "Live grep",
},
{
"<leader>gf",
function()
require("telescope.builtin").git_files()
end,
desc = "Live grep",
},
{
"<leader>gs",
function()
require("telescope.builtin").git_status()
end,
desc = "Live grep",
},
{
"<leader>fc",
function()
require("telescope.builtin").git_commits()
end,
desc = "Git Commits",
},
{
"<leader>of",
function()
require("telescope.builtin").oldfiles()
end,
desc = "[ O ]ld [ F ]iles",
},
{
"<leader>ds",
function()
require("telescope.builtin").lsp_document_symbols()
end,
desc = "[ D ]ocument [ S ]ymbols",
},
{
"<leader>wss",
function()
require("telescope.builtin").lsp_dynamic_workspace_symbols()
end,
desc = "[ W ]orkspace [ S ]ymbol[ s ]",
remap = true,
},
{
"<leader>lr",
function()
require("telescope.builtin").lsp_references()
end,
desc = "[L]ist [R]erefrences",
},
{
"<leader>ld",
function()
require("telescope.builtin").diagnostics()
end,
desc = "[ L ]ist [ D ]iagnostics",
},
{
"<leader>li",
function()
require("telescope.builtin").lsp_implementations()
end,
desc = "[ L ]ist [ I ]mplementation",
},
{
"<leader>ldi",
function()
require("telescope.builtin").lsp_definitions()
end,
desc = "[ L ]ist [ D ]ef[ i ]nitions",
},
},
opts = {
defaults = {
prompt_prefix = "",
selection_caret = "",
sorting_strategy = "ascending",
path_display = {
"smart",
},
layout_config = {
horizontal = {
prompt_position = "top",
width = 0.75,
height = 0.65,
preview_width = 0.6,
},
},
mappings = {
i = {
["<C-k>"] = function(...)
require("telescope.actions").move_selection_previous(...)
end,
["<C-j>"] = function(...)
require("telescope.actions").move_selection_next(...)
end,
["<c-t>"] = function(...)
require("trouble.providers.telescope").open_with_trouble(...)
end,
},
n = {
q = function(...)
require("telescope.actions").close(...)
end,
["<c-t>"] = function(...)
require("trouble.providers.telescope").open_with_trouble(...)
end,
},
},
},
},
},
}

View File

@ -64,13 +64,4 @@ return {
{
"nvim-treesitter/playground",
},
{
"windwp/nvim-ts-autotag",
opts = {
enable_rename = true,
enable_close = true,
enable_close_on_slash = true,
},
},
}

41
lua/plugins/trouble.lua Normal file
View File

@ -0,0 +1,41 @@
return {
{
"folke/trouble.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
keys = {
{
"<leader>xx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leadr>xb",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>xL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>xQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
opts = {},
},
}

7
lua/plugins/twilight.lua Normal file
View File

@ -0,0 +1,7 @@
return {
{
"folke/twilight.nvim",
opts = {},
},
}

View File

@ -0,0 +1,21 @@
return {
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
config = function()
require("typescript-tools").setup({
single_file_support = true,
settings = {
single_file_support = true,
},
})
vim.keymap.set(
"n",
"<leader>toi",
"<CMD>TSToolsOrganizeImports<CR>",
{ desc = "[T]ypescript [O]rganize [I]mports" }
)
end,
},
}

View File

@ -1,198 +0,0 @@
return {
{
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
options = {
theme = "catppuccin",
globalstatus = true,
disabled_filetypes = {
statusline = {
"dashboard",
"alpha",
},
},
section_separators = "",
component_separators = "",
},
sections = {
lualine_a = {
{ "mode", icons_enabled = true },
},
lualine_b = {
"branch",
"diff",
"diagnostics",
},
lualine_c = {
{ "filename", path = 1 },
},
},
},
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
},
opts = {
options = {
offsets = {
{
filetype = "neo-tree",
},
},
},
},
},
{
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPost", "BufNewFile" },
main = "ibl",
opts = {
indent = {
char = "",
},
whitespace = {
highlight = {
"CursorColumn",
"Whitespace",
},
},
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
},
},
},
-- active indent guide and indent text objects
{
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
event = { "BufReadPre", "BufNewFile" },
opts = {
-- symbol = "▏",
symbol = "",
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
{
"stevearc/dressing.nvim",
opts = {
select = {
enabled = true,
backend = {
"telescope",
"fzf",
"builtin",
"nui",
},
telescope = require("telescope.themes").get_ivy(),
},
},
},
{
"rcarriga/nvim-notify",
config = function(_, opts)
local notify = require("notify")
notify.setup(vim.tbl_extend("keep", {
background_colour = "#000000",
}, opts))
end,
},
{
"goolord/alpha-nvim",
event = "VimEnter",
opts = function()
local dashboard = require("alpha.themes.dashboard")
local logo = [[
]]
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
dashboard.button("f", "" .. " Find file", ":Telescope find_files <CR>"),
dashboard.button("n", "" .. " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", "" .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("g", "" .. " Find text", ":Telescope live_grep <CR>"),
dashboard.button("c", "" .. " Config", ":e $MYVIMRC <CR>"),
dashboard.button("s", "" .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy<CR>"),
dashboard.button("q", "" .. " Quit", ":qa<CR>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end,
config = function(_, dashboard)
local lazy = require("lazy")
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
callback = function()
lazy.show()
end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
callback = function()
local stats = lazy.stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
},
}

11
lua/plugins/whichkey.lua Normal file
View File

@ -0,0 +1,11 @@
return {
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = {
spelling = true,
},
},
},
}

23
lua/plugins/zenmode.lua Normal file
View File

@ -0,0 +1,23 @@
return {
{
"folke/zen-mode.nvim",
keys = {
{
"<leader>zm",
function()
require("zen-mode").toggle({
window = {
width = 0.85,
},
})
end,
},
},
opts = {
plugins = {
twilight = { enabled = true },
},
},
},
}