diff --git a/init.lua b/init.lua index 9f19978..f790dbe 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,7 @@ require("user.notify") require("user.navic") require("user.cmp") require("user.lsp") +require("user.colorscheme") require("user.telescope") require("user.treesitter") require("user.autopairs") diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua index 777afa3..4db41ff 100644 --- a/lua/user/bufferline.lua +++ b/lua/user/bufferline.lua @@ -21,7 +21,7 @@ bufferline.setup({ tab_size = 21, diagnostics = "nvim_lsp", diagnostics_update_in_insert = true, - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, + offsets = { { filetype = "NvimTree", text = "" } }, show_buffer_icons = true, show_buffer_close_icons = true, show_close_icon = true, diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua new file mode 100644 index 0000000..f42924d --- /dev/null +++ b/lua/user/colorscheme.lua @@ -0,0 +1,5 @@ +vim.g.nord_italic = false +vim.g.nord_contrast = true +vim.g.nord_borders = true +require("nord").set() +require("lsp-colors").setup() diff --git a/lua/user/lualine.lua b/lua/user/lualine.lua index ae1152e..0f3847e 100644 --- a/lua/user/lualine.lua +++ b/lua/user/lualine.lua @@ -6,26 +6,10 @@ end lualine.setup({ options = { icons_enabled = true, - theme = "onenord", + theme = "auto", component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = { "alpha", "NvimTree" }, - winbar = { - "help", - "startify", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "Trouble", - "alpha", - "lir", - "Outline", - "spectre_panel", - "toggleterm", - }, - }, + disabled_filetypes = { "alpha", "NvimTree" }, always_divide_middle = true, }, sections = { @@ -44,22 +28,6 @@ lualine.setup({ lualine_y = {}, lualine_z = {}, }, - winbar = { - lualine_a = { require("user.winbar").get_winbar() }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - inactive_winbar = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, tabline = {}, extensions = { "nvim-tree", diff --git a/lua/user/options.lua b/lua/user/options.lua index e898977..971bb97 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -36,6 +36,7 @@ vim.opt.incsearch = true vim.opt.colorcolumn = "120" vim.opt.list = true vim.opt.listchars:append("lead:.") +vim.opt.winbar = "%{%v:lua.require'user.winbar'.get_winbar()%}" vim.opt.foldcolumn = "2" vim.opt.foldlevel = 99 vim.opt.foldlevelstart = -1 diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 5435289..b7ee76f 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -48,19 +48,9 @@ return packer.startup(function(use) use("antoinemadec/FixCursorHold.nvim") use("kevinhwang91/promise-async") - -- Theme - use({ - "rmehri01/onenord.nvim", - config = function() - require("onenord").setup() - end, - }) - use({ - "folke/lsp-colors.nvim", - config = function() - require("lsp-colors").setup() - end, - }) + -- Themes + use("shaunsingh/nord.nvim") + use("folke/lsp-colors.nvim") -- Completion use("hrsh7th/nvim-cmp") diff --git a/lua/user/winbar.lua b/lua/user/winbar.lua index b298cb6..cbde77d 100644 --- a/lua/user/winbar.lua +++ b/lua/user/winbar.lua @@ -7,6 +7,29 @@ local function is_empty(s) return s == nil or s == "" end +M.winbar_filetype_exclude = { + "help", + "startify", + "dashboard", + "packer", + "neogitstatus", + "NvimTree", + "Trouble", + "alpha", + "lir", + "Outline", + "spectre_panel", + "toggleterm", +} + +local excludes = function() + if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then + vim.opt_local.winbar = nil + return true + end + return false +end + local function get_filename() return "%#WinBarFilename#" .. "%t" .. "%*" end @@ -45,6 +68,9 @@ local function get_fileicon() end function M.get_winbar() + if excludes() then + return "" + end if navic.is_available() then return get_fileicon() .. get_filename() .. get_location() else