diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-09-07 21:40:21 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-09-07 21:40:21 +0200 |
| commit | 17ef2292b271a8b0cce89aefde8a84c1a7e8c49a (patch) | |
| tree | 14168f362ecb70a62fa81df9a454a8a216931655 /lua | |
| parent | 4cb5d762460477dddb559bd006d77c9cef0ddbaf (diff) | |
| download | dotfiles-17ef2292b271a8b0cce89aefde8a84c1a7e8c49a.tar.gz dotfiles-17ef2292b271a8b0cce89aefde8a84c1a7e8c49a.zip | |
Toggle loclist
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/plugins/loclist.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lua/plugins/loclist.lua b/lua/plugins/loclist.lua new file mode 100644 index 0000000..9b72a94 --- /dev/null +++ b/lua/plugins/loclist.lua @@ -0,0 +1,18 @@ +local M = {} + +function M.loclist_toggle() + for _, info in ipairs(vim.fn.getwininfo()) do + if info.loclist == 1 then + vim.cmd('lclose') + return + end + end + + if next(vim.fn.getloclist(0)) == nil then + print('loc list empty') + return + end + vim.cmd('lopen') +end + +return M |
