From f54c1fca3ba2c64ba02c3fb310b9cf683da4315d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20SALVI?= Date: Fri, 29 Dec 2023 23:55:02 +0100 Subject: [PATCH] improve tree --- lua/config/comment.lua | 1 - lua/config/init.lua | 10 +++++++ lua/plugins/bufferline.lua | 2 -- lua/plugins/gitsigns.lua | 9 ------ lua/plugins/indent-blankline.lua | 9 ------ lua/plugins/lualine.lua | 29 ------------------ lua/plugins/nvim-autopairs.lua | 9 ------ lua/plugins/nvim-tree.lua | 48 ------------------------------ lua/plugins/nvim-treesitter.lua | 29 ------------------ lua/plugins/onedark.lua | 4 --- lua/plugins/rainbow-delimiters.lua | 29 ------------------ lua/plugins/telescope.lua | 10 ------- lua/plugins/which-key.lua | 27 ----------------- 13 files changed, 10 insertions(+), 206 deletions(-) diff --git a/lua/config/comment.lua b/lua/config/comment.lua index e128c73..10b0b86 100644 --- a/lua/config/comment.lua +++ b/lua/config/comment.lua @@ -3,6 +3,5 @@ local ok, comment = pcall(require, "Comment") if not ok then return end - --- Load plugin comment.setup() diff --git a/lua/config/init.lua b/lua/config/init.lua index bdc4c8f..49691be 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -1,2 +1,12 @@ require("config/comment") require("config/bufferline") +require("config/gitsigns") +require("config/indent-blankline") +require("config/lualine") +require("config/nvim-autopairs") +require("config/nvim-tree") +require("config/nvim-treesitter") +require("config/onedark") +require("config/rainbow-delimiters") +require("config/telescope") +require("config/which-key") diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 6358ba4..a0ab9e4 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -1,7 +1,5 @@ - return { "akinsho/bufferline.nvim", version = "*", dependencies = "nvim-tree/nvim-web-devicons", - config = config } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 0b01434..b6f0f3b 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,12 +1,3 @@ -local function config() - --- Ensure plugin is avaiable - local gitsigns = require('gitsigns') - - --- Load plugin - gitsigns.setup() -end - return { "lewis6991/gitsigns.nvim", - config = config } diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua index 6b2d058..1de354f 100644 --- a/lua/plugins/indent-blankline.lua +++ b/lua/plugins/indent-blankline.lua @@ -1,12 +1,3 @@ -local function config() - --- Ensure plugin is avaiable - local ibl = require("ibl") - - --- Load plugin - ibl.setup() -end - return { "lukas-reineke/indent-blankline.nvim", - config = config, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 2805294..53c6b5d 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,35 +1,6 @@ -local function config() - --- Ensure plugins are avaiable - local lualine = require("lualine") - local lazy_status = require("lazy.status") - - --- Plugin options - opts = { - options = { - theme = "onedark", - }, - sections = { - lualine_x = { - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = "#ff9e64" }, - }, - { "encoding" }, - { "fileformat" }, - { "filetype" }, - }, - }, - } - - --- Load plugin - lualine.setup(opts) -end - return { 'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons', opt = true }, - config = config } diff --git a/lua/plugins/nvim-autopairs.lua b/lua/plugins/nvim-autopairs.lua index 6058de4..3c01225 100644 --- a/lua/plugins/nvim-autopairs.lua +++ b/lua/plugins/nvim-autopairs.lua @@ -1,13 +1,4 @@ -local function config() - --- Ensure plugin is avaiable - local nvimautopairs = require("nvim-autopairs") - - --- Load plugin - nvimautopairs.setup() -end - return { 'windwp/nvim-autopairs', event = "InsertEnter", - config = config } diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index 28cb92c..7f94679 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -1,50 +1,3 @@ -local function config() - --- Ensure plugin is avaiable - local nvimtree = require("nvim-tree") - - --- Unload netrw - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - - --- Plugin options - local opts = { - sort = { - -- sorter = "case_sensitive", - }, - view = { - width = 30, - }, - renderer = { - group_empty = true, - indent_markers = { - enable = true, - }, - icons = { - glyphs = { - folder = { - arrow_closed = "", -- arrow when folder is closed - arrow_open = "", -- arrow when folder is open - }, - }, - }, - }, - filters = { - dotfiles = false, - }, - } - - --- Load plugin - nvimtree.setup(opts) - - --- Override keymap - local km = vim.keymap.set - km('n', '', ':NvimTreeFocus') - km('n', 'ee', ':NvimTreeToggle') - km('n', 'ef', ':NvimTreeFindFileToggle') - km('n', 'ec', ':NvimTreeCollapse') - km('n', 'er', ':NvimTreeRefresh') -end - return { "nvim-tree/nvim-tree.lua", version = "*", @@ -52,5 +5,4 @@ return { dependencies = { "nvim-tree/nvim-web-devicons", }, - config = config } diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index dd5d9c1..c83dea1 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -1,33 +1,4 @@ -local function config() - --- Ensure plugin is avaiable - local treesitter = require("nvim-treesitter.configs") - - --- Plugin options - opts = { - highlight = { - enable = true, - }, - autotag = { - enable = true, - }, - auto_install = true, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "ss", - node_incremental = false, - scope_incremental = false, - node_decremental = false, - }, - }, - } - - --- Load plugin - treesitter.setup(opts) -end - return { "nvim-treesitter/nvim-treesitter", event = { "BufReadPre", "BufNewFile" }, - config = config } diff --git a/lua/plugins/onedark.lua b/lua/plugins/onedark.lua index c2f5615..93e206e 100644 --- a/lua/plugins/onedark.lua +++ b/lua/plugins/onedark.lua @@ -1,7 +1,3 @@ -local function config() - require('onedark').load() -end - return { "navarasu/onedark.nvim", priority = 1000, diff --git a/lua/plugins/rainbow-delimiters.lua b/lua/plugins/rainbow-delimiters.lua index 4031d03..bd2967d 100644 --- a/lua/plugins/rainbow-delimiters.lua +++ b/lua/plugins/rainbow-delimiters.lua @@ -1,33 +1,4 @@ -local function config() - local rainbow_delimiters = require 'rainbow-delimiters' - - vim.g.rainbow_delimiters = { - strategy = { - [''] = rainbow_delimiters.strategy['global'], - vim = rainbow_delimiters.strategy['local'], - }, - query = { - [''] = 'rainbow-delimiters', - lua = 'rainbow-blocks', - }, - priority = { - [''] = 110, - lua = 210, - }, - highlight = { - 'RainbowDelimiterYellow', - 'RainbowDelimiterBlue', - 'RainbowDelimiterOrange', - 'RainbowDelimiterGreen', - 'RainbowDelimiterViolet', - 'RainbowDelimiterCyan', - 'RainbowDelimiterRed', - }, - } -end - return { "hiphish/rainbow-delimiters.nvim", event = { "BufReadPre", "BufNewFile" }, - config = config } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 54dba24..19560b6 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,14 +1,4 @@ -local function config() - --- Ensute telescope is installed - local builtin = require('telescope.builtin') - --- Override keymaps - local km = vim.keymap.set - km('n', 'ff', builtin.find_files) - -end - return { 'nvim-telescope/telescope.nvim', tag = '0.1.5', dependencies = { 'nvim-lua/plenary.nvim' }, - config = config } diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 49f59a5..40bd2b9 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -1,31 +1,4 @@ -local function config() - --- Ensure plugin is avaiable - local wk = require("which-key") - - --- Global options - vim.o.timeout = true - vim.o.timeoutlen = 300 - - --- Add description to leader group - wk.register({ - n = { - name = "NoHighLight", - }, - e = { - name = "NvimTree", - }, - f = { - name = "Telescope" - }, - }, { prefix = "" }) - - --- Override keymap - local km = vim.keymap.set - km('n', '', ':WhichKey', { desc = "Which-key" }) -end - return { "folke/which-key.nvim", event = "VeryLazy", - config = config }