From 7cd4fc3ae0e064794eeae33b99a50d91096b6947 Mon Sep 17 00:00:00 2001 From: ItaloBorrelli Date: Fri, 11 Apr 2025 14:33:21 -0700 Subject: [PATCH] Add a few extra features --- .config/nvim/lua/plugins/barbar.lua | 22 ++++++++++ .config/nvim/lua/plugins/conform.lua | 16 +++++++ .config/nvim/lua/plugins/mason.lua | 44 ++++++++++++++++++++ .config/nvim/lua/plugins/nvim-treesitter.lua | 12 ++++++ .config/nvim/lua/plugins/theme.lua | 9 ++++ .config/nvim/lua/plugins/which-key.lua | 18 ++++++++ 6 files changed, 121 insertions(+) create mode 100644 .config/nvim/lua/plugins/barbar.lua create mode 100644 .config/nvim/lua/plugins/conform.lua create mode 100644 .config/nvim/lua/plugins/mason.lua create mode 100644 .config/nvim/lua/plugins/nvim-treesitter.lua create mode 100644 .config/nvim/lua/plugins/theme.lua create mode 100644 .config/nvim/lua/plugins/which-key.lua diff --git a/.config/nvim/lua/plugins/barbar.lua b/.config/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..93a84f4 --- /dev/null +++ b/.config/nvim/lua/plugins/barbar.lua @@ -0,0 +1,22 @@ +return { + "romgrk/barbar.nvim", + dependencies = { + "lewis6991/gitsigns.nvim", -- OPTIONAL: for git status + "nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons + }, + keys = { + { "", "BufferNext", desc = "next tab" }, + { "", "BufferPrevious", desc = "previous tab" }, + { "x", "BufferClose", desc = "close tab" }, + }, + init = function() + vim.g.barbar_auto_setup = false + end, + config = function() + require("barbar").setup({ + animation = true, + auto_hide = true, + clickable = true, + }) + end, +} diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..e780164 --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,16 @@ +return { + { + "stevearc/conform.nvim", + config = function() + require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + }, + format_on_save = { + -- Enable or disable auto-formatting on save + lua = true, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..22def00 --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,44 @@ +return { + { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + local mason = require("mason") + local mason_lspconfig = require("mason-lspconfig") + local mason_tool_installer = require("mason-tool-installer") + + -- Enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, + }) + + -- Combine the setup for mason-lspconfig and mason-tool-installer + mason_lspconfig.setup({ + ensure_installed = { + "cssls", + "dockerls", + "html", + "jsonls", + "lua_ls", + "vimls", + "yamlls", + }, + }) + + mason_tool_installer.setup({ + ensure_installed = { + "stylua", + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..7c24457 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,12 @@ +return { + "nvim-treesitter/nvim-treesitter", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "lua", + }, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/theme.lua b/.config/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..9bc9e01 --- /dev/null +++ b/.config/nvim/lua/plugins/theme.lua @@ -0,0 +1,9 @@ +return { + "rebelot/kanagawa.nvim", + lazy = false, -- Ensure the plugin is loaded on startup + priority = 1000, -- Load this plugin first to apply the color scheme early + config = function() + -- Set the Kanagawa color scheme + vim.cmd("colorscheme kanagawa") + end, +} diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..9427793 --- /dev/null +++ b/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,18 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, +}