From 0c7605138051b67d381d201a5203bf1589cd3bfb Mon Sep 17 00:00:00 2001 From: Benjamin Kyd Date: Fri, 3 Mar 2023 19:44:53 +0000 Subject: [PATCH] that fixed it??? --- common/.config/nvim/lua/lsp-general.lua | 31 -- .../nvim/lua/plugin-config/galaxyline.lua | 284 ------------------ common/.config/nvim/lua/plugins.lua | 12 +- .../.config/nvim/plugin/packer_compiled.lua | 23 +- 4 files changed, 14 insertions(+), 336 deletions(-) delete mode 100644 common/.config/nvim/lua/plugin-config/galaxyline.lua diff --git a/common/.config/nvim/lua/lsp-general.lua b/common/.config/nvim/lua/lsp-general.lua index 1549693..303d6b0 100644 --- a/common/.config/nvim/lua/lsp-general.lua +++ b/common/.config/nvim/lua/lsp-general.lua @@ -1,34 +1,3 @@ -local lsp_installer = require'nvim-lsp-installer' -local lsp_installer_servers = require'nvim-lsp-installer.servers' - --- install LSP servers -local function installServer(name) - local ok, server = lsp_installer_servers.get_server(name) - if ok then - if not server:is_installed() then - server:install() - end - end -end - -local function installServers(names) - for _,name in pairs(names) do - installServer(name) - end -end - --- find a list of available ones here: https://github.com/williamboman/nvim-lsp-installer -installServers({'angularls', 'bashls', 'dockerls', 'lua_ls', 'pyright', 'jsonls', 'cssls', 'tsserver'}) - --- setup installed servers -lsp_installer.on_server_ready(function(server) - local opts = {} - - -- This setup() function is exactly the same as lspconfig's setup function. - -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/ADVANCED_README.md - server:setup(opts) -end) - -- diagnostic symbols local signs = { Error = "", Warn = "", Hint = "", Info = ""} for type, icon in pairs(signs) do diff --git a/common/.config/nvim/lua/plugin-config/galaxyline.lua b/common/.config/nvim/lua/plugin-config/galaxyline.lua deleted file mode 100644 index 3ec9edf..0000000 --- a/common/.config/nvim/lua/plugin-config/galaxyline.lua +++ /dev/null @@ -1,284 +0,0 @@ -local gl = require('galaxyline') -local section = gl.section -local condition = require('galaxyline.condition') - --- TODO: move to util - credit to kraftwerk28/dotfiles -local function u(code) - if type(code) == 'string' then code = tonumber('0x' .. code) end - local c = string.char - if code <= 0x7f then return c(code) end - local t = {} - if code <= 0x07ff then - t[1] = c(bit.bor(0xc0, bit.rshift(code, 6))) - t[2] = c(bit.bor(0x80, bit.band(code, 0x3f))) - elseif code <= 0xffff then - t[1] = c(bit.bor(0xe0, bit.rshift(code, 12))) - t[2] = c(bit.bor(0x80, bit.band(bit.rshift(code, 6), 0x3f))) - t[3] = c(bit.bor(0x80, bit.band(code, 0x3f))) - else - t[1] = c(bit.bor(0xf0, bit.rshift(code, 18))) - t[2] = c(bit.bor(0x80, bit.band(bit.rshift(code, 12), 0x3f))) - t[3] = c(bit.bor(0x80, bit.band(bit.rshift(code, 6), 0x3f))) - t[4] = c(bit.bor(0x80, bit.band(code, 0x3f))) - end - return table.concat(t) -end - --- li - line icon -local li = { - -- block - b = '█', - -- bottom left - bl = u'e0b8', -- '', - -- bottom right - br = u'e0ba', -- '', - -- top left - tl = u'e0bc', -- '', - -- top right - tr = u'e0be' -- '', -} - --- taken from LunarVim -local colors = { - bg = '#292D38', - yellow = '#FFEB68', - dark_yellow = '#D7BA7D', - cyan = '#4EC9B0', - green = '#608B4E', - light_green = '#B5CEA8', - string_orange = '#CE9178', - orange = '#FF8800', - purple = '#C586C0', - magenta = '#D16D9E', - grey = '#858585', - blue = '#569CD6', - vivid_blue = '#4FC1FF', - light_blue = '#9CDCFE', - red = '#D16969', - error_red = '#F44747', - info_yellow = '#FFCC66', - white = '#FFFFFF' -} - --- list of windows for which short line will be used --- short line is just a shorter status line. it's normally used in --- places where it's not really needed/desired -gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'} - --- first section to the left will be a colored block shape that will --- tell in which mode we're in -section.left[1] = { - ViMode = { - provider = function() - -- define color for each mode - local mode_color = { - n = colors.blue, -- normal - i = colors.grey, -- insert - v = colors.purple, -- visual - [''] = colors.purple, -- visual block - V = colors.purple, -- visual line - c = colors.dark_yellow, -- command - no = colors.blue, -- normal ?? - s = colors.orange, -- select ?? - S = colors.orange, -- select line ?? - [''] = colors.orange, -- select block?? - ic = colors.yellow, - R = colors.red, -- Replace - Rv = colors.red, -- replace visual? - cv = colors.blue, -- command ?? - ce = colors.blue, -- command ?? - r = colors.cyan, -- ?? - rm = colors.cyan, -- ?? - ['r?'] = colors.cyan, - ['!'] = colors.blue, - t = colors.blue - } - -- set color with nvim command - vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()]) - - -- returns the text that will be displayed in this section - return li.b..li.tl..' ' - end, - highlight = {colors.red, colors.bg} - } -} - --- git branch icon -section.left[2] = { - GitIcon = { - -- main text - provider = function() - return ' ' - end, - -- enable only if vim is open in git workspace - condition = condition.check_git_workspace, - -- separator is the stuff after the main text - separator = ' ', - -- separator foreground & background color - separator_highlight = {'NONE', colors.bg}, - -- main text foreground & background color - highlight = {colors.orange, colors.bg} - } -} - --- git branch name -section.left[3] = { - GitBranch = { - provider = 'GitBranch', - -- enable only if vim is open in git workspace - condition = condition.check_git_workspace, - separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} - } -} - --- git added files -section.left[4] = { - DiffAdd = { - provider = 'DiffAdd', - condition = condition.hide_in_width, - icon = '  ', - highlight = {colors.green, colors.bg} - } -} - --- git modified files -section.left[5] = { - DiffModified = { - provider = 'DiffModified', - condition = condition.hide_in_width, - icon = ' 柳', - highlight = {colors.blue, colors.bg} - } -} - --- git removed files -section.left[6] = { - DiffRemove = { - provider = 'DiffRemove', - condition = condition.hide_in_width, - icon = '  ', - highlight = {colors.red, colors.bg} - } -} - --- diagnostics -section.right[1] = { - DiagnosticError = { - provider = 'DiagnosticError', - icon = '  ', - highlight = {colors.error_red, colors.bg} - } -} -section.right[2] = { - DiagnosticWarn = { - provider = 'DiagnosticWarn', - icon = '  ', - highlight = {colors.orange, colors.bg} - } -} -section.right[3] = { - DiagnosticHint = { - provider = 'DiagnosticHint', - icon = '  ', - highlight = {colors.vivid_blue, colors.bg} - } -} -section.right[4] = { - DiagnosticInfo = { - provider = 'DiagnosticInfo', - icon = '  ', - highlight = { - colors.info_yellow, - colors.bg - } - } -} - --- cosmetics -section.right[5] = { - Space2 = { - provider = function() - return li.br..li.b - end, - separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.white, colors.bg} - } -} - --- lsp info -section.right[7] = { - ShowLspClient = { - provider = 'GetLspClient', - condition = function() - local tbl = {['dashboard'] = true, [' '] = true} - if tbl[vim.bo.filetype] then return false end - return true - end, - separator = ' ', - separator_highlight = {colors.grey, colors.white}, - icon = ' ', - highlight = {colors.grey, colors.white} - } -} - --- file type -section.right[8] = { - BufferType = { - provider = 'FileTypeName', - separator = li.b..li.tl..' ', - separator_highlight = {colors.white, colors.bg}, - highlight = {colors.grey, colors.bg} - } -} -section.right[9] = { - FileEncode = { - provider = 'FileEncode', - condition = condition.hide_in_width, - separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} - } -} --- cosmetics: right dash -section.right[10] = { - LastDash = { - provider = function() - return li.tr..li.b - end, - separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.white, colors.bg} - } -} - --- short line settings -section.short_line_left[1] = { - BufferType = { - provider = 'FileTypeName', - separator = ' ', - separator_highlight = {'NONE', colors.bg}, - highlight = {colors.grey, colors.bg} - } -} -section.short_line_left[2] = { - SFileName = { - provider = 'SFileName', - condition = condition.buffer_not_empty, - highlight = { - colors.grey, - colors.bg - } - } -} -section.short_line_right[1] = { - BufferIcon = { - provider = 'BufferIcon', - highlight = { - colors.grey, - colors.bg - } - } -} diff --git a/common/.config/nvim/lua/plugins.lua b/common/.config/nvim/lua/plugins.lua index 2316a14..adb7ceb 100644 --- a/common/.config/nvim/lua/plugins.lua +++ b/common/.config/nvim/lua/plugins.lua @@ -39,11 +39,12 @@ local packer = require('packer').startup(function(use) } -- better hotfix window (for showing and searching through results in telescope's find usages) - use {"kevinhwang91/nvim-bqf"} + use 'kevinhwang91/nvim-bqf' -- better highlighting use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'} use 'nvim-treesitter/nvim-treesitter-context' + -- better split navigation use 'mrjones2014/smart-splits.nvim' @@ -73,7 +74,6 @@ local packer = require('packer').startup(function(use) }) -- better find and replace - use 'nvim-lua/plenary.nvim' use 'windwp/nvim-spectre' @@ -106,8 +106,9 @@ local packer = require('packer').startup(function(use) -- lsp config use { - 'neovim/nvim-lspconfig', - 'williamboman/nvim-lsp-installer', + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "neovim/nvim-lspconfig", } -- for LSP autocompletion @@ -117,9 +118,6 @@ local packer = require('packer').startup(function(use) use 'hrsh7th/cmp-path' use 'hrsh7th/cmp-cmdline' - --highlight variables under cursor - use 'RRethy/vim-illuminate' - -- this will automatically install listed dependencies -- only the first time NeoVim is opened, because that's when Packer gets installed if packerBootstrap then diff --git a/common/.config/nvim/plugin/packer_compiled.lua b/common/.config/nvim/plugin/packer_compiled.lua index b3a4409..68b4d86 100644 --- a/common/.config/nvim/plugin/packer_compiled.lua +++ b/common/.config/nvim/plugin/packer_compiled.lua @@ -136,6 +136,11 @@ _G.packer_plugins = { path = "/home/benk/.local/share/nvim/site/pack/packer/start/lspsaga.nvim", url = "https://github.com/glepnir/lspsaga.nvim" }, + ["mason.nvim"] = { + loaded = true, + path = "/home/benk/.local/share/nvim/site/pack/packer/start/mason.nvim", + url = "https://github.com/williamboman/mason.nvim" + }, ["mini.indentscope"] = { loaded = true, path = "/home/benk/.local/share/nvim/site/pack/packer/start/mini.indentscope", @@ -176,11 +181,6 @@ _G.packer_plugins = { path = "/home/benk/.local/share/nvim/site/pack/packer/start/nvim-hardline", url = "https://github.com/ojroques/nvim-hardline" }, - ["nvim-lsp-installer"] = { - loaded = true, - path = "/home/benk/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer", - url = "https://github.com/williamboman/nvim-lsp-installer" - }, ["nvim-lspconfig"] = { loaded = true, path = "/home/benk/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", @@ -240,23 +240,18 @@ _G.packer_plugins = { loaded = true, path = "/home/benk/.local/share/nvim/site/pack/packer/start/vim-fugitive", url = "https://github.com/tpope/vim-fugitive" - }, - ["vim-illuminate"] = { - loaded = true, - path = "/home/benk/.local/share/nvim/site/pack/packer/start/vim-illuminate", - url = "https://github.com/RRethy/vim-illuminate" } } time([[Defining packer_plugins]], false) --- Config for: codewindow.nvim -time([[Config for codewindow.nvim]], true) -try_loadstring("\27LJ\2\nW\0\0\3\0\4\0\b6\0\0\0'\2\1\0B\0\2\0029\1\2\0B\1\1\0019\1\3\0B\1\1\1K\0\1\0\27apply_default_keybinds\nsetup\15codewindow\frequire\0", "config", "codewindow.nvim") -time([[Config for codewindow.nvim]], false) -- Config for: lspsaga.nvim time([[Config for lspsaga.nvim]], true) try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\flspsaga\frequire\0", "config", "lspsaga.nvim") time([[Config for lspsaga.nvim]], false) +-- Config for: codewindow.nvim +time([[Config for codewindow.nvim]], true) +try_loadstring("\27LJ\2\nW\0\0\3\0\4\0\b6\0\0\0'\2\1\0B\0\2\0029\1\2\0B\1\1\0019\1\3\0B\1\1\1K\0\1\0\27apply_default_keybinds\nsetup\15codewindow\frequire\0", "config", "codewindow.nvim") +time([[Config for codewindow.nvim]], false) _G._packer.inside_compile = false if _G._packer.needs_bufread == true then