From 3e94f2786fb15cf1953444886df899d19268428a Mon Sep 17 00:00:00 2001 From: Hubert Pelczarski <41551030+hoob3rt@users.noreply.github.com> Date: Mon, 12 Apr 2021 05:03:25 -0700 Subject: [PATCH] feat: addad chad&nnvim tree extensions (#167) * feat: addad chad&nnvim tree extensions * fix: updated all extensions * applied suggestions --- README.md | 2 ++ lua/lualine/extensions/chadtree.lua | 13 +++++++++++++ lua/lualine/extensions/nerdtree.lua | 4 +++- lua/lualine/extensions/nvim-tree.lua | 13 +++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 lua/lualine/extensions/chadtree.lua create mode 100644 lua/lualine/extensions/nvim-tree.lua diff --git a/README.md b/README.md index e500578..a76350a 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,8 @@ extensions = { 'fzf' } * fugitive * fzf * nerdtree +* chadtree +* nvim-tree diff --git a/lua/lualine/extensions/chadtree.lua b/lua/lualine/extensions/chadtree.lua new file mode 100644 index 0000000..f210ea5 --- /dev/null +++ b/lua/lualine/extensions/chadtree.lua @@ -0,0 +1,13 @@ +-- Copyright (c) 2020-2021 hoob3rt +-- MIT license, see LICENSE for more details. +local nerdtree = require('lualine.extensions.nerdtree') + +local M = {} + +M.sections = nerdtree.sections + +M.inactive_sections = nerdtree.inactive_sections + +M.filetypes = {'CHADTree'} + +return M diff --git a/lua/lualine/extensions/nerdtree.lua b/lua/lualine/extensions/nerdtree.lua index 7a6516c..f3741af 100644 --- a/lua/lualine/extensions/nerdtree.lua +++ b/lua/lualine/extensions/nerdtree.lua @@ -1,8 +1,10 @@ -- Copyright (c) 2020-2021 hoob3rt -- MIT license, see LICENSE for more details. +local function get_short_cwd() return vim.fn.fnamemodify(vim.fn.getcwd(), ':~') end + local M = {} -M.sections = {lualine_a = {vim.fn.getcwd}} +M.sections = {lualine_a = {get_short_cwd}} M.inactive_sections = M.sections diff --git a/lua/lualine/extensions/nvim-tree.lua b/lua/lualine/extensions/nvim-tree.lua new file mode 100644 index 0000000..ae73fd5 --- /dev/null +++ b/lua/lualine/extensions/nvim-tree.lua @@ -0,0 +1,13 @@ +-- Copyright (c) 2020-2021 hoob3rt +-- MIT license, see LICENSE for more details. +local nerdtree = require('lualine.extensions.nerdtree') + +local M = {} + +M.sections = nerdtree.sections + +M.inactive_sections = nerdtree.inactive_sections + +M.filetypes = {'NvimTree'} + +return M