diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 4112b1c..9561d21 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -46,7 +46,7 @@ vim.keymap.set('n', 'cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D] vim.keymap.set({ 'n', 'v' }, 'go', ':Gito', { desc = '[G]it [O]pen' }) -- [[ Basic Autocommands ]] --- See :help lua-guide-autocommands +-- See `:help lua-guide-autocommands` -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index ee375bb..a230c89 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -6,15 +6,16 @@ --]] local check_version = function() + local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch) if not vim.version.cmp then - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version()))) + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) return end if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then - vim.health.ok(string.format("Neovim version is: '%s'", tostring(vim.version()))) + 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", tostring(vim.version()))) + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) end end diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index fedccd7..441ab6d 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -35,7 +35,7 @@ return { -- Neovim. This is where `mason` and related plugins come into play. -- -- If you're wondering about lsp vs treesitter, you can check out the wonderfully - -- and elegantly composed help section, :help lsp-vs-treesitter + -- and elegantly composed help section, `:help lsp-vs-treesitter` -- This function gets run when an LSP attaches to a particular buffer. -- That is to say, every time a new file is opened that is associated with @@ -165,6 +165,9 @@ return { -- library = { vim.env.VIMRUNTIME }, }, telemetry = { enable = false }, + completion = { + callSnippet = 'Replace', + }, -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings -- diagnostics = { disable = { 'missing-fields' } }, }, @@ -196,15 +199,11 @@ return { handlers = { function(server_name) local server = servers[server_name] or {} - require('lspconfig')[server_name].setup { - cmd = server.cmd, - settings = server.settings, - filetypes = server.filetypes, - -- 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 tsserver) - capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities 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 tsserver) + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) end, }, } diff --git a/lua/kickstart/plugins/mini.lua b/lua/kickstart/plugins/mini.lua index 87a312a..94de556 100644 --- a/lua/kickstart/plugins/mini.lua +++ b/lua/kickstart/plugins/mini.lua @@ -5,7 +5,7 @@ return { -- Better Around/Inside textobjects -- -- Examples: - -- - va) - [V]isually select [A]round [)]parenthen + -- - va) - [V]isually select [A]round [)]paren -- - yinq - [Y]ank [I]nside [N]ext [']quote -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { n_lines = 500 } @@ -20,8 +20,14 @@ return { -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - require('mini.statusline').setup() - MiniStatusline.section_location = function() + local statusline = require 'mini.statusline' + statusline.setup() + + -- You can configure sections in the statusline by overriding their + -- 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 diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index 9e1c8dc..c8d2ff8 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -8,7 +8,7 @@ return { { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', - event = 'VeryLazy', + event = 'VimEnter', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', diff --git a/lua/kickstart/plugins/todo-comments.lua b/lua/kickstart/plugins/todo-comments.lua index c4c7764..407e821 100644 --- a/lua/kickstart/plugins/todo-comments.lua +++ b/lua/kickstart/plugins/todo-comments.lua @@ -1,5 +1,5 @@ -- Highlight todo, notes, etc in comments return { - { 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, + { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, } -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index 9118f1e..dbd30e8 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -73,6 +73,11 @@ return { }, }, } + + -- 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` end, }, } diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index 38a1337..a0e9d82 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -4,10 +4,10 @@ -- lazy loading plugins that don't need to be loaded immediately at startup. -- -- For example, in the following configuration, we use: --- event = 'VeryLazy' +-- event = 'VimEnter' -- --- which loads which-key after all the UI elements are loaded. Events can be --- normal autocommands events (:help autocomd-events). +-- which loads which-key before all the UI elements are loaded. Events can be +-- normal autocommands events (`:help autocmd-events`). -- -- Then, because we use the `config` key, the configuration only runs -- after the plugin has been loaded: @@ -16,7 +16,7 @@ return { { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', - event = 'VeryLazy', -- Sets the loading event to 'VeryLazy' + event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading require('which-key').setup() diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 665e7c2..69adc1d 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -10,7 +10,6 @@ -- -- NOTE: Here is where you install your plugins. require('lazy').setup { - -- [[ Plugin Specs list ]] -- NOTE: First, some plugins that don't require any configuration @@ -81,7 +80,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. - -- For additional information see: :help lazy.nvim-lazy.nvim-structuring-your-plugins + -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` { import = 'custom.plugins' }, } diff --git a/lua/options.lua b/lua/options.lua index 8149d80..e103e56 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -62,8 +62,8 @@ vim.opt.splitright = true vim.opt.splitbelow = true -- Sets how neovim will display certain whitespace in the editor. --- See :help 'list' --- and :help 'listchars' +-- See `:help 'list'` +-- and `:help 'listchars'` vim.opt.list = true vim.opt.listchars = { tab = 'ยป ',