diff --git a/.gitmodules b/.gitmodules index a9c6b42..4568257 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "vim/bundle/lightline.vim"] path = vim/bundle/lightline.vim url = https://github.com/itchyny/lightline.vim -[submodule "vim/bundle/vim-togglelist"] - path = vim/bundle/vim-togglelist - url = https://github.com/milkypostman/vim-togglelist.git [submodule "vim/bundle/vim-fugitive"] path = vim/bundle/vim-fugitive url = https://github.com/tpope/vim-fugitive.git @@ -88,3 +85,6 @@ [submodule "vim/bundle/vista.vim"] path = vim/bundle/vista.vim url = https://github.com/liuchengxu/vista.vim +[submodule "vim/bundle/qf.nvim"] + path = vim/bundle/qf.nvim + url = https://github.com/ten3roberts/qf.nvim diff --git a/readme.md b/readme.md index ffac077..25ce4ee 100644 --- a/readme.md +++ b/readme.md @@ -130,6 +130,7 @@ For a complete list of mappings specific to **darkcloud-nvimconfig**, check the * [nvim-surround](https://github.com/kylechui/nvim-surround): Add/change/delete surrounding delimiter pairs with ease * [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter): Treesitter configurations and abstraction layer for Neovim * [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects): Syntax aware text-objects, select, move, swap, and peek support +* [qf.nvim](https://github.com/ten3roberts/qf.nvim): Extends the default quickfix and location lists for neovim * [ReplaceWithRegister](https://github.com/vim-scripts/ReplaceWithRegister): Replace text with the contents of a register (for paste+replace without writing over the buffer) * [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim): Simplifies the transition between multiline and single-line code * [tabular](https://github.com/godlygeek/tabular): Vim script for text filtering and alignment @@ -139,7 +140,6 @@ For a complete list of mappings specific to **darkcloud-nvimconfig**, check the * [vim-pathogen](https://github.com/tpope/vim-pathogen): A plugin to load other plugins while keeping them isolated in their own directory structure rather than all dumped together * [vim-polyglot-darkcloud](https://github.com/prurigro/vim-polyglot-darkcloud): The darkcloud-nvimconfig fork of a meta-package that attempts to provide the best syntax plugins for each file type * [vim-signify](https://github.com/mhinz/vim-signify): When a version controlled file is changed, this displays a column showing where and how, and allows for navigation to and between differences -* [vim-togglelist](https://github.com/milkypostman/vim-togglelist): A simple plugin for vim that allows you to bind a key to toggle the Location List and the Quickfix List * [vim-trailing-whitespace](https://github.com/bronson/vim-trailing-whitespace): Highlights and allows for the easy removal of trailing whitespace in documents * [vista.vim](https://github.com/liuchengxu/vista.vim): Viewer & Finder for LSP symbols and tags diff --git a/vim/bundle/qf.nvim b/vim/bundle/qf.nvim new file mode 160000 index 0000000..e7db62a --- /dev/null +++ b/vim/bundle/qf.nvim @@ -0,0 +1 @@ +Subproject commit e7db62a4ec814c12585c0c8262d3304000a1af2e diff --git a/vim/bundle/vim-togglelist b/vim/bundle/vim-togglelist deleted file mode 160000 index 48f0d30..0000000 --- a/vim/bundle/vim-togglelist +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 48f0d30292efdf20edc883e61b121e6123e03df7 diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 672bf6f..2b91694 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -154,6 +154,9 @@ " >> | (N) -> next difference (vimdiff/signify) " << | (N) -> previous difference (vimdiff/signify) " +" [[ | (N) -> jump to previous issue in the location list (qf.nvim) +" ]] | (N) -> jump to the next issue in the location list (qf.nvim) +" " (selection) " | (N) -> select all text " | (V) -> select all text @@ -415,7 +418,7 @@ nnoremap ] ':Vista!!' "toggle the location list - nnoremap ':call ToggleLocationList()' + nnoremap lua require('qf').toggle('l', false) "} "SPELLCHECK:{ @@ -542,6 +545,10 @@ nmap [g (signify-prev-hunk) nmap >> ]g nmap << [g + + "jump to the previous and next issues in the location list + nnoremap [[ lua require('qf').above('l') + nnoremap ]] lua require('qf').below('l') "} "SELECTION:{ @@ -576,7 +583,7 @@ autocmd FileType qf map h k autocmd FileType qf map <2-LeftMouse> autocmd FileType qf map p - autocmd FileType qf if getwininfo(win_getid())[0]['loclist'] == 0|map q ':call ToggleQuickfixList()'|else|map q ':call ToggleLocationList()'|endif + autocmd FileType qf map q ':q' "vimdiff autocmd FilterWritePre * if &diff|nmap <> ':diffu'|endif diff --git a/vim/config/plugins/qf.lua b/vim/config/plugins/qf.lua new file mode 100644 index 0000000..0e028e4 --- /dev/null +++ b/vim/config/plugins/qf.lua @@ -0,0 +1,39 @@ +require("qf").setup { + -- Location list configuration + l = { + auto_close = true, -- Automatically close location/quickfix list if empty + auto_follow = 'prev', -- Follow current entry, possible values: prev,next,nearest, or false to disable + auto_follow_limit = 8, -- Do not follow if entry is further away than x lines + follow_slow = true, -- Only follow on CursorHold + auto_open = false, -- Automatically open list on QuickFixCmdPost + auto_resize = true, -- Auto resize and shrink location list if less than `max_height` + max_height = 12, -- Maximum height of location/quickfix list + min_height = 5, -- Minimum height of location/quickfix list + wide = true, -- Open list at the very bottom of the screen, stretching the whole width. + number = false, -- Show line numbers in list + relativenumber = false, -- Show relative line numbers in list + unfocus_close = false, -- Close list when window loses focus + focus_open = false, -- Auto open list on window focus if it contains items + }, + + -- Quickfix list configuration + c = { + auto_close = true, -- Automatically close location/quickfix list if empty + auto_follow = 'prev', -- Follow current entry, possible values: prev,next,nearest, or false to disable + auto_follow_limit = 8, -- Do not follow if entry is further away than x lines + follow_slow = true, -- Only follow on CursorHold + auto_open = false, -- Automatically open list on QuickFixCmdPost + auto_resize = true, -- Auto resize and shrink location list if less than `max_height` + max_height = 12, -- Maximum height of location/quickfix list + min_height = 5, -- Minimum height of location/quickfix list + wide = true, -- Open list at the very bottom of the screen, stretching the whole width. + number = false, -- Show line numbers in list + relativenumber = false, -- Show relative line numbers in list + unfocus_close = false, -- Close list when window loses focus + focus_open = false, -- Auto open list on window focus if it contains items + }, + + close_other = false, -- Close location list when quickfix list opens + pretty = false, -- Pretty print quickfix lists + silent = true, -- Suppress messages like "(1 of 3): *line content*" on jump +}