From 650d1951a6bd479edf2bdbf1afa11df3d47b5e9e Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 11:44:31 +0200 Subject: [PATCH 01/24] Added lua/lazy-bootstrap.lua --- init.lua | 175 ++++++++++++++++++++++++++++++++++++++++- lua/lazy-bootstrap.lua | 17 ++++ 2 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 lua/lazy-bootstrap.lua diff --git a/init.lua b/init.lua index ed50b69d7f3..db9ae12dc48 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,180 @@ 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 +-- Install lazy plugin manager +require('lazy-bootstrap') + +-- NOTE: Here is where you install your plugins. +-- You can configure plugins using the `config` key. +-- +-- You can also configure plugins after the setup call, +-- as they will be available in your neovim runtime. +require('lazy').setup({ + -- NOTE: First, some plugins that don't require any configuration + + -- Git related plugins + 'tpope/vim-fugitive', + 'tpope/vim-rhubarb', + + -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', + + -- NOTE: This is where your plugins related to LSP can be installed. + -- The configuration is done below. Search for lspconfig to find it below. + { + -- LSP Configuration & Plugins + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs to stdpath for neovim + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + + -- Useful status updates for LSP + -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + + -- Additional lua configuration, makes nvim stuff amazing! + 'folke/neodev.nvim', + }, + }, + + { + -- Autocompletion + 'hrsh7th/nvim-cmp', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', + + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, + }, + + -- Useful plugin to show you pending keybinds. + { 'folke/which-key.nvim', opts = {} }, + { + -- Adds git related signs to the gutter, as well as utilities for managing changes + 'lewis6991/gitsigns.nvim', + opts = { + -- See `:help gitsigns.txt` + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + on_attach = function(bufnr) + vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + + -- don't override the built-in and fugitive keymaps + local gs = package.loaded.gitsigns + vim.keymap.set({ 'n', 'v' }, ']c', function() + if vim.wo.diff then + return ']c' + end + vim.schedule(function() + gs.next_hunk() + end) + return '' + end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) + vim.keymap.set({ 'n', 'v' }, '[c', function() + if vim.wo.diff then + return '[c' + end + vim.schedule(function() + gs.prev_hunk() + end) + return '' + end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) + end, + }, + }, + + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + config = function() + vim.cmd.colorscheme 'onedark' + end, + }, + + { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'onedark', + component_separators = '|', + section_separators = '', + }, + }, + }, + + { + -- Add indentation guides even on blank lines + 'lukas-reineke/indent-blankline.nvim', + -- Enable `lukas-reineke/indent-blankline.nvim` + -- See `:help ibl` + main = 'ibl', + opts = {}, + }, + + -- "gc" to comment visual regions/lines + { 'numToStr/Comment.nvim', opts = {} }, + + -- Fuzzy Finder (files, lsp, etc) + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + }, + }, + + { + -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + build = ':TSUpdate', + }, + + -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- These are some example plugins that I've included in the kickstart repository. + -- Uncomment any of the lines below to enable them. + -- require 'kickstart.plugins.autoformat', + -- require 'kickstart.plugins.debug', + + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping + -- up-to-date with whatever is in the kickstart repo. + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- + -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- { import = 'custom.plugins' }, +}, {}) -- [[ Setting options ]] -- See `:help vim.o` diff --git a/lua/lazy-bootstrap.lua b/lua/lazy-bootstrap.lua new file mode 100644 index 00000000000..70aebf55ba8 --- /dev/null +++ b/lua/lazy-bootstrap.lua @@ -0,0 +1,17 @@ +-- [[ Bootstrap lazy plugin manager ]] +-- https://github.com/folke/lazy.nvim +-- `:help lazy.nvim.txt` for more info +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not vim.loop.fs_stat(lazypath) then + vim.fn.system { + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', -- latest stable release + lazypath, + } +end +vim.opt.rtp:prepend(lazypath) + +-- vim: ts=2 sts=2 sw=2 et From 25cc6698de34a13c3634fb9e2ebb21b49ef60f2d Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 11:50:38 +0200 Subject: [PATCH 02/24] Added lua/lazy-plugins.lua --- init.lua | 172 +----------------------------------------- lua/lazy-plugins.lua | 173 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 170 deletions(-) create mode 100644 lua/lazy-plugins.lua diff --git a/init.lua b/init.lua index db9ae12dc48..eedf3913cbe 100644 --- a/init.lua +++ b/init.lua @@ -95,176 +95,8 @@ vim.g.have_nerd_font = true -- Install lazy plugin manager require('lazy-bootstrap') --- NOTE: Here is where you install your plugins. --- You can configure plugins using the `config` key. --- --- You can also configure plugins after the setup call, --- as they will be available in your neovim runtime. -require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration - - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', - - -- Detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', - - -- NOTE: This is where your plugins related to LSP can be installed. - -- The configuration is done below. Search for lspconfig to find it below. - { - -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', - }, - }, - - { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - }, - }, - - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - { - -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - -- See `:help gitsigns.txt` - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) - - -- don't override the built-in and fugitive keymaps - local gs = package.loaded.gitsigns - vim.keymap.set({ 'n', 'v' }, ']c', function() - if vim.wo.diff then - return ']c' - end - vim.schedule(function() - gs.next_hunk() - end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) - vim.keymap.set({ 'n', 'v' }, '[c', function() - if vim.wo.diff then - return '[c' - end - vim.schedule(function() - gs.prev_hunk() - end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) - end, - }, - }, - - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, - - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, - }, - - { - -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - opts = {}, - }, - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, - - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - }, - }, - - { - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - }, - build = ':TSUpdate', - }, - - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', - - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, -}, {}) +-- Setup lazy plugin manager - configure plugins +require('lazy-plugins') -- [[ Setting options ]] -- See `:help vim.o` diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua new file mode 100644 index 00000000000..03418e2a13b --- /dev/null +++ b/lua/lazy-plugins.lua @@ -0,0 +1,173 @@ +-- [[ Setup lazy plugin manager ]] +-- NOTE: Here is where you install your plugins. +-- You can configure plugins using the `config` key. +-- +-- You can also configure plugins after the setup call, +-- as they will be available in your neovim runtime. +require('lazy').setup({ + -- NOTE: First, some plugins that don't require any configuration + + -- Git related plugins + 'tpope/vim-fugitive', + 'tpope/vim-rhubarb', + + -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', + + -- NOTE: This is where your plugins related to LSP can be installed. + -- The configuration is done below. Search for lspconfig to find it below. + { + -- LSP Configuration & Plugins + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs to stdpath for neovim + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + + -- Useful status updates for LSP + -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + + -- Additional lua configuration, makes nvim stuff amazing! + 'folke/neodev.nvim', + }, + }, + + { + -- Autocompletion + 'hrsh7th/nvim-cmp', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', + + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, + }, + + -- Useful plugin to show you pending keybinds. + { 'folke/which-key.nvim', opts = {} }, + { + -- Adds git related signs to the gutter, as well as utilities for managing changes + 'lewis6991/gitsigns.nvim', + opts = { + -- See `:help gitsigns.txt` + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + on_attach = function(bufnr) + vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) + + -- don't override the built-in and fugitive keymaps + local gs = package.loaded.gitsigns + vim.keymap.set({ 'n', 'v' }, ']c', function() + if vim.wo.diff then + return ']c' + end + vim.schedule(function() + gs.next_hunk() + end) + return '' + end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) + vim.keymap.set({ 'n', 'v' }, '[c', function() + if vim.wo.diff then + return '[c' + end + vim.schedule(function() + gs.prev_hunk() + end) + return '' + end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) + end, + }, + }, + + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + config = function() + vim.cmd.colorscheme 'onedark' + end, + }, + + { + -- Set lualine as statusline + 'nvim-lualine/lualine.nvim', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'onedark', + component_separators = '|', + section_separators = '', + }, + }, + }, + + { + -- Add indentation guides even on blank lines + 'lukas-reineke/indent-blankline.nvim', + -- Enable `lukas-reineke/indent-blankline.nvim` + -- See `:help ibl` + main = 'ibl', + opts = {}, + }, + + -- "gc" to comment visual regions/lines + { 'numToStr/Comment.nvim', opts = {} }, + + -- Fuzzy Finder (files, lsp, etc) + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + }, + }, + + { + -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + build = ':TSUpdate', + }, + + -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- These are some example plugins that I've included in the kickstart repository. + -- Uncomment any of the lines below to enable them. + -- require 'kickstart.plugins.autoformat', + -- require 'kickstart.plugins.debug', + + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping + -- up-to-date with whatever is in the kickstart repo. + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- + -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- { import = 'custom.plugins' }, +}, {}) + +-- vim: ts=2 sts=2 sw=2 et From 4e2623e557ed36e515f227ae278168cb2920a144 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 12:13:07 +0200 Subject: [PATCH 03/24] Added lua/options.lua --- init.lua | 2 ++ lua/options.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 lua/options.lua diff --git a/init.lua b/init.lua index eedf3913cbe..78d2fcb9803 100644 --- a/init.lua +++ b/init.lua @@ -168,6 +168,8 @@ vim.o.scrolloff = 10 -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` vim.o.confirm = true +-- Set options +require('options') -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 00000000000..a636e35549e --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,42 @@ +-- [[ Setting options ]] +-- See `:help vim.o` +-- NOTE: You can change these options as you wish! + +-- Set highlight on search +vim.o.hlsearch = false + +-- Make line numbers default +vim.wo.number = true + +-- Enable mouse mode +vim.o.mouse = 'a' + +-- Sync clipboard between OS and Neovim. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +vim.o.clipboard = 'unnamedplus' + +-- Enable break indent +vim.o.breakindent = true + +-- Save undo history +vim.o.undofile = true + +-- Case-insensitive searching UNLESS \C or capital in search +vim.o.ignorecase = true +vim.o.smartcase = true + +-- Keep signcolumn on by default +vim.wo.signcolumn = 'yes' + +-- Decrease update time +vim.o.updatetime = 250 +vim.o.timeoutlen = 300 + +-- Set completeopt to have a better completion experience +vim.o.completeopt = 'menuone,noselect' + +-- NOTE: You should make sure your terminal supports this +vim.o.termguicolors = true + +-- vim: ts=2 sts=2 sw=2 et From 303f354d5d65c9d42299b47720f7373f99eb371d Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 12:16:17 +0200 Subject: [PATCH 04/24] Added lua/keymaps.lua --- init.lua | 150 ++++++++++++++++++++++++++++++++++++++++++++++++ lua/keymaps.lua | 28 +++++++++ 2 files changed, 178 insertions(+) create mode 100644 lua/keymaps.lua diff --git a/init.lua b/init.lua index 78d2fcb9803..00df8835336 100644 --- a/init.lua +++ b/init.lua @@ -244,6 +244,156 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end +-- Configure keymaps +require('keymaps') + +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + +-- Enable telescope fzf native, if installed +pcall(require('telescope').load_extension, 'fzf') + +-- See `:help telescope.builtin` +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer' }) + +vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) +vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) + +-- [[ Configure Treesitter ]] +-- See `:help nvim-treesitter` +-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' +vim.defer_fn(function() + require('nvim-treesitter.configs').setup { + -- Add languages to be installed here that you want installed for treesitter + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, + + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + auto_install = false, + + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer', + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer', + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer', + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', + }, + }, + swap = { + enable = true, + swap_next = { + ['a'] = '@parameter.inner', + }, + swap_previous = { + ['A'] = '@parameter.inner', + }, + }, + }, + } +end, 0) + +-- [[ Configure LSP ]] +-- This function gets run when an LSP connects to a particular buffer. +local on_attach = function(_, bufnr) + -- NOTE: Remember that lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself + -- many times. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local nmap = function(keys, func, desc) + if desc then + desc = 'LSP: ' .. desc + end + + vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) + end + + nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') + nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + + nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + + -- See `:help K` for why this keymap + nmap('K', vim.lsp.buf.hover, 'Hover Documentation') + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + + -- Lesser used LSP functionality + nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') + nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') + nmap('wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, '[W]orkspace [L]ist Folders') + + -- Create a command `:Format` local to the LSP buffer + vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) + vim.lsp.buf.format() + end, { desc = 'Format current buffer with LSP' }) end ---@type vim.Option diff --git a/lua/keymaps.lua b/lua/keymaps.lua new file mode 100644 index 00000000000..22d77965d18 --- /dev/null +++ b/lua/keymaps.lua @@ -0,0 +1,28 @@ +-- [[ Basic Keymaps ]] + +-- Keymaps for better default experience +-- See `:help vim.keymap.set()` +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + +-- Remap for dealing with word wrap +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- [[ Highlight on yank ]] +-- See `:help vim.highlight.on_yank()` +local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) +vim.api.nvim_create_autocmd('TextYankPost', { + callback = function() + vim.highlight.on_yank() + end, + group = highlight_group, + pattern = '*', +}) + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +-- vim: ts=2 sts=2 sw=2 et From 5a94c28e34068f14205284c03e3e97534956bba6 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 12:24:25 +0200 Subject: [PATCH 05/24] Added lua/telescope-setup.lua --- init.lua | 36 ++---------------------------------- lua/telescope-setup.lua | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 34 deletions(-) create mode 100644 lua/telescope-setup.lua diff --git a/init.lua b/init.lua index 00df8835336..86913ae345e 100644 --- a/init.lua +++ b/init.lua @@ -247,40 +247,8 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then -- Configure keymaps require('keymaps') --- [[ Configure Telescope ]] --- See `:help telescope` and `:help telescope.setup()` -require('telescope').setup { - defaults = { - mappings = { - i = { - [''] = false, - [''] = false, - }, - }, - }, -} - --- Enable telescope fzf native, if installed -pcall(require('telescope').load_extension, 'fzf') - --- See `:help telescope.builtin` -vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) -vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) -vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) -end, { desc = '[/] Fuzzily search in current buffer' }) - -vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) +-- Configure Telescope (fuzzy finder) +require('telescope-setup') -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` diff --git a/lua/telescope-setup.lua b/lua/telescope-setup.lua new file mode 100644 index 00000000000..be340512ab4 --- /dev/null +++ b/lua/telescope-setup.lua @@ -0,0 +1,36 @@ +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + +-- Enable telescope fzf native, if installed +pcall(require('telescope').load_extension, 'fzf') + +-- See `:help telescope.builtin` +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer' }) + +vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) +vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) + +-- vim: ts=2 sts=2 sw=2 et From b22e4e8f4c511cc6c58e90b4a9ad11f12ee4137f Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 12:27:28 +0200 Subject: [PATCH 06/24] Added lua/treesitter-setup.lua --- init.lua | 70 ++-------------------------------------- lua/treesitter-setup.lua | 70 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 68 deletions(-) create mode 100644 lua/treesitter-setup.lua diff --git a/init.lua b/init.lua index 86913ae345e..9b7fe19d658 100644 --- a/init.lua +++ b/init.lua @@ -250,74 +250,8 @@ require('keymaps') -- Configure Telescope (fuzzy finder) require('telescope-setup') --- [[ Configure Treesitter ]] --- See `:help nvim-treesitter` --- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' -vim.defer_fn(function() - require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, - - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, - } -end, 0) +-- Configure Treesitter (syntax parser for highlighting) +require('treesitter-setup') -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. diff --git a/lua/treesitter-setup.lua b/lua/treesitter-setup.lua new file mode 100644 index 00000000000..78c84e420f3 --- /dev/null +++ b/lua/treesitter-setup.lua @@ -0,0 +1,70 @@ +-- [[ Configure Treesitter ]] +-- See `:help nvim-treesitter` +-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' +vim.defer_fn(function() + require('nvim-treesitter.configs').setup { + -- Add languages to be installed here that you want installed for treesitter + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, + + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + auto_install = false, + + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer', + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer', + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer', + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', + }, + }, + swap = { + enable = true, + swap_next = { + ['a'] = '@parameter.inner', + }, + swap_previous = { + ['A'] = '@parameter.inner', + }, + }, + }, + } +end, 0) + +-- vim: ts=2 sts=2 sw=2 et From 5196d555a79482539dbe72503d128102908ae46f Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 12:31:11 +0200 Subject: [PATCH 07/24] Added lua/lsp-setup.lua --- init.lua | 2 + lua/lsp-setup.lua | 111 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 lua/lsp-setup.lua diff --git a/init.lua b/init.lua index 9b7fe19d658..3dd2ef87b63 100644 --- a/init.lua +++ b/init.lua @@ -393,6 +393,8 @@ require('lazy').setup({ { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', -- By default, Telescope is included and acts as your picker for everything. +-- Configure LSP (Language Server Protocol) +require('lsp-setup') -- If you would like to switch to a different picker (like snacks, or fzf-lua) -- you can disable the Telescope plugin by setting enabled to false and enable diff --git a/lua/lsp-setup.lua b/lua/lsp-setup.lua new file mode 100644 index 00000000000..08f35efec60 --- /dev/null +++ b/lua/lsp-setup.lua @@ -0,0 +1,111 @@ +-- [[ Configure LSP ]] +-- This function gets run when an LSP connects to a particular buffer. +local on_attach = function(_, bufnr) + -- NOTE: Remember that lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself + -- many times. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local nmap = function(keys, func, desc) + if desc then + desc = 'LSP: ' .. desc + end + + vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) + end + + nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') + nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + + nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + + -- See `:help K` for why this keymap + nmap('K', vim.lsp.buf.hover, 'Hover Documentation') + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + + -- Lesser used LSP functionality + nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') + nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') + nmap('wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, '[W]orkspace [L]ist Folders') + + -- Create a command `:Format` local to the LSP buffer + vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) + vim.lsp.buf.format() + end, { desc = 'Format current buffer with LSP' }) +end + +-- document existing key chains +require('which-key').register { + ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, + ['h'] = { name = 'More git', _ = 'which_key_ignore' }, + ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, +} + +-- mason-lspconfig requires that these setup functions are called in this order +-- before setting up the servers. +require('mason').setup() +require('mason-lspconfig').setup() + +-- Enable the following language servers +-- Feel free to add/remove any LSPs that you want here. They will automatically be installed. +-- +-- Add any additional override configuration in the following tables. They will be passed to +-- the `settings` field of the server config. You must look up that documentation yourself. +-- +-- If you want to override the default filetypes that your language server will attach to you can +-- define the property 'filetypes' to the map in question. +local servers = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- tsserver = {}, + -- html = { filetypes = { 'html', 'twig', 'hbs'} }, + + lua_ls = { + Lua = { + workspace = { checkThirdParty = false }, + telemetry = { enable = false }, + }, + }, +} + +-- Setup neovim lua configuration +require('neodev').setup() + +-- nvim-cmp supports additional completion capabilities, so broadcast that to servers +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) + +-- Ensure the servers above are installed +local mason_lspconfig = require 'mason-lspconfig' + +mason_lspconfig.setup { + ensure_installed = vim.tbl_keys(servers), +} + +mason_lspconfig.setup_handlers { + function(server_name) + require('lspconfig')[server_name].setup { + capabilities = capabilities, + on_attach = on_attach, + settings = servers[server_name], + filetypes = (servers[server_name] or {}).filetypes, + } + end, +} + +-- vim: ts=2 sts=2 sw=2 et From e1d58f75f0c5940c485a606ca93881d28ca92b91 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 12:37:32 +0200 Subject: [PATCH 08/24] Added lua/cmp-setup.lua --- init.lua | 2 ++ lua/cmp-setup.lua | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 lua/cmp-setup.lua diff --git a/init.lua b/init.lua index 3dd2ef87b63..7e68ce2fdfc 100644 --- a/init.lua +++ b/init.lua @@ -1008,6 +1008,8 @@ require('lsp-setup') }, }, }) +-- Configure CMP (completion) +require('cmp-setup') -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/cmp-setup.lua b/lua/cmp-setup.lua new file mode 100644 index 00000000000..ce389e4f330 --- /dev/null +++ b/lua/cmp-setup.lua @@ -0,0 +1,49 @@ +-- [[ Configure nvim-cmp ]] +-- See `:help cmp` +local cmp = require 'cmp' +local luasnip = require 'luasnip' +require('luasnip.loaders.from_vscode').lazy_load() +luasnip.config.setup {} + +cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + [''] = 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' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, +} + +-- vim: ts=2 sts=2 sw=2 et From 9d8811f5459dccca4dce68827c660d0284321c98 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 11:32:25 +0200 Subject: [PATCH 09/24] Update README.md - remove single-file --- README.md | 4 ++-- init.lua | 55 ------------------------------------------------------- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 093e42a6dd9..5c888412aa9 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ A starting point for Neovim that is: * Small -* Single-file -* Completely Documented +* Documented +* Modular **NOT** a Neovim distribution, but instead a starting point for your configuration. diff --git a/init.lua b/init.lua index 7e68ce2fdfc..8e8d87ccb70 100644 --- a/init.lua +++ b/init.lua @@ -168,8 +168,6 @@ vim.o.scrolloff = 10 -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` vim.o.confirm = true --- Set options -require('options') -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -244,58 +242,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end --- Configure keymaps -require('keymaps') - --- Configure Telescope (fuzzy finder) -require('telescope-setup') - --- Configure Treesitter (syntax parser for highlighting) -require('treesitter-setup') - --- [[ Configure LSP ]] --- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(_, bufnr) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local nmap = function(keys, func, desc) - if desc then - desc = 'LSP: ' .. desc - end - - vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) - end - - nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - - nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - - -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') - - -- Lesser used LSP functionality - nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') - nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') - nmap('wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, '[W]orkspace [L]ist Folders') - - -- Create a command `:Format` local to the LSP buffer - vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - vim.lsp.buf.format() - end, { desc = 'Format current buffer with LSP' }) end ---@type vim.Option @@ -394,7 +340,6 @@ require('lazy').setup({ 'nvim-telescope/telescope.nvim', -- By default, Telescope is included and acts as your picker for everything. -- Configure LSP (Language Server Protocol) -require('lsp-setup') -- If you would like to switch to a different picker (like snacks, or fzf-lua) -- you can disable the Telescope plugin by setting enabled to false and enable From bf94d21ddd0fb9f5245e32320a25412008e0e812 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 22 Oct 2023 11:32:25 +0200 Subject: [PATCH 10/24] Update README.md - kickstart-modular fork --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c888412aa9..0b688173de2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -# kickstart.nvim +# kickstart-modular.nvim ## Introduction +*This is a fork of [nvim-lua/kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) that moves from a single file to a multi file configuration.* + A starting point for Neovim that is: * Small From 85cb3c3dbd7356347597566815e1fbaad3ad53f4 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Tue, 7 Nov 2023 17:26:53 +0100 Subject: [PATCH 11/24] init.lua: update section comments to match upstream --- init.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 8e8d87ccb70..9bfd3d210ce 100644 --- a/init.lua +++ b/init.lua @@ -92,11 +92,6 @@ vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true --- Install lazy plugin manager -require('lazy-bootstrap') - --- Setup lazy plugin manager - configure plugins -require('lazy-plugins') -- [[ Setting options ]] -- See `:help vim.o` @@ -107,7 +102,7 @@ require('lazy-plugins') 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' @@ -953,8 +948,6 @@ require('lazy').setup({ }, }, }) --- Configure CMP (completion) -require('cmp-setup') -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 97019274018681f35342dd4723c9b2e269847afc Mon Sep 17 00:00:00 2001 From: "Peter S. Jaglom" <145091604+pjaglom@users.noreply.github.com> Date: Fri, 22 Dec 2023 00:31:59 -0800 Subject: [PATCH 12/24] Minor changes to README to reflect the modular repo (#3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update README to reflect modular organization - Change install links to this repo instead of nvim-lua/kickstart.nvim - Change “Recommended Steps” repo link to reflect kickstart-modular.nvim.git - Change FAQ re: multiple files to reflect that we are in the modular repo, not the single file repo. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b688173de2..61fb45afa08 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's
Linux and Mac ```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim ```
@@ -125,7 +125,6 @@ examples of adding popularly requested plugins. > [!NOTE] > For more information about a particular plugin check its repository's documentation. - ### Getting Started [The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) From 07973b7a014184bf2e96bdaf5236ddd19963fd8b Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 26 Feb 2024 21:37:26 +0100 Subject: [PATCH 13/24] README.md: minor update to the modular fork note --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 61fb45afa08..ce8cceda6d6 100644 --- a/README.md +++ b/README.md @@ -155,12 +155,6 @@ examples of adding popularly requested plugins. into smaller parts. A fork of kickstart that does this while maintaining the same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) - * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) - -### Install Recipes - Below you can find OS specific install instructions for Neovim and dependencies. After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step. From f25cce3982454fecf782c4e3d2f1ff4f27074b54 Mon Sep 17 00:00:00 2001 From: killeik <69602482+killeik@users.noreply.github.com> Date: Sat, 14 Jun 2025 19:49:21 +0300 Subject: [PATCH 14/24] Use the dot syntax for module paths --- lua/lazy-plugins.lua | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 03418e2a13b..ba002784031 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -69,21 +69,13 @@ require('lazy').setup({ -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns vim.keymap.set({ 'n', 'v' }, ']c', function() - if vim.wo.diff then - return ']c' - end - vim.schedule(function() - gs.next_hunk() - end) + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) return '' end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) vim.keymap.set({ 'n', 'v' }, '[c', function() - if vim.wo.diff then - return '[c' - end - vim.schedule(function() - gs.prev_hunk() - end) + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) return '' end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) end, @@ -94,9 +86,7 @@ require('lazy').setup({ -- Theme inspired by Atom 'navarasu/onedark.nvim', priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, + config = function() vim.cmd.colorscheme 'onedark' end, }, { @@ -139,9 +129,7 @@ require('lazy').setup({ -- NOTE: If you are having trouble with this installation, -- refer to the README for telescope-fzf-native for more instructions. build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, + cond = function() return vim.fn.executable 'make' == 1 end, }, }, }, From 78e145660a272eeae54900247ca55a6d1f2d83d4 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Mon, 14 Jul 2025 09:25:59 -0400 Subject: [PATCH 15/24] latest --- backup | 1 + init.lua | 88 --------------------------- lua/custom/plugins/float-terminal.lua | 59 ++++++++++++++++++ lua/custom/plugins/init.lua | 36 +++++++++++ lua/custom/plugins/lsp-lines.lua | 6 ++ 5 files changed, 102 insertions(+), 88 deletions(-) create mode 160000 backup create mode 100644 lua/custom/plugins/float-terminal.lua create mode 100644 lua/custom/plugins/lsp-lines.lua diff --git a/backup b/backup new file mode 160000 index 00000000000..7d954aef619 --- /dev/null +++ b/backup @@ -0,0 +1 @@ +Subproject commit 7d954aef6198f4b244517c259dbcdc6a746df7e1 diff --git a/init.lua b/init.lua index 9bfd3d210ce..415134ee085 100644 --- a/init.lua +++ b/init.lua @@ -1,91 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -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. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - --- Set as the leader key --- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' diff --git a/lua/custom/plugins/float-terminal.lua b/lua/custom/plugins/float-terminal.lua new file mode 100644 index 00000000000..bb76b230384 --- /dev/null +++ b/lua/custom/plugins/float-terminal.lua @@ -0,0 +1,59 @@ +vim.keymap.set('t', '', '') + +local state = { + floating = { + buf = -1, + win = -1, + }, +} + +local function create_floating_window(opts) + opts = opts or {} + local width = opts.width or math.floor(vim.o.columns * 0.8) + local height = opts.height or math.floor(vim.o.lines * 0.8) + + -- Calculate the position to center the window + local col = math.floor((vim.o.columns - width) / 2) + local row = math.floor((vim.o.lines - height) / 2) + + -- Create a buffer + local buf = nil + if vim.api.nvim_buf_is_valid(opts.buf) then + buf = opts.buf + else + buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer + end + + -- Define window configuration + local win_config = { + relative = 'editor', + width = width, + height = height, + col = col, + row = row, + style = 'minimal', -- No borders or extra UI elements + border = 'rounded', + } + + -- Create the floating window + local win = vim.api.nvim_open_win(buf, true, win_config) + + return { buf = buf, win = win } +end + +local toggle_terminal = function() + if not vim.api.nvim_win_is_valid(state.floating.win) then + state.floating = create_floating_window { buf = state.floating.buf } + if vim.bo[state.floating.buf].buftype ~= 'terminal' then + vim.cmd.terminal() + end + else + vim.api.nvim_win_hide(state.floating.win) + end +end +vim.keymap.set({ 't', 'n' }, 'tt', toggle_terminal) + +-- Example usage: +-- Create a floating window with default dimensions +vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {}) +return {} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index b3ddcfdd3aa..40d0044f737 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,4 +5,40 @@ ---@module 'lazy' ---@type LazySpec +vim.g.netrw_banner = '0' -- disable topbar +-- vim.g.netrw_browse_split = 4 -- open in prior buffer/window +-- -- vim.g.netrw_altv = 1 -- open fle splits to the right +vim.g.netrw_liststyle = 3 -- tree view +-- vim.g.netrw_winsize = 25 -- length of the window +vim.diagnostic.config { + virtual_text = { + -- source = "always", -- Or "if_many" + prefix = '●', -- Could be '■', '▎', 'x' + }, + severity_sort = true, + float = { + source = true, -- Or "if_many" + }, +} + +vim.wo.foldmethod = 'expr' +vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' +vim.wo.foldenable = false + +-- copy current buffer path to "+ +vim.keymap.set('n', 'yb', 'let @+ = expand("%")', { desc = 'yank to plus register current relative path' }) + +-- https://devpad.net/blog/upgrading-nvim-v010-to-v011 +vim.opt.completeopt = { 'menuone', 'fuzzy', 'noinsert', 'preview' } +vim.o.omnifunc = 'v:lua.vim.lsp.omnifunc' + +-- vim.diagnostic.config { +-- virtual_text = false, +-- } +-- never use tabs +vim.o.expandtab = true + +local set = vim.opt_local +set.shiftwidth = 2 +vim.o.shiftwidth = 2 return {} diff --git a/lua/custom/plugins/lsp-lines.lua b/lua/custom/plugins/lsp-lines.lua new file mode 100644 index 00000000000..3bbd306f951 --- /dev/null +++ b/lua/custom/plugins/lsp-lines.lua @@ -0,0 +1,6 @@ +return { + 'https://git.sr.ht/~whynothugo/lsp_lines.nvim', + config = function() + require('lsp_lines').setup() + end, +} From 1569339c0e162b696e7db69a6a7ab31a29e4138f Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Thu, 25 Sep 2025 12:40:02 -0300 Subject: [PATCH 16/24] latest 2 --- lua/custom/plugins/init.lua | 1 + lua/keymaps.lua | 4 +- lua/kickstart/plugins/gitsigns.lua | 119 ++++++++++++++++------------- 3 files changed, 70 insertions(+), 54 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 40d0044f737..2b020f06340 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -41,4 +41,5 @@ vim.o.expandtab = true local set = vim.opt_local set.shiftwidth = 2 vim.o.shiftwidth = 2 +vim.keymap.set('n', 'yb', 'let @+ = expand("%")', { desc = 'yank to plus register current relative path' }) return {} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 22d77965d18..2c1bb864e54 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -12,9 +12,7 @@ vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = tr -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank() - end, + callback = function() vim.highlight.on_yank() end, group = highlight_group, pattern = '*', }) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 5f5652f9249..6283887dc7e 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -1,58 +1,75 @@ --- Adds git related signs to the gutter, as well as utilities for managing changes --- NOTE: gitsigns is already included in init.lua but contains only the base --- config. This will add also the recommended keymaps. - ----@module 'lazy' ----@type LazySpec +-- Alternatively, use `config = function() ... end` for full control over the configuration. +-- If you prefer to call `setup` explicitly, use: +-- { +-- 'lewis6991/gitsigns.nvim', +-- config = function() +-- require('gitsigns').setup({ +-- -- Your gitsigns configuration here +-- }) +-- end, +-- } +-- +-- Here is a more advanced example where we pass configuration +-- options to `gitsigns.nvim`. +-- +-- See `:help gitsigns` to understand what the configuration keys do return { - 'lewis6991/gitsigns.nvim', - ---@module 'gitsigns' - ---@type Gitsigns.Config - ---@diagnostic disable-next-line: missing-fields - opts = { - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + { -- Adds git related signs to the gutter, as well as utilities for managing changes + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + current_line_blame = true, + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) end - end, { desc = 'Jump to next git [c]hange' }) - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' + end + end, { desc = 'Jump to next git [c]hange' }) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end, { desc = 'Jump to previous git [c]hange' }) - -- Actions - -- visual mode - map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) - map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) - end, + -- Actions + -- visual mode + map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) + map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) + -- normal mode + map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) + map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) + map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) + map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) + map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) + map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) + map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) + map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) + map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) + -- Toggles + map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) + map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) + end, + }, }, } +-- vim: ts=2 sts=2 sw=2 et From 1da7ebeb331e9453fe2dcbf9b529fab573fcc61a Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Tue, 16 Dec 2025 13:53:34 -0300 Subject: [PATCH 17/24] fix(my-account-ui): [CUSTMIC-] delete backupt add copilot --- backup | 1 - 1 file changed, 1 deletion(-) delete mode 160000 backup diff --git a/backup b/backup deleted file mode 160000 index 7d954aef619..00000000000 --- a/backup +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7d954aef6198f4b244517c259dbcdc6a746df7e1 From 3c5a2f75087a596f28f8b10afbcc8fb82937e137 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Thu, 5 Feb 2026 09:17:13 -0300 Subject: [PATCH 18/24] latest --- README.md | 2 +- lua/custom/plugins/init.lua | 8 +-- lua/lazy-plugins.lua | 2 +- lua/options.lua | 24 +++++++++ session.vim | 99 +++++++++++++++++++++++++++++++++++++ 5 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 session.vim diff --git a/README.md b/README.md index ce8cceda6d6..e127e8d37ff 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ available methods being discussed
Bob [Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for -all platforms. Simply install +all plattforms. Simply install [rustup](https://rust-lang.github.io/rustup/installation/other.html), and run the following commands: diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 2b020f06340..0c7f0b97b86 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -9,10 +9,8 @@ vim.g.netrw_banner = '0' -- disable topbar -- vim.g.netrw_browse_split = 4 -- open in prior buffer/window -- -- vim.g.netrw_altv = 1 -- open fle splits to the right vim.g.netrw_liststyle = 3 -- tree view --- vim.g.netrw_winsize = 25 -- length of the window vim.diagnostic.config { virtual_text = { - -- source = "always", -- Or "if_many" prefix = '●', -- Could be '■', '▎', 'x' }, severity_sort = true, @@ -32,14 +30,12 @@ vim.keymap.set('n', 'yb', 'let @+ = expand("%")', { desc = 'yan vim.opt.completeopt = { 'menuone', 'fuzzy', 'noinsert', 'preview' } vim.o.omnifunc = 'v:lua.vim.lsp.omnifunc' --- vim.diagnostic.config { --- virtual_text = false, --- } -- never use tabs vim.o.expandtab = true +-- evitar folds +vim.o.foldlevelstart = 99 local set = vim.opt_local set.shiftwidth = 2 vim.o.shiftwidth = 2 -vim.keymap.set('n', 'yb', 'let @+ = expand("%")', { desc = 'yank to plus register current relative path' }) return {} diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index ba002784031..ae319fdabfa 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -155,7 +155,7 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, {}) -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/options.lua b/lua/options.lua index a636e35549e..cb3f5e79dcb 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -38,5 +38,29 @@ vim.o.completeopt = 'menuone,noselect' -- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +-- +-- Notice listchars is set using `vim.opt` instead of `vim.o`. +-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. +-- See `:help lua-options` +-- and `:help lua-guide-options` +vim.o.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +vim.o.inccommand = 'split' + +-- Show which line your cursor is on +vim.o.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.o.scrolloff = 10 + +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.o.confirm = true -- vim: ts=2 sts=2 sw=2 et diff --git a/session.vim b/session.vim new file mode 100644 index 00000000000..5ff6c16fa6e --- /dev/null +++ b/session.vim @@ -0,0 +1,99 @@ +let SessionLoad = 1 +let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1 +let v:this_session=expand(":p") +silent only +silent tabonly +cd ~/.config/nvim +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +let s:shortmess_save = &shortmess +if &shortmess =~ 'A' + set shortmess=aoOA +else + set shortmess=aoO +endif +badd +6 lua/kickstart/plugins/treesitter.lua +badd +1 ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter.lua +badd +126 lua/kickstart/plugins/lspconfig.lua +argglobal +%argdel +edit ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter.lua +let s:save_splitbelow = &splitbelow +let s:save_splitright = &splitright +set splitbelow splitright +wincmd _ | wincmd | +vsplit +1wincmd h +wincmd w +let &splitbelow = s:save_splitbelow +let &splitright = s:save_splitright +wincmd t +let s:save_winminheight = &winminheight +let s:save_winminwidth = &winminwidth +set winminheight=0 +set winheight=1 +set winminwidth=0 +set winwidth=1 +exe 'vert 1resize ' . ((&columns * 77 + 77) / 155) +exe 'vert 2resize ' . ((&columns * 77 + 77) / 155) +argglobal +balt lua/kickstart/plugins/treesitter.lua +setlocal foldmethod=expr +setlocal foldexpr=v:lua.vim.treesitter.foldexpr() +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=99 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal nofoldenable +let s:l = 1 - ((0 * winheight(0) + 20) / 40) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 1 +normal! 0 +wincmd w +argglobal +if bufexists(fnamemodify("lua/kickstart/plugins/lspconfig.lua", ":p")) | buffer lua/kickstart/plugins/lspconfig.lua | else | edit lua/kickstart/plugins/lspconfig.lua | endif +if &buftype ==# 'terminal' + silent file lua/kickstart/plugins/lspconfig.lua +endif +balt ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter.lua +setlocal foldmethod=expr +setlocal foldexpr=v:lua.vim.treesitter.foldexpr() +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=99 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal nofoldenable +let s:l = 126 - ((18 * winheight(0) + 20) / 40) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 126 +normal! 09| +wincmd w +2wincmd w +exe 'vert 1resize ' . ((&columns * 77 + 77) / 155) +exe 'vert 2resize ' . ((&columns * 77 + 77) / 155) +tabnext 1 +if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 +let &shortmess = s:shortmess_save +let &winminheight = s:save_winminheight +let &winminwidth = s:save_winminwidth +let s:sx = expand(":p:r")."x.vim" +if filereadable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &g:so = s:so_save | let &g:siso = s:siso_save +set hlsearch +nohlsearch +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : From 79899c73917342d01b2849672cf58d321bc658d4 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Thu, 5 Feb 2026 11:10:46 -0300 Subject: [PATCH 19/24] latest --- init.lua | 8 ++++++ lua/custom/plugins/init.lua | 15 +++------- session.vim | 55 +++++++------------------------------ 3 files changed, 22 insertions(+), 56 deletions(-) diff --git a/init.lua b/init.lua index 415134ee085..33008615a56 100644 --- a/init.lua +++ b/init.lua @@ -5,6 +5,14 @@ vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true +-- Configure lazy.nvim to use LuaJIT for rocks support +vim.g.lazy_rocks = { + hererocks = { + lua_dir = '/usr/local/bin', + lua_version = '5.1', + } +} + -- [[ Setting options ]] -- See `:help vim.o` -- NOTE: You can change these options as you wish! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 0c7f0b97b86..79c471a6e05 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -9,19 +9,12 @@ vim.g.netrw_banner = '0' -- disable topbar -- vim.g.netrw_browse_split = 4 -- open in prior buffer/window -- -- vim.g.netrw_altv = 1 -- open fle splits to the right vim.g.netrw_liststyle = 3 -- tree view -vim.diagnostic.config { - virtual_text = { - prefix = '●', -- Could be '■', '▎', 'x' - }, - severity_sort = true, - float = { - source = true, -- Or "if_many" - }, -} vim.wo.foldmethod = 'expr' -vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -vim.wo.foldenable = false +-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' +-- vim.wo.foldenable = false +vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' +vim.wo[0][0].foldmethod = 'expr' -- copy current buffer path to "+ vim.keymap.set('n', 'yb', 'let @+ = expand("%")', { desc = 'yank to plus register current relative path' }) diff --git a/session.vim b/session.vim index 5ff6c16fa6e..d5514e631ec 100644 --- a/session.vim +++ b/session.vim @@ -13,21 +13,14 @@ if &shortmess =~ 'A' else set shortmess=aoO endif -badd +6 lua/kickstart/plugins/treesitter.lua -badd +1 ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter.lua -badd +126 lua/kickstart/plugins/lspconfig.lua +badd +20 lua/kickstart/plugins/conform.lua +badd +5 lua/kickstart/plugins/treesitter.lua +badd +1 init.lua +badd +37 lua/lazy-plugins.lua +badd +127 lua/kickstart/plugins/lspconfig.lua argglobal %argdel -edit ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter.lua -let s:save_splitbelow = &splitbelow -let s:save_splitright = &splitright -set splitbelow splitright -wincmd _ | wincmd | -vsplit -1wincmd h -wincmd w -let &splitbelow = s:save_splitbelow -let &splitright = s:save_splitright +edit lua/kickstart/plugins/lspconfig.lua wincmd t let s:save_winminheight = &winminheight let s:save_winminwidth = &winminwidth @@ -35,8 +28,6 @@ set winminheight=0 set winheight=1 set winminwidth=0 set winwidth=1 -exe 'vert 1resize ' . ((&columns * 77 + 77) / 155) -exe 'vert 2resize ' . ((&columns * 77 + 77) / 155) argglobal balt lua/kickstart/plugins/treesitter.lua setlocal foldmethod=expr @@ -46,38 +37,13 @@ setlocal foldignore=# setlocal foldlevel=99 setlocal foldminlines=1 setlocal foldnestmax=20 -setlocal nofoldenable -let s:l = 1 - ((0 * winheight(0) + 20) / 40) +setlocal foldenable +let s:l = 127 - ((11 * winheight(0) + 20) / 40) if s:l < 1 | let s:l = 1 | endif keepjumps exe s:l normal! zt -keepjumps 1 -normal! 0 -wincmd w -argglobal -if bufexists(fnamemodify("lua/kickstart/plugins/lspconfig.lua", ":p")) | buffer lua/kickstart/plugins/lspconfig.lua | else | edit lua/kickstart/plugins/lspconfig.lua | endif -if &buftype ==# 'terminal' - silent file lua/kickstart/plugins/lspconfig.lua -endif -balt ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter.lua -setlocal foldmethod=expr -setlocal foldexpr=v:lua.vim.treesitter.foldexpr() -setlocal foldmarker={{{,}}} -setlocal foldignore=# -setlocal foldlevel=99 -setlocal foldminlines=1 -setlocal foldnestmax=20 -setlocal nofoldenable -let s:l = 126 - ((18 * winheight(0) + 20) / 40) -if s:l < 1 | let s:l = 1 | endif -keepjumps exe s:l -normal! zt -keepjumps 126 -normal! 09| -wincmd w -2wincmd w -exe 'vert 1resize ' . ((&columns * 77 + 77) / 155) -exe 'vert 2resize ' . ((&columns * 77 + 77) / 155) +keepjumps 127 +normal! 034| tabnext 1 if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' silent exe 'bwipe ' . s:wipebuf @@ -93,7 +59,6 @@ if filereadable(s:sx) endif let &g:so = s:so_save | let &g:siso = s:siso_save set hlsearch -nohlsearch doautoall SessionLoadPost unlet SessionLoad " vim: set ft=vim : From 8eff8ff770d1e01fad90ba5c6964b2a7e88a824c Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Sun, 22 Mar 2026 14:53:51 -0300 Subject: [PATCH 20/24] latest --- init.lua | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 33008615a56..339de8a2fae 100644 --- a/init.lua +++ b/init.lua @@ -10,7 +10,7 @@ vim.g.lazy_rocks = { hererocks = { lua_dir = '/usr/local/bin', lua_version = '5.1', - } + }, } -- [[ Setting options ]] @@ -164,15 +164,7 @@ local rtp = vim.opt.rtp rtp:prepend(lazypath) -- [[ Configure and install plugins ]] --- --- To check the current status of your plugins, run --- :Lazy --- --- You can press `?` in this menu for help. Use `:q` to close the window --- --- To update plugins you can run --- :Lazy update --- + -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` @@ -254,7 +246,7 @@ require('lazy').setup({ { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', -- By default, Telescope is included and acts as your picker for everything. --- Configure LSP (Language Server Protocol) + -- Configure LSP (Language Server Protocol) -- If you would like to switch to a different picker (like snacks, or fzf-lua) -- you can disable the Telescope plugin by setting enabled to false and enable @@ -525,12 +517,12 @@ require('lazy').setup({ -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, - -- + cssls = {}, -- 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 (`ts_ls`) will work just fine - -- ts_ls = {}, + ts_ls = {}, stylua = {}, -- Used to format Lua code @@ -831,7 +823,7 @@ 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', @@ -841,7 +833,7 @@ require('lazy').setup({ -- 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! From bdd0353c4d97d3a1eaee158498d51a157ce8b386 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Sun, 22 Mar 2026 14:54:41 -0300 Subject: [PATCH 21/24] comment git lock on gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 68486fc3d35..bfc720f63cc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,6 @@ spell/ # lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile # For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded # merge conflicts. -lazy-lock.json +# lazy-lock.json .DS_Store From aebe62ad53f09fde143b6d34ef20488a1aee2068 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Sun, 22 Mar 2026 14:54:56 -0300 Subject: [PATCH 22/24] add lazy-lock --- lazy-lock.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lazy-lock.json diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..1802ba3c0b6 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,25 @@ +{ + "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a979821a975897b88493843301950c456a725982" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.nvim": { "branch": "main", "commit": "59f09943573c5348ca6c88393fa09ce3b66a7818" }, + "nvim-lspconfig": { "branch": "master", "commit": "841c6d4139aedb8a3f2baf30cef5327371385b93" }, + "nvim-treesitter": { "branch": "main", "commit": "875515255192864c33981c3ed66ad94e561b904a" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} From 38ebfd7912f90d399286b21df7957db1a36a0977 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Sun, 22 Mar 2026 16:39:43 -0300 Subject: [PATCH 23/24] fix(my-account-ui): [CUSTMIC-] files not used --- init.lua | 17 +--- lazy-lock.json | 2 +- lua/cmp-setup.lua | 49 ----------- lua/custom/plugins/init.lua | 4 + lua/keymaps.lua | 26 ------ lua/lazy-bootstrap.lua | 17 ---- lua/lazy-plugins.lua | 161 ------------------------------------ lua/lsp-setup.lua | 111 ------------------------- lua/options.lua | 66 --------------- lua/telescope-setup.lua | 36 -------- lua/treesitter-setup.lua | 70 ---------------- 11 files changed, 6 insertions(+), 553 deletions(-) delete mode 100644 lua/cmp-setup.lua delete mode 100644 lua/keymaps.lua delete mode 100644 lua/lazy-bootstrap.lua delete mode 100644 lua/lazy-plugins.lua delete mode 100644 lua/lsp-setup.lua delete mode 100644 lua/options.lua delete mode 100644 lua/telescope-setup.lua delete mode 100644 lua/treesitter-setup.lua diff --git a/init.lua b/init.lua index 339de8a2fae..bda4e61f455 100644 --- a/init.lua +++ b/init.lua @@ -185,21 +185,6 @@ require('lazy').setup({ -- options to `gitsigns.nvim`. -- -- See `:help gitsigns` to understand what the configuration keys do - { -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - ---@module 'gitsigns' - ---@type Gitsigns.Config - ---@diagnostic disable-next-line: missing-fields - opts = { - signs = { - add = { text = '+' }, ---@diagnostic disable-line: missing-fields - change = { text = '~' }, ---@diagnostic disable-line: missing-fields - delete = { text = '_' }, ---@diagnostic disable-line: missing-fields - topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields - changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields - }, - }, - }, -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- @@ -214,6 +199,7 @@ require('lazy').setup({ -- -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', @@ -827,7 +813,6 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended 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. diff --git a/lazy-lock.json b/lazy-lock.json index 1802ba3c0b6..65eb82c3e62 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,7 +6,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a979821a975897b88493843301950c456a725982" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, diff --git a/lua/cmp-setup.lua b/lua/cmp-setup.lua deleted file mode 100644 index ce389e4f330..00000000000 --- a/lua/cmp-setup.lua +++ /dev/null @@ -1,49 +0,0 @@ --- [[ Configure nvim-cmp ]] --- See `:help cmp` -local cmp = require 'cmp' -local luasnip = require 'luasnip' -require('luasnip.loaders.from_vscode').lazy_load() -luasnip.config.setup {} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - [''] = 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' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, -} - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 79c471a6e05..3ece8cc3f46 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -31,4 +31,8 @@ vim.o.foldlevelstart = 99 local set = vim.opt_local set.shiftwidth = 2 vim.o.shiftwidth = 2 + +-- +vim.cmd "set statusline+=%{get(b:,'gitsigns_status','')}" + return {} diff --git a/lua/keymaps.lua b/lua/keymaps.lua deleted file mode 100644 index 2c1bb864e54..00000000000 --- a/lua/keymaps.lua +++ /dev/null @@ -1,26 +0,0 @@ --- [[ Basic Keymaps ]] - --- Keymaps for better default experience --- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) - --- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - --- [[ Highlight on yank ]] --- See `:help vim.highlight.on_yank()` -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() vim.highlight.on_yank() end, - group = highlight_group, - pattern = '*', -}) - --- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/lazy-bootstrap.lua b/lua/lazy-bootstrap.lua deleted file mode 100644 index 70aebf55ba8..00000000000 --- a/lua/lazy-bootstrap.lua +++ /dev/null @@ -1,17 +0,0 @@ --- [[ Bootstrap lazy plugin manager ]] --- https://github.com/folke/lazy.nvim --- `:help lazy.nvim.txt` for more info -local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not vim.loop.fs_stat(lazypath) then - vim.fn.system { - 'git', - 'clone', - '--filter=blob:none', - 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', -- latest stable release - lazypath, - } -end -vim.opt.rtp:prepend(lazypath) - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua deleted file mode 100644 index ae319fdabfa..00000000000 --- a/lua/lazy-plugins.lua +++ /dev/null @@ -1,161 +0,0 @@ --- [[ Setup lazy plugin manager ]] --- NOTE: Here is where you install your plugins. --- You can configure plugins using the `config` key. --- --- You can also configure plugins after the setup call, --- as they will be available in your neovim runtime. -require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration - - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', - - -- Detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', - - -- NOTE: This is where your plugins related to LSP can be installed. - -- The configuration is done below. Search for lspconfig to find it below. - { - -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', - }, - }, - - { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - }, - }, - - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - { - -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - -- See `:help gitsigns.txt` - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) - - -- don't override the built-in and fugitive keymaps - local gs = package.loaded.gitsigns - vim.keymap.set({ 'n', 'v' }, ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' }) - vim.keymap.set({ 'n', 'v' }, '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' }) - end, - }, - }, - - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() vim.cmd.colorscheme 'onedark' end, - }, - - { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, - }, - - { - -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - opts = {}, - }, - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, - - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() return vim.fn.executable 'make' == 1 end, - }, - }, - }, - - { - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - }, - build = ':TSUpdate', - }, - - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', - - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - { import = 'custom.plugins' }, -}, {}) - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/lsp-setup.lua b/lua/lsp-setup.lua deleted file mode 100644 index 08f35efec60..00000000000 --- a/lua/lsp-setup.lua +++ /dev/null @@ -1,111 +0,0 @@ --- [[ Configure LSP ]] --- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(_, bufnr) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local nmap = function(keys, func, desc) - if desc then - desc = 'LSP: ' .. desc - end - - vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) - end - - nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - - nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - - -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') - - -- Lesser used LSP functionality - nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') - nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') - nmap('wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, '[W]orkspace [L]ist Folders') - - -- Create a command `:Format` local to the LSP buffer - vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - vim.lsp.buf.format() - end, { desc = 'Format current buffer with LSP' }) -end - --- document existing key chains -require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, - ['h'] = { name = 'More git', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, -} - --- mason-lspconfig requires that these setup functions are called in this order --- before setting up the servers. -require('mason').setup() -require('mason-lspconfig').setup() - --- Enable the following language servers --- Feel free to add/remove any LSPs that you want here. They will automatically be installed. --- --- Add any additional override configuration in the following tables. They will be passed to --- the `settings` field of the server config. You must look up that documentation yourself. --- --- If you want to override the default filetypes that your language server will attach to you can --- define the property 'filetypes' to the map in question. -local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - - lua_ls = { - Lua = { - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - }, - }, -} - --- Setup neovim lua configuration -require('neodev').setup() - --- nvim-cmp supports additional completion capabilities, so broadcast that to servers -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - --- Ensure the servers above are installed -local mason_lspconfig = require 'mason-lspconfig' - -mason_lspconfig.setup { - ensure_installed = vim.tbl_keys(servers), -} - -mason_lspconfig.setup_handlers { - function(server_name) - require('lspconfig')[server_name].setup { - capabilities = capabilities, - on_attach = on_attach, - settings = servers[server_name], - filetypes = (servers[server_name] or {}).filetypes, - } - end, -} - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/options.lua b/lua/options.lua deleted file mode 100644 index cb3f5e79dcb..00000000000 --- a/lua/options.lua +++ /dev/null @@ -1,66 +0,0 @@ --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! - --- Set highlight on search -vim.o.hlsearch = false - --- Make line numbers default -vim.wo.number = true - --- Enable mouse mode -vim.o.mouse = 'a' - --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.o.clipboard = 'unnamedplus' - --- Enable break indent -vim.o.breakindent = true - --- Save undo history -vim.o.undofile = true - --- Case-insensitive searching UNLESS \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true - --- Keep signcolumn on by default -vim.wo.signcolumn = 'yes' - --- Decrease update time -vim.o.updatetime = 250 -vim.o.timeoutlen = 300 - --- Set completeopt to have a better completion experience -vim.o.completeopt = 'menuone,noselect' - --- NOTE: You should make sure your terminal supports this -vim.o.termguicolors = true --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` --- --- Notice listchars is set using `vim.opt` instead of `vim.o`. --- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. --- See `:help lua-options` --- and `:help lua-guide-options` -vim.o.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - --- Preview substitutions live, as you type! -vim.o.inccommand = 'split' - --- Show which line your cursor is on -vim.o.cursorline = true - --- Minimal number of screen lines to keep above and below the cursor. -vim.o.scrolloff = 10 - --- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), --- instead raise a dialog asking if you wish to save the current file(s) --- See `:help 'confirm'` -vim.o.confirm = true - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/telescope-setup.lua b/lua/telescope-setup.lua deleted file mode 100644 index be340512ab4..00000000000 --- a/lua/telescope-setup.lua +++ /dev/null @@ -1,36 +0,0 @@ --- [[ Configure Telescope ]] --- See `:help telescope` and `:help telescope.setup()` -require('telescope').setup { - defaults = { - mappings = { - i = { - [''] = false, - [''] = false, - }, - }, - }, -} - --- Enable telescope fzf native, if installed -pcall(require('telescope').load_extension, 'fzf') - --- See `:help telescope.builtin` -vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) -vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) -vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) -end, { desc = '[/] Fuzzily search in current buffer' }) - -vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) - --- vim: ts=2 sts=2 sw=2 et diff --git a/lua/treesitter-setup.lua b/lua/treesitter-setup.lua deleted file mode 100644 index 78c84e420f3..00000000000 --- a/lua/treesitter-setup.lua +++ /dev/null @@ -1,70 +0,0 @@ --- [[ Configure Treesitter ]] --- See `:help nvim-treesitter` --- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' -vim.defer_fn(function() - require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, - - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, - } -end, 0) - --- vim: ts=2 sts=2 sw=2 et From ba851a3ce3b65c65415d6876d93113d9dff261bf Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Sun, 22 Mar 2026 18:43:32 -0300 Subject: [PATCH 24/24] add deno tsserver config, and config for telescope to use .env --- init.lua | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index bda4e61f455..40366c44aca 100644 --- a/init.lua +++ b/init.lua @@ -286,13 +286,19 @@ require('lazy').setup({ require('telescope').setup { -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} + defaults = { + file_ignore_patterns = { '%.git/', 'node_modules/', 'dist/', 'build/' }, + }, + pickers = { + find_files = { + no_ignore = true, + }, + live_grep = { + additional_args = function() + return { '--no-ignore' } + end, + }, + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown() }, }, @@ -497,6 +503,17 @@ require('lazy').setup({ -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- See `:help lsp-config` for information about keys and how to configure + local util = require 'lspconfig.util' + + local function root_dir_from_pattern(...) + local matcher = util.root_pattern(...) + return function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + local root = matcher(fname) + if root then on_dir(root) end + end + end + ---@type table local servers = { -- clangd = {}, @@ -508,9 +525,16 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - ts_ls = {}, + ts_ls = { + root_dir = root_dir_from_pattern('package.json', 'tsconfig.json', 'jsconfig.json'), + single_file_support = false, + }, - stylua = {}, -- Used to format Lua code + -- Use Deno's built-in language server when deno configuration files are present + denols = { + root_dir = root_dir_from_pattern('deno.json', 'deno.jsonc'), + single_file_support = false, + }, -- Special Lua Config, as recommended by neovim help docs lua_ls = { @@ -549,9 +573,13 @@ require('lazy').setup({ -- :Mason -- -- You can press `g?` for help in this menu. - local ensure_installed = vim.tbl_keys(servers or {}) + local ensure_installed = {} + for server_name in pairs(servers or {}) do + if server_name ~= 'denols' then table.insert(ensure_installed, server_name) end + end vim.list_extend(ensure_installed, { -- You can add other tools here that you want Mason to install + 'stylua', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed }