From 40fbcf82536c6f858fa5d44ef992fbfb28bc1538 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 20 Dec 2022 22:11:10 -0500 Subject: [PATCH] wip --- README.md | 5 +++-- init.lua | 22 +++++----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f7a6b76..b424085 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 18780e3..636d86a 100644 --- a/init.lua +++ b/init.lua @@ -327,22 +327,15 @@ 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 -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, 'lua/?.lua') -table.insert(runtime_path, 'lua/?/init.lua') - -- 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 +-- the `settings` field of the server config. You must look up that documentation yourself. local servers = { -- clangd = {}, -- gopls = {}, @@ -352,12 +345,7 @@ local servers = { sumneko_lua = { Lua = { - runtime = { version = 'LuaJIT', path = runtime_path }, - diagnostics = { globals = { 'vim' } }, - workspace = { - library = vim.api.nvim_get_runtime_file('', true), - checkThirdParty = false, - }, + workspace = { checkThirdParty = false }, telemetry = { enable = false }, }, }, @@ -374,7 +362,7 @@ capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) require('mason').setup() -- Ensure the servers above are installed -local mason_lspconfig = require('mason-lspconfig') +local mason_lspconfig = require 'mason-lspconfig' mason_lspconfig.setup { ensure_installed = vim.tbl_keys(servers),