diff --git a/home/tui/config/nvim/lua/config/barbar.lua b/home/tui/config/nvim/lua/config/barbar.lua deleted file mode 100644 index 6f72577e..00000000 --- a/home/tui/config/nvim/lua/config/barbar.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - auto_hide = false, - hide = { extensions = true }, - modified = { button = "●" }, - pinned = { button = "車", filename = true, separator = { right = "" } }, -} diff --git a/home/tui/config/nvim/lua/config/barbecue.lua b/home/tui/config/nvim/lua/config/barbecue.lua deleted file mode 100644 index 7d6edb42..00000000 --- a/home/tui/config/nvim/lua/config/barbecue.lua +++ /dev/null @@ -1 +0,0 @@ -return { theme = "catppuccin" } diff --git a/home/tui/config/nvim/lua/config/init.lua b/home/tui/config/nvim/lua/config/init.lua index 17fb4f29..9363fcc7 100644 --- a/home/tui/config/nvim/lua/config/init.lua +++ b/home/tui/config/nvim/lua/config/init.lua @@ -1,6 +1,7 @@ -- Opt vim.opt.laststatus = 3 -vim.opt.showtabline = 2 +vim.opt.cmdheight = 0 +vim.opt.showtabline = 1 vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.number = true diff --git a/home/tui/config/nvim/lua/config/lualine.lua b/home/tui/config/nvim/lua/config/lualine.lua index 6c5cca9f..f4747632 100644 --- a/home/tui/config/nvim/lua/config/lualine.lua +++ b/home/tui/config/nvim/lua/config/lualine.lua @@ -1,62 +1,49 @@ --- Bubbles config for lualine --- Author: lokesh-krishna --- MIT license, see LICENSE for more details. +local lsp_progress = function() + local Lsp = vim.lsp.util.get_progress_messages()[1] --- stylua: ignore -local colors = { - blue = '#80a0ff', - cyan = '#79dac8', - black = '#080808', - white = '#c6c6c6', - red = '#ff5189', - violet = '#d183e8', - grey = '#303030', -} + if Lsp then + local msg = Lsp.message or "" + local percentage = Lsp.percentage + if not percentage then return "" end + local title = Lsp.title or "" + local spinners = { "", "", "" } + local success_icon = { "", "", "" } + local ms = vim.loop.hrtime() / 1000000 + local frame = math.floor(ms / 120) % #spinners -local bubbles_theme = { - normal = { - a = { fg = colors.black, bg = colors.violet }, - b = { fg = colors.white, bg = colors.grey }, - c = { fg = colors.black, bg = colors.black }, - }, + if percentage >= 70 then + return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage) + end - insert = { a = { fg = colors.black, bg = colors.blue } }, - visual = { a = { fg = colors.black, bg = colors.cyan } }, - replace = { a = { fg = colors.black, bg = colors.red } }, + return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage) + end - inactive = { - a = { fg = colors.white, bg = colors.black }, - b = { fg = colors.white, bg = colors.black }, - c = { fg = colors.black, bg = colors.black }, - }, -} + return "" +end -require("lualine").setup { +return { options = { - theme = bubbles_theme, + theme = "catppuccin", component_separators = "|", section_separators = { left = "", right = "" }, + globalstatus = true, }, sections = { - lualine_a = { - { "mode", separator = { left = "" }, right_padding = 2 }, - }, - lualine_b = { "filename", "branch" }, - lualine_c = { "fileformat" }, + lualine_a = { "mode" }, + lualine_b = { "filetype", "branch", "diff" }, + lualine_c = { lsp_progress, "diagnostics" }, lualine_x = {}, - lualine_y = { "filetype", "progress" }, - lualine_z = { - { "location", separator = { right = "" }, left_padding = 2 }, - }, - }, - inactive_sections = { - lualine_a = { "filename" }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, + lualine_y = { "searchcount", "progress", "selectioncount" }, lualine_z = { "location" }, }, - tabline = {}, - extensions = {}, + tabline = { + 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" }, } diff --git a/home/tui/config/nvim/lua/config/nvim-navic.lua b/home/tui/config/nvim/lua/config/nvim-navic.lua index 1a205510..6e6df323 100644 --- a/home/tui/config/nvim/lua/config/nvim-navic.lua +++ b/home/tui/config/nvim/lua/config/nvim-navic.lua @@ -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 = " ", + }, +} diff --git a/home/tui/config/nvim/lua/lsp/attach.lua b/home/tui/config/nvim/lua/lsp/attach.lua index 589b6387..fa088719 100644 --- a/home/tui/config/nvim/lua/lsp/attach.lua +++ b/home/tui/config/nvim/lua/lsp/attach.lua @@ -1,6 +1,6 @@ -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer -local on_attach = function(_, bufnr) +local on_attach = function(client, bufnr) -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap = true, silent = true, buffer = bufnr } @@ -19,5 +19,6 @@ local on_attach = function(_, bufnr) vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "i", require "lsp.formatting", bufopts) + if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end end return on_attach diff --git a/home/tui/config/nvim/lua/plugins/barbar.lua b/home/tui/config/nvim/lua/plugins/barbar.lua deleted file mode 100644 index 459bdc02..00000000 --- a/home/tui/config/nvim/lua/plugins/barbar.lua +++ /dev/null @@ -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 -} diff --git a/home/tui/config/nvim/lua/plugins/barbecue.lua b/home/tui/config/nvim/lua/plugins/barbecue.lua deleted file mode 100644 index 995b0880..00000000 --- a/home/tui/config/nvim/lua/plugins/barbecue.lua +++ /dev/null @@ -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, -} diff --git a/home/tui/config/nvim/lua/plugins/feline.lua b/home/tui/config/nvim/lua/plugins/feline.lua deleted file mode 100644 index e49b574a..00000000 --- a/home/tui/config/nvim/lua/plugins/feline.lua +++ /dev/null @@ -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, -} diff --git a/home/tui/config/nvim/lua/plugins/fugitive.lua b/home/tui/config/nvim/lua/plugins/fugitive.lua deleted file mode 100644 index fd2b49fa..00000000 --- a/home/tui/config/nvim/lua/plugins/fugitive.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "tpope/vim-fugitive", - cmd = { "G", "Git" }, - lazy = true, -} diff --git a/home/tui/config/nvim/lua/plugins/lspconfig.lua b/home/tui/config/nvim/lua/plugins/lspconfig.lua index ce9b98a8..6b7cf417 100644 --- a/home/tui/config/nvim/lua/plugins/lspconfig.lua +++ b/home/tui/config/nvim/lua/plugins/lspconfig.lua @@ -13,6 +13,10 @@ return { { "hrsh7th/nvim-cmp" }, { "rafamadriz/friendly-snippets" }, { "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() require "lsp.config" @@ -35,7 +39,4 @@ return { }, 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 }, } diff --git a/home/tui/config/nvim/lua/plugins/lualine.lua b/home/tui/config/nvim/lua/plugins/lualine.lua index 2f1e049e..230f859f 100644 --- a/home/tui/config/nvim/lua/plugins/lualine.lua +++ b/home/tui/config/nvim/lua/plugins/lualine.lua @@ -1,6 +1,6 @@ return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, - event = { "BufReadPre", "BufNewFile" }, - config = require "config.lualine", + event = { "BufEnter" }, + config = function() require("lualine").setup(require "config.lualine") end, } diff --git a/home/tui/config/nvim/lua/plugins/nvim_navic.lua b/home/tui/config/nvim/lua/plugins/nvim_navic.lua index d53de2f4..54353ba3 100644 --- a/home/tui/config/nvim/lua/plugins/nvim_navic.lua +++ b/home/tui/config/nvim/lua/plugins/nvim_navic.lua @@ -2,5 +2,6 @@ return { "SmiteshP/nvim-navic", dependencies = "neovim/nvim-lspconfig", lazy = true, + config = true, opts = require "config.nvim-navic", } diff --git a/home/tui/config/nvim/lua/plugins/project.lua b/home/tui/config/nvim/lua/plugins/project.lua index e97cf62e..7eda78b3 100644 --- a/home/tui/config/nvim/lua/plugins/project.lua +++ b/home/tui/config/nvim/lua/plugins/project.lua @@ -1,5 +1,5 @@ return { "ahmedkhalf/project.nvim", - event = { "BufReadPre", "BufNewFile" }, + event = { "BufEnter" }, config = function() require("project_nvim").setup(require "config.project") end, }