From aa0432684fd9c71b7a20414ca767ac33b11b882a Mon Sep 17 00:00:00 2001 From: Fraser Fewster Date: Wed, 1 Oct 2025 22:01:58 +0100 Subject: [PATCH] Update configuration --- init.lua | 14 +++++------ lua/custom/plugins/comment.lua | 14 +++++++++++ lua/custom/plugins/copilot.lua | 26 +++++++++++++++++++++ lua/custom/plugins/init.lua | 8 ++++++- lua/custom/plugins/masonconfig.lua | 31 +++++++++++++++++++++++++ lua/custom/plugins/neo-tree-config.lua | 32 ++++++++++++++++++++++++++ lua/custom/plugins/tabs.lua | 26 +++++++++++++++++++++ 7 files changed, 143 insertions(+), 8 deletions(-) create mode 100644 lua/custom/plugins/comment.lua create mode 100644 lua/custom/plugins/copilot.lua create mode 100644 lua/custom/plugins/masonconfig.lua create mode 100644 lua/custom/plugins/neo-tree-config.lua create mode 100644 lua/custom/plugins/tabs.lua diff --git a/init.lua b/init.lua index b98ffc61..219095de 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.o.relativenumber = true +vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -975,16 +975,16 @@ require('lazy').setup({ -- -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/comment.lua b/lua/custom/plugins/comment.lua new file mode 100644 index 00000000..b610b7f3 --- /dev/null +++ b/lua/custom/plugins/comment.lua @@ -0,0 +1,14 @@ +return { + { + 'numToStr/Comment.nvim', + config = function(_, opts) + require('Comment').setup(opts) + + vim.keymap.set('n', '/', function() + require('Comment.api').toggle.linewise.current() + end, { desc = 'comment toggle' }) + + vim.keymap.set('v', '/', "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", { desc = 'comment toggle' }) + end, + }, +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000..203bda61 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,26 @@ +return { + { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + config = function() + require('copilot').setup { + suggestion = { + enabled = true, + auto_trigger = true, + keymap = { + accept = '', + }, + }, + panel = { + enabled = true, + auto_refresh = true, + }, + filetypes = { + ['*'] = true, + typescript = true, + }, + } + end, + }, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..fbc067bc 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,10 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + require 'custom.plugins.comment', + require 'custom.plugins.tabs', + require 'custom.plugins.copilot', + require 'custom.plugins.masonconfig', + require 'custom.plugins.neo-tree-config', +} diff --git a/lua/custom/plugins/masonconfig.lua b/lua/custom/plugins/masonconfig.lua new file mode 100644 index 00000000..d4fa5be9 --- /dev/null +++ b/lua/custom/plugins/masonconfig.lua @@ -0,0 +1,31 @@ +return { + { + 'williamboman/mason.nvim', + opts = function(_, opts) + -- Ensure these tools are installed + opts.ensure_installed = opts.ensure_installed or {} + + local ensure_installed = { + 'ts_ls', + 'biome', + 'docker_compose_language_service', + 'dockerls', + 'graphql', + 'jsonls', + 'sqlls', + 'yamlls', + 'eslint', + 'bashls', + } + + -- Merge with existing ensure_installed if any + for _, tool in ipairs(ensure_installed) do + if not vim.tbl_contains(opts.ensure_installed, tool) then + table.insert(opts.ensure_installed, tool) + end + end + + return opts + end, + }, +} diff --git a/lua/custom/plugins/neo-tree-config.lua b/lua/custom/plugins/neo-tree-config.lua new file mode 100644 index 00000000..6e0394a7 --- /dev/null +++ b/lua/custom/plugins/neo-tree-config.lua @@ -0,0 +1,32 @@ +return { + { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim', + }, + keys = { + { 'e', desc = 'Open NeoTree' }, + { 'n', desc = 'Focus NeoTree' }, + }, + config = function() + local toggle_tree = function() + vim.cmd 'Neotree toggle' + vim.opt.relativenumber = true -- Use relative line numbers + end + + -- Set up your custom keymaps + vim.keymap.set('n', 'e', toggle_tree, { desc = 'Open NeoTree' }) + vim.keymap.set('n', 'n', function() + vim.cmd 'Neotree focus' + end, { desc = 'Focus NeoTree' }) + + -- Setup neo-tree + require('neo-tree').setup { + -- Add any neo-tree options here if needed + } + end, + }, +} diff --git a/lua/custom/plugins/tabs.lua b/lua/custom/plugins/tabs.lua new file mode 100644 index 00000000..88c00344 --- /dev/null +++ b/lua/custom/plugins/tabs.lua @@ -0,0 +1,26 @@ +return { + { + 'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() + local map = vim.api.nvim_set_keymap + local opts = { noremap = true, silent = true } + vim.g.barbar_auto_setup = false + map('n', '', 'BufferNext', opts) + map('n', '', 'BufferPrevious', opts) + map('n', 'xx', 'BufferClose', opts) + map('n', 'xl', 'BufferCloseBuffersRight', opts) + map('n', 'xh', 'BufferCloseBuffersLeft', opts) + end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released + }, +}