wip
This commit is contained in:
parent
81aaccd4ae
commit
40fbcf8253
2 changed files with 8 additions and 19 deletions
|
@ -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.
|
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
|
### Installation
|
||||||
|
|
||||||
|
@ -65,5 +65,6 @@ Each PR, especially those which increase the line count, should have a descripti
|
||||||
### FAQ
|
### FAQ
|
||||||
|
|
||||||
* What should I do if I already have a pre-existing neovim configuration?
|
* 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/`
|
||||||
|
|
||||||
|
|
22
init.lua
22
init.lua
|
@ -327,22 +327,15 @@ local on_attach = function(_, bufnr)
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
if vim.lsp.buf.format then
|
vim.lsp.buf.format()
|
||||||
vim.lsp.buf.format()
|
|
||||||
elseif vim.lsp.buf.formatting then
|
|
||||||
vim.lsp.buf.formatting()
|
|
||||||
end
|
|
||||||
end, { desc = 'Format current buffer with LSP' })
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
end
|
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
|
-- Enable the following language servers
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
-- 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
|
-- 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 = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
|
@ -352,12 +345,7 @@ local servers = {
|
||||||
|
|
||||||
sumneko_lua = {
|
sumneko_lua = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = { version = 'LuaJIT', path = runtime_path },
|
workspace = { checkThirdParty = false },
|
||||||
diagnostics = { globals = { 'vim' } },
|
|
||||||
workspace = {
|
|
||||||
library = vim.api.nvim_get_runtime_file('', true),
|
|
||||||
checkThirdParty = false,
|
|
||||||
},
|
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -374,7 +362,7 @@ capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
|
|
||||||
-- Ensure the servers above are installed
|
-- Ensure the servers above are installed
|
||||||
local mason_lspconfig = require('mason-lspconfig')
|
local mason_lspconfig = require 'mason-lspconfig'
|
||||||
|
|
||||||
mason_lspconfig.setup {
|
mason_lspconfig.setup {
|
||||||
ensure_installed = vim.tbl_keys(servers),
|
ensure_installed = vim.tbl_keys(servers),
|
||||||
|
|
Loading…
Reference in a new issue