From 5623cd033f823f06afa75739813066b13aa39598 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 | 18 +++--------------- lua/lazy-bootstrap.lua | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 lua/lazy-bootstrap.lua diff --git a/init.lua b/init.lua index a7667ddcc63..16cc97768ad 100644 --- a/init.lua +++ b/init.lua @@ -37,27 +37,15 @@ I hope you enjoy your Neovim journey, 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 required (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Install package 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) +-- Install lazy plugin manager +require('lazy-bootstrap') -- NOTE: Here is where you install your plugins. -- You can configure plugins using the `config` key. 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 bc8966a42cd890c12c50935852d0bcf2cb002932 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 16cc97768ad..2c00435a6d7 100644 --- a/init.lua +++ b/init.lua @@ -47,176 +47,8 @@ vim.g.maplocalleader = ' ' -- 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 7070190fa9cd058159034dc700d48f316200f424 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 | 42 ++---------------------------------------- lua/options.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 40 deletions(-) create mode 100644 lua/options.lua diff --git a/init.lua b/init.lua index 2c00435a6d7..fa3cdfaf8b5 100644 --- a/init.lua +++ b/init.lua @@ -50,46 +50,8 @@ require('lazy-bootstrap') -- Setup lazy plugin manager - configure plugins require('lazy-plugins') --- [[ 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 +-- Set options +require('options') -- [[ Basic Keymaps ]] 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 79e010e68130a639be0cbfaf9db35f8e975897a9 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 | 28 ++-------------------------- lua/keymaps.lua | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 lua/keymaps.lua diff --git a/init.lua b/init.lua index fa3cdfaf8b5..d7c519f1dfe 100644 --- a/init.lua +++ b/init.lua @@ -53,26 +53,8 @@ require('lazy-plugins') -- Set options require('options') --- [[ 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 = '*', -}) +-- Configure keymaps +require('keymaps') -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` @@ -178,12 +160,6 @@ vim.defer_fn(function() } end, 0) --- 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' }) - -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) 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 7a354c714eb2b787a2370d89052cc9c9c514726c 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 d7c519f1dfe..81db1213d51 100644 --- a/init.lua +++ b/init.lua @@ -56,40 +56,8 @@ require('options') -- 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 a13e1b0effb01f094d6100f48d82e582ab1ff852 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 81db1213d51..4dfc5606ffd 100644 --- a/init.lua +++ b/init.lua @@ -59,74 +59,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 cff9b1339c70f23c7d0d8e4491f4a73c219b8e4f 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 | 111 +--------------------------------------------- lua/lsp-setup.lua | 111 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 109 deletions(-) create mode 100644 lua/lsp-setup.lua diff --git a/init.lua b/init.lua index 4dfc5606ffd..f2d37fe939e 100644 --- a/init.lua +++ b/init.lua @@ -62,115 +62,8 @@ 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 - --- 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, -} +-- Configure LSP (Language Server Protocol) +require('lsp-setup') -- [[ Configure nvim-cmp ]] -- See `:help cmp` 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 3ab1c22507932078cad6e7dc00b952ba2532e59a 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 | 49 ++--------------------------------------------- lua/cmp-setup.lua | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 47 deletions(-) create mode 100644 lua/cmp-setup.lua diff --git a/init.lua b/init.lua index f2d37fe939e..eb373d2d9c2 100644 --- a/init.lua +++ b/init.lua @@ -65,53 +65,8 @@ require('treesitter-setup') -- Configure LSP (Language Server Protocol) require('lsp-setup') --- [[ 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' }, - }, -} +-- 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 d6466a768b7d4c6e45dd685f1f42fcfd22f78694 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 | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1f8e6f40476..666eba941ad 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4f A starting point for Neovim that is: * Small -* Single-file (with examples of moving to multi-file) * Documented * Modular From ae9617bcd2d7c7a2aa1830e08f3a9c03fa38c8fa 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 666eba941ad..d554f2df7bf 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -# kickstart.nvim +# kickstart-modular.nvim https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b ### 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 37d62823fdf229808f1b822b61ec6f0af9300d1f 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 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index eb373d2d9c2..6b9ebf53c5c 100644 --- a/init.lua +++ b/init.lua @@ -44,28 +44,32 @@ P.S. You can delete this when you're done too. It's your config now :) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Install lazy plugin manager +-- [[ Install `lazy.nvim` plugin manager ]] require('lazy-bootstrap') --- Setup lazy plugin manager - configure plugins +-- [[ Configure plugins ]] require('lazy-plugins') --- Set options +-- [[ Setting options ]] require('options') --- Configure keymaps +-- [[ Basic Keymaps ]] require('keymaps') --- Configure Telescope (fuzzy finder) +-- [[ Configure Telescope ]] +-- (fuzzy finder) require('telescope-setup') --- Configure Treesitter (syntax parser for highlighting) +-- [[ Configure Treesitter ]] +-- (syntax parser for highlighting) require('treesitter-setup') --- Configure LSP (Language Server Protocol) +-- [[ Configure LSP ]] +-- (Language Server Protocol) require('lsp-setup') --- Configure CMP (completion) +-- [[ Configure nvim-cmp ]] +-- (completion) require('cmp-setup') -- The line beneath this is called `modeline`. See `:help modeline` From cbaae1e97e433df731a7d3ddc60a32d4f00655c2 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Tue, 5 Dec 2023 10:28:02 +0100 Subject: [PATCH 12/24] Run stylua on init.lua --- init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 6b9ebf53c5c..8ea3bd26e6c 100644 --- a/init.lua +++ b/init.lua @@ -45,32 +45,32 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- [[ Install `lazy.nvim` plugin manager ]] -require('lazy-bootstrap') +require 'lazy-bootstrap' -- [[ Configure plugins ]] -require('lazy-plugins') +require 'lazy-plugins' -- [[ Setting options ]] -require('options') +require 'options' -- [[ Basic Keymaps ]] -require('keymaps') +require 'keymaps' -- [[ Configure Telescope ]] -- (fuzzy finder) -require('telescope-setup') +require 'telescope-setup' -- [[ Configure Treesitter ]] -- (syntax parser for highlighting) -require('treesitter-setup') +require 'treesitter-setup' -- [[ Configure LSP ]] -- (Language Server Protocol) -require('lsp-setup') +require 'lsp-setup' -- [[ Configure nvim-cmp ]] -- (completion) -require('cmp-setup') +require 'cmp-setup' -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From f6f5537a3a682b43ab8ea1862fea96e1e1ca5817 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 13/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 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 839a5cf4936..21b7a90225e 100644 --- a/README.md +++ b/README.md @@ -42,17 +42,17 @@ Clone kickstart.nvim: - on 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 ``` - on Windows (cmd) ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/dam9000/kickstart-modular.nvim.git %userprofile%\AppData\Local\nvim\ ``` - on Windows (powershell) ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/dam9000/kickstart-modular.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ``` @@ -77,7 +77,7 @@ nvim --headless "+Lazy! sync" +qa [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo (so that you have your own copy that you can modify) and then installing you can install to your machine using the methods above. > **NOTE** -> Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` +> Your fork's url will be something like this: `https://github.com//kickstart-modular.nvim.git` ### Configuration And Extension @@ -171,9 +171,10 @@ Each PR, especially those which increase the line count, should have a descripti * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily `git clone` as a basis for their own. As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the exact - same functionality is available here: - * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) + into smaller parts. *This is the fork of the original project that splits the configuration into smaller parts.* + The original repo that maintains the exact + same functionality in a single `init.lua` file is available here: + * [kickstart.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) From 49b21aeb12eff66eb44e992a29e1a58b2df4eca5 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Fri, 22 Dec 2023 09:44:57 +0100 Subject: [PATCH 14/24] README.md: removed some trailing spaces --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 21b7a90225e..3856d804b03 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,12 @@ git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HO - on Windows (cmd) ``` -git clone https://github.com/dam9000/kickstart-modular.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/dam9000/kickstart-modular.nvim.git %userprofile%\AppData\Local\nvim\ ``` - on Windows (powershell) ``` -git clone https://github.com/dam9000/kickstart-modular.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/dam9000/kickstart-modular.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ``` @@ -171,7 +171,7 @@ Each PR, especially those which increase the line count, should have a descripti * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily `git clone` as a basis for their own. As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. *This is the fork of the original project that splits the configuration into smaller parts.* + into smaller parts. *This is the fork of the original project that splits the configuration into smaller parts.* The original repo that maintains the exact same functionality in a single `init.lua` file is available here: * [kickstart.nvim](https://github.com/dam9000/kickstart-modular.nvim) From 0be3fcfae9c7d34ffa0da1687a2d8713a69ec571 Mon Sep 17 00:00:00 2001 From: Vinit Neogi <20491952+vneogi199@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:39:35 +0530 Subject: [PATCH 15/24] fix: incorrect reference to init.lua in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3856d804b03..19649973469 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ nvim --headless "+Lazy! sync" +qa * Inside of your copy, feel free to modify any file you like! It's your copy! * Feel free to change any of the default options in `init.lua` to better suit your needs. * For adding plugins, there are 3 primary options: - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this) + * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `lua/lazy-plugins.lua` file to enable this) * Modify `init.lua` with additional plugins. * Include the `lua/kickstart/plugins/*` files in your configuration. From d17289318a358cfebf62f6c6a170b9833f190f30 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 26 Feb 2024 21:37:26 +0100 Subject: [PATCH 16/24] README.md: minor update to the modular fork note --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b61e91a44a9..448a996109d 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ return { into smaller parts. A fork of kickstart that does this while maintaining the exact same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) - *NOTE: This is the fork of the original project that splits the configuration into smaller parts.* + * *NOTE: This is the fork that splits the configuration into smaller parts.* The original repo with the single `init.lua` file is available here: * [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) * Discussions on this topic can be found here: From f8727376ad2dcfc7fb5850a80566760699d92508 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Tue, 15 Apr 2025 21:00:06 +0200 Subject: [PATCH 17/24] remove cmp.lua which was replaced with blink-cmp.lua --- lua/kickstart/plugins/cmp.lua | 120 ---------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 lua/kickstart/plugins/cmp.lua diff --git a/lua/kickstart/plugins/cmp.lua b/lua/kickstart/plugins/cmp.lua deleted file mode 100644 index d5248488351..00000000000 --- a/lua/kickstart/plugins/cmp.lua +++ /dev/null @@ -1,120 +0,0 @@ -return { - { -- Autocompletion - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - { - 'L3MON4D3/LuaSnip', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end - return 'make install_jsregexp' - end)(), - dependencies = { - -- `friendly-snippets` contains a variety of premade snippets. - -- See the README about individual language/framework/plugin snippets: - -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, - }, - }, - 'saadparwaiz1/cmp_luasnip', - - -- Adds other completion capabilities. - -- nvim-cmp does not ship with all sources by default. They are split - -- into multiple repos for maintenance purposes. - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-nvim-lsp-signature-help', - }, - config = function() - -- See `:help cmp` - local cmp = require 'cmp' - local luasnip = require 'luasnip' - luasnip.config.setup {} - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = 'menu,menuone,noinsert' }, - - -- For an understanding of why these mappings were - -- chosen, you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - mapping = cmp.mapping.preset.insert { - -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), - -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), - - -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - - -- Accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, - - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), - - -- Manually trigger a completion from nvim-cmp. - -- Generally you don't need this, because nvim-cmp will display - -- completions whenever it has completion options available. - [''] = cmp.mapping.complete {}, - - -- Think of as moving to the right of your snippet expansion. - -- So if you have a snippet that's like: - -- function $name($args) - -- $body - -- end - -- - -- will move you to the right of each of the expansion locations. - -- is similar, except moving you backwards. - [''] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { 'i', 's' }), - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - sources = { - { - name = 'lazydev', - -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it - group_index = 0, - }, - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - { name = 'nvim_lsp_signature_help' }, - }, - } - end, - }, -} --- vim: ts=2 sts=2 sw=2 et From 61e8b304e55c428ec5fa66af7ea33917304ddd9c Mon Sep 17 00:00:00 2001 From: jaho5 Date: Sat, 17 May 2025 11:54:16 -0700 Subject: [PATCH 18/24] Update windows installation command --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54c36e26d42..d18e70ce63d 100644 --- a/README.md +++ b/README.md @@ -86,13 +86,13 @@ git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HO If you're using `cmd.exe`: ``` -git clone https://github.com/dam9000/kickstart.nvim.git "%localappdata%\nvim" +git clone https://github.com/dam9000/kickstart-modular.nvim.git "%localappdata%\nvim" ``` If you're using `powershell.exe` ``` -git clone https://github.com/dam9000/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" +git clone https://github.com/dam9000/kickstart-modular.nvim.git "${env:LOCALAPPDATA}\nvim" ``` From f2309053c75046d5e33084938ef9bba66d9e427e 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 19/24] Use the dot syntax for module paths --- lua/lazy-plugins.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 0a2b211af69..9f3ca2acd73 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -20,28 +20,28 @@ require('lazy').setup({ -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. -- - -- modular approach: using `require 'path/name'` will + -- modular approach: using `require 'path.name'` will -- include a plugin definition from file lua/path/name.lua - require 'kickstart/plugins/gitsigns', + require 'kickstart.plugins.gitsigns', - require 'kickstart/plugins/which-key', + require 'kickstart.plugins.which-key', - require 'kickstart/plugins/telescope', + require 'kickstart.plugins.telescope', - require 'kickstart/plugins/lspconfig', + require 'kickstart.plugins.lspconfig', - require 'kickstart/plugins/conform', + require 'kickstart.plugins.conform', - require 'kickstart/plugins/blink-cmp', + require 'kickstart.plugins.blink-cmp', - require 'kickstart/plugins/tokyonight', + require 'kickstart.plugins.tokyonight', - require 'kickstart/plugins/todo-comments', + require 'kickstart.plugins.todo-comments', - require 'kickstart/plugins/mini', + require 'kickstart.plugins.mini', - require 'kickstart/plugins/treesitter', + require 'kickstart.plugins.treesitter', -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and From dbe7c11c2baa8f916b0cb42a811001c2bd1aaeec Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Mon, 14 Jul 2025 09:25:59 -0400 Subject: [PATCH 20/24] latest --- backup | 1 + init.lua | 90 +-------------------------- lua/custom/plugins/float-terminal.lua | 59 ++++++++++++++++++ lua/custom/plugins/init.lua | 40 ++++++++++-- lua/custom/plugins/lsp-lines.lua | 6 ++ lua/kickstart/plugins/lspconfig.lua | 26 ++++---- lua/kickstart/plugins/telescope.lua | 53 +++++++--------- lua/lazy-plugins.lua | 2 +- 8 files changed, 141 insertions(+), 136 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 3784c1a18c9..255fbedf4a2 100644 --- a/init.lua +++ b/init.lua @@ -1,97 +1,9 @@ ---[[ - -===================================================================== -==================== 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 = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] require 'options' 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 be0eb9d8d7a..c36ce473e57 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,5 +1,37 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information +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, +} diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 6532757d872..1bb01b91486 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -208,19 +208,19 @@ return { -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - -- - + clangd = {}, + helm_ls = {}, + jsonls = { + init_options = { + provideFormatter = true, + }, + }, + cssls = {}, + eslint = {}, + bashls = {}, + vtsls = {}, + nginx_language_server = {}, + gitlab_ci_ls = {}, lua_ls = { -- cmd = { ... }, -- filetypes = { ... }, diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index bb74bf10fcd..6a33d8db2a9 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -1,10 +1,3 @@ --- NOTE: Plugins can specify dependencies. --- --- The dependencies are proper plugin specifications as well - anything --- you do for a plugin at the top level, you can do for a dependency. --- --- Use the `dependencies` key to specify the dependencies of a particular plugin - return { { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', @@ -30,17 +23,6 @@ return { { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- -- Two important keymaps to use while in Telescope are: -- - Insert mode: -- - Normal mode: ? @@ -49,18 +31,31 @@ return { -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it! - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.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/', + }, + vimgrep_arguments = { + 'rg', + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case', + '--hidden', -- Busca en archivos ocultos + '--glob', + '!.git/', -- Excluye .git pero no .gitlab + }, + }, + -- show hidden files, does it respect config for whatever command is using? + pickers = { + find_files = { + hidden = true, + }, + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 9f3ca2acd73..5d58ec1da7a 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -62,7 +62,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 0f40c264cbac86882eaaf80e1ab075d3e460939b Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Thu, 25 Sep 2025 12:40:02 -0300 Subject: [PATCH 21/24] latest 2 --- lua/custom/plugins/init.lua | 1 + lua/keymaps.lua | 8 ++++---- lua/kickstart/plugins/conform.lua | 3 ++- lua/kickstart/plugins/gitsigns.lua | 1 + lua/kickstart/plugins/telescope.lua | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index c36ce473e57..fba0009a0d9 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -34,4 +34,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 054c769b756..c1377874870 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -17,10 +17,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows diff --git a/lua/kickstart/plugins/conform.lua b/lua/kickstart/plugins/conform.lua index ca7c0c00b25..678d60366ed 100644 --- a/lua/kickstart/plugins/conform.lua +++ b/lua/kickstart/plugins/conform.lua @@ -19,7 +19,8 @@ return { -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + print('aa', vim.bo[bufnr].filetype) + local disable_filetypes = { c = true, cpp = true, javascript = true, typescript = true, javascriptreact = true, typescriptreact = true } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 79a3552b963..2d00963c97b 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -24,6 +24,7 @@ return { topdelete = { text = '‾' }, changedelete = { text = '~' }, }, + current_line_blame = true, on_attach = function(bufnr) local gitsigns = require 'gitsigns' diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index 6a33d8db2a9..388b255a21b 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -48,6 +48,8 @@ return { '--hidden', -- Busca en archivos ocultos '--glob', '!.git/', -- Excluye .git pero no .gitlab + '--glob', + '!package-lock.json', }, }, -- show hidden files, does it respect config for whatever command is using? From 7f0f862b1f0b8787501dbb94e882213165c3fbd8 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Tue, 16 Dec 2025 12:10:46 -0300 Subject: [PATCH 22/24] latest --- lua/kickstart/plugins/conform.lua | 2 +- lua/kickstart/plugins/lspconfig.lua | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lua/kickstart/plugins/conform.lua b/lua/kickstart/plugins/conform.lua index 678d60366ed..6b883334dec 100644 --- a/lua/kickstart/plugins/conform.lua +++ b/lua/kickstart/plugins/conform.lua @@ -20,7 +20,7 @@ return { -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. print('aa', vim.bo[bufnr].filetype) - local disable_filetypes = { c = true, cpp = true, javascript = true, typescript = true, javascriptreact = true, typescriptreact = true } + local disable_filetypes = { c = true, cpp = true, javascript = true, typescript = true, javascriptreact = true, typescriptreact = true, css = true } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 1bb01b91486..35df6132767 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -208,17 +208,29 @@ return { -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { + biome = {}, clangd = {}, helm_ls = {}, - jsonls = { - init_options = { - provideFormatter = true, - }, - }, + -- this is extracted from vscode i cant find a way to deactivete the format on save + -- jsonls = { + -- capabilities = { + -- init_options = { + -- provideFormatter = false, + -- }, + -- }, + -- }, cssls = {}, eslint = {}, bashls = {}, - vtsls = {}, + -- deno = {}, + vtsls = { + javascript = { + preferences = { + importModuleSpecifier = 'relative', + jsxAttributeCompletionStyle = 'auto', + }, + }, + }, nginx_language_server = {}, gitlab_ci_ls = {}, lua_ls = { @@ -235,6 +247,7 @@ return { }, }, }, + dockerls = {}, } -- Ensure the servers and tools above are installed From 230929c4a58062e9d15e428551dbf416846120b2 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Tue, 16 Dec 2025 13:53:34 -0300 Subject: [PATCH 23/24] fix(my-account-ui): [CUSTMIC-] delete backupt add copilot --- backup | 1 - lua/kickstart/plugins/blink-cmp.lua | 105 +++++++++++----------------- 2 files changed, 40 insertions(+), 66 deletions(-) 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 diff --git a/lua/kickstart/plugins/blink-cmp.lua b/lua/kickstart/plugins/blink-cmp.lua index 2b2f32596c5..4ddf25cd815 100644 --- a/lua/kickstart/plugins/blink-cmp.lua +++ b/lua/kickstart/plugins/blink-cmp.lua @@ -9,93 +9,68 @@ return { 'L3MON4D3/LuaSnip', version = '2.*', build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end return 'make install_jsregexp' end)(), - dependencies = { - -- `friendly-snippets` contains a variety of premade snippets. - -- See the README about individual language/framework/plugin snippets: - -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, - }, + dependencies = {}, opts = {}, }, 'folke/lazydev.nvim', - }, - --- @module 'blink.cmp' - --- @type blink.cmp.Config - opts = { - keymap = { - -- 'default' (recommended) for mappings similar to built-in completions - -- to accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - -- 'super-tab' for tab to accept - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- For an understanding of why the 'default' preset is recommended, - -- you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + -- Copilot backend (Lua) -- disable inline/panel; we'll use Blink only + { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + build = ':Copilot auth', + event = 'BufReadPost', + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + }, }, - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - }, + -- Blink source for Copilot + 'giuxtaposition/blink-cmp-copilot', + }, - completion = { - -- By default, you may press `` to show the documentation. - -- Optionally, set `auto_show = true` to show the documentation after a delay. - documentation = { auto_show = false, auto_show_delay_ms = 500 }, - }, + --- @module 'blink.cmp' + --- @type blink.cmp.Config + opts = { + keymap = { preset = 'default' }, + appearance = { nerd_font_variant = 'mono' }, + completion = { documentation = { auto_show = false, auto_show_delay_ms = 500 } }, sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, + -- add "copilot" to the default sources + default = { 'lsp', 'path', 'snippets', 'lazydev', 'copilot' }, providers = { lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, + + -- define the Copilot provider for Blink + copilot = { + name = 'copilot', + module = 'blink-cmp-copilot', + async = true, + score_offset = 100, -- slightly boost Copilot + -- optional: mark items visually as "Copilot" + transform_items = function(_, items) + local Kind = require('blink.cmp.types').CompletionItemKind + local idx = #Kind + 1 + Kind[idx] = 'Copilot' + for _, item in ipairs(items) do + item.kind = idx + end + return items + end, + }, }, }, snippets = { preset = 'luasnip' }, - - -- Blink.cmp includes an optional, recommended rust fuzzy matcher, - -- which automatically downloads a prebuilt binary when enabled. - -- - -- By default, we use the Lua implementation instead, but you may enable - -- the rust implementation via `'prefer_rust_with_warning'` - -- - -- See :h blink-cmp-config-fuzzy for more information fuzzy = { implementation = 'lua' }, - - -- Shows a signature help window while you type arguments for a function signature = { enabled = true }, }, }, } --- vim: ts=2 sts=2 sw=2 et From c28edb2eec48529764ec73aaee90cf0c46f525d0 Mon Sep 17 00:00:00 2001 From: dlsaldanas Date: Thu, 5 Feb 2026 09:17:13 -0300 Subject: [PATCH 24/24] latest --- .gitignore | 1 + .stylua.toml | 1 + README.md | 85 ++++++++++++- lua/custom/plugins/init.lua | 10 +- lua/keymaps.lua | 28 ++++- lua/kickstart/health.lua | 2 +- lua/kickstart/plugins/blink-cmp.lua | 10 +- lua/kickstart/plugins/conform.lua | 4 +- lua/kickstart/plugins/debug.lua | 28 ++--- lua/kickstart/plugins/gitsigns.lua | 12 +- lua/kickstart/plugins/lint.lua | 4 +- lua/kickstart/plugins/lspconfig.lua | 181 ++++++++------------------- lua/kickstart/plugins/mini.lua | 8 +- lua/kickstart/plugins/telescope.lua | 78 +++++++++--- lua/kickstart/plugins/treesitter.lua | 30 ++--- lua/kickstart/plugins/which-key.lua | 39 +----- lua/lazy-bootstrap.lua | 4 +- lua/lazy-plugins.lua | 11 +- lua/options.lua | 6 +- session.vim | 99 +++++++++++++++ 20 files changed, 355 insertions(+), 286 deletions(-) create mode 100644 session.vim diff --git a/.gitignore b/.gitignore index 005b535b606..86152ef5f3f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ nvim spell/ lazy-lock.json +.DS_Store diff --git a/.stylua.toml b/.stylua.toml index 139e9397d90..edfa5067106 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -4,3 +4,4 @@ indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferSingle" call_parentheses = "None" +collapse_simple_statement = "Always" diff --git a/README.md b/README.md index d18e70ce63d..68d05ad1e06 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,14 @@ A starting point for Neovim that is: Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. -If you are experiencing issues, please make sure you have the latest versions. +If you are experiencing issues, please make sure you have at least the latest +stable version. Most likely, you want to install neovim via a [package +manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package). +To check your neovim version, run `nvim --version` and make sure it is not +below the latest +['stable'](https://github.com/neovim/neovim/releases/tag/stable) version. If +your chosen install method only gives you an outdated version of neovim, find +alternative [installation methods below](#alternative-neovim-installation-methods). ### Install External Dependencies @@ -159,7 +166,7 @@ examples of adding popularly requested plugins. 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. +After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step. #### Windows Installation @@ -244,3 +251,77 @@ sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim ``` +### Alternative neovim installation methods + +For some systems it is not unexpected that the [package manager installation +method](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package) +recommended by neovim is significantly behind. If that is the case for you, +pick one of the following methods that are known to deliver fresh neovim versions very quickly. +They have been picked for their popularity and because they make installing and updating +neovim to the latest versions easy. You can also find more detail about the +available methods being discussed +[here](https://github.com/nvim-lua/kickstart.nvim/issues/1583). + + +
Bob + +[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for +all plattforms. Simply install +[rustup](https://rust-lang.github.io/rustup/installation/other.html), +and run the following commands: + +```bash +rustup default stable +rustup update stable +cargo install bob-nvim +bob use stable +``` + +
+ +
Homebrew + +[Homebrew](https://brew.sh) is a package manager popular on Mac and Linux. +Simply install using [`brew install`](https://formulae.brew.sh/formula/neovim). + +
+ +
Flatpak + +Flatpak is a package manager for applications that allows developers to package their applications +just once to make it available on all Linux systems. Simply [install flatpak](https://flatpak.org/setup/) +and setup [flathub](https://flathub.org/setup) to [install neovim](https://flathub.org/apps/io.neovim.nvim). + +
+ +
asdf and mise-en-place + +[asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/) are tool version managers, +mostly aimed towards project-specific tool versioning. However both support managing tools +globally in the user-space as well: + +
mise + +[Install mise](https://mise.jdx.dev/getting-started.html), then run: + +```bash +mise plugins install neovim +mise use neovim@stable +``` + +
+ +
asdf + +[Install asdf](https://asdf-vm.com/guide/getting-started.html), then run: + +```bash +asdf plugin add neovim +asdf install neovim stable +asdf set neovim stable --home +asdf reshim neovim +``` + +
+ +
diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index fba0009a0d9..47fe5b0d1d2 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,11 +1,7 @@ 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, @@ -25,14 +21,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/keymaps.lua b/lua/keymaps.lua index c1377874870..96028ae4d62 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -5,7 +5,29 @@ -- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') --- Diagnostic keymaps +-- Diagnostic Config & Keymaps +-- See :help vim.diagnostic.Opts +vim.diagnostic.config { + update_in_insert = false, + severity_sort = true, + float = { + border = 'rounded', + source = 'if_many', + format = function(diagnostic) + -- Incluye el mensaje y el origen (LSP) + return string.format('%s [%s]', diagnostic.message, diagnostic.source or 'unknown') + end, + }, + underline = { severity = vim.diagnostic.severity.ERROR }, + + -- Can switch between these as you prefer + virtual_text = true, -- Text shows up at the end of the line + virtual_lines = false, -- Teest shows up underneath the line, with virtual lines + + -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` + jump = { float = true }, +} + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -46,9 +68,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.hl.on_yank() - end, + callback = function() vim.hl.on_yank() end, }) -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index b59d08649af..ca684516003 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -12,7 +12,7 @@ local check_version = function() return end - if vim.version.ge(vim.version(), '0.10-dev') then + if vim.version.ge(vim.version(), '0.11') then vim.health.ok(string.format("Neovim version is: '%s'", verstr)) else vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) diff --git a/lua/kickstart/plugins/blink-cmp.lua b/lua/kickstart/plugins/blink-cmp.lua index 4ddf25cd815..d893d4ad672 100644 --- a/lua/kickstart/plugins/blink-cmp.lua +++ b/lua/kickstart/plugins/blink-cmp.lua @@ -9,15 +9,12 @@ return { 'L3MON4D3/LuaSnip', version = '2.*', build = (function() - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end return 'make install_jsregexp' end)(), dependencies = {}, opts = {}, }, - 'folke/lazydev.nvim', -- Copilot backend (Lua) -- disable inline/panel; we'll use Blink only { @@ -44,10 +41,8 @@ return { sources = { -- add "copilot" to the default sources - default = { 'lsp', 'path', 'snippets', 'lazydev', 'copilot' }, + default = { 'lsp', 'path', 'snippets', 'copilot' }, providers = { - lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, - -- define the Copilot provider for Blink copilot = { name = 'copilot', @@ -67,7 +62,6 @@ return { }, }, }, - snippets = { preset = 'luasnip' }, fuzzy = { implementation = 'lua' }, signature = { enabled = true }, diff --git a/lua/kickstart/plugins/conform.lua b/lua/kickstart/plugins/conform.lua index 6b883334dec..7570f59227a 100644 --- a/lua/kickstart/plugins/conform.lua +++ b/lua/kickstart/plugins/conform.lua @@ -6,9 +6,7 @@ return { keys = { { 'f', - function() - require('conform').format { async = true, lsp_format = 'fallback' } - end, + function() require('conform').format { async = true, lsp_format = 'fallback' } end, mode = '', desc = '[F]ormat buffer', }, diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 8e332bf2ff9..1e3570f9bf3 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -28,52 +28,38 @@ return { -- Basic debugging keymaps, feel free to change to your liking! { '', - function() - require('dap').continue() - end, + function() require('dap').continue() end, desc = 'Debug: Start/Continue', }, { '', - function() - require('dap').step_into() - end, + function() require('dap').step_into() end, desc = 'Debug: Step Into', }, { '', - function() - require('dap').step_over() - end, + function() require('dap').step_over() end, desc = 'Debug: Step Over', }, { '', - function() - require('dap').step_out() - end, + function() require('dap').step_out() end, desc = 'Debug: Step Out', }, { 'b', - function() - require('dap').toggle_breakpoint() - end, + function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint', }, { 'B', - function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, + function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, desc = 'Debug: Set Breakpoint', }, -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. { '', - function() - require('dapui').toggle() - end, + function() require('dapui').toggle() end, desc = 'Debug: See last session result.', }, }, diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 2d00963c97b..6283887dc7e 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -53,12 +53,8 @@ return { -- 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' }) + 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' }) @@ -68,9 +64,7 @@ return { 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' }) + 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' }) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index dec42f097c6..f8a73485ea5 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -50,9 +50,7 @@ return { -- Only run the linter in buffers that you can modify in order to -- avoid superfluous noise, notably within the handy LSP pop-ups that -- describe the hovered symbol using Markdown. - if vim.bo.modifiable then - lint.try_lint() - end + if vim.bo.modifiable then lint.try_lint() end end, }) end, diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 35df6132767..23a214f7bf3 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -1,17 +1,5 @@ -- LSP Plugins return { - { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, - }, - }, - }, { -- Main LSP Configuration 'neovim/nvim-lspconfig', @@ -20,7 +8,7 @@ return { -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` { 'mason-org/mason.nvim', opts = {} }, - 'mason-org/mason-lspconfig.nvim', + { 'mason-org/mason-lspconfig.nvim', opts = {} }, 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. @@ -80,55 +68,17 @@ return { -- or a suggestion from your LSP for this to activate. map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - -- Find references for the word under your cursor. - map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - - -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) - ---@param client vim.lsp.Client - ---@param method vim.lsp.protocol.Method - ---@param bufnr? integer some lsp support methods only in specific files - ---@return boolean - local function client_supports_method(client, method, bufnr) - if vim.fn.has 'nvim-0.11' == 1 then - return client:supports_method(method, bufnr) - else - return client.supports_method(method, { bufnr = bufnr }) - end - end - -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + if client and client:supports_method('textDocument/documentHighlight', event.buf) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -155,43 +105,12 @@ return { -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then - map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) - end, '[T]oggle Inlay [H]ints') + if client and client:supports_method('textDocument/inlayHint', event.buf) then + map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end end, }) - -- Diagnostic Config - -- See :help vim.diagnostic.Opts - vim.diagnostic.config { - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, - signs = vim.g.have_nerd_font and { - text = { - [vim.diagnostic.severity.ERROR] = '󰅚 ', - [vim.diagnostic.severity.WARN] = '󰀪 ', - [vim.diagnostic.severity.INFO] = '󰋽 ', - [vim.diagnostic.severity.HINT] = '󰌶 ', - }, - } or {}, - virtual_text = { - source = 'if_many', - spacing = 2, - format = function(diagnostic) - local diagnostic_message = { - [vim.diagnostic.severity.ERROR] = diagnostic.message, - [vim.diagnostic.severity.WARN] = diagnostic.message, - [vim.diagnostic.severity.INFO] = diagnostic.message, - [vim.diagnostic.severity.HINT] = diagnostic.message, - } - return diagnostic_message[diagnostic.severity] - end, - }, - } - -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. @@ -201,16 +120,10 @@ return { -- 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. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + -- See `:help lsp-config` for information about keys and how to configure local servers = { biome = {}, clangd = {}, - helm_ls = {}, -- this is extracted from vscode i cant find a way to deactivete the format on save -- jsonls = { -- capabilities = { @@ -219,9 +132,6 @@ return { -- }, -- }, -- }, - cssls = {}, - eslint = {}, - bashls = {}, -- deno = {}, vtsls = { javascript = { @@ -231,23 +141,6 @@ return { }, }, }, - nginx_language_server = {}, - gitlab_ci_ls = {}, - lua_ls = { - -- cmd = { ... }, - -- filetypes = { ... }, - -- capabilities = {}, - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, - }, - dockerls = {}, } -- Ensure the servers and tools above are installed @@ -258,31 +151,59 @@ return { -- -- You can press `g?` for help in this menu. -- - -- `mason` had to be setup earlier: to configure its options see the - -- `dependencies` table for `nvim-lspconfig` above. - -- - -- You can add other tools here that you want Mason to install - -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { + -- 'lua-language-server', + 'lua_ls', -- Lua Language server 'stylua', -- Used to format Lua code + -- You can add other tools here that you want Mason to install + 'helm-ls', + 'dockerls', + hls = { + filetypes = { 'haskell', 'lhaskell', 'cabal' }, + }, + 'eslint', + 'cssls', + 'bashls', + 'gitlab_ci_ls', + 'nginx_language_server', }) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } - require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) - automatic_installation = false, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for ts_ls) - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) - end, + for name, server in pairs(servers) do + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + vim.lsp.config(name, server) + vim.lsp.enable(name) + end + + -- Special Lua Config, as recommended by neovim help docs + vim.lsp.config('lua_ls', { + on_init = function(client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { 'lua/?.lua', 'lua/?/init.lua' }, + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + -- NOTE: this is a lot slower and will cause issues when working on your own configuration. + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + library = vim.api.nvim_get_runtime_file('', true), + }, + }) + end, + settings = { + Lua = {}, }, - } + }) + vim.lsp.enable 'lua_ls' end, }, } diff --git a/lua/kickstart/plugins/mini.lua b/lua/kickstart/plugins/mini.lua index 3a9bdc30813..98f2e649467 100644 --- a/lua/kickstart/plugins/mini.lua +++ b/lua/kickstart/plugins/mini.lua @@ -1,6 +1,6 @@ return { { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', + 'nvim-mini/mini.nvim', config = function() -- Better Around/Inside textobjects -- @@ -28,12 +28,10 @@ return { -- default behavior. For example, here we set the section for -- cursor location to LINE:COLUMN ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + statusline.section_location = function() return '%2l:%-2v' end -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim + -- Check out: https://github.com/nvim-mini/mini.nvim end, }, } diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index 388b255a21b..0d60992e7e9 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -1,6 +1,16 @@ return { { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', + -- By default, Telescope is included and acts as your picker for everything. + + -- 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 + -- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks') + + -- Note: If you customize your config for yourself, + -- it’s best to remove the Telescope plugin config entirely + -- instead of just disabling it here, to keep your config clean. + enabled = true, event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim', @@ -13,9 +23,7 @@ return { -- `cond` is a condition used to determine whether this plugin should be -- installed and loaded. - cond = function() - return vim.fn.executable 'make' == 1 - end, + cond = function() return vim.fn.executable 'make' == 1 end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, @@ -59,9 +67,7 @@ return { }, }, extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, + ['ui-select'] = { require('telescope.themes').get_dropdown() }, }, } @@ -75,14 +81,49 @@ return { vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set({ 'n', 'v' }, 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - -- Slightly advanced example of overriding default behavior and theme + -- This runs on LSP attach per buffer (see main LSP attach function in 'neovim/nvim-lspconfig' config for more info, + -- it is better explained there). This allows easily switching between pickers if you prefer using something else! + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), + callback = function(event) + local buf = event.buf + + -- Find references for the word under your cursor. + vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) + end, + }) + + -- Override default behavior and theme when searching vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { @@ -93,17 +134,20 @@ return { -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[S]earch [/] in Open Files' }) + vim.keymap.set( + 'n', + 's/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + { desc = '[S]earch [/] in Open Files' } + ) -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) + vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) end, }, } diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index b026245adf3..df8f4f925c9 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -1,28 +1,14 @@ return { { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - main = 'nvim-treesitter.configs', -- Sets main module to use for opts - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects + config = function() + local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + require('nvim-treesitter').install(filetypes) + vim.api.nvim_create_autocmd('FileType', { + pattern = filetypes, + callback = function() vim.treesitter.start() end, + }) + end, }, } -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index 82eb4adb5b4..1dff1622ac2 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -20,46 +20,11 @@ return { -- delay between pressing a key and opening which-key (milliseconds) -- this setting is independent of vim.o.timeoutlen delay = 0, - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, - }, + icons = { mappings = vim.g.have_nerd_font }, -- Document existing key chains spec = { - { 's', group = '[S]earch' }, + { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, diff --git a/lua/lazy-bootstrap.lua b/lua/lazy-bootstrap.lua index 867cc4eff48..2d7c907ba1b 100644 --- a/lua/lazy-bootstrap.lua +++ b/lua/lazy-bootstrap.lua @@ -4,9 +4,7 @@ local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' 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 + if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end end ---@type vim.Option diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 5d58ec1da7a..6ed6a27fdbf 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -10,15 +10,8 @@ -- -- NOTE: Here is where you install your plugins. require('lazy').setup({ - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically - - -- NOTE: Plugins can also be added by using a table, - -- with the first argument being the link and the following - -- keys can be used to configure plugin behavior/loading/etc. - -- - -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. - -- + -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` + { 'NMAC427/guess-indent.nvim', opts = {} }, -- modular approach: using `require 'path.name'` will -- include a plugin definition from file lua/path/name.lua diff --git a/lua/options.lua b/lua/options.lua index c1a70a5453a..483212ec04e 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -19,9 +19,7 @@ vim.o.showmode = false -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = 'unnamedplus' -end) +vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) -- Enable break indent vim.o.breakindent = true @@ -53,7 +51,7 @@ vim.o.splitbelow = true -- 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-options-guide` +-- and `:help lua-guide-options` vim.o.list = true vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } 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 :