Configure lualine

Setup lualine modules, remove some old plugins
This commit is contained in:
Evie Litherland-Smith 2023-05-10 22:13:59 +01:00
parent 6afbb00ca6
commit ed663b9674
14 changed files with 79 additions and 96 deletions

View file

@ -1,6 +0,0 @@
return {
auto_hide = false,
hide = { extensions = true },
modified = { button = "" },
pinned = { button = "", filename = true, separator = { right = "" } },
}

View file

@ -1 +0,0 @@
return { theme = "catppuccin" }

View file

@ -1,6 +1,7 @@
-- Opt -- Opt
vim.opt.laststatus = 3 vim.opt.laststatus = 3
vim.opt.showtabline = 2 vim.opt.cmdheight = 0
vim.opt.showtabline = 1
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.expandtab = true vim.opt.expandtab = true
vim.opt.number = true vim.opt.number = true

View file

@ -1,62 +1,49 @@
-- Bubbles config for lualine local lsp_progress = function()
-- Author: lokesh-krishna local Lsp = vim.lsp.util.get_progress_messages()[1]
-- MIT license, see LICENSE for more details.
-- stylua: ignore if Lsp then
local colors = { local msg = Lsp.message or ""
blue = '#80a0ff', local percentage = Lsp.percentage
cyan = '#79dac8', if not percentage then return "" end
black = '#080808', local title = Lsp.title or ""
white = '#c6c6c6', local spinners = { "", "", "" }
red = '#ff5189', local success_icon = { "", "", "" }
violet = '#d183e8', local ms = vim.loop.hrtime() / 1000000
grey = '#303030', local frame = math.floor(ms / 120) % #spinners
}
local bubbles_theme = { if percentage >= 70 then
normal = { return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage)
a = { fg = colors.black, bg = colors.violet }, end
b = { fg = colors.white, bg = colors.grey },
c = { fg = colors.black, bg = colors.black },
},
insert = { a = { fg = colors.black, bg = colors.blue } }, return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
visual = { a = { fg = colors.black, bg = colors.cyan } }, end
replace = { a = { fg = colors.black, bg = colors.red } },
inactive = { return ""
a = { fg = colors.white, bg = colors.black }, end
b = { fg = colors.white, bg = colors.black },
c = { fg = colors.black, bg = colors.black },
},
}
require("lualine").setup { return {
options = { options = {
theme = bubbles_theme, theme = "catppuccin",
component_separators = "|", component_separators = "|",
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
globalstatus = true,
}, },
sections = { sections = {
lualine_a = { lualine_a = { "mode" },
{ "mode", separator = { left = "" }, right_padding = 2 }, lualine_b = { "filetype", "branch", "diff" },
}, lualine_c = { lsp_progress, "diagnostics" },
lualine_b = { "filename", "branch" },
lualine_c = { "fileformat" },
lualine_x = {}, lualine_x = {},
lualine_y = { "filetype", "progress" }, lualine_y = { "searchcount", "progress", "selectioncount" },
lualine_z = {
{ "location", separator = { right = "" }, left_padding = 2 },
},
},
inactive_sections = {
lualine_a = { "filename" },
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = { "location" }, lualine_z = { "location" },
}, },
tabline = {}, tabline = {
extensions = {}, lualine_a = {},
lualine_b = { { "filetype", icon_only = true }, "fileformat", "encoding" },
lualine_c = { "require('nvim-navic').get_location()" },
lualine_x = { { "windows", use_mode_colors = true } },
lualine_y = {},
lualine_z = {},
},
winbar = {},
extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" },
} }

View file

@ -1 +1,32 @@
return { highlight = true } return {
safe_output = true,
click = true,
icons = {
File = "",
Module = "",
Namespace = "",
Package = "",
Class = "",
Method = "",
Property = "",
Field = "",
Constructor = "",
Enum = "",
Interface = "",
Function = "",
Variable = "",
Constant = "",
String = "",
Number = "",
Boolean = "",
Array = "",
Object = "",
Key = "",
Null = "",
EnumMember = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
},
}

View file

@ -1,6 +1,6 @@
-- 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(_, bufnr) local on_attach = function(client, bufnr)
-- 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 }
@ -19,5 +19,6 @@ local on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts)
vim.keymap.set("n", "<leader>i", require "lsp.formatting", bufopts) vim.keymap.set("n", "<leader>i", require "lsp.formatting", bufopts)
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
end end
return on_attach return on_attach

View file

@ -1,9 +0,0 @@
return {
"romgrk/barbar.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
event = { "BufReadPre", "BufNewFile" },
init = function() vim.g.barbar_auto_setup = false end,
config = true,
opts = require "config.barbar",
version = "^1.0.0", -- optional: only update when a new 1.x version is released
}

View file

@ -1,12 +0,0 @@
return {
"utilyre/barbecue.nvim",
name = "barbecue",
version = "*",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons",
},
event = { "BufReadPre", "BufNewFile" },
-- opts = require "config.barbecue",
config = function() require("barbecue").setup(require "config.barbecue") end,
}

View file

@ -1,6 +0,0 @@
return {
"feline-nvim/feline.nvim",
dependencies = { require "plugins.catppuccin" },
event = { "BufReadPre", "BufNewFile" },
-- config = function() require("feline").setup(require "config.feline") end,
}

View file

@ -1,5 +0,0 @@
return {
"tpope/vim-fugitive",
cmd = { "G", "Git" },
lazy = true,
}

View file

@ -13,6 +13,10 @@ return {
{ "hrsh7th/nvim-cmp" }, { "hrsh7th/nvim-cmp" },
{ "rafamadriz/friendly-snippets" }, { "rafamadriz/friendly-snippets" },
{ "windwp/nvim-autopairs" }, { "windwp/nvim-autopairs" },
{ "jose-elias-alvarez/null-ls.nvim", lazy = true },
{ "mfussenegger/nvim-dap", lazy = true },
{ "folke/neodev.nvim", dependencies = { "hrsh7th/nvim-cmp" }, lazy = true },
{ "SmiteshP/nvim-navic", lazy = true, config = true, opts = require "config.nvim-navic" },
}, },
config = function() config = function()
require "lsp.config" require "lsp.config"
@ -35,7 +39,4 @@ return {
}, },
cmd = "CmpStatus", cmd = "CmpStatus",
}, },
{ "jose-elias-alvarez/null-ls.nvim", dependencies = { "neovim/nvim-lspconfig" }, lazy = true },
{ "mfussenegger/nvim-dap", dependencies = { "neovim/nvim-lspconfig" }, lazy = true },
{ "folke/neodev.nvim", dependencies = { "neovim/nvim-lspconfig", "hrsh7th/nvim-cmp" }, lazy = true },
} }

View file

@ -1,6 +1,6 @@
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
event = { "BufReadPre", "BufNewFile" }, event = { "BufEnter" },
config = require "config.lualine", config = function() require("lualine").setup(require "config.lualine") end,
} }

View file

@ -2,5 +2,6 @@ return {
"SmiteshP/nvim-navic", "SmiteshP/nvim-navic",
dependencies = "neovim/nvim-lspconfig", dependencies = "neovim/nvim-lspconfig",
lazy = true, lazy = true,
config = true,
opts = require "config.nvim-navic", opts = require "config.nvim-navic",
} }

View file

@ -1,5 +1,5 @@
return { return {
"ahmedkhalf/project.nvim", "ahmedkhalf/project.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufEnter" },
config = function() require("project_nvim").setup(require "config.project") end, config = function() require("project_nvim").setup(require "config.project") end,
} }