Add LSP status to feline

This commit is contained in:
Evie Litherland-Smith 2023-02-09 22:25:53 +00:00
parent 6881b5dfb9
commit 11de3e525f
4 changed files with 7 additions and 17 deletions

View file

@ -366,7 +366,7 @@ local c = {
}, },
lsp_status = { lsp_status = {
provider = function() provider = function()
return vim.tbl_count(vim.lsp.buf_get_clients(0)) == 0 and "" or "" return require("lsp-status").status()
end, end,
hl = "UserSLStatus", hl = "UserSLStatus",
left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true }, left_sep = { str = "", hl = "UserSLStatusBg", always_visible = true },
@ -409,10 +409,6 @@ local c = {
provider = "position", provider = "position",
hl = "StatusLine", hl = "StatusLine",
}, },
file_winbar = {
provider = file_info,
hl = "Comment",
},
} }
local active = { local active = {

View file

@ -1,8 +0,0 @@
require('fidget').setup{
text = {
spinner = "dots",
},
window = {
blend = 0,
},
}

View file

@ -1,3 +1,6 @@
local lsp_status = require('lsp-status')
lsp_status.register_progress()
-- Set up null_ls first -- Set up null_ls first
local null_ls = require("null-ls") local null_ls = require("null-ls")
null_ls.setup { null_ls.setup {
@ -41,6 +44,7 @@ end
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
lsp_status.on_attach(client)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr } local bufopts = { noremap = true, silent = true, buffer = bufnr }
@ -68,7 +72,7 @@ local lsp_flags = {
debounce_text_changes = 150, debounce_text_changes = 150,
} }
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = vim.tbl_extend('keep', require('cmp_nvim_lsp').default_capabilities(), lsp_status.capabilities)
require('lspconfig')['pyright'].setup{ require('lspconfig')['pyright'].setup{
on_attach = on_attach, on_attach = on_attach,

View file

@ -44,6 +44,7 @@ require('packer').startup {
use 'nvim-lua/plenary.nvim' use 'nvim-lua/plenary.nvim'
use { use {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
'https://github.com/nvim-lua/lsp-status.nvim.git',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
@ -77,9 +78,6 @@ require('packer').startup {
} }
use { use {
'j-hui/fidget.nvim', 'j-hui/fidget.nvim',
config = function()
require 'config.fidget'
end
} }
use { use {
'stevearc/aerial.nvim', 'stevearc/aerial.nvim',