diff --git a/.config/nvim/lua/config/keymaplist.lua b/.config/nvim/lua/config/keymaplist.lua index 04cd26063..f6e06a23d 100644 --- a/.config/nvim/lua/config/keymaplist.lua +++ b/.config/nvim/lua/config/keymaplist.lua @@ -48,7 +48,7 @@ M.whichkey = { n = { ["w"] = { "w!", "Save" }, ["q"] = { function() require("funcs").buf_kill() end, "Close" }, - -- TODO: filepicker ["f"] = {}, + ["f"] = { function() require("lf").start("~") end, "File Picker" }, ["h"] = { "nohlsearch", "Clear Highlights" }, u = { name = "Utility", @@ -181,9 +181,9 @@ M.whichkey = { }, } }, - nvimtree = { + lf = { n = { - ["e"] = { "NvimTreeToggle", "Toggle Filetree" }, + ["e"] = { function() require('lf').start() end, "File Picker" }, } }, alpha = { diff --git a/.config/nvim/lua/plugins/config/bufferline.lua b/.config/nvim/lua/plugins/config/bufferline.lua index 7afda062c..9a95ab3b6 100644 --- a/.config/nvim/lua/plugins/config/bufferline.lua +++ b/.config/nvim/lua/plugins/config/bufferline.lua @@ -10,14 +10,14 @@ end local icons = require 'config.iconlist' local config = { - highlights = { - background = { - italic = true, - }, - buffer_selected = { - bold = true, - }, - }, + -- highlights = { + -- background = { + -- italic = true, + -- }, + -- buffer_selected = { + -- bold = true, + -- }, + -- }, options = { mode = "buffers", -- set to "tabs" to only show tabpages instead numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function @@ -50,9 +50,6 @@ local config = { tab_size = 18, diagnostics = "nvim_lsp", diagnostics_update_in_insert = false, - diagnostics_indicator = diagnostics_indicator, - -- NOTE: this will be called a lot so don't do any heavy processing here - custom_filter = custom_filter, offsets = { { filetype = "undotree", @@ -104,37 +101,4 @@ local config = { }, } -local function diagnostics_indicator(num, _, diagnostics, _) - local result = {} - local symbols = { - error = icons.diagnostics.Error, - warning = icons.diagnostics.Warning, - info = icons.diagnostics.Info, - } - for name, count in pairs(diagnostics) do - if symbols[name] and count > 0 then - table.insert(result, symbols[name] .. " " .. count) - end - end - result = table.concat(result, " ") - return #result > 0 and result or "" -end - -local function custom_filter(buf, buf_nums) - local logs = vim.tbl_filter(function(b) - return is_ft(b, "log") - end, buf_nums) - if vim.tbl_isempty(logs) then - return true - end - local tab_num = vim.fn.tabpagenr() - local last_tab = vim.fn.tabpagenr "$" - local is_log = is_ft(buf, "log") - if last_tab == 1 then - return true - end - -- only show log buffers in secondary tabs - return (tab_num == last_tab and is_log) or (tab_num ~= last_tab and not is_log) -end - bufferline.setup(config) diff --git a/.config/nvim/lua/plugins/config/lf.lua b/.config/nvim/lua/plugins/config/lf.lua new file mode 100644 index 000000000..4971019d7 --- /dev/null +++ b/.config/nvim/lua/plugins/config/lf.lua @@ -0,0 +1,9 @@ +-- Defaults +require("lf").setup({ + winblend = 0, + highlights = { + border = "Normal", + background = "Normal", + }, + border = "rounded", +}) diff --git a/.config/nvim/lua/plugins/config/nvim-tree.lua b/.config/nvim/lua/plugins/config/nvim-tree.lua deleted file mode 100644 index 8e51ec725..000000000 --- a/.config/nvim/lua/plugins/config/nvim-tree.lua +++ /dev/null @@ -1,68 +0,0 @@ -local status_ok, nvim_tree = pcall(require, 'nvim-tree') -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, 'nvim-tree.config') -if not config_status_ok then - return -end - -local tree_cb = nvim_tree_config.nvim_tree_callback -local icons = require('config.iconlist') - -nvim_tree.setup { - update_focused_file = { - enable = true, - update_cwd = true, - }, - renderer = { - root_folder_modifier = ":t", - icons = { - glyphs = { - default = icons.ui.File, - symlink = icons.ui.FileSymlink, - folder = { - arrow_open = icons.ui.ChevronShortDown, - arrow_closed = icons.ui.ChevronShortRight, - default = icons.ui.Folder, - open = icons.ui.FolderOpen, - empty = icons.ui.EmptyFolder, - empty_open = icons.ui.EmptyFolderOpen, - symlink = icons.ui.FolderSymlink, - symlink_open = icons.ui.FolderSymlink, - }, - git = { - unstaged = icons.git.FileUnstaged, - staged = icons.git.FileStaged, - unmerged = icons.git.FileUnmerged, - renamed = icons.git.FileRenamed, - untracked = icons.git.FileUntracked, - deleted = icons.git.FileDeleted, - ignored = icons.git.FileIgnored, - }, - }, - }, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { - hint = icons.diagnostics.BoldHint, - info = icons.diagnostics.BoldInformation, - warning = icons.diagnostics.BoldWarning, - error = icons.diagnostics.BoldError, - }, - }, - view = { - width = 30, - side = "left", - mappings = { - list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/config/toggleterm.lua b/.config/nvim/lua/plugins/config/toggleterm.lua index bb322b30a..b6d8ada51 100644 --- a/.config/nvim/lua/plugins/config/toggleterm.lua +++ b/.config/nvim/lua/plugins/config/toggleterm.lua @@ -16,7 +16,12 @@ toggleterm.setup({ close_on_exit = true, shell = vim.o.shell, float_opts = { - border = "curved", + winblend = 0, + highlights = { + border = "Normal", + background = "Normal", + }, + border = "rounded", }, }) diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua index adc8c6a2c..747fff0f9 100644 --- a/.config/nvim/lua/plugins/init.lua +++ b/.config/nvim/lua/plugins/init.lua @@ -48,9 +48,9 @@ local plugins = { setup = function() require('funcs').on_file_open("bufferline.nvim") + require('funcs').map("bufferline") end, config = function() - require('funcs').map("bufferline") require('plugins.config.bufferline') end, }, @@ -71,9 +71,9 @@ local plugins = { after = "nvim-treesitter", setup = function() require('funcs').on_file_open("indent-blankline.nvim") + require('funcs').map("blankline") end, config = function() - require('funcs').map("blankline") require('plugins.config.indent-blankline') end, }, @@ -88,9 +88,9 @@ local plugins = { { "RRethy/vim-illuminate", setup = function() require('funcs').on_file_open("vim-illuminate") + require('funcs').map("illuminate") end, config = function() - require('funcs').map("illuminate") require('plugins.config.illuminate') end, }, @@ -133,9 +133,9 @@ local plugins = { after = "mason-lspconfig.nvim", setup = function() require('funcs').on_file_open("nvim-lspconfig") + require('funcs').map("lspconfig") end, config = function() - require('funcs').map("lspconfig") require('plugins.config.lspconfig') end, }, @@ -156,9 +156,9 @@ local plugins = { { "mfussenegger/nvim-dap", setup = function() require('funcs').on_file_open("nvim-dap") + require('funcs').map("dap") end, config = function() - require('funcs').map("dap") require('plugins.config.dap') end, }, @@ -195,28 +195,28 @@ local plugins = { end, }, { "numToStr/Comment.nvim", - setup = function() - require('funcs').on_file_open("Comment.nvim") - end, config = function() - require('funcs').map("comment") require('plugins.config.comment') end, - }, - { "kyazdani42/nvim-tree.lua", - ft = "alpha", - cmd = { "NvimTreeToggle", "NvimTreeFocus" }, - config = function() - require('funcs').map("nvimtree") - require('plugins.config.nvim-tree') + setup = function() + require('funcs').on_file_open("Comment.nvim") + require('funcs').map("comment") end, }, + { "lmburns/lf.nvim", + config = function() + require('plugins.config.lf') + require('funcs').map("lf") + end + }, { "nvim-telescope/telescope.nvim", cmd = "Telescope", config = function() - require('funcs').map("telescope") require('plugins.config.telescope') end, + setup = function() + require('funcs').map("telescope") + end, }, { "ahmedkhalf/project.nvim", cmd = "Telescope",