From acd9e41d8c41d36a66899b770ec0e4c21e3fd536 Mon Sep 17 00:00:00 2001 From: Beau Date: Wed, 12 Jun 2024 21:47:37 +0200 Subject: [PATCH 01/19] Changed config to my liking for initial use --- init.lua | 28 ++++++++++++++++++++-------- lua/custom/plugins/filetree.lua | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 lua/custom/plugins/filetree.lua diff --git a/init.lua b/init.lua index 88658ef3033..3c460acba6e 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.opt` @@ -176,10 +176,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -204,6 +204,18 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) + +vim.api.nvim_create_autocmd('BufWinEnter', { + desc = 'Open neo-tree by default', + group = vim.api.nvim_create_augroup("neotree_autoopen", { clear = true }), + callback = function() + if not vim.g.neotree_opened then + vim.cmd "Neotree show" + vim.g.neotree_opened = true + end + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -874,10 +886,10 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + 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` @@ -885,7 +897,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 00000000000..44f5dddbecc --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,21 @@ +return { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + config = function() + require('neo-tree').setup { + filesystem = { + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = false, + }, + }, + reveal = true + } + end, +} From 648eaa9c19377ad9a3dac1bb97ea34b1b97c5bf7 Mon Sep 17 00:00:00 2001 From: Beau Date: Wed, 12 Jun 2024 21:54:46 +0200 Subject: [PATCH 02/19] testing some things --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 00000000000..e69de29bb2d From 1703015fc3e2d4c66be6b4c1f57c948cf195f915 Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 13 Jun 2024 22:00:02 +0200 Subject: [PATCH 03/19] automatic push --- init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 3c460acba6e..78ad86dc035 100644 --- a/init.lua +++ b/init.lua @@ -204,13 +204,12 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) - vim.api.nvim_create_autocmd('BufWinEnter', { desc = 'Open neo-tree by default', - group = vim.api.nvim_create_augroup("neotree_autoopen", { clear = true }), + group = vim.api.nvim_create_augroup('neotree_autoopen', { clear = true }), callback = function() if not vim.g.neotree_opened then - vim.cmd "Neotree show" + vim.cmd 'Neotree show' vim.g.neotree_opened = true end end, @@ -889,7 +888,7 @@ require('lazy').setup({ require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - require 'kickstart.plugins.neo-tree', + 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` From f45ce1be82b7a49d13b836202020d66c0db9fabf Mon Sep 17 00:00:00 2001 From: Beau Date: Mon, 17 Jun 2024 22:00:02 +0200 Subject: [PATCH 04/19] automatic push --- init.lua | 6 +++++- test | 0 2 files changed, 5 insertions(+), 1 deletion(-) delete mode 100644 test diff --git a/init.lua b/init.lua index 78ad86dc035..5d1067b1859 100644 --- a/init.lua +++ b/init.lua @@ -190,6 +190,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Custom keybinds +vim.keymap.set('n', '', ':w', { desc = 'Save file with Ctrl + s' }) +vim.keymap.set('n', '', ':below terminal', { desc = 'Open terminal at bottom' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -888,7 +892,7 @@ require('lazy').setup({ require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - require('kickstart.plugins.neo-tree'), + 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` diff --git a/test b/test deleted file mode 100644 index e69de29bb2d..00000000000 From ed4b473eaaef23bba7de442f3ea3c9118fb442f7 Mon Sep 17 00:00:00 2001 From: Beau Date: Tue, 18 Jun 2024 22:00:00 +0200 Subject: [PATCH 05/19] automatic push --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 00000000000..e69de29bb2d From c960c8d8c2e52665db0b089839f1483031edf54c Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 20 Jun 2024 22:00:00 +0200 Subject: [PATCH 06/19] automatic push --- init.lua | 7 +++---- test | 0 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 test diff --git a/init.lua b/init.lua index 5d1067b1859..6bd99bd55c9 100644 --- a/init.lua +++ b/init.lua @@ -878,7 +878,6 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects end, }, - -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. @@ -888,10 +887,10 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.debug', require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps diff --git a/test b/test deleted file mode 100644 index e69de29bb2d..00000000000 From 3fc342ec91db8d186e906a59788425b705236c8c Mon Sep 17 00:00:00 2001 From: Beau Date: Tue, 25 Jun 2024 22:00:01 +0200 Subject: [PATCH 07/19] automatic push --- init.lua | 223 ++++++++++++++-------------- lua/custom/plugins/autocomplete.lua | 122 +++++++++++++++ 2 files changed, 234 insertions(+), 111 deletions(-) create mode 100644 lua/custom/plugins/autocomplete.lua diff --git a/init.lua b/init.lua index 6bd99bd55c9..c229c041a95 100644 --- a/init.lua +++ b/init.lua @@ -469,6 +469,7 @@ require('lazy').setup({ -- That is to say, every time a new file is opened that is associated with -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this -- function will be executed to configure the current buffer + vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), callback = function(event) @@ -580,7 +581,7 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, + clangd = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, @@ -677,116 +678,116 @@ require('lazy').setup({ }, }, - { -- Autocompletion - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - { - 'L3MON4D3/LuaSnip', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end - return 'make install_jsregexp' - end)(), - dependencies = { - -- `friendly-snippets` contains a variety of premade snippets. - -- See the README about individual language/framework/plugin snippets: - -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, - }, - }, - 'saadparwaiz1/cmp_luasnip', - - -- Adds other completion capabilities. - -- nvim-cmp does not ship with all sources by default. They are split - -- into multiple repos for maintenance purposes. - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - }, - config = function() - -- See `:help cmp` - local cmp = require 'cmp' - local luasnip = require 'luasnip' - luasnip.config.setup {} - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = 'menu,menuone,noinsert' }, - - -- For an understanding of why these mappings were - -- chosen, you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - mapping = cmp.mapping.preset.insert { - -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), - -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), - - -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - - -- Accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, - - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), - - -- Manually trigger a completion from nvim-cmp. - -- Generally you don't need this, because nvim-cmp will display - -- completions whenever it has completion options available. - [''] = cmp.mapping.complete {}, - - -- Think of as moving to the right of your snippet expansion. - -- So if you have a snippet that's like: - -- function $name($args) - -- $body - -- end - -- - -- will move you to the right of each of the expansion locations. - -- is similar, except moving you backwards. - [''] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { 'i', 's' }), - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - }, - } - end, - }, + -- { -- Autocompletion + -- 'hrsh7th/nvim-cmp', + -- event = 'InsertEnter', + -- dependencies = { + -- -- Snippet Engine & its associated nvim-cmp source + -- { + -- 'L3MON4D3/LuaSnip', + -- build = (function() + -- -- Build Step is needed for regex support in snippets. + -- -- This step is not supported in many windows environments. + -- -- Remove the below condition to re-enable on windows. + -- if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + -- return + -- end + -- return 'make install_jsregexp' + -- end)(), + -- dependencies = { + -- -- `friendly-snippets` contains a variety of premade snippets. + -- -- See the README about individual language/framework/plugin snippets: + -- -- https://github.com/rafamadriz/friendly-snippets + -- { + -- 'rafamadriz/friendly-snippets', + -- config = function() + -- require('luasnip.loaders.from_vscode').lazy_load() + -- end, + -- }, + -- }, + -- }, + -- 'saadparwaiz1/cmp_luasnip', + -- + -- -- Adds other completion capabilities. + -- -- nvim-cmp does not ship with all sources by default. They are split + -- -- into multiple repos for maintenance purposes. + -- 'hrsh7th/cmp-nvim-lsp', + -- 'hrsh7th/cmp-path', + -- }, + -- config = function() + -- -- See `:help cmp` + -- local cmp = require 'cmp' + -- local luasnip = require 'luasnip' + -- luasnip.config.setup {} + -- + -- cmp.setup { + -- snippet = { + -- expand = function(args) + -- luasnip.lsp_expand(args.body) + -- end, + -- }, + -- completion = { completeopt = 'menu,menuone,noinsert' }, + -- + -- -- For an understanding of why these mappings were + -- -- chosen, you will need to read `:help ins-completion` + -- -- + -- -- No, but seriously. Please read `:help ins-completion`, it is really good! + -- mapping = cmp.mapping.preset.insert { + -- -- Select the [n]ext item + -- [''] = cmp.mapping.select_next_item(), + -- -- Select the [p]revious item + -- [''] = cmp.mapping.select_prev_item(), + -- + -- -- Scroll the documentation window [b]ack / [f]orward + -- [''] = cmp.mapping.scroll_docs(-4), + -- [''] = cmp.mapping.scroll_docs(4), + -- + -- -- Accept ([y]es) the completion. + -- -- This will auto-import if your LSP supports it. + -- -- This will expand snippets if the LSP sent a snippet. + -- [''] = cmp.mapping.confirm { select = true }, + -- + -- -- If you prefer more traditional completion keymaps, + -- -- you can uncomment the following lines + -- --[''] = cmp.mapping.confirm { select = true }, + -- --[''] = cmp.mapping.select_next_item(), + -- --[''] = cmp.mapping.select_prev_item(), + -- + -- -- Manually trigger a completion from nvim-cmp. + -- -- Generally you don't need this, because nvim-cmp will display + -- -- completions whenever it has completion options available. + -- [''] = cmp.mapping.complete {}, + -- + -- -- Think of as moving to the right of your snippet expansion. + -- -- So if you have a snippet that's like: + -- -- function $name($args) + -- -- $body + -- -- end + -- -- + -- -- will move you to the right of each of the expansion locations. + -- -- is similar, except moving you backwards. + -- [''] = cmp.mapping(function() + -- if luasnip.expand_or_locally_jumpable() then + -- luasnip.expand_or_jump() + -- end + -- end, { 'i', 's' }), + -- [''] = cmp.mapping(function() + -- if luasnip.locally_jumpable(-1) then + -- luasnip.jump(-1) + -- end + -- end, { 'i', 's' }), + -- + -- -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + -- }, + -- sources = { + -- { name = 'nvim_lsp' }, + -- { name = 'luasnip' }, + -- { name = 'path' }, + -- }, + -- } + -- end, + -- }, { -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then diff --git a/lua/custom/plugins/autocomplete.lua b/lua/custom/plugins/autocomplete.lua new file mode 100644 index 00000000000..f4ec957f041 --- /dev/null +++ b/lua/custom/plugins/autocomplete.lua @@ -0,0 +1,122 @@ +return { -- Autocompletion + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + { + 'L3MON4D3/LuaSnip', + build = (function() + -- Build Step is needed for regex support in snippets. + -- This step is not supported in many windows environments. + -- Remove the below condition to re-enable on windows. + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + return + end + return 'make install_jsregexp' + end)(), + dependencies = { + -- `friendly-snippets` contains a variety of premade snippets. + -- See the README about individual language/framework/plugin snippets: + -- https://github.com/rafamadriz/friendly-snippets + -- { + -- 'rafamadriz/friendly-snippets', + -- config = function() + -- require('luasnip.loaders.from_vscode').lazy_load() + -- end, + -- }, + }, + }, + 'saadparwaiz1/cmp_luasnip', + + -- Adds other completion capabilities. + -- nvim-cmp does not ship with all sources by default. They are split + -- into multiple repos for maintenance purposes. + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-vsnip', + 'hrsh7th/cmp-path', + }, + config = function() + -- See `:help cmp` + local cmp = require 'cmp' + local luasnip = require 'luasnip' + luasnip.config.setup {} + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { completeopt = 'menu,menuone,noinsert' }, + + -- For an understanding of why these mappings were + -- chosen, you will need to read `:help ins-completion` + -- + -- No, but seriously. Please read `:help ins-completion`, it is really good! + mapping = cmp.mapping.preset.insert { + -- Select the [n]ext item + --[''] = cmp.mapping.select_next_item(), + -- Select the [p]revious item + --[''] = cmp.mapping.select_prev_item(), + + -- Scroll the documentation window [b]ack / [f]orward + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + + -- Accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + --[''] = cmp.mapping.confirm { select = true }, + + -- If you prefer more traditional completion keymaps, + -- you can uncomment the following lines + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + + -- Manually trigger a completion from nvim-cmp. + -- Generally you don't need this, because nvim-cmp will display + -- completions whenever it has completion options available. + [''] = cmp.mapping.complete {}, + + -- Think of as moving to the right of your snippet expansion. + -- So if you have a snippet that's like: + -- function $name($args) + -- $body + -- end + -- + -- will move you to the right of each of the expansion locations. + -- is similar, except moving you backwards. + [''] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + + -- [''] = cmp.mapping(function(fallback) + -- if cmp.visible() then + -- cmp.select_next_item() + -- elseif luasnip.expand_or_locally_jumpable() then + -- luasnip.expand_or_jump() + -- else + -- fallback() + -- end + -- end, { 'i', 's' }), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + }, + } + end, +} From 6aaf0b61aa1711a714cae49236698ee577fa3ea5 Mon Sep 17 00:00:00 2001 From: Beau Date: Mon, 1 Jul 2024 22:00:00 +0200 Subject: [PATCH 08/19] automatic push --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index c229c041a95..b1fb2677435 100644 --- a/init.lua +++ b/init.lua @@ -253,7 +253,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -288,7 +288,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -340,7 +340,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -433,11 +433,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** From 933a3ba9ffa17c92320ef66b230c25550f05cdca Mon Sep 17 00:00:00 2001 From: Beau Date: Wed, 3 Jul 2024 22:00:00 +0200 Subject: [PATCH 09/19] automatic push --- init.lua | 10 +++++----- lua/custom/plugins/autocmds.lua | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 lua/custom/plugins/autocmds.lua diff --git a/init.lua b/init.lua index b1fb2677435..c229c041a95 100644 --- a/init.lua +++ b/init.lua @@ -253,7 +253,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -288,7 +288,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -340,7 +340,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -433,11 +433,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** diff --git a/lua/custom/plugins/autocmds.lua b/lua/custom/plugins/autocmds.lua new file mode 100644 index 00000000000..77aa00815d0 --- /dev/null +++ b/lua/custom/plugins/autocmds.lua @@ -0,0 +1,14 @@ +local function augroup(name) + return vim.api.nvim_create_augroup('lazyvim_' .. name, { clear = true }) +end + +vim.api.nvim_create_autocmd('VimEnter', { + group = augroup 'autoupdate', + callback = function() + require('lazy').update { + show = false, + } + end, +}) + +return {} From 2314d0162a0e2ccfa5892a65b4e4b3af84047424 Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 4 Jul 2024 20:40:22 +0200 Subject: [PATCH 10/19] automatic push --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 00000000000..e69de29bb2d From f6970e64927155e6d9733607ad4612d3011b62ce Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Mon, 15 Jul 2024 22:00:00 +0200 Subject: [PATCH 11/19] automatic push --- init.lua | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/init.lua b/init.lua index c229c041a95..6449865c6e0 100644 --- a/init.lua +++ b/init.lua @@ -253,7 +253,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -288,26 +288,24 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading require('which-key').setup() -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, + require('which-key').add { + { + { 'c', group = '[C]ode' }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + }, } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) end, }, @@ -340,7 +338,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -433,11 +431,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** From 0e34b12fa0f3728681275e1eee5a5adaf46f277b Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Wed, 17 Jul 2024 22:00:00 +0200 Subject: [PATCH 12/19] automatic push --- lua/custom/plugins/filetree.lua | 21 --------------------- lua/custom/plugins/neotree-close.lua | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 lua/custom/plugins/filetree.lua create mode 100644 lua/custom/plugins/neotree-close.lua diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua deleted file mode 100644 index 44f5dddbecc..00000000000 --- a/lua/custom/plugins/filetree.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - }, - config = function() - require('neo-tree').setup { - filesystem = { - filtered_items = { - visible = true, - hide_dotfiles = false, - hide_gitignored = false, - }, - }, - reveal = true - } - end, -} diff --git a/lua/custom/plugins/neotree-close.lua b/lua/custom/plugins/neotree-close.lua new file mode 100644 index 00000000000..2fcf23d2d71 --- /dev/null +++ b/lua/custom/plugins/neotree-close.lua @@ -0,0 +1,17 @@ +return { + require('neo-tree').setup { + event_handlers = { + + { + event = 'file_open_requested', + handler = function() + -- auto close + vim.cmd.Neotree 'toggle' + -- vimc.cmd 'Neotree close' + -- OR + -- require('neo-tree.command').execute { action = 'toggle' } + end, + }, + }, + }, +} From 1e7a9c0a4bdcdfdb2fd8ddabcdd79c326a0034b7 Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Wed, 31 Jul 2024 22:00:00 +0200 Subject: [PATCH 13/19] automatic push --- init.lua | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index 6449865c6e0..5d9f7577128 100644 --- a/init.lua +++ b/init.lua @@ -154,6 +154,10 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 +-- Custom vim settings +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -253,7 +257,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -288,7 +292,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -338,7 +342,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -431,11 +435,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** @@ -585,12 +589,13 @@ require('lazy').setup({ -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, - -- + yamlls = {}, + + tsserver = { + 'pmizio/typescript-tools.nvim', + dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, + opts = {}, + }, lua_ls = { -- cmd = {...}, From fba32f761cec05e84819df135e90bad1438c281d Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Fri, 6 Sep 2024 22:00:00 +0200 Subject: [PATCH 14/19] automatic push --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5d9f7577128..e3266dff420 100644 --- a/init.lua +++ b/init.lua @@ -591,7 +591,7 @@ require('lazy').setup({ -- yamlls = {}, - tsserver = { + ts_ls = { 'pmizio/typescript-tools.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, opts = {}, From 208872d2d720205e7c33aa5ac70b5564cfcdd4fb Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Sat, 7 Sep 2024 22:00:00 +0200 Subject: [PATCH 15/19] automatic push --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test diff --git a/test b/test deleted file mode 100644 index e69de29bb2d..00000000000 From 6d64368923929f794fa4b3dd5808bc455933473b Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Mon, 6 Jan 2025 23:00:00 +0100 Subject: [PATCH 16/19] automatic push --- init.lua | 26 ++++++++++++++++++------ lua/custom/plugins/neotree-close.lua | 30 ++++++++++++++-------------- lua/custom/plugins/venv-selector.lua | 17 ++++++++++++++++ 3 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 lua/custom/plugins/venv-selector.lua diff --git a/init.lua b/init.lua index e3266dff420..fd94fe1194c 100644 --- a/init.lua +++ b/init.lua @@ -257,7 +257,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -292,7 +292,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -342,7 +342,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -435,11 +435,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** @@ -585,7 +585,20 @@ require('lazy').setup({ local servers = { clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = { + root_dir = function(fname) + return vim.fn.getcwd() + end, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'workspace', + }, + }, + }, + }, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -626,6 +639,7 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'markdownlint', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } diff --git a/lua/custom/plugins/neotree-close.lua b/lua/custom/plugins/neotree-close.lua index 2fcf23d2d71..1503339b491 100644 --- a/lua/custom/plugins/neotree-close.lua +++ b/lua/custom/plugins/neotree-close.lua @@ -1,17 +1,17 @@ return { - require('neo-tree').setup { - event_handlers = { - - { - event = 'file_open_requested', - handler = function() - -- auto close - vim.cmd.Neotree 'toggle' - -- vimc.cmd 'Neotree close' - -- OR - -- require('neo-tree.command').execute { action = 'toggle' } - end, - }, - }, - }, + -- require('neo-tree').setup { + -- event_handlers = { + -- + -- { + -- event = 'file_open_requested', + -- handler = function() + -- -- auto close + -- vim.cmd.Neotree 'toggle' + -- -- vimc.cmd 'Neotree close' + -- -- OR + -- -- require('neo-tree.command').execute { action = 'toggle' } + -- end, + -- }, + -- }, + -- }, } diff --git a/lua/custom/plugins/venv-selector.lua b/lua/custom/plugins/venv-selector.lua new file mode 100644 index 00000000000..29244dcd6f7 --- /dev/null +++ b/lua/custom/plugins/venv-selector.lua @@ -0,0 +1,17 @@ +return { + -- 'linux-cultist/venv-selector.nvim', + -- dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' }, + -- opts = { + -- name = 'venv', + -- -- Your options go here + -- -- name = "venv", + -- -- auto_refresh = false + -- }, + -- event = 'VeryLazy', -- Optional: needed only if you want to type `:VenvSelect` without a keymapping + -- keys = { + -- -- Keymap to open VenvSelector to pick a venv. + -- { 'vs', 'VenvSelect' }, + -- -- Keymap to retrieve the venv from a cache (the one previously used for the same project directory). + -- { 'vc', 'VenvSelectCached' }, + -- }, +} From bb8896752e6ad93365e272ec666ed4cff7150b32 Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Wed, 11 Jun 2025 22:00:00 +0200 Subject: [PATCH 17/19] automatic push --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index fd94fe1194c..c171bd98e69 100644 --- a/init.lua +++ b/init.lua @@ -257,7 +257,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -292,7 +292,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -342,7 +342,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -435,11 +435,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** From 6dbce916ade0d3290fe562e904c4c7f78f746604 Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Thu, 10 Jul 2025 22:00:00 +0200 Subject: [PATCH 18/19] automatic push --- init.lua | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/init.lua b/init.lua index c171bd98e69..0ddd49fbe41 100644 --- a/init.lua +++ b/init.lua @@ -43,19 +43,6 @@ What is Kickstart? Kickstart Guide: - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - Next, run AND READ `:help`. This will open up a help window with some basic information about reading, navigating and searching the builtin help documentation. @@ -257,7 +244,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -292,7 +279,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -342,7 +329,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -435,11 +422,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** @@ -814,7 +801,6 @@ require('lazy').setup({ 'folke/tokyonight.nvim', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() - -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. vim.cmd.colorscheme 'tokyonight-night' @@ -868,7 +854,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'terraform' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -896,10 +882,6 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects end, }, - -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the - -- init.lua. If you want these files, they are in the repository, so you can just download them and - -- place them in the correct locations. - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart -- -- Here are some example plugins that I've included in the Kickstart repository. @@ -912,11 +894,6 @@ require('lazy').setup({ 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. - -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` { import = 'custom.plugins' }, }, { ui = { From 8a531876325b492b95660f7b6e3fdab7735b4e1f Mon Sep 17 00:00:00 2001 From: Beau Taapken Date: Wed, 15 Oct 2025 22:00:00 +0200 Subject: [PATCH 19/19] automatic push --- init.lua | 24 ++----- lua/custom/plugins/auto-open-neo-tree.lua | 26 ++++++++ lua/custom/plugins/lazy-ssh.lua | 6 ++ lua/custom/plugins/neotree-close.lua | 17 ----- lua/custom/plugins/terraform.lua | 81 +++++++++++++++++++++++ 5 files changed, 119 insertions(+), 35 deletions(-) create mode 100644 lua/custom/plugins/auto-open-neo-tree.lua create mode 100644 lua/custom/plugins/lazy-ssh.lua delete mode 100644 lua/custom/plugins/neotree-close.lua create mode 100644 lua/custom/plugins/terraform.lua diff --git a/init.lua b/init.lua index 0ddd49fbe41..36f2e4411db 100644 --- a/init.lua +++ b/init.lua @@ -199,17 +199,6 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) -vim.api.nvim_create_autocmd('BufWinEnter', { - desc = 'Open neo-tree by default', - group = vim.api.nvim_create_augroup('neotree_autoopen', { clear = true }), - callback = function() - if not vim.g.neotree_opened then - vim.cmd 'Neotree show' - vim.g.neotree_opened = true - end - end, -}) - -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -244,7 +233,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -277,9 +266,8 @@ require('lazy').setup({ -- -- Then, because we use the `config` key, the configuration only runs -- after the plugin has been loaded: - -- config = function() ... end - - { -- Useful plugin to show you pending keybinds. + -- config = function() ... e -- -- Useful plugin to show you pending keybinds. + { 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -329,7 +317,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -422,11 +410,11 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/neodev.nvim', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** diff --git a/lua/custom/plugins/auto-open-neo-tree.lua b/lua/custom/plugins/auto-open-neo-tree.lua new file mode 100644 index 00000000000..177c53fb274 --- /dev/null +++ b/lua/custom/plugins/auto-open-neo-tree.lua @@ -0,0 +1,26 @@ +return { + { + 'nvim-neo-tree/neo-tree.nvim', + init = function() + -- Mirror your current behavior: open once on first BufWinEnter + local group = vim.api.nvim_create_augroup('neotree_autoopen', { clear = true }) + vim.api.nvim_create_autocmd('BufWinEnter', { + group = group, + desc = 'Open Neo-tree by default (first window only)', + callback = function(args) + if vim.g.neotree_opened then + return + end + -- Avoid re-entering when the window *is* Neo-tree or other side UIs + local ft = vim.bo[args.buf].filetype + if ft == 'neo-tree' or ft == 'lazy' or ft == 'starter' then + return + end + + vim.g.neotree_opened = true + vim.cmd 'Neotree show' + end, + }) + end, + }, +} diff --git a/lua/custom/plugins/lazy-ssh.lua b/lua/custom/plugins/lazy-ssh.lua new file mode 100644 index 00000000000..5dab5d18341 --- /dev/null +++ b/lua/custom/plugins/lazy-ssh.lua @@ -0,0 +1,6 @@ +-- Force Lazy.nvim to use SSH for GitHub (avoids HTTPS credential prompts) +local ok, Config = pcall(require, 'lazy.core.config') +if ok and Config.options and Config.options.git then + Config.options.git.url_format = 'git@github.com:%s.git' +end +return {} diff --git a/lua/custom/plugins/neotree-close.lua b/lua/custom/plugins/neotree-close.lua deleted file mode 100644 index 1503339b491..00000000000 --- a/lua/custom/plugins/neotree-close.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - -- require('neo-tree').setup { - -- event_handlers = { - -- - -- { - -- event = 'file_open_requested', - -- handler = function() - -- -- auto close - -- vim.cmd.Neotree 'toggle' - -- -- vimc.cmd 'Neotree close' - -- -- OR - -- -- require('neo-tree.command').execute { action = 'toggle' } - -- end, - -- }, - -- }, - -- }, -} diff --git a/lua/custom/plugins/terraform.lua b/lua/custom/plugins/terraform.lua new file mode 100644 index 00000000000..5d03de08202 --- /dev/null +++ b/lua/custom/plugins/terraform.lua @@ -0,0 +1,81 @@ +return { + -- 1) Treesitter: add terraform + hcl parsers + { + 'nvim-treesitter/nvim-treesitter', + opts = function(_, opts) + opts = opts or {} + opts.ensure_installed = opts.ensure_installed or {} + for _, lang in ipairs { 'terraform', 'hcl' } do + if not vim.tbl_contains(opts.ensure_installed, lang) then + table.insert(opts.ensure_installed, lang) + end + end + return opts + end, + }, + + -- 2) LSP: extend Kickstart's lsp plugin (no direct lspconfig.setup) + { + 'neovim/nvim-lspconfig', + opts = function(_, opts) + opts = opts or {} + opts.servers = opts.servers or {} + -- Kickstart will call lspconfig for you using this table + opts.servers.terraformls = { + filetypes = { 'terraform', 'terraform-vars', 'hcl' }, + } + return opts + end, + }, + { + 'williamboman/mason-lspconfig.nvim', + opts = function(_, opts) + opts = opts or {} + opts.ensure_installed = opts.ensure_installed or {} + if not vim.tbl_contains(opts.ensure_installed, 'terraformls') then + table.insert(opts.ensure_installed, 'terraformls') + end + return opts + end, + }, + + -- 3) Formatting: terraform fmt via conform.nvim + { + 'stevearc/conform.nvim', + opts = function(_, opts) + opts = opts or {} + opts.formatters_by_ft = opts.formatters_by_ft or {} + opts.formatters_by_ft.terraform = { 'terraform_fmt' } + opts.formatters_by_ft['terraform-vars'] = { 'terraform_fmt' } + opts.formatters_by_ft.hcl = { 'terraform_fmt' } + return opts + end, + }, + + -- 4) Linting: tflint via nvim-lint (fixed require + callback) + { + 'mfussenegger/nvim-lint', + config = function() + local lint = require 'lint' + lint.linters_by_ft = lint.linters_by_ft or {} + lint.linters_by_ft.terraform = { 'tflint' } + lint.linters_by_ft['terraform-vars'] = { 'tflint' } + + vim.api.nvim_create_autocmd({ 'BufWritePost', 'BufEnter', 'InsertLeave' }, { + callback = function() + require('lint').try_lint() + end, + }) + end, + }, + + -- (Optional) 5) Auto-install CLI tools like tflint + { + 'WhoIsSethDaniel/mason-tool-installer.nvim', + opts = { + ensure_installed = { 'tflint', 'terraform-ls' }, -- terraform-ls is harmless if already installed + run_on_start = true, + auto_update = false, + }, + }, +}