Compare commits

..

21 Commits
main ... dev

Author SHA1 Message Date
Dinesh Salunke
eaf23496e9 refactor: remove the luasnip from nvim cmp 2025-02-03 12:16:46 +05:30
Dinesh Salunke
629d950126 refactor: add prettierd to conform 2025-02-03 12:16:29 +05:30
Dinesh Salunke
6a5a899429 refactor: color scheme settings 2025-02-03 12:16:19 +05:30
Dinesh Salunke
6cd3836bd7 refactor: add tnf package 2025-01-03 20:09:04 +05:30
Dinesh Salunke
e087408b1f refactor: remove copilot 2025-01-03 20:08:04 +05:30
Dinesh Salunke
0758db6327 refactor: split into individual files 2025-01-01 09:08:27 +05:30
Dinesh Salunke
81b0f8593e refactor: comment the tab shortcut for nvim cmp 2024-12-16 12:46:42 +05:30
Dinesh Salunke
a9ada7444e chore: udpate packages 2024-12-16 12:46:15 +05:30
Dinesh Salunke
68050d2123 refactor: add mdx package 2024-12-16 12:46:03 +05:30
Dinesh Salunke
ed6dd19238 refactor: add ruby lsp 2024-12-16 12:45:24 +05:30
Dinesh Salunke
b6a9376e6e refactor: remove the rest nvim package 2024-12-16 12:45:13 +05:30
Dinesh Salunke
354db1f435 refactor: add background color for notify plugin 2024-12-16 12:45:00 +05:30
Dinesh Salunke
68d31dfb1c refactor: add spectre package and some keyboard shortcuts for tourble 2024-12-16 12:44:40 +05:30
Dinesh Salunke
86ab0af01d refactor: theme based on the system preference 2024-12-16 12:43:07 +05:30
385bf1bd50 refactor: replace formatter plugin with conform 2024-06-08 17:26:10 +05:30
e1930ef9d3 chore: update package versions 2024-06-08 16:40:24 +05:30
356110906d refactor: add some highlight options 2024-06-08 16:40:15 +05:30
22e43507bf refactor: organize imports for typescript-tools 2024-06-08 16:39:52 +05:30
a17e69d419 refactor: git status key for telescope 2024-06-08 16:39:32 +05:30
dabb532500 refactor: add formatter for jsonc 2024-06-08 16:39:10 +05:30
f3aee592e1 refactor: add listchars for space and tabs etc 2024-06-08 16:39:02 +05:30
47 changed files with 1097 additions and 945 deletions

View File

@ -2,56 +2,54 @@
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "b7bbdf93b42866f166af98d39a2563eedb7cabac" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"bufferline.nvim": { "branch": "main", "commit": "9f0826ae6adfd836a23bf8a4910e3c07450211f4" },
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"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": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
"formatter.nvim": { "branch": "master", "commit": "eb89a1f3e079f1b9680bc7293b75fffccb5e1598" },
"gitsigns.nvim": { "branch": "main", "commit": "1796c7cedfe7e5dd20096c5d7b8b753d8f8d22eb" },
"glow.nvim": { "branch": "main", "commit": "5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2" },
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
"lsp-zero.nvim": { "branch": "v2.x", "commit": "320d5913bc5a0b0f15537e32777331d2323ab7f8" },
"conform.nvim": { "branch": "master", "commit": "990d37017e193fe40bdabf058e598e76f5e7d929" },
"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": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" },
"lsp-zero.nvim": { "branch": "v2.x", "commit": "9a686513eaaa13d737d0fec8956a18268ead8b29" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lspsaga.nvim": { "branch": "main", "commit": "920b1253e1a26732e53fac78412f6da7f674671d" },
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"mini.bufremove": { "branch": "main", "commit": "66019ecebdc5bc0759e04747586994e2e3f98416" },
"mini.indentscope": { "branch": "main", "commit": "8af2569a7d7fd37300dfa760e44e71efbbf322fd" },
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
"mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"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.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" },
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
"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": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"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": "46434074f188e6bfccf9d9153dd8be6b1381498b" },
"nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" },
"nvim-lspconfig": { "branch": "master", "commit": "a8ef5e6e497b3ebeaaf35b939c07c211563b2e05" },
"nvim-notify": { "branch": "master", "commit": "bd9cd51f9ef2f6326fc2bc9931d0718c1794e247" },
"nvim-spectre": { "branch": "master", "commit": "08be31c104df3b4b049607694ebb2b6ced4f928b" },
"nvim-treesitter": { "branch": "master", "commit": "b6492f41c46d9c3bc3550ecfb10c3f261e73cba6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" },
"smart-splits.nvim": { "branch": "master", "commit": "fdb4e812b615bbdc94b403a0c0b21c9e0af2cf2a" },
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"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": "3c501d7c7f79457932a8750a2a1476a004c5c1a9" },
"vim-illuminate": { "branch": "master", "commit": "fbc16dee336d8cc0d3d2382ea4a53f4a29725abf" },
"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": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" },
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }
}

View File

@ -0,0 +1,79 @@
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local Path = require("plenary.path")
local built_in = require("telescope.builtin")
local os_sep = Path.path.sep
local is_dir = function(path)
if Path.is_path(path) then
return path:is_dir()
end
return string.sub(path, -1, -1) == os_sep
end
local create_file = function(file)
if not file then
return
end
if file == "" then
vim.notify(
string.format("[file_browser.%s] %s", "actions.create", "Please enter a valid file or folder name!"),
vim.log.levels.WARN,
{
title = "telescope-file-browser.nvim",
}
)
return
end
file = Path:new(file)
if file:exists() then
vim.notify(
string.format("[file_browser.%s] %s", "actions.create", "Selection already exists!"),
vim.log.levels.WARN,
{
title = "telescope-file-browser.nvim",
}
)
return
end
if not is_dir(file.filename) then
file:touch({ parents = true })
else
Path:new(file.filename:sub(1, -2)):mkdir({ parents = true, mode = 493 }) -- 493 => decimal for mode 0755
end
return file
end
local get_dropdown = require("telescope.themes").get_dropdown
local tnf = function()
built_in.find_files(get_dropdown({
previewer = false,
find_command = { "find", ".", "-type", "d", "-not", "-path", "*/node_modules/*" },
attach_mappings = function(prompt_bufnr)
actions.select_default:replace(function()
local current_picker = action_state.get_current_picker(prompt_bufnr)
local entry = action_state.get_selected_entry()
if entry then
local base_dir = action_state.get_selected_entry().value .. os_sep
current_picker:reset_prompt(base_dir, true)
else
local file_path = current_picker:_get_prompt()
actions.close(prompt_bufnr)
local file = create_file(file_path)
if file then
vim.cmd.edit(file:absolute())
end
end
end)
return true
end,
}))
end
return require("telescope").register_extension({
exports = {
tnf = tnf,
},
})

View File

@ -35,9 +35,3 @@ vim.api.nvim_create_autocmd("BufEnter", {
end
end,
})
vim.api.nvim_create_augroup("__formatter__", { clear = true })
vim.api.nvim_create_autocmd("BufWritePost", {
group = "__formatter__",
command = ":FormatWrite"
})

View File

@ -68,5 +68,8 @@ map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
-- map("t", "<esc>", [[<c-\><c-n>]], { desc = "Escape on terminal" })
map("n", "<C-a>", "gg<S-v>G", { desc = "Select all" })
map("n", "<leader>nf", "<cmd>Telescope tnf<cr>", { desc = "Telescope new file" })

View File

@ -67,6 +67,7 @@ opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.inccommand = "nosplit" -- preview incremental substitute
opt.list = true -- Show some invisible characters (tabs...
opt.listchars = "tab:→ ,space:·,nbsp:␣,trail:•,precedes:«,extends:»"
opt.pumblend = 12 -- Popup blend
opt.pumheight = 12 -- Maximum number of entries in a popup

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,218 +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,
},
{
"mhartington/formatter.nvim",
opts = {},
config = function()
local formatter = require("formatter")
formatter.setup({
filetype = {
lua = {
require("formatter.filetypes.lua").stylua,
},
typescript = {
require("formatter.filetypes.typescript").prettierd,
require("formatter.filetypes.typescript").eslint_d,
},
typescriptreact = {
require("formatter.filetypes.typescript").prettierd,
require("formatter.filetypes.typescript").eslint_d,
},
javascript = {
require("formatter.filetypes.typescript").prettierd,
require("formatter.filetypes.typescript").eslint_d,
},
javascriptreact = {
require("formatter.filetypes.typescript").prettierd,
require("formatter.filetypes.typescript").eslint_d,
},
json = {
require("formatter.filetypes.typescript").prettierd,
},
jsonc = {
require("formatter.filetypes.typescript").prettierd,
},
go = {
require("formatter.filetypes.go").gofumpt,
require("formatter.filetypes.go").goimports,
},
},
})
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 = {},
},
}

View File

@ -8,7 +8,28 @@ return {
neotree = true,
},
config = function()
vim.cmd.colorscheme("catppuccin-mocha")
local catppuccin = require("catppuccin")
catppuccin.setup({
flavour = "auto",
background = {
dark = "mocha",
light = "latte",
},
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
transparent_background = true,
})
vim.cmd.colorscheme("catppuccin")
end,
},
}

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

@ -0,0 +1,26 @@
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" },
yaml = { "prettierd" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
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,408 +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>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>xd", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
{ "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
{ "<leader>xl", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
{ "<leader>xq", "<cmd>TroubleToggle quickfix<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 = {},
},
}

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,22 +1,4 @@
return {
{
"nvimdev/lspsaga.nvim",
config = function()
require("lspsaga").setup({})
end,
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
},
{
"VonHeikemen/lsp-zero.nvim",
branch = "v2.x",
lazy = true,
config = function()
require("lsp-zero.settings").preset({})
end,
},
{
"neovim/nvim-lspconfig",
@ -56,6 +38,7 @@ return {
"lua_ls",
"gopls",
"yamlls",
"ruby_lsp",
})
local lspconfig = require("lspconfig")
@ -72,27 +55,9 @@ return {
},
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
})
lspconfig.ruby_lsp.setup({})
lsp.setup()
end,
},
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
config = function()
require("typescript-tools").setup({})
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,
},
}

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

@ -0,0 +1,113 @@
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 = true,
},
},
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()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
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 = {},
},
}

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

@ -0,0 +1,153 @@
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",
},
},
config = function(_, opts)
local telescope = require("telescope")
telescope.setup({
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,
},
},
},
})
telescope.load_extension("tnf")
end,
},
}

View File

@ -1,25 +0,0 @@
return {
"akinsho/toggleterm.nvim",
version = "*",
config = function()
require("toggleterm").setup({
shell = "fish", -- use fish shell
start_in_insert = true,
insert_mappings = true,
})
-- Horizontal terminal on <leader>tt
vim.keymap.set("n", "<leader>tt", function()
require("toggleterm.terminal").Terminal
:new({ direction = "horizontal", size = 15 })
:toggle()
end, { desc = "Toggle horizontal terminal" })
-- Vertical terminal on <leader>tv
vim.keymap.set("n", "<leader>tv", function()
require("toggleterm.terminal").Terminal
:new({ direction = "vertical", size = 60 })
:toggle()
end, { desc = "Toggle vertical terminal" })
end,
}

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

@ -0,0 +1,5 @@
return {
"thob/tnf.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
dir = "~/.config/nvim/lua/_plugins/tnf.nvim",
}

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,187 +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 = "",
},
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",
opts = {},
},
{
"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,
},
}

View File

@ -4,20 +4,6 @@ return {
lazy = true,
},
{
"rest-nvim/rest.nvim",
opts = {},
keys = {
{
"<leader>rt",
function()
require("rest-nvim").run()
end,
desc = "Run the rest request in the current buffer",
},
},
},
{
"ellisonleao/glow.nvim",
config = true,

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 },
},
},
},
}