From c73aefcb210125677aea9e62366c24beb0211b79 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Sat, 17 Dec 2022 21:40:20 -0500 Subject: [PATCH 1/9] Closes #46 --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index d35ebf7c..52a0b98c 100644 --- a/init.lua +++ b/init.lua @@ -57,7 +57,7 @@ require('packer').startup(function(use) -- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable 'make' == 1 } - -- Add custom plugins to packer from /nvim/lua/custom/plugins.lua + -- Add custom plugins to packer from ~/.config/nvim/lua/custom/plugins.lua local has_plugins, plugins = pcall(require, 'custom.plugins') if has_plugins then plugins(use) From f218bcd6fe9c1e4aeb209dd4035a4d9341aac161 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 19 Dec 2022 17:56:21 -0500 Subject: [PATCH 2/9] note: tell people to remove languages they arent going to use --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 931348dd..c7e8b2cb 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ This repo is meant to be used as a starting point for a user's own configuration * Start Neovim (`nvim`) and run `:PackerInstall` - ignore any error message about missing plugins, `:PackerInstall` will fix that shortly * Restart Neovim +If there are languages that you don't want to use, remove their configuration and notes from your `init.lua` after copy and pasting (for example, in the mason configuration). + ### Configuration You could directly modify the `init.lua` file with your personal customizations. This option is the most straightforward, but if you update your config from this repo, you may need to reapply your changes. From 99df0d8f66ac499e949109883792ddb22ddba025 Mon Sep 17 00:00:00 2001 From: Debashis Biswas <37234687+debashisbiswas@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:57:28 -0700 Subject: [PATCH 3/9] Fix error on Windows when space in install path (#64) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 52a0b98c..961eb784 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nv local is_bootstrap = false if vim.fn.empty(vim.fn.glob(install_path)) > 0 then is_bootstrap = true - vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) + vim.fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) vim.cmd [[packadd packer.nvim]] end From d37a3a946288c97e52e3d82e8a710c099eb6bd90 Mon Sep 17 00:00:00 2001 From: Nicolas Gryman Date: Tue, 20 Dec 2022 00:01:33 +0100 Subject: [PATCH 4/9] fix: don't check third party for Lua LSP (#57) * fix: don't check third party for Lua LSP Co-authored-by: Sean <44933921+seantwie03@users.noreply.github.com> Co-authored-by: TJ DeVries Co-authored-by: Sean <44933921+seantwie03@users.noreply.github.com> --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 961eb784..167114ca 100644 --- a/init.lua +++ b/init.lua @@ -379,7 +379,10 @@ require('lspconfig').sumneko_lua.setup { diagnostics = { globals = { 'vim' }, }, - workspace = { library = vim.api.nvim_get_runtime_file('', true) }, + workspace = { + library = vim.api.nvim_get_runtime_file('', true), + checkThirdParty = false, + }, -- Do not send telemetry data containing a randomized but unique identifier telemetry = { enable = false }, }, From 6dccf03fd23e708549139204bfe3cbfc5bf0ea7d Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 19 Dec 2022 21:29:52 -0500 Subject: [PATCH 5/9] Update issue templates (#72) --- .github/ISSUE_TEMPLATE/bug_report.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..6999d51e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. ... + +**Desktop (please complete the following information):** +- OS: +- Terminal: + +** Neovim Version ** + - Output of running `:version` from inside of neovim: + +``` +``` From bec74101277a56b2b890f0020c29037fd7d045a7 Mon Sep 17 00:00:00 2001 From: Matthias Debernardini <32387851+matthiasdebernardini@users.noreply.github.com> Date: Tue, 20 Dec 2022 19:27:01 +0100 Subject: [PATCH 6/9] Update intstructions for existing nvim setups (#65) * Update intstructions for existing nvim setups If you already had a nvim setup, then this makes it so that the kickstarter can work without a problem. Having that file exist and loaded with plugins gives the script many issues. Also better to have it be a shell command rather than have the script delete a bunch of files on your computer. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index c7e8b2cb..f7a6b764 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This repo is meant to be used as a starting point for a user's own configuration * Start Neovim (`nvim`) and run `:PackerInstall` - ignore any error message about missing plugins, `:PackerInstall` will fix that shortly * Restart Neovim + If there are languages that you don't want to use, remove their configuration and notes from your `init.lua` after copy and pasting (for example, in the mason configuration). ### Configuration @@ -60,3 +61,9 @@ Pull-requests are welcome. The goal of this repo is not to create a Neovim confi * Lazy-loading. Kickstart.nvim should start within 40 ms on modern hardware. Please profile and contribute to upstream plugins to optimize startup time instead. Each PR, especially those which increase the line count, should have a description as to why the PR is necessary. + +### 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 .local which can be deleted with `rm -rf ~/.local/share/nvim/` + From aa660e64cea945e7ee4b0ede2475e1ac49e1f592 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 20 Dec 2022 16:03:05 -0500 Subject: [PATCH 7/9] remove python indent: closes #78 --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 167114ca..fb7c0972 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nv local is_bootstrap = false if vim.fn.empty(vim.fn.glob(install_path)) > 0 then is_bootstrap = true - vim.fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path } vim.cmd [[packadd packer.nvim]] end @@ -221,7 +221,7 @@ require('nvim-treesitter.configs').setup { ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help' }, highlight = { enable = true }, - indent = { enable = true }, + indent = { enable = true, disable = { 'python' } }, incremental_selection = { enable = true, keymaps = { From 521940693e10eee57f4e67dce960d2229c1441d3 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 20 Dec 2022 22:12:39 -0500 Subject: [PATCH 8/9] move server config to easy to extend style (#71) Move servers to new configuration style. I will probably cover this in a new shorter video, or maybe in combination with something else. This should hopefully remove getting so many people making issues about LSPs that they don't want to. I can update documentation if what is happening is not clear. --- .gitignore | 1 + README.md | 5 +-- init.lua | 98 +++++++++++++++++++++++++----------------------------- 3 files changed, 49 insertions(+), 55 deletions(-) diff --git a/.gitignore b/.gitignore index d699e1d6..1b83131b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ tags test.sh .luarc.json nvim +plugin/packer_compiled.lua diff --git a/README.md b/README.md index f7a6b764..b4240858 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ 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. -This repo is meant to be used as a starting point for a user's own configuration; remove the things you don't use and add what you miss. This configuration serves as the reference configuration for the [lspconfig wiki](https://github.com/neovim/nvim-lspconfig/wiki). +This repo is meant to be used as a starting point for a user's own configuration; remove the things you don't use and add what you miss. Please refrain from leaving comments about enabling / disabling particular languages out of the box. ### Installation @@ -65,5 +65,6 @@ Each PR, especially those which increase the line count, should have a descripti ### 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 .local which can be deleted with `rm -rf ~/.local/share/nvim/` + * You should back it up, then delete all files associated with it. + * This includes your existing init.lua and the neovim files in `.local` which can be deleted with `rm -rf ~/.local/share/nvim/` diff --git a/init.lua b/init.lua index fb7c0972..636d86af 100644 --- a/init.lua +++ b/init.lua @@ -20,6 +20,9 @@ require('packer').startup(function(use) -- Useful status updates for LSP 'j-hui/fidget.nvim', + + -- Additional lua configuration, makes nvim stuff amazing + 'folke/neodev.nvim', }, } @@ -324,71 +327,60 @@ local on_attach = function(_, bufnr) -- Create a command `:Format` local to the LSP buffer vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - if vim.lsp.buf.format then - vim.lsp.buf.format() - elseif vim.lsp.buf.formatting then - vim.lsp.buf.formatting() - end + vim.lsp.buf.format() end, { desc = 'Format current buffer with LSP' }) end --- Setup mason so it can manage external tooling -require('mason').setup() - -- Enable the following language servers --- Feel free to add/remove any LSPs that you want here. They will automatically be installed -local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'gopls' } - --- Ensure the servers above are installed -require('mason-lspconfig').setup { - ensure_installed = servers, -} - --- nvim-cmp supports additional completion capabilities -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - -for _, lsp in ipairs(servers) do - require('lspconfig')[lsp].setup { - on_attach = on_attach, - capabilities = capabilities, - } -end - --- Turn on lsp status information -require('fidget').setup() - --- Example custom configuration for lua +-- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- --- Make runtime files discoverable to the server -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, 'lua/?.lua') -table.insert(runtime_path, 'lua/?/init.lua') +-- 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. +local servers = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- tsserver = {}, -require('lspconfig').sumneko_lua.setup { - on_attach = on_attach, - capabilities = capabilities, - settings = { + sumneko_lua = { Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT) - version = 'LuaJIT', - -- Setup your lua path - path = runtime_path, - }, - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file('', true), - checkThirdParty = false, - }, - -- Do not send telemetry data containing a randomized but unique identifier + 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) + +-- Setup mason so it can manage external tooling +require('mason').setup() + +-- 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], + } + end, +} + +-- Turn on lsp status information +require('fidget').setup() + -- nvim-cmp setup local cmp = require 'cmp' local luasnip = require 'luasnip' From 39a941c3851fbadf08731601b9958785e50bee73 Mon Sep 17 00:00:00 2001 From: kazenix Date: Thu, 22 Dec 2022 04:45:20 -0800 Subject: [PATCH 9/9] Adding cmake documentation to README.md (#85) --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b4240858..e29f426a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,20 @@ This repo is meant to be used as a starting point for a user's own configuration If there are languages that you don't want to use, remove their configuration and notes from your `init.lua` after copy and pasting (for example, in the mason configuration). +### Windows Installation + +Installation may require installing build tools, and updating the run command for `telescope-fzf-native` + +See `telescope-fzf-native` documention for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) + +This requires: + +- Install CMake, and the Microsoft C++ Build Tools on Windows + +```lua +use {'nvim-telescope/telescope-fzf-native.nvim', run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } +``` + ### Configuration You could directly modify the `init.lua` file with your personal customizations. This option is the most straightforward, but if you update your config from this repo, you may need to reapply your changes.