feat: add auto pairs, rainbow, and indent guides

This commit is contained in:
Stevan Freeborn
2025-01-22 21:24:56 -06:00
parent ce7a820333
commit c0173b2956
4 changed files with 138 additions and 68 deletions
+12 -2
View File
@@ -1,4 +1,11 @@
return {
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup()
end,
},
{
"hrsh7th/cmp-nvim-lsp",
},
@@ -15,6 +22,9 @@ return {
local luasnip = require("luasnip")
local cmp = require("cmp")
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
@@ -44,7 +54,7 @@ return {
else
fallback()
end
end, {}),
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
@@ -53,7 +63,7 @@ return {
else
fallback()
end
end, {}),
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
+27 -19
View File
@@ -20,24 +20,24 @@ return {
},
}
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require('dap.utils').pick_process,
cwd = "${workspaceFolder}",
}
}
end
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
}
end
dap.configurations.javascript = {
{
@@ -80,6 +80,14 @@ return {
end
vim.keymap.set("n", "<Leader>dt", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
vim.keymap.set("n", "<Leader>dc", dap.continue, { desc = "Continue" })
local continue = function()
if vim.fn.filereadable(".vscode/launch.json") then
require("dap.ext.vscode").load_launchjs()
end
dap.continue()
end
vim.keymap.set("n", "<Leader>dc", continue, { desc = "Continue" })
end,
}
+89 -41
View File
@@ -1,44 +1,92 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
{
"nvim-treesitter/nvim-treesitter-context",
config = function()
require("treesitter-context").setup()
end,
},
{
"hiphish/rainbow-delimiters.nvim",
config = function()
require("rainbow-delimiters.setup").setup()
end,
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
config = function()
config.setup({
auto_install = true,
ensure_installed = {
"bash",
"css",
"html",
"javascript",
"json",
"lua",
"python",
"typescript",
"tsx",
"vue",
"yaml",
"c_sharp",
"rust",
"csv",
"dockerfile",
"editorconfig",
"json",
"jsdoc",
"jsonc",
"markdown",
"markdown_inline",
"nginx",
"proto",
"sql",
"toml",
"ssh_config",
"xml",
},
indent = { enabled = true },
highlight = {
enabled = true,
},
})
end,
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require("ibl.hooks")
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup({ scope = { highlight = highlight } })
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
end,
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
auto_install = true,
ensure_installed = {
"bash",
"css",
"html",
"javascript",
"json",
"lua",
"python",
"typescript",
"tsx",
"vue",
"yaml",
"c_sharp",
"rust",
"csv",
"dockerfile",
"editorconfig",
"json",
"jsdoc",
"jsonc",
"markdown",
"markdown_inline",
"nginx",
"proto",
"sql",
"toml",
"ssh_config",
"xml",
},
indent = { enabled = true },
highlight = {
enabled = true,
},
})
end,
},
}