From 48b37e0ac66aede0e03dfc9d183eec8f276cf672 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 10 Feb 2023 09:27:22 +0000 Subject: [PATCH] Clean up some unused plugins, re-enable nvim-tree auto open with new autocmd --- config/nvim/lua/config/aerial.lua | 17 ----------------- config/nvim/lua/config/lualine.lua | 10 ---------- config/nvim/lua/config/nvim-tree.lua | 21 ++++++++++++++++++--- config/nvim/lua/config/telescope.lua | 1 - config/nvim/lua/plugins.lua | 17 ----------------- ohmyzsh/paths.zsh | 3 +++ 6 files changed, 21 insertions(+), 48 deletions(-) delete mode 100644 config/nvim/lua/config/aerial.lua delete mode 100644 config/nvim/lua/config/lualine.lua diff --git a/config/nvim/lua/config/aerial.lua b/config/nvim/lua/config/aerial.lua deleted file mode 100644 index 28e7ce34..00000000 --- a/config/nvim/lua/config/aerial.lua +++ /dev/null @@ -1,17 +0,0 @@ -local aerial = require('aerial') -aerial.setup { - -- backends = { "lsp", "treesitter", "markdown", "man" }, - layout = { - default_direction = "float", - }, - manage_folds = true, - close_on_select = true, - show_guides = true, - close_automatic_events = { - "unfocus", "switch_buffer", "unsupported" - }, - float = { - relative = "win", - }, - filter_kind = false, -} diff --git a/config/nvim/lua/config/lualine.lua b/config/nvim/lua/config/lualine.lua deleted file mode 100644 index d89edc3d..00000000 --- a/config/nvim/lua/config/lualine.lua +++ /dev/null @@ -1,10 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - }, - sections = { - -- lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_x = { 'aerial', 'filetype' } - }, - extensions = { 'aerial', 'fugitive', 'fzf', 'nvim-tree', 'toggleterm' } -} diff --git a/config/nvim/lua/config/nvim-tree.lua b/config/nvim/lua/config/nvim-tree.lua index 77788ef4..289c54bf 100644 --- a/config/nvim/lua/config/nvim-tree.lua +++ b/config/nvim/lua/config/nvim-tree.lua @@ -28,9 +28,6 @@ require('nvim-tree').setup { }, view = { centralize_selection = true, - float = { - enable = true, - }, }, renderer = { add_trailing = true, @@ -52,3 +49,21 @@ require('nvim-tree').setup { dotfiles = true, }, } + +local function open_nvim_tree(data) + + -- buffer is a real file on the disk + local real_file = vim.fn.filereadable(data.file) == 1 + + -- buffer is a [No Name] + local no_name = data.file == "" and vim.bo[data.buf].buftype == "" + + if not real_file and not no_name then + return + end + + -- open the tree, find the file but don't focus it + require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, }) +end + +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/config/nvim/lua/config/telescope.lua b/config/nvim/lua/config/telescope.lua index 65827773..2e56906e 100644 --- a/config/nvim/lua/config/telescope.lua +++ b/config/nvim/lua/config/telescope.lua @@ -28,6 +28,5 @@ require('telescope').setup { } require('telescope').load_extension('fzf') -require('telescope').load_extension('aerial') require('telescope').load_extension('notify') require('telescope').load_extension('projects') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index bb386d03..0a4dfe71 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -22,9 +22,6 @@ require('packer').startup { require 'config.tabby' end } - use { - "navarasu/onedark.nvim", - } use { 'rcarriga/nvim-notify', config = function() @@ -76,19 +73,8 @@ require('packer').startup { require("refactoring").setup() end } - use { - 'j-hui/fidget.nvim', - } - use { - 'stevearc/aerial.nvim', - config = function() - require 'config.aerial' - end - } use { 'tpope/vim-fugitive', - opt = true, - cmd = { 'G', 'Git' } } use { 'https://github.com/lewis6991/gitsigns.nvim.git', @@ -102,9 +88,6 @@ require('packer').startup { require 'config.feline' end } - use { - 'nvim-lualine/lualine.nvim', - } use { 'kyazdani42/nvim-tree.lua', config = function() diff --git a/ohmyzsh/paths.zsh b/ohmyzsh/paths.zsh index 1c939330..49ac52f0 100644 --- a/ohmyzsh/paths.zsh +++ b/ohmyzsh/paths.zsh @@ -2,3 +2,6 @@ LOCAL_BIN="$HOME/.local/bin" echo $PATH | grep -i "$LOCAL_BIN" - > /dev/null || export PATH=$PATH:$LOCAL_BIN + +DOTFILES_BIN="$(dirname $(dirname $(readlink -f $0)))/bin" +echo $PATH | grep -i "$DOTFILES_BIN" - > /dev/null || export PATH=$PATH:$DOTFILES_BIN