Compare commits

9 Commits

Author SHA1 Message Date
a81f0a2041 go: add gopls 2023-10-26 14:52:30 +02:00
8555092095 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/7131f3c223a2d799568e4b278380cd9dac2b8579' (2023-10-04)
  → 'github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c' (2023-10-25)
2023-10-26 14:48:34 +02:00
b9f6e59d12 flake: update 2023-10-04 20:59:16 +02:00
871a8b4a8c enable zls (zig language server) 2023-07-10 10:41:56 +02:00
d26fa59d72 shorten keybind expressions 2023-07-10 10:30:17 +02:00
2544f1130f don't call lsp setup twice, clieanup global opt setting 2023-07-09 17:23:18 +02:00
44eaabc43c lua_ls: fix vim global not found 2023-07-09 12:01:44 +02:00
aa745901c6 don't display diagnostics by default 2023-07-08 17:15:22 +02:00
6ebd6e83c6 don\'t display diagnostics by default 2023-07-08 17:11:09 +02:00
3 changed files with 63 additions and 18 deletions

6
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1688646010,
"narHash": "sha256-kCeza5eKI2NEi8k0EoeZfv3lN1r1Vwx+L/VA6I8tmG4=",
"lastModified": 1698266953,
"narHash": "sha256-jf72t7pC8+8h8fUslUYbWTX5rKsRwOzRMX8jJsGqDXA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5daaa32204e9c46b05cd709218b7ba733d07e80c",
"rev": "75a52265bda7fd25e06e3a67dee3f0354e73243c",
"type": "github"
},
"original": {

View File

@@ -11,6 +11,7 @@
(nvim-treesitter.withPlugins (parsers: [
parsers.c
parsers.cpp
parsers.go
parsers.json
parsers.latex
parsers.lua
@@ -30,6 +31,7 @@
colorizer
fugitive
fzf-lua
gopls
gruvbox
nvim-cmp
nvim-lspconfig

View File

@@ -1,22 +1,30 @@
-- Basic settings
vim.g.loaded_matchparen = true
vim.g.netrw_liststyle = 3
vim.go.background = 'dark'
vim.go.belloff = 'all'
vim.go.breakindent = true
vim.go.hlsearch = false
vim.go.laststatus = 0
vim.go.lazyredraw = true
vim.go.showcmd = true
vim.go.synmaxcol = 800
vim.go.syntax = 'on'
vim.go.termguicolors = true
vim.go.titleold = vim.fn.getcwd()
vim.go.title = true
vim.go.wildmenu = true
vim.go.wrap = true
vim.wo.number = true
local glob_opts = {
background = 'dark',
belloff = 'all',
breakindent = true,
hlsearch = false,
laststatus = 0,
lazyredraw = true,
showcmd = true,
synmaxcol = 800,
syntax = 'on',
termguicolors = true,
titleold = vim.fn.getcwd(),
title = true,
wildmenu = true,
wrap = true,
}
for option, value in pairs(glob_opts) do
vim.go[option] = value
end
vim.cmd([[colorscheme gruvbox]])
require 'nvim-treesitter.configs'.setup {
@@ -99,6 +107,19 @@ vim.api.nvim_create_autocmd('LspAttach', {
end
})
vim.diagnostic.config({ virtual_text = false}) -- Turn off inline diagnostics
-- Show all diagnostics on current line in floating window
vim.api.nvim_set_keymap( 'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
-- Go to next diagnostic (if there are multiple on the same line, only shows
-- one at a time in the floating window)
vim.api.nvim_set_keymap( 'n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
-- Go to prev diagnostic (if there are multiple on the same line, only shows
-- one at a time in the floating window)
vim.api.nvim_set_keymap( 'n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local cmp = require 'cmp'
@@ -163,7 +184,7 @@ cmp.setup({
}
})
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'lua_ls', 'nixd', 'texlab', 'verible' }
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab', 'zls', 'gopls' }
local capabilities = require('cmp_nvim_lsp').default_capabilities()
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
@@ -172,10 +193,32 @@ for _, lsp in pairs(servers) do
end
require('lspconfig').lua_ls.setup({
capabilities = capabilities,
single_file_support = true,
settings = {
Lua = {
diagnostics = {
globals = { 'vim' },
},
runtime = {
version = 'LuaJIT',
path = vim.split(package.path, ';'),
},
workspace = {
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
},
},
telemetry = {
enable = false,
},
},
},
})
require('lspconfig').verible.setup({
capabilities = capabilities,
root_dir = function() return vim.loop.cwd() end
})