V2 #1

Merged
wonderfulfrog merged 20 commits from v2 into main 2024-05-10 11:26:26 -07:00
26 changed files with 564 additions and 430 deletions

View file

@ -1,33 +1,44 @@
{
"LuaSnip": { "branch": "master", "commit": "79cc25c39878401d4e8b6ec42fcf14639426bafc" },
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
"alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" },
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" },
"bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" },
"hardtime.nvim": { "branch": "main", "commit": "21b0f9146198bb43fbc9f5ec66c8af3234f278ed" },
"conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" },
"dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" },
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
"lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" },
"lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" },
"lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "b129892f783740e6cf741f2ea09fa5dd512aa584" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" },
"mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" },
"mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" },
"mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" },
"mini.surround": { "branch": "main", "commit": "0f528eb2e1bab420c0569d9e52615144c51db920" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" },
"noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
"nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" },
"nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" },
"nvim-lint": { "branch": "master", "commit": "6670b3ac73fa4caf720f017b91c619e9424d955e" },
"nvim-lspconfig": { "branch": "master", "commit": "f4619ab31fc4676001ea05ae8200846e6e7700c7" },
"nvim-treesitter": { "branch": "master", "commit": "30492e7e1c9e5af3642e8a74c2f88dc1f50ec305" },
"nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" },
"nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" },
"nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" },
"nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" },
"nvim-treesitter": { "branch": "master", "commit": "b1f3f02027f1fd21956c1e219878764014498a59" },
"nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" },
"nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" },
"tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" },
"vim-fugitive": { "branch": "master", "commit": "c0b03f1cac242d96837326d300f42a660306fc1a" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

View file

@ -10,12 +10,3 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
vim.opt_local.wrap = true
end,
})
-- vim.api.nvim_create_autocmd({ "FileType" }, {
-- group = augroup("close_with_q"),
-- pattern = { "fugitive", "git", "gitcommit" },
-- callback = function(event)
-- vim.bo[event.buf].buflisted = false
-- vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
-- end,
-- })

View file

@ -3,6 +3,10 @@ vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Go to split above" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Go to split below" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Go to split on right" })
vim.keymap.set("n", "<leader>|", "<C-w>v", { desc = "Split window right" })
vim.keymap.set("n", "<leader>-", "<C-w>s", { desc = "Split window below" })
vim.keymap.set("n", "<leader>wd", "<C-w>c", { desc = "Delete window" })
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move lines under cursor up" })
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move lines under cursor down" })
@ -14,7 +18,4 @@ vim.keymap.set("x", "<Leader>p", "\"_dP", { desc = "Paste without replacing clip
vim.keymap.set("n", "<Leader>y", "\"*y", { desc = "Yank into system clipboard" })
vim.keymap.set("v", "<Leader>y", "\"*y", { desc = "Yank into system clipboard" })
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
{ desc = "Like `ciw` for any highlighted text (doesn't have to be word)" })
vim.keymap.set("i", "jk", "<Esc>", { desc = "Exit insert mode" })

View file

@ -42,3 +42,5 @@ vim.opt.fillchars = {
vim.opt.foldlevel = 99
vim.opt.foldmethod = "indent"
vim.opt.termguicolors = true

View file

@ -1,43 +0,0 @@
return {
'goolord/alpha-nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
-- https://github.com/MaximilianLloyd/ascii.nvim
dashboard.section.header.val = {
" ",
" ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ",
" ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ",
" ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ",
" ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ",
" ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ",
" ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ",
" ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ",
" ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ",
" ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ",
" ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ",
" ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ",
" ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ",
" ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ",
" ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ",
" ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ",
" ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ",
" ▄█████████▄▄ ",
" ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ",
" ▄▄█████▀▀▀▀ ▀■ ",
" ▄███▀▀▀▀ ",
" ■▀▀ ",
" ",
}
dashboard.section.buttons.val = {
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
dashboard.button("SPC ee", " > File explorer", "<cmd>Neotree<CR>"),
dashboard.button("q", " > Quit", "<cmd>qa<CR>"),
}
alpha.setup(dashboard.opts)
end
};

100
lua/plugins/coding.lua Normal file
View file

@ -0,0 +1,100 @@
return {
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
},
config = function()
local cmp = require("cmp")
cmp.setup({
-- Highlights the first result always
completion = {
completeopt = "menu,menuone,noinsert",
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-o>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i" }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
})
end,
},
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
},
{
"echasnovski/mini.pairs",
version = false,
opts = {
mappings = {
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } },
},
},
},
{
"echasnovski/mini.surround",
version = false,
opts = {
mappings = {
add = "gsa", -- Add surrounding in Normal and Visual modes
delete = "gsd", -- Delete surrounding
find = "gsf", -- Find surrounding (to the right)
find_left = "gsF", -- Find surrounding (to the left)
highlight = "gsh", -- Highlight surrounding
replace = "gsr", -- Replace surrounding
update_n_lines = "gsn", -- Update `n_lines`
},
},
},
{
"JoosepAlviste/nvim-ts-context-commentstring",
opts = {
enable_autocmd = false,
},
},
{
"echasnovski/mini.comment",
version = false,
opts = {
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring()
or vim.bo.commentstring
end,
},
},
},
}

View file

@ -2,7 +2,8 @@ return {
"folke/tokyonight.nvim",
lazy = true,
opts = {
style = "storm",
transparent = true,
dim_inactive = true,
}
},
}

View file

@ -1,3 +0,0 @@
return {
"tpope/vim-commentary"
}

View file

@ -1,59 +0,0 @@
return {
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
cmp.setup({
-- Highlights the first result always
completion = {
completeopt = "menu,menuone,noinsert"
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-o>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i" }),
["<CR>"] = cmp.mapping.confirm({
behaviour = cmp.ConfirmBehavior.Insert,
select = true
})
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }
}, {
{ name = "buffer" }
})
})
end
},
{
"hrsh7th/cmp-nvim-lsp"
},
{
"L3MON4D3/LuaSnip"
}
}

171
lua/plugins/editor.lua Normal file
View file

@ -0,0 +1,171 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
event = "VeryLazy",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set("n", "<Leader>ee", ":Neotree toggle<CR>", { desc = "Toggle Neotree" })
vim.keymap.set("n", "<Leader>er", ":Neotree reveal<CR>", { desc = "Reveal file" })
local nt = require("neo-tree")
nt.setup({
open_files_do_not_replace_types = { "terminal", "trouble", "qf" },
filesystem = {
filtered_items = {
show_hidden_count = false,
hide_dotfiles = false,
hide_gitignored = true,
always_show = {
".env",
".env.local",
},
never_show = {
".git",
"thumbs.db",
".DS_Store",
},
},
},
window = {
mappings = {
["m"] = {
"move",
config = {
show_path = "relative",
},
},
},
},
event_handlers = {
{
event = "neo_tree_popup_input_ready",
handler = function()
-- Switch to normal inside popups by default.
vim.cmd.stopinsert()
end,
},
},
})
end,
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {},
},
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
vim.keymap.set("n", "<Leader>tt", ":TroubleToggle<CR>", { desc = "Toggle Trouble" })
end,
},
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
},
{
"nvim-pack/nvim-spectre",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { open_cmd = "noswapfile vnew" },
keys = {
{
"<leader>sr",
function()
require("spectre").open()
end,
desc = "Replace in Files (Spectre)",
},
},
},
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<Leader>ff", builtin.git_files, { desc = "Search git_files" })
vim.keymap.set("n", "<Leader>fg", builtin.live_grep, { desc = "Grep git_files" })
vim.keymap.set("n", "<Leader>fh", builtin.help_tags, { desc = "View help tags" })
vim.keymap.set("n", "<Leader>fb", builtin.buffers, { desc = "Search buffers" })
vim.keymap.set("n", "<Leader>sk", builtin.keymaps, { desc = "View keymaps" })
vim.keymap.set("n", "<Leader>sR", builtin.resume, { desc = "Resume" })
vim.keymap.set("n", "<Leader>st", "<cmd>TodoTelescope<cr>", { desc = "Search TODOs" })
end,
},
{
"nvim-telescope/telescope-ui-select.nvim",
config = function()
require("telescope").setup({
defaults = {
initial_mode = "normal",
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
},
})
require("telescope").load_extension("ui-select")
end,
},
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, 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" },
},
},
{
"kdheepak/lazygit.nvim",
event = "VeryLazy",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
keys = {
{ "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
}
},
{
"lewis6991/gitsigns.nvim",
event = "VeryLazy",
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
}
}
}

View file

@ -0,0 +1,20 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
css = { "prettierd" },
scss = { "prettierd" },
html = { "djlint" },
lua = { "stylelua" },
javascript = { "eslint_d", "prettierd" },
javascriptreact = { "eslint_d", "prettierd" },
json = { "prettierd" },
jsonc = { "prettierd" },
typescript = { "eslint_d", "prettierd" },
typescriptreact = { "eslint_d", "prettierd" },
},
format_on_save = {
lsp_fallback = true,
},
},
}

View file

@ -1,10 +0,0 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<Leader>gs", vim.cmd.Git, { desc = "View `git status`" })
vim.keymap.set("n", "gh", "<cmd>diffget //2<CR>", { desc = "Pick gitdiff on left" })
vim.keymap.set("n", "gl", "<cmd>diffget //3<CR>", { desc = "Pick gitdiff on right" })
vim.keymap.set("n", "<Leader>gp", ":Git push<CR>", { desc = "Run `git push`" })
vim.keymap.set("n", "<Leader>gc", ":Git checkout ", { desc = "Git checkout" })
end
}

View file

@ -1,28 +0,0 @@
return {
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
opts = {
disable_mouse = true,
disabled_keys = {
-- Drill Sergeant Demchuk!
["<Up>"] = { "", "i" },
["<Down>"] = { "", "i" },
["<Left>"] = { "", "i" },
["<Right>"] = { "", "i" },
},
disabled_filetypes = {
"checkhealth",
"fugitive",
"help",
"lazy",
"mason",
"markdown",
"neo-tree",
"neo-tree-popup",
"netrw",
"noice",
"notify",
"qf",
},
},
}

View file

@ -1,32 +0,0 @@
return {
"mfussenegger/nvim-lint",
event = {
"BufReadPre",
"BufNewFile",
},
config = function()
local lint = require("lint")
local djlint = lint.linters.djlint
djlint.args = {
"--reformat",
}
lint.linters_by_ft = {
html = { "djlint" },
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
}

26
lua/plugins/linting.lua Normal file
View file

@ -0,0 +1,26 @@
return {
"mfussenegger/nvim-lint",
opts = {
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
linters_by_ft = {
html = { "djlint" },
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
},
},
config = function(_, opts)
local lint = require("lint")
lint.linters_by_ft = opts.linters_by_ft
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd(opts.events, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
}

View file

@ -1,76 +0,0 @@
return {
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "tsserver", "html" }
})
end
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.lua_ls.setup({
capabilities = capabilities
})
lspconfig.tsserver.setup({
capabilities = capabilities,
})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" })
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Show signature" })
vim.keymap.set('n', '<Leader>f', vim.lsp.buf.format, { desc = "Format buffer" })
vim.keymap.set('n', '<Leader>ca', vim.lsp.buf.code_action, { desc = "View code actions" })
end
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
config = function()
local mason_tool_installer = require("mason-tool-installer")
mason_tool_installer.setup({
ensure_installed = {
"djlint",
"prettierd",
"eslint_d",
},
automatic_installation = true
})
end
},
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
javascript = { "eslint_d" },
javascriptreact = { "eslint_d" },
json = { "prettierd" },
jsonc = { "prettierd" },
yaml = { "prettierd" },
typescript = { "eslint_d" },
typescriptreact = { "eslint_d" },
html = { "djlint" },
ejs = { "prettierd" },
css = { "prettierd" },
scss = { "prettierd" },
graphql = { "prettierd" },
["_"] = { "trim_whitespace" },
},
format_on_save = {
lsp_fallback = true,
},
},
}
}

60
lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,60 @@
return {
{
"williamboman/mason.nvim",
opts = {},
},
{
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = {
"lua_ls",
"tsserver",
"html",
}
}
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
opts = {
ensure_installed = {
"djlint",
"eslint",
"eslint_d",
"prettierd",
"stylua",
},
automatic_installation = true,
}
},
-- lspconfig should be the last step.
{
"neovim/nvim-lspconfig",
event = "VeryLazy",
dependencies = {
"mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
opts = {
servers = {
tsserver = {},
lua_ls = {},
}
},
config = function(_, opts)
local lspconfig = require("lspconfig")
local servers = opts.servers
for server, server_opts in pairs(servers) do
lspconfig[server].setup(server_opts)
end
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" })
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show signature" })
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, { desc = "Format buffer" })
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action, { desc = "View code actions" })
vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename, { desc = "Rename" })
end,
},
}

View file

@ -1,12 +0,0 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
icons_enabled = true,
theme = 'tokyonight'
}
})
end
}

View file

@ -1,52 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set("n", "<Leader>nn", ":Neotree toggle<CR>", { desc = "Toggle Neotree" })
local nt = require("neo-tree")
nt.setup({
open_files_do_not_replace_types = { "terminal", "trouble", "qf" },
filesystem = {
filtered_items = {
show_hidden_count = false,
hide_dotfiles = false,
hide_gitignored = true,
always_show = {
".env",
},
never_show = {
".git",
"thumbs.db",
".DS_Store",
},
},
},
window = {
mappings = {
["m"] = {
"move",
config = {
show_path = "relative",
},
},
},
},
event_handlers = {
{
event = "neo_tree_popup_input_ready",
handler = function()
-- Switch to normal inside popups by default.
vim.cmd.stopinsert()
end,
},
},
})
end,
}

View file

@ -1,3 +0,0 @@
return {
"tpope/vim-surround"
}

View file

@ -1,36 +0,0 @@
return {
{
'nvim-telescope/telescope.nvim',
tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<Leader>pp', builtin.git_files, { desc = "Search git_files" })
vim.keymap.set('n', '<Leader>pf', builtin.find_files, { desc = "Search all files " })
vim.keymap.set('n', '<Leader>fh', builtin.help_tags, { desc = "View help tags" })
vim.keymap.set('n', '<Leader>gc', builtin.git_branches, { desc = "Checkout git branches" })
vim.keymap.set('n', '<Leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end, { desc = "Grep entire project for string" })
vim.keymap.set('n', '<Leader>b', builtin.buffers, { desc = "Search buffers" })
end
},
{
"nvim-telescope/telescope-ui-select.nvim",
config = function()
require("telescope").setup {
defaults = {
initial_mode = "normal"
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {}
}
}
}
require("telescope").load_extension("ui-select")
end
}
}

View file

@ -1,5 +0,0 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
}

View file

@ -1,26 +1,41 @@
return {
{
"nvim-treesitter/nvim-treesitter",
version = false,
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = { "lua", "javascript", "typescript", "tsx", "htmldjango", "html", "jsonc", "json", "jsdoc", "markdown", "markdown_inline", "vim", "vimdoc" },
sync_install = false,
opts = {
ensure_installed = {
"lua",
"javascript",
"typescript",
"tsx",
"htmldjango",
"html",
"jsonc",
"json",
"jsdoc",
"markdown",
"markdown_inline",
"vim",
"vimdoc",
},
highlight = { enable = true },
indent = { enable = true }
})
end
indent = { enable = true },
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
{
"nvim-treesitter/nvim-treesitter-context",
opts = {
max_lines = 2,
}
},
},
{
'windwp/nvim-autopairs',
event = "InsertEnter",
opts = {}
}
-- TODO: Figure out why this plugin is not working.
"windwp/nvim-autopairs",
event = "VeryLazy",
opts = {},
},
}

View file

@ -1,7 +0,0 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
vim.keymap.set("n", "<Leader>tt", ":TroubleToggle<CR>", { desc = "Toggle Trouble" })
end
}

View file

@ -1,4 +1,48 @@
return {
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
options = {
icons_enabled = true,
theme = "tokyonight",
disabled_filetypes = {
statusline = {
"alpha",
"neo-tree",
}
}
}
},
},
{
"famiu/bufdelete.nvim",
keys = {
{ "<leader>bd", "<cmd>Bdelete<cr>", desc = "Close Buffer" },
},
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<cmd>BufferLineTogglePin<cr>", desc = "Toggle Pin" },
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
},
opts = {
options = {
diagnostics = "nvim_lsp",
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "Directory",
text_align = "left",
},
},
}
}
},
{
"lukas-reineke/indent-blankline.nvim",
opts = {
@ -52,4 +96,71 @@ return {
})
end,
},
{
"stevearc/dressing.nvim",
event = "VeryLazy",
opts = {}
},
{
"rcarriga/nvim-notify",
opts = {
timeout = 2000,
stages = "static",
}
},
{
"MunifTanjim/nui.nvim"
},
{
"folke/noice.nvim",
event = "VeryLazy",
opts = {},
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
}
},
{
"goolord/alpha-nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
-- https://github.com/MaximilianLloyd/ascii.nvim
dashboard.section.header.val = {
" ",
" ░░░ ▄▄▄▄▄▄███▄▄▄▄▄ ",
" ▄███████▀▀▀▀▀▀█▓▓▓▓▓▓██▄▄▄▄ ",
" ▐████▄▄ ■▓▓▓▓▀▀▀▀▀▀▀▀▀█████■ ██▄ ",
" ▀█████████▄▄▄▄▄███████████▀▀ ▄▄ ████░▄▄▄ ",
" ▐██▄ ▄▄▄▄▄▄▀▀▀▀▀▀▀▀▓▓▓▀░░░▄▄▄ ▄▄ ▐███▏▐██▓▄████ ",
" ▄█▓░███▓ ▄▓▓▓▄▄████████████▄█████▄ ▄█████████▐███ ████▏██▀████▀ ",
" ▐███▄███░▀████████▀▀ ▀▓█████▓▀██▓████▀▀ ███████ ▄█████ ■ ██▀ ",
" ▀████▓██ ▐██████ ▐████ ▐████▀ ▒████████▄ ▄███████ ",
" ▀███ ▀▀█████▄ ▄████ ▄████▏ ▄█████▀█████████▀ ███ ",
" ▀████▄ ▄████▐██▄███████▄▄▄███▓██▏ ▀██████▀ ▐██ ",
" ▀████████▀ ▀████▀▀████████▀▐██▏ ▀██▀▀ ▐██▏ ",
" ▓▓█ ▀████ ▀ ■███▄▄ ███ ██▏ ",
" ▀▀▀ ▀▀ ▀█████▄▓▀ ██▏ ",
" ░░ ▄████████████▄▄▄▄▄▄▄ ▀▀▀████▄▄ ▒▒▒ ██▏ ▄▄ ",
" ▀▀████▀▀▀▀▀▀████████████▄▄▓▓▓███▄ ░░░░ ▐█▏ ■▀▀ ",
" ▀▀▀▀▀▀█████▓▓▓▓█▄▄ ▐█ ",
" ▄█████████▄▄ ",
" ▄▄▄▄████████▀▀▀▀▀▀▀███▏ ",
" ▄▄█████▀▀▀▀ ▀■ ",
" ▄███▀▀▀▀ ",
" ■▀▀ ",
" ",
}
dashboard.section.buttons.val = {
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
dashboard.button("SPC ee", " > File explorer", "<cmd>Neotree<CR>"),
dashboard.button("q", " > Quit", "<cmd>qa<CR>"),
}
alpha.setup(dashboard.opts)
end,
}
}

View file

@ -1,9 +0,0 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {}
}