From b58666dd15fa9abd40c53b4e6b7a1e1c6e586dcb Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Thu, 29 Feb 2024 12:08:01 -0500 Subject: [PATCH 01/22] fixup: updated some style stuff --- init.lua | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 89da77b..c81ae2e 100644 --- a/init.lua +++ b/init.lua @@ -219,9 +219,6 @@ vim.opt.rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup { - - -- [[ Plugin Specs list ]] - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically @@ -592,15 +589,11 @@ require('lazy').setup { 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, }, } @@ -761,9 +754,15 @@ require('lazy').setup { -- 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() - return '%2l:%-2v' + local statusline = require 'mini.statusline' + statusline.setup() + + -- You can confiure sections in the statusline by overriding their + -- default behavior. For example, here we disable the section for + -- cursor information because line numbers are already enabled + ---@diagnostic disable-next-line: duplicate-set-field + statusline.section_location = function() + return '' end -- ... and there is more! From 38828dcaf7c140902fedeaa75b017bf968400bb0 Mon Sep 17 00:00:00 2001 From: Anton Kastritskii Date: Thu, 29 Feb 2024 18:14:36 +0000 Subject: [PATCH 02/22] feat: enable lua lsp snipppets (#660) --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index c81ae2e..9146b5f 100644 --- a/init.lua +++ b/init.lua @@ -562,6 +562,9 @@ require('lazy').setup { -- If lua_ls is really slow on your computer, you can try this instead: -- library = { vim.env.VIMRUNTIME }, }, + completion = { + callSnippet = 'Replace', + }, -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings -- diagnostics = { disable = { 'missing-fields' } }, }, From 94a93643ab76f92435de2db21a41f6476894f8b3 Mon Sep 17 00:00:00 2001 From: Nhan Luu <62146587+nhld@users.noreply.github.com> Date: Sat, 2 Mar 2024 04:07:34 +0700 Subject: [PATCH 03/22] chore: fix typos (#666) --- init.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 9146b5f..3f53732 100644 --- a/init.lua +++ b/init.lua @@ -134,8 +134,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 = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } @@ -185,7 +185,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the lower win vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- [[ Basic Autocommands ]] --- See :help lua-guide-autocommands +-- See `:help lua-guide-autocommands` -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode @@ -261,7 +261,7 @@ require('lazy').setup { -- event = 'VeryLazy' -- -- which loads which-key after all the UI elements are loaded. Events can be - -- normal autocommands events (:help autocomd-events). + -- normal autocommands events (`:help autocmd-events`). -- -- Then, because we use the `config` key, the configuration only runs -- after the plugin has been loaded: @@ -434,7 +434,7 @@ require('lazy').setup { -- 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 @@ -742,7 +742,7 @@ require('lazy').setup { -- 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 } @@ -760,7 +760,7 @@ require('lazy').setup { local statusline = require 'mini.statusline' statusline.setup() - -- You can confiure sections in the statusline by overriding their + -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we disable the section for -- cursor information because line numbers are already enabled ---@diagnostic disable-next-line: duplicate-set-field @@ -791,7 +791,7 @@ require('lazy').setup { -- 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 + -- - 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 end, @@ -813,7 +813,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' }, } From b99af2d6a361e7332cfd3efb7aa5396d2338e289 Mon Sep 17 00:00:00 2001 From: Taulant Aliraj Date: Sun, 3 Mar 2024 02:07:58 +0000 Subject: [PATCH 04/22] feat: use VimEnter event instead of VeryLazy (#673) --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 3f53732..292ec07 100644 --- a/init.lua +++ b/init.lua @@ -258,9 +258,9 @@ require('lazy').setup { -- 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 + -- 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 @@ -269,7 +269,7 @@ require('lazy').setup { { -- 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() @@ -293,7 +293,7 @@ require('lazy').setup { { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', - event = 'VeryLazy', + event = 'VimEnter', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', @@ -734,7 +734,7 @@ require('lazy').setup { }, -- Highlight todo, notes, etc in comments - { '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 } }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', From 23fc4e59dc54dc22f2372cd9a2e4c76ba335f9a1 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 3 Mar 2024 03:12:55 +0100 Subject: [PATCH 05/22] README.md: updated windows install instructions (#674) --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index c9b9d84..0f6911c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ Neovim's configurations are located under the following paths, depending on your | Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | | Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | +### Install Kickstart + Clone kickstart.nvim:
Linux and Mac @@ -192,3 +194,23 @@ This requires: ```lua {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } ``` + +Alternatively one can install gcc and make which don't require changing the config, +the easiest way is to use choco: + +1. install [chocolatey](https://chocolatey.org/install) +either follow the instructions on the page or use winget, +run in cmd as **admin**: +``` +winget install --accept-source-agreements chocolatey.chocolatey +``` + +2. install all requirements using choco, exit previous cmd and +open a new one so that choco path is set, run in cmd as **admin**: +``` +choco install -y neovim git ripgrep wget fd unzip gzip mingw make +``` + +Then continue with the [Install Kickstart](#Install-Kickstart) step. + + From e6710a461ab08513af80c213929ff64e75b5e456 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Sun, 3 Mar 2024 03:13:16 -0500 Subject: [PATCH 06/22] fix: add note in readme for custom plugins --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0f6911c..b6d19f4 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,8 @@ can install to your machine using the methods above. #### Examples of adding popularly requested plugins +NOTE: You'll need to uncomment the line in the init.lua that turns on loading custom plugins. +
Adding autopairs From c9122e89e3c2e19cd784642a1d0cddae258d0672 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Mar 2024 01:32:06 +0100 Subject: [PATCH 07/22] fix: checkhealth reported nvim version (#685) --- lua/kickstart/health.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index 957204e..04df77b 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 From c3127f1226df227e436a62105a1e33ea052f5e56 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Mar 2024 14:16:50 +0100 Subject: [PATCH 08/22] Change statusline location to LINE:COLUMN (#689) --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 292ec07..16d3c26 100644 --- a/init.lua +++ b/init.lua @@ -761,11 +761,11 @@ require('lazy').setup { statusline.setup() -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we disable the section for - -- cursor information because line numbers are already enabled + -- 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 '' + return '%2l:%-2v' end -- ... and there is more! From a02abdb161bb1db4864254245a27e7d153b41efb Mon Sep 17 00:00:00 2001 From: Chiller Dragon Date: Mon, 4 Mar 2024 21:47:11 +0800 Subject: [PATCH 09/22] chore: remove trailing spaces from readme (#679) --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b6d19f4..82eeceb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you are experiencing issues, please make sure you have the latest versions. ### Install External Dependencies -> **NOTE** +> **NOTE** > [Backup](#FAQ) your previous configuration (if any exists) External Requirements: @@ -60,13 +60,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ ```
@@ -97,7 +97,7 @@ install instructions in this file instead. An updated video is coming soon. (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** +> **NOTE** > Your fork's url will be something like this: `https://github.com//kickstart.nvim.git` #### Examples of adding popularly requested plugins @@ -214,5 +214,3 @@ choco install -y neovim git ripgrep wget fd unzip gzip mingw make ``` Then continue with the [Install Kickstart](#Install-Kickstart) step. - - From b83b2b061c1fab0e1a3a28c185345be7957e74cd Mon Sep 17 00:00:00 2001 From: Chiller Dragon Date: Mon, 4 Mar 2024 21:47:45 +0800 Subject: [PATCH 10/22] chore: link new installation youtube video (#678) --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 82eeceb..c44d5f9 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,7 @@ information about extending and exploring Neovim. ### Getting Started -See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the -previous version. Note: The install via init.lua is outdated, please follow the -install instructions in this file instead. An updated video is coming soon. +[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) ### Recommended Steps From f764b7bacd54a59cf51ab0e2c8e1d397ec5ae174 Mon Sep 17 00:00:00 2001 From: Ryan Winchester Date: Tue, 5 Mar 2024 21:19:06 -0400 Subject: [PATCH 11/22] Add more detail to colorscheme comment (#713) --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 16d3c26..e8c8693 100644 --- a/init.lua +++ b/init.lua @@ -725,7 +725,9 @@ require('lazy').setup { lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() - -- Load the colorscheme here + -- Load the colorscheme here. + -- Like many other themes, this one has different styles, and you could load + -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. vim.cmd.colorscheme 'tokyonight-night' -- You can configure highlights by doing something like From 0d927e25aef490e814a187ed5f45fc2f8c41cc0e Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 6 Mar 2024 07:54:21 +0100 Subject: [PATCH 12/22] use choco installation, native make, mingw and unzip configuration --- lua/kickstart/health.lua | 2 +- lua/kickstart/plugins/cmp.lua | 4 ++-- lua/kickstart/plugins/telescope.lua | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index a230c89..04df77b 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -21,7 +21,7 @@ end local check_external_reqs = function() -- Basic utils: `git`, `make`, `unzip` - for _, exe in ipairs { 'git', 'cmake', 'rg' } do + for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do local is_executable = vim.fn.executable(exe) == 1 if is_executable then vim.health.ok(string.format("Found executable: '%s'", exe)) diff --git a/lua/kickstart/plugins/cmp.lua b/lua/kickstart/plugins/cmp.lua index 10433a8..e3c26f1 100644 --- a/lua/kickstart/plugins/cmp.lua +++ b/lua/kickstart/plugins/cmp.lua @@ -10,10 +10,10 @@ return { -- 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 'cmake' == 0 then + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end - return 'cmake install_jsregexp' + return 'make install_jsregexp' end)(), }, 'saadparwaiz1/cmp_luasnip', diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua index c8d2ff8..139baec 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/kickstart/plugins/telescope.lua @@ -17,12 +17,12 @@ return { -- `build` is used to run some command when the plugin is installed/updated. -- This is only run then, not every time Neovim starts up. - build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release; cmake --build build --config Release; cmake --install build --prefix build', + build = 'make', -- `cond` is a condition used to determine whether this plugin should be -- installed and loaded. cond = function() - return vim.fn.executable 'cmake' == 1 + return vim.fn.executable 'make' == 1 end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, From 24d1fe2e59375f7ffae66801e7abab02a8a84935 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 6 Mar 2024 07:55:22 +0100 Subject: [PATCH 13/22] update README, denote windows-choco installation, include other systems --- README.md | 130 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index a5f29f3..a0174b8 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,69 @@ +# nvim-config + ## Introduction -This project is a fork of [dam9000/kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim.git) +*This is a fork of [dam9000/kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) that represents my personal configuration of Neovim.* +## Installation -### Installation (Windows Only) +### Install Neovim + +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. + +### Install External Dependencies > **NOTE** > [Backup](#FAQ) your previous configuration (if any exists) -Neovim's configurations are located under the following path: +External Requirements: +- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) +- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) +- Language Setup: + - If want to write Typescript, you need `npm` + - If want to write Golang, you will need `go` + - etc. -| Shell | PATH | +> **NOTE** +> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes + +Neovim's configurations are located under the following paths, depending on your OS: + +| OS | PATH | | :- | :--- | -| cmd | `%userprofile%\AppData\Local\nvim\` | -| powershell | `$env:USERPROFILE\AppData\Local\nvim\` | +| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | +| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | -- Download and install: - - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) - - [MinGW](https://www.mingw-w64.org/) - > **NOTE** - > In this case, using [chocolatey](https://chocolatey.org/) is quick and easy - - [CMake](https://cmake.org/) - > **NOTE** - > Make sure to select 'add to PATH' during installation - - [MSBuild-Tools](https://github.com/bycloudai/InstallVSBuildToolsWindows) -- Clone this repository: - - on Windows (cmd) - ``` - git clone https://github.com/Baipyrus/nvim-config.git %userprofile%\AppData\Local\nvim\ - ``` +### Install this Configuration - - on Windows (powershell) - ``` - git clone https://github.com/Baipyrus/nvim-config.git $env:USERPROFILE\AppData\Local\nvim\ - ``` +Clone it from GitHub: +
Linux and Mac + +```sh +git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +``` + +
+ +
Windows + +If you're using `cmd.exe`: + +```bat +git clone https://github.com/Baipyrus/nvim-config.git %userprofile%\AppData\Local\nvim\ +``` + +If you're using `powershell.exe` + +```pwsh +git clone https://github.com/Baipyrus/nvim-config.git $env:USERPROFILE\AppData\Local\nvim\ +``` + +
### Post Installation @@ -44,32 +73,43 @@ Start Neovim nvim ``` -The `Lazy` plugin manager will start automatically on the first run and install the configured plugins. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up. - -If you would prefer to hide this step and run the plugin sync from the command line, you can use: - -```sh -nvim --headless "+Lazy! sync" +qa -``` - +That's it! Lazy will install all the plugins you have. Use `:Lazy` to view +current plugin status. ### FAQ * What should I do if I already have a pre-existing neovim configuration? * You should back it up, then delete all files associated with it. - * This includes your existing init.lua and the neovim files in `%userprofile%\AppData\Local\nvim-data\` (CMD) or `$env:USERPROFILE\AppData\Local\nvim-data\` (Powershell) which should be deleted afterwards. - * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) + * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` or their windows counterparts in `AppData\Local\nvim-data` +* Can I keep my existing configuration in parallel to kickstart? + * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias: + ```sh + alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' + ``` + When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`. + You could also run your configuration inline, for example in Windows Powershell: + ```pwsh + $env:NVIM_APPNAME = 'nvim-kickstart'; nvim + ``` * What if I want to "uninstall" this configuration: * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information -* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? - * 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.* - 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) +### Windows Installation + +Installation requires gcc and make, for which you don't need to change the config, +the easiest way is to use choco: + +1. install [chocolatey](https://chocolatey.org/install) +either follow the instructions on the page or use winget, +run in cmd as **admin**: +``` +winget install --accept-source-agreements chocolatey.chocolatey +``` + +2. install all requirements using choco, exit previous cmd and +open a new one so that choco path is set, run in cmd as **admin**: +``` +choco install -y neovim git ripgrep wget fd unzip gzip mingw make +``` + +Then continue with the [Install Kickstart](#Install-this-Configuration) step. From 66e2a5a425a4f3b2e4f9456d82b29718c24a8993 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Wed, 6 Mar 2024 17:49:44 +0100 Subject: [PATCH 14/22] Make the Nerd Font an optional requirement (#716) --- README.md | 2 ++ init.lua | 36 +++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c44d5f9..6d48c18 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ If you are experiencing issues, please make sure you have the latest versions. External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) +- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons + - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: - If want to write Typescript, you need `npm` - If want to write Golang, you will need `go` diff --git a/init.lua b/init.lua index e8c8693..3bdb5e3 100644 --- a/init.lua +++ b/init.lua @@ -90,6 +90,9 @@ P.S. You can delete this when you're done too. It's your config now! :) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' +-- Set to true if you have a Nerd Font installed +vim.g.have_nerd_font = false + -- [[ Setting options ]] -- See `:help vim.opt` -- NOTE: You can change these options as you wish! @@ -218,7 +221,7 @@ vim.opt.rtp:prepend(lazypath) -- :Lazy update -- -- NOTE: Here is where you install your plugins. -require('lazy').setup { +require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically @@ -312,10 +315,8 @@ require('lazy').setup { }, { 'nvim-telescope/telescope-ui-select.nvim' }, - -- Useful for getting pretty icons, but requires special font. - -- If you already have a Nerd Font, or terminal set up with fallback fonts - -- you can enable this - -- { 'nvim-tree/nvim-web-devicons' } + -- Useful for getting pretty icons, but requires a Nerd Font. + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -760,7 +761,8 @@ require('lazy').setup { -- You could remove this setup call if you don't like it, -- and try some other statusline plugin local statusline = require 'mini.statusline' - statusline.setup() + -- set use_icons to true if you have a Nerd Font + statusline.setup { use_icons = vim.g.have_nerd_font } -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we set the section for @@ -817,7 +819,27 @@ require('lazy').setup { -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- { import = 'custom.plugins' }, -} +}, { + ui = { + -- If you have a Nerd Font, set icons to an empty table which will use the + -- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table + icons = vim.g.have_nerd_font and {} or { + cmd = 'โŒ˜', + config = '๐Ÿ› ', + event = '๐Ÿ“…', + ft = '๐Ÿ“‚', + init = 'โš™', + keys = '๐Ÿ—', + plugin = '๐Ÿ”Œ', + runtime = '๐Ÿ’ป', + require = '๐ŸŒ™', + source = '๐Ÿ“„', + start = '๐Ÿš€', + task = '๐Ÿ“Œ', + lazy = '๐Ÿ’ค ', + }, + }, +}) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 0a21a56a34a5bd4a51b9aaf8c2b092ea10a45e8c Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 12:50:03 +0100 Subject: [PATCH 15/22] treesitter: incremental selection already enabled --- lua/kickstart/plugins/treesitter.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index dbd30e8..9118f1e 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -73,11 +73,6 @@ 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, }, } From 6c52d13b7464bcd216f47f511d0554be732049b8 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 12:50:18 +0100 Subject: [PATCH 16/22] treesitter: auto (closing) tag --- lua/kickstart/plugins/treesitter.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index 9118f1e..0798fe4 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -3,6 +3,7 @@ return { { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', dependencies = { + 'windwp/nvim-ts-autotag', 'nvim-treesitter/nvim-treesitter-context', 'nvim-treesitter/nvim-treesitter-textobjects', }, @@ -15,6 +16,11 @@ return { ensure_installed = { 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'vim', 'svelte', 'c_sharp' }, -- Autoinstall languages that are not installed auto_install = false, + -- Enable autotags and -rename + autotag = { + enable = true, + enable_autocmd = true, + }, -- Install languages synchronously (only applied to `ensure_installed`) sync_install = false, highlight = { enable = true }, From 758893b0601c9f713ed3da45a0ab8d52938d489a Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 12:50:37 +0100 Subject: [PATCH 17/22] add horizontal scrolloff option --- lua/options.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/options.lua b/lua/options.lua index e103e56..e70dd0d 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -77,7 +77,8 @@ vim.opt.inccommand = 'split' -- Show which line your cursor is on vim.opt.cursorline = true --- Minimal number of screen lines to keep above and below the cursor. +-- Minimal spacing to keep around the cursor. vim.opt.scrolloff = 8 +vim.opt.sidescrolloff = 12 -- vim: ts=2 sts=2 sw=2 et From b74dc3c0bebec8dcb3c0cfa7e44a8af124968c8b Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 12:50:51 +0100 Subject: [PATCH 18/22] install neoscroll.nvim for smooth scrolling and additional keymaps --- lua/lazy-plugins.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 69adc1d..80f8a6b 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -23,6 +23,34 @@ require('lazy').setup { 'tpope/vim-fugitive', 'tpope/vim-rhubarb', + -- Smooth scroll plugin and keymaps + { + 'karb94/neoscroll.nvim', + config = function() + require('neoscroll').setup { + hide_cursor = false, + easing_function = nil, + respect_scrolloff = true, + } + + require('neoscroll.config').set_mappings { + -- Scroll normally + [''] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } }, + [''] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } }, + -- Scroll entire page height + [''] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } }, + [''] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } }, + -- Scroll 10% at a time + [''] = { 'scroll', { '-0.10', 'false', '25' } }, + [''] = { 'scroll', { '0.10', 'false', '25' } }, + -- Jump to top, bottom and center + ['zt'] = { 'zt', { '40' } }, + ['zz'] = { 'zz', { '50' } }, + ['zb'] = { 'zb', { '40' } }, + } + end, + }, + -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically From 4590c8b423f4f64b2fab8389938e33e791c83f82 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 14:17:22 +0100 Subject: [PATCH 19/22] simple exit terminal description --- lua/keymaps.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 9561d21..069771f 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -12,11 +12,6 @@ vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagn 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 --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- Disable arrow keys in normal mode From aa9dea494a983f80db5693b540d0d53217763df1 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 14:17:46 +0100 Subject: [PATCH 20/22] open terminal keymap --- lua/keymaps.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 069771f..cc61d76 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -14,6 +14,9 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) +-- Open terminal in current window +vim.keymap.set({ 'n', 'v' }, 'to', 'term', { desc = '[T]erminal [O]pen' }) + -- Disable arrow keys in normal mode vim.keymap.set({ 'n', 'v' }, '', 'echo "Use h to move!!"') vim.keymap.set({ 'n', 'v' }, '', 'echo "Use l to move!!"') From 8b16b56386dc2227ca89aebccac8cb17f6f923bb Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 14:19:29 +0100 Subject: [PATCH 21/22] [g]it [s]tatus keymap, use current window --- lua/keymaps.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index cc61d76..7658267 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -40,8 +40,8 @@ vim.keymap.set('v', 'pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' }) -- Populate CMD to prepare for change directory vim.keymap.set('n', 'cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' }) --- Open git window from fugitive in full screen -vim.keymap.set({ 'n', 'v' }, 'go', ':Gito', { desc = '[G]it [O]pen' }) +-- Switch in fugitive.vim status window with the current one +vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` From 5a074e6f82255374f5e62542be96f05cdfec4358 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 7 Mar 2024 14:37:23 +0100 Subject: [PATCH 22/22] use nerd font by default --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b93bfdd..3ed4ea3 100644 --- a/init.lua +++ b/init.lua @@ -4,7 +4,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] require 'options'