From cb130434c7f0869a3e3bdb966f4505e3d6030b90 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Tue, 9 May 2023 19:11:48 -0500 Subject: [PATCH] lsp config to manual until mason-lspconfig fixes automatic setup --- init.lua | 16 ++++++++-------- lua/plugins/lsp.lua | 41 ++++++++++++++++++++++++++++++----------- lua/theme.lua | 28 ++++++++++++++++++---------- 3 files changed, 56 insertions(+), 29 deletions(-) diff --git a/init.lua b/init.lua index 62d51f8..b4a3696 100644 --- a/init.lua +++ b/init.lua @@ -1,14 +1,14 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--single-branch", - "https://github.com/folke/lazy.nvim.git", - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "--single-branch", + "https://github.com/folke/lazy.nvim.git", + lazypath, + }) end vim.opt.runtimepath:prepend(lazypath) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 6b1ff58..997d3c0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,28 +1,47 @@ return { { 'neovim/nvim-lspconfig', - event = { 'BufReadPre', 'BufNewFile' }, + -- event = { 'BufReadPre', 'BufNewFile' }, + lazy = false, dependencies = { 'nvim-cmp', 'nvim-treesitter', 'Maan2003/lsp_lines.nvim', - { 'williamboman/mason.nvim', build = ':MasonUpdate' }, - 'williamboman/mason-lspconfig', + { 'williamboman/mason.nvim', build = ':MasonUpdate' }, + { 'williamboman/mason-lspconfig', version = '1.3.0' }, }, config = function() - local lspconfig = require('lspconfig') require('mason').setup() require('mason-lspconfig').setup({ automatic_installation = true, - ensure_installed = {} + ensure_installed = { 'rust_analyzer' } }) - require('mason-lspconfig').setup_handlers({ - function(server_name) - lspconfig[server_name].setup({}) - end - }) + -- local handlers = { + -- function(server_name) + -- require("lspconfig")[server_name].setup({}) + -- end, + -- } + + -- require('mason-lspconfig').setup_handlers(handlers) + + -- docker_compose_language_service, jsonls, marksman, yamlls, awk_ls, solargraph, bashls, dockerls, clangd, lua_ls, vimls, rust_analyzer, html, cssls + + require('lspconfig').docker_compose_language_service.setup({}) + require('lspconfig').jsonls.setup({}) + require('lspconfig').marksman.setup({}) + require('lspconfig').yamlls.setup({}) + require('lspconfig').awk_ls.setup({}) + require('lspconfig').solargraph.setup({}) + require('lspconfig').bashls.setup({}) + require('lspconfig').dockerls.setup({}) + require('lspconfig').clangd.setup({}) + require('lspconfig').lua_ls.setup({}) + require('lspconfig').vimls.setup({}) + require('lspconfig').rust_analyzer.setup({}) + require('lspconfig').html.setup({}) + require('lspconfig').cssls.setup({}) local border = { { "┏", "FloatBorder" }, @@ -60,7 +79,7 @@ return { { 'jay-babu/mason-null-ls.nvim', - event = { 'BufReadPre', 'BufNewFile' }, + lazy = { 'BufReadPre', 'BufNewFile' }, dependencies = { 'mason.nvim', { diff --git a/lua/theme.lua b/lua/theme.lua index 8c490c0..1186264 100644 --- a/lua/theme.lua +++ b/lua/theme.lua @@ -27,7 +27,7 @@ local c_green = "2" local c_yellow = "3" local c_blue = "4" local c_purple = "5" -local c_pink = "6" +local c_cyan = "6" local c_white = "7" local c_grey = "8" local c_dark_red = "9" @@ -35,7 +35,7 @@ local c_dark_green = "10" local c_dark_yellow = "11" local c_dark_blue = "12" local c_dark_purple = "13" -local c_dark_pink = "14" +local c_dark_cyan = "14" vim.g.terminal_color_0 = black vim.g.terminal_color_1 = red @@ -85,8 +85,8 @@ highlight("EndOfBuffer", black, black, c_black, c_black, nil, nil) highlight("LineNr", yellow, black, c_yellow, c_black, nil, nil) highlight("CursorLineNr", red, black, c_red, c_black, bold, nil) highlight("MatchParen", nil, grey, nil, c_grey, bold, nil) -highlight("SpecialKey", cyan, nil, c_pink, nil, nil, nil) -highlight("NonText", cyan, black, c_pink, c_black, nil, nil) +highlight("SpecialKey", cyan, nil, c_cyan, nil, nil, nil) +highlight("NonText", cyan, black, c_cyan, c_black, nil, nil) highlight("Search", nil, green, nil, c_green, nil, nil) highlight("Visual", nil, dark_grey, nil, c_grey, nil, nil) highlight("Folded", blue, dark_grey, c_blue, c_grey, nil, nil) @@ -115,7 +115,7 @@ highlight("CursorLine", white, grey, c_white, c_grey, nil, nil) -- Spelling highlight("SpellBad", red, black, c_red, c_black, underline, red) -highlight("SpellCap", cyan, black, c_pink, c_black, underline, cyan) +highlight("SpellCap", cyan, black, c_cyan, c_black, underline, cyan) highlight("SpellRare", green, black, c_green, c_black, underline, green) highlight("SpellLocal", magenta, black, c_purple, c_black, underline, magenta) @@ -142,8 +142,8 @@ highlight("DiagnosticUnderlineHint", nil, nil, nil, nil, underline, grey) highlight("CmpItemAbbrMatch", dark_blue, "NONE", c_dark_blue, "NONE", nil, nil) highlight("CmpItemAbbrMatchFuzzy", blue, "NONE", c_blue, "NONE", nil, nil) highlight("CmpItemKindVariable", green, "NONE", c_green, "NONE", nil, nil) -highlight("CmpItemKindInterface", dark_cyan, "NONE", c_dark_pink, "NONE", nil, nil) -highlight("CmpItemKindText", cyan, "NONE", c_pink, "NONE", nil, nil) +highlight("CmpItemKindInterface", dark_cyan, "NONE", c_dark_cyan, "NONE", nil, nil) +highlight("CmpItemKindText", cyan, "NONE", c_cyan, "NONE", nil, nil) highlight("CmpItemKindFunction", magenta, "NONE", c_purple, "NONE", nil, nil) highlight("CmpItemKindMethod", magenta, "NONE", c_purple, "NONE", nil, nil) highlight("CmpItemKindKeyword", dark_yellow, "NONE", c_dark_yellow, "NONE", nil, nil) @@ -195,7 +195,7 @@ highlight("Debug", dark_yellow, black, c_dark_yellow, c_black, nil, nil) -- Diff highlight("DiffAdd", black, green, c_black, c_green, nil, nil) -highlight("DiffText", black, cyan, c_black, c_pink, nil, nil) +highlight("DiffText", black, cyan, c_black, c_cyan, nil, nil) highlight("DiffDelete", black, red, c_black, c_red, nil, nil) highlight("DiffChange", black, magenta, c_black, c_purple, nil, nil) @@ -210,6 +210,14 @@ highlight("LazyButton", white, black, c_white, c_black, nil, nil) highlight("LazyButtonActive", white, black, c_white, c_black, bold, nil) highlight("LazyH1", white, black, c_white, c_black, bold, nil) +-- completion +highlight("CmpItemAbbrDefault", white, black, c_white, c_black, nil, nil) +highlight("CmpItemMenuDefault", white, black, c_white, c_black, nil, nil) +highlight("CmpItemAbbrDeprecatedDefault", white, black, c_white, c_black, nil, nil) +highlight("CmpItemAbbrMatchDefault", dark_blue, black, c_white, c_dark_blue, nil, nil) +highlight("CmpItemAbbrMatchFuzzyDefault", blue, black, c_white, c_blue, nil, nil) +highlight("CmpItemKindDefault", cyan, black, c_white, c_cyan, nil, nil) + -- Lualine highlight("lualine_a_visual", black, yellow, c_black, c_yellow, nil, nil) highlight("lualine_b_visual", yellow, black, c_yellow, c_black, nil, nil) @@ -226,8 +234,8 @@ highlight("lualine_c_command", grey, black, c_grey, c_black, nil, nil) highlight("lualine_a_insert", black, green, c_black, c_green, nil, nil) highlight("lualine_b_insert", green, black, c_green, c_black, nil, nil) highlight("lualine_c_insert", grey, black, c_grey, c_black, nil, nil) -highlight("lualine_a_terminal", black, cyan, c_black, c_pink, nil, nil) -highlight("lualine_b_terminal", cyan, black, c_pink, c_black, nil, nil) +highlight("lualine_a_terminal", black, cyan, c_black, c_cyan, nil, nil) +highlight("lualine_b_terminal", cyan, black, c_cyan, c_black, nil, nil) highlight("lualine_c_terminal", grey, black, c_grey, c_black, nil, nil) highlight("lualine_a_inactive", grey, black, c_grey, c_black, nil, nil) highlight("lualine_b_inactive", grey, black, c_grey, c_black, nil, nil) -- 2.45.2