From 31de50919a5228475ce8b573eda51fc86d212e91 Mon Sep 17 00:00:00 2001 From: Hubert Pelczarski <41551030+hoob3rt@users.noreply.github.com> Date: Tue, 11 May 2021 21:22:58 +0200 Subject: [PATCH] feat: quickfix extension (#229) * feat: quickfix extension --- README.md | 3 ++- doc/lualine.txt | 3 ++- lua/lualine/extensions/quickfix.lua | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 lua/lualine/extensions/quickfix.lua diff --git a/README.md b/README.md index 6787b3e..5e19258 100644 --- a/README.md +++ b/README.md @@ -387,11 +387,12 @@ extensions = { 'fzf' }
Available extensions +* chadtree * fugitive * fzf * nerdtree -* chadtree * nvim-tree +* quickfix
diff --git a/doc/lualine.txt b/doc/lualine.txt index 7f5ed78..8bc4be2 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -506,11 +506,12 @@ using a plugin which is supported you can load it this way: < Available extensions + * chadtree * fugitive * fzf * nerdtree - * chadtree * nvim-tree + * quickfix -------------------------------------------------------------------------------- CONGIG EXAMPLES *lualine_config_examples* diff --git a/lua/lualine/extensions/quickfix.lua b/lua/lualine/extensions/quickfix.lua new file mode 100644 index 0000000..c9af169 --- /dev/null +++ b/lua/lualine/extensions/quickfix.lua @@ -0,0 +1,19 @@ +-- Copyright (c) 2020-2021 hoob3rt +-- MIT license, see LICENSE for more details. +local function quickfix() return 'Quickfix List' end + +local function quickfix_title() return vim.fn.getqflist({title = 0}).title end + +local M = {} + +M.sections = { + lualine_a = {quickfix}, + lualine_b = {quickfix_title}, + lualine_z = {'location'} +} + +M.inactive_sections = vim.deepcopy(M.sections) + +M.filetypes = {'qf'} + +return M