From 3e6eebee6aa23bda881649eb027b82b5f9e0ed42 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Mon, 19 Dec 2022 23:57:06 +0000 Subject: [PATCH] lualine --- vim/.vim/lua/lsp.lua | 8 +++++--- vim/.vim/lua/lualine_config.lua | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/vim/.vim/lua/lsp.lua b/vim/.vim/lua/lsp.lua index c09ba02..73c54f8 100644 --- a/vim/.vim/lua/lsp.lua +++ b/vim/.vim/lua/lsp.lua @@ -1,6 +1,10 @@ local use_google = require("utils").use_google local notify = require 'notify' +local lsp_status = require('lsp-status') +lsp_status.register_progress() + + require("mason").setup() require("mason-lspconfig").setup({ ensure_installed = { "sumneko_lua", "rust_analyzer" } @@ -84,8 +88,6 @@ cider_lsp_handlers['window/showMessage'] = function(_, result, ctx) }) end -local lsp_status = require('lsp-status') - -- 3. Set up CiderLSP local on_attach = function(client, bufnr) vim.b['is_cider_lsp_attached'] = 'no' @@ -141,7 +143,6 @@ capabilities.textDocument.publishDiagnostics={ layeredDiagnostics=true } -lsp_status.register_progress() capabilities = vim.tbl_extend('keep', capabilities or {}, lsp_status.capabilities) local runtime_path = vim.split(package.path, ";") @@ -186,6 +187,7 @@ if use_google() then }) lspconfig.analysislsp.setup({ capabilities = capabilities, + on_attach = on_attach, }) end diff --git a/vim/.vim/lua/lualine_config.lua b/vim/.vim/lua/lualine_config.lua index e872eaa..a784593 100644 --- a/vim/.vim/lua/lualine_config.lua +++ b/vim/.vim/lua/lualine_config.lua @@ -17,7 +17,7 @@ local function isCiderLspAttached() if vim.b['is_cider_lsp_attached'] == 'yes' then return '✓' else - return 'LSP..' + return 'x' end else return '' @@ -41,6 +41,8 @@ local function getLGTMs() return "LGTM:"..table.concat(lgtm, ",").." Approval:"..table.concat(appr, ",") end +local lsp_status = require('lsp-status') + require('lualine').setup { options = { theme = 'auto', @@ -53,8 +55,8 @@ require('lualine').setup { }, sections = { lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', getCitc, isCiderLspAttached, 'lsp_progress'}, - lualine_c = {'filename', getLightbulb}, + lualine_b = {'branch', 'diff', getCitc, isCiderLspAttached}, + lualine_c = {getLightbulb, 'filename'}, lualine_x = { { 'diagnostics', sources = {"nvim_lsp"}, symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '} }, 'encoding',