mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-01 09:00:29 +08:00
Compare commits
No commits in common. "01d493a2b6e1f9785084752d140069f1b33255ae" and "a0fc3ad29004e5da49cdfff9c20fbebcfd54e8fb" have entirely different histories.
01d493a2b6
...
a0fc3ad290
@ -567,16 +567,6 @@ EOT
|
|||||||
_detact lua/spacevim/api/vim/window.lua
|
_detact lua/spacevim/api/vim/window.lua
|
||||||
_detact autoload/SpaceVim/logger.vim
|
_detact autoload/SpaceVim/logger.vim
|
||||||
;;
|
;;
|
||||||
quickfix.nvim)
|
|
||||||
git clone https://github.com/wsdjeg/quickfix.nvim.git detach/$1
|
|
||||||
cd detach/$1
|
|
||||||
_checkdir plugin
|
|
||||||
_checkdir lua
|
|
||||||
_detact_bundle quickfix.nvim lua/quickfix.lua
|
|
||||||
_detact_bundle quickfix.nvim plugin/quickfix.lua
|
|
||||||
_detact LICENSE
|
|
||||||
_detact_bundle quickfix.nvim README.md
|
|
||||||
;;
|
|
||||||
GitHub.vim)
|
GitHub.vim)
|
||||||
git clone https://github.com/wsdjeg/GitHub.vim.git detach/$1
|
git clone https://github.com/wsdjeg/GitHub.vim.git detach/$1
|
||||||
cd detach/$1
|
cd detach/$1
|
||||||
|
2
.github/workflows/async.yml
vendored
2
.github/workflows/async.yml
vendored
@ -7,7 +7,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
detachPlugin: ["FlyGrep.vim", "dein-ui.vim", "vim-todo", "iedit.vim", "scrollbar.vim", "vim-chat", "vim-cheat", "xmake.vim", "GitHub.vim", "JavaUnit.vim", "git.vim", "cpicker.nvim", "SourceCounter.vim", "vim-zettelkasten", "format.nvim", "record-key.nvim", "quickfix.nvim"]
|
detachPlugin: ["FlyGrep.vim", "dein-ui.vim", "vim-todo", "iedit.vim", "scrollbar.vim", "vim-chat", "vim-cheat", "xmake.vim", "GitHub.vim", "JavaUnit.vim", "git.vim", "cpicker.nvim", "SourceCounter.vim", "vim-zettelkasten", "format.nvim", "record-key.nvim"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -21,8 +21,6 @@ scriptencoding utf-8
|
|||||||
" 3. `enable_filetree_gitstatus`: enable/disable git status column in filetree.
|
" 3. `enable_filetree_gitstatus`: enable/disable git status column in filetree.
|
||||||
" 4. `enable_filetree_filetypeicon`: enable/disable filetype icons in filetree.
|
" 4. `enable_filetree_filetypeicon`: enable/disable filetype icons in filetree.
|
||||||
" 5. `enable_netrw`: enable/disable netrw, disabled by default.
|
" 5. `enable_netrw`: enable/disable netrw, disabled by default.
|
||||||
" 6. `enable_quickfix_key_bindings`: enable/disable quickfix.nvim, mappings
|
|
||||||
" for neovim quickfix window. This option is only for neovim.
|
|
||||||
"
|
"
|
||||||
" NOTE: the `enable_vimfiler_gitstatus` and `enable_filetree_gitstatus` option
|
" NOTE: the `enable_vimfiler_gitstatus` and `enable_filetree_gitstatus` option
|
||||||
" has been deprecated. Use layer option instead.
|
" has been deprecated. Use layer option instead.
|
||||||
@ -154,7 +152,6 @@ endif
|
|||||||
|
|
||||||
let s:enable_smooth_scrolling = 1
|
let s:enable_smooth_scrolling = 1
|
||||||
let s:enable_netrw = 0
|
let s:enable_netrw = 0
|
||||||
let s:enable_quickfix_key_bindings = 0
|
|
||||||
|
|
||||||
let g:_spacevim_enable_filetree_gitstatus = 0
|
let g:_spacevim_enable_filetree_gitstatus = 0
|
||||||
let g:_spacevim_enable_filetree_filetypeicon = 0
|
let g:_spacevim_enable_filetree_filetypeicon = 0
|
||||||
@ -241,10 +238,6 @@ function! SpaceVim#layers#core#plugins() abort
|
|||||||
\}])
|
\}])
|
||||||
call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-grepper' , { 'on_cmd' : 'Grepper',
|
call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-grepper' , { 'on_cmd' : 'Grepper',
|
||||||
\ 'loadconf' : 1} ])
|
\ 'loadconf' : 1} ])
|
||||||
|
|
||||||
if s:enable_quickfix_key_bindings
|
|
||||||
call add(plugins, [g:_spacevim_root_dir . 'bundle/quickfix.nvim' , { 'merged' : 0} ])
|
|
||||||
endif
|
|
||||||
return plugins
|
return plugins
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -1220,9 +1213,6 @@ function! SpaceVim#layers#core#set_variable(var) abort
|
|||||||
let s:enable_netrw = get(a:var,
|
let s:enable_netrw = get(a:var,
|
||||||
\ 'enable_netrw',
|
\ 'enable_netrw',
|
||||||
\ 0)
|
\ 0)
|
||||||
let s:enable_quickfix_key_bindings = get(a:var,
|
|
||||||
\ 'enable_quickfix_key_bindings',
|
|
||||||
\ s:enable_quickfix_key_bindings)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:defx_find_current_file() abort
|
function! s:defx_find_current_file() abort
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
# quickfix.nvim
|
|
||||||
|
|
||||||
> _quickfix.nvim_ is a plugin which provides default key bindings for quickfix window.
|
|
||||||
|
|
||||||
[](https://spacevim.org)
|
|
||||||
[](LICENSE)
|
|
||||||
|
|
||||||
<!-- vim-markdown-toc GFM -->
|
|
||||||
|
|
||||||
- [Install](#install)
|
|
||||||
- [Key bindings in quickfix window](#key-bindings-in-quickfix-window)
|
|
||||||
- [Options](#options)
|
|
||||||
- [Feedback](#feedback)
|
|
||||||
|
|
||||||
<!-- vim-markdown-toc -->
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
1. Using `quickfix.nvim` in SpaceVim:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[[layers]]
|
|
||||||
name = 'core'
|
|
||||||
enable_quickfix_key_bindings = true
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Using `quickfix.nvim` without SpaceVim:
|
|
||||||
|
|
||||||
```
|
|
||||||
Plug 'wsdjeg/quickfix.nvim'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Key bindings in quickfix window
|
|
||||||
|
|
||||||
| Key bindings | description |
|
|
||||||
| ------------ | ---------------------------------------------------------- |
|
|
||||||
| `dd` | remove item under cursor line in normal mode |
|
|
||||||
| `d` | remove selected items in visual mode |
|
|
||||||
| `c` | remove items which filename match input regex |
|
|
||||||
| `C` | remove items which filename not match input regex |
|
|
||||||
| `o` | remove items which error description match input regex |
|
|
||||||
| `O` | remove items which error description not match input regex |
|
|
||||||
| `u` | undo last change |
|
|
||||||
|
|
||||||
## Options
|
|
||||||
|
|
||||||
- `g:quickfix_mapping_delete`: default is `dd`
|
|
||||||
- `g:quickfix_mapping_visual_delete`: default is `d`
|
|
||||||
- `g:quickfix_mapping_filter_filename`: default is `c`
|
|
||||||
- `g:quickfix_mapping_rfilter_filename`: default is `C`
|
|
||||||
- `g:quickfix_mapping_filter_text`: default is `o`
|
|
||||||
- `g:quickfix_mapping_rfilter_text`: default is `O`
|
|
||||||
- `g:quickfix_mapping_undo`: default is `u`
|
|
||||||
|
|
||||||
## Feedback
|
|
||||||
|
|
||||||
The development of this plugin is in [`SpaceVim/bundle/quickfix.nvim`](https://github.com/SpaceVim/SpaceVim/tree/master/bundle/quickfix.nvim) directory.
|
|
||||||
|
|
||||||
If you encounter any bugs or have suggestions, please file an issue in the [issue tracker](https://github.com/SpaceVim/SpaceVim/issues)
|
|
@ -1,169 +0,0 @@
|
|||||||
--=============================================================================
|
|
||||||
-- qf.lua
|
|
||||||
-- Copyright 2025 Eric Wong
|
|
||||||
-- Author: Eric Wong < wsdjeg@outlook.com >
|
|
||||||
-- URL: https://spacevim.org
|
|
||||||
-- License: GPLv3
|
|
||||||
--=============================================================================
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
local qf_historys = {}
|
|
||||||
|
|
||||||
M.setup = function()
|
|
||||||
local group = vim.api.nvim_create_augroup('quickfix_mapping', {
|
|
||||||
clear = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('n', vim.g.quickfix_mapping_delete or 'dd', function()
|
|
||||||
local qflist = vim.fn.getqflist()
|
|
||||||
local line = vim.fn.line('.')
|
|
||||||
if #qflist >= 1 then
|
|
||||||
table.insert(qf_historys, vim.deepcopy(qflist))
|
|
||||||
table.remove(qflist, line)
|
|
||||||
end
|
|
||||||
vim.fn.setqflist(qflist)
|
|
||||||
vim.cmd(tostring(line))
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
local function table_remove(t, from, to)
|
|
||||||
local rst = {}
|
|
||||||
for i = 1, #t, 1 do
|
|
||||||
if i < from or i > to then
|
|
||||||
rst[#rst + 1] = t[i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return rst
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('v', vim.g.quickfix_mapping_visual_delete or 'd', function()
|
|
||||||
local esc = vim.api.nvim_replace_termcodes('<esc>', true, false, true)
|
|
||||||
vim.api.nvim_feedkeys(esc, 'x', false)
|
|
||||||
local qflist = vim.fn.getqflist()
|
|
||||||
local from = vim.fn.getpos("'<")[2]
|
|
||||||
local to = vim.fn.getpos("'>")[2]
|
|
||||||
if from > to then
|
|
||||||
from, to = to, from
|
|
||||||
end
|
|
||||||
local qf = table_remove(qflist, from, to)
|
|
||||||
if #qf ~= #qflist and #qflist ~= 0 then
|
|
||||||
table.insert(qf_historys, qflist)
|
|
||||||
end
|
|
||||||
vim.fn.setqflist(qf)
|
|
||||||
vim.cmd(tostring(from))
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('n', vim.g.quickfix_mapping_filter_filename or 'c', function()
|
|
||||||
local input_pattern = vim.fn.input('filter pattern:')
|
|
||||||
-- vim.cmd('noautocmd normal! :')
|
|
||||||
local re = vim.regex(input_pattern)
|
|
||||||
local qflist = vim.fn.getqflist()
|
|
||||||
local qf = {}
|
|
||||||
for _, item in ipairs(qflist) do
|
|
||||||
if not re:match_str(vim.fn.bufname(item.bufnr)) then
|
|
||||||
table.insert(qf, item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #qf ~= #qflist and #qflist ~= 0 then
|
|
||||||
table.insert(qf_historys, qflist)
|
|
||||||
end
|
|
||||||
vim.fn.setqflist(qf)
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('n', vim.g.quickfix_mapping_rfilter_filename or 'C', function()
|
|
||||||
local input_pattern = vim.fn.input('filter pattern:')
|
|
||||||
local re = vim.regex(input_pattern)
|
|
||||||
local qf = {}
|
|
||||||
local qflist = vim.fn.getqflist()
|
|
||||||
for _, item in ipairs(qflist) do
|
|
||||||
if re:match_str(vim.fn.bufname(item.bufnr)) then
|
|
||||||
table.insert(qf, item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #qf ~= #qflist and #qflist ~= 0 then
|
|
||||||
table.insert(qf_historys, qflist)
|
|
||||||
end
|
|
||||||
vim.fn.setqflist(qf)
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('n', vim.g.quickfix_mapping_filter_text or 'o', function()
|
|
||||||
local input_pattern = vim.fn.input('filter pattern:')
|
|
||||||
-- vim.cmd('noautocmd normal! :')
|
|
||||||
local re = vim.regex(input_pattern)
|
|
||||||
local qf = {}
|
|
||||||
local qflist = vim.fn.getqflist()
|
|
||||||
for _, item in ipairs(qflist) do
|
|
||||||
if not re:match_str(item.text) then
|
|
||||||
table.insert(qf, item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #qf ~= #qflist and #qflist ~= 0 then
|
|
||||||
table.insert(qf_historys, qflist)
|
|
||||||
end
|
|
||||||
vim.fn.setqflist(qf)
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('n', vim.g.quickfix_mapping_rfilter_text or 'O', function()
|
|
||||||
local input_pattern = vim.fn.input('filter pattern:')
|
|
||||||
-- vim.cmd('noautocmd normal! :')
|
|
||||||
local re = vim.regex(input_pattern)
|
|
||||||
local qf = {}
|
|
||||||
local qflist = vim.fn.getqflist()
|
|
||||||
for _, item in ipairs(qflist) do
|
|
||||||
if re:match_str(item.text) then
|
|
||||||
table.insert(qf, item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #qf ~= #qflist and #qflist ~= 0 then
|
|
||||||
table.insert(qf_historys, qflist)
|
|
||||||
end
|
|
||||||
vim.fn.setqflist(qf)
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
|
||||||
pattern = 'qf',
|
|
||||||
group = group,
|
|
||||||
callback = function(ev)
|
|
||||||
vim.keymap.set('n', vim.g.quickfix_mapping_undo or 'u', function()
|
|
||||||
local qf = table.remove(qf_historys)
|
|
||||||
if qf then
|
|
||||||
vim.fn.setqflist(qf)
|
|
||||||
end
|
|
||||||
end, { buffer = ev.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
@ -1,9 +0,0 @@
|
|||||||
--=============================================================================
|
|
||||||
-- quickfix.lua
|
|
||||||
-- Copyright 2025 Eric Wong
|
|
||||||
-- Author: Eric Wong < wsdjeg@outlook.com >
|
|
||||||
-- URL: https://spacevim.org
|
|
||||||
-- License: GPLv3
|
|
||||||
--=============================================================================
|
|
||||||
|
|
||||||
require('quickfix').setup()
|
|
@ -2285,8 +2285,6 @@ OPTIONS
|
|||||||
4. `enable_filetree_filetypeicon`: enable/disable filetype icons in
|
4. `enable_filetree_filetypeicon`: enable/disable filetype icons in
|
||||||
filetree.
|
filetree.
|
||||||
5. `enable_netrw`: enable/disable netrw, disabled by default.
|
5. `enable_netrw`: enable/disable netrw, disabled by default.
|
||||||
6. `enable_quickfix_key_bindings`: enable/disable quickfix.nvim, mappings
|
|
||||||
for neovim quickfix window. This option is only for neovim.
|
|
||||||
|
|
||||||
NOTE: the `enable_vimfiler_gitstatus` and `enable_filetree_gitstatus` option
|
NOTE: the `enable_vimfiler_gitstatus` and `enable_filetree_gitstatus` option
|
||||||
has been deprecated. Use layer option instead.
|
has been deprecated. Use layer option instead.
|
||||||
|
@ -27,39 +27,10 @@ nerdtree 或者 vimfiler,默认为 vimfiler,由 `filemanager` 选项控制
|
|||||||
|
|
||||||
- `filetree_show_hidden`: 在文件树内显示隐藏的文件,默认是 false。
|
- `filetree_show_hidden`: 在文件树内显示隐藏的文件,默认是 false。
|
||||||
- `enable_smooth_scrolling`: 启用或者禁用平滑滚屏快捷键,默认已启用。
|
- `enable_smooth_scrolling`: 启用或者禁用平滑滚屏快捷键,默认已启用。
|
||||||
- `enable_filetree_gitstatus`: 在文件树内显示 Git 文件状态
|
|
||||||
- `enable_filetree_filetypeicon`: 在文件树内显示文件类型图标
|
|
||||||
- `enable_netrw`: 启用或者禁用 netrw
|
|
||||||
- `enable_quickfix_key_bindings`: 启用或者禁用 quickfix 窗口内常用快捷键
|
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[layers]]
|
[[layers]]
|
||||||
name = 'core'
|
name = 'core'
|
||||||
filetree_show_hidden = true
|
filetree_show_hidden = true
|
||||||
enable_smooth_scrolling = true
|
enable_smooth_scrolling = true
|
||||||
filetree_opened_icon = ''
|
|
||||||
filetree_closed_icon = ''
|
|
||||||
```
|
```
|
||||||
|
|
||||||
如果 `enable_quickfix_key_bindings` 设置为 `true`,那么可以在 quickfix 窗口内使用如下快捷键:
|
|
||||||
|
|
||||||
| Key bindings | description |
|
|
||||||
| ------------ | ---------------------------------------------------------- |
|
|
||||||
| `dd` | remove item under cursor line in normal mode |
|
|
||||||
| `d` | remove selected items in visual mode |
|
|
||||||
| `c` | remove items which filename match input regex |
|
|
||||||
| `C` | remove items which filename not match input regex |
|
|
||||||
| `o` | remove items which error description match input regex |
|
|
||||||
| `O` | remove items which error description not match input regex |
|
|
||||||
| `u` | undo last change |
|
|
||||||
|
|
||||||
也可以在启动函数里面使用如下变量修改默认的按键:
|
|
||||||
|
|
||||||
- `g:quickfix_mapping_delete`: default is `dd`
|
|
||||||
- `g:quickfix_mapping_visual_delete`: default is `d`
|
|
||||||
- `g:quickfix_mapping_filter_filename`: default is `c`
|
|
||||||
- `g:quickfix_mapping_rfilter_filename`: default is `C`
|
|
||||||
- `g:quickfix_mapping_filter_text`: default is `o`
|
|
||||||
- `g:quickfix_mapping_rfilter_text`: default is `O`
|
|
||||||
- `g:quickfix_mapping_undo`: default is `u`
|
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ To use defx, please add following snippet into your configuration file.
|
|||||||
- `enable_filetree_gitstatus`: enable/disable git status column in filetree.
|
- `enable_filetree_gitstatus`: enable/disable git status column in filetree.
|
||||||
- `enable_filetree_filetypeicon`: enable/disable filetype icons in filetree.
|
- `enable_filetree_filetypeicon`: enable/disable filetype icons in filetree.
|
||||||
- `enable_netrw`: enable/disable netrw, disabled by default.
|
- `enable_netrw`: enable/disable netrw, disabled by default.
|
||||||
- `enable_quickfix_key_bindings`: enable/disable quickfix.nvim, mappings for neovim quickfix window. This option is only for neovim.
|
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[layers]]
|
[[layers]]
|
||||||
@ -48,27 +47,3 @@ To use defx, please add following snippet into your configuration file.
|
|||||||
filetree_opened_icon = ''
|
filetree_opened_icon = ''
|
||||||
filetree_closed_icon = ''
|
filetree_closed_icon = ''
|
||||||
```
|
```
|
||||||
|
|
||||||
If `enable_quickfix_key_bindings` is `true`, The following key bindings can be used in quickfix window,
|
|
||||||
and which also can be change in bootstrap function.
|
|
||||||
|
|
||||||
| Key bindings | description |
|
|
||||||
| ------------ | ---------------------------------------------------------- |
|
|
||||||
| `dd` | remove item under cursor line in normal mode |
|
|
||||||
| `d` | remove selected items in visual mode |
|
|
||||||
| `c` | remove items which filename match input regex |
|
|
||||||
| `C` | remove items which filename not match input regex |
|
|
||||||
| `o` | remove items which error description match input regex |
|
|
||||||
| `O` | remove items which error description not match input regex |
|
|
||||||
| `u` | undo last change |
|
|
||||||
|
|
||||||
Options to change these mappings:
|
|
||||||
|
|
||||||
- `g:quickfix_mapping_delete`: default is `dd`
|
|
||||||
- `g:quickfix_mapping_visual_delete`: default is `d`
|
|
||||||
- `g:quickfix_mapping_filter_filename`: default is `c`
|
|
||||||
- `g:quickfix_mapping_rfilter_filename`: default is `C`
|
|
||||||
- `g:quickfix_mapping_filter_text`: default is `o`
|
|
||||||
- `g:quickfix_mapping_rfilter_text`: default is `O`
|
|
||||||
- `g:quickfix_mapping_undo`: default is `u`
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user