Skip to content

Commit 38675d3

Browse files
committed
no qf
1 parent 61ee4b1 commit 38675d3

File tree

6 files changed

+82
-57
lines changed

6 files changed

+82
-57
lines changed
File renamed without changes.

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ curl -sSLf https://142857.red/files/nvimrc-install.sh | bash
125125
- `gsc` 预览类定义
126126
- `gso` 打开大纲
127127
- `gst` 打开项目文件树
128-
- `gsd` 查看所有静态检查语法错误
129-
- `gsq` 查看所有编译器报错
128+
- `gsd` 查看当前光标下的静态语法错误
129+
- `gss` 查看所有静态语法错误
130+
- `gsl` 查看所有编译器报错
130131
- `gsi` 开关 Inlay Hint
131132

132133
**标签页**

Diff for: key_details.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ int main() {
229229

230230
适用场景:如果你不喜欢 `viw``vaf` 之类一次性完成的选择,可以多次按 `+``-` 调整,渐进地选出想要的范围。
231231

232+
- `vm` 可视化选择任意大小的块
233+
232234
#### 语法块跳转 (nvim-treesitter)
233235

234236
- `]c` 下一个类开头
@@ -294,9 +296,9 @@ int main() {
294296

295297
- `gsc` 在小窗口中预览当前光标下类或变量的定义(但不跳转过去)
296298
- `gsf` 在小窗口中预览当前光标下函数的定义(但不跳转过去)
297-
- `gsd` 在弹出窗口中预览当前项目中的所有静态检查语法错误
298-
- `<C-w>d` 在小窗口中预览当前光标下存在的静态检查语法错误
299-
- `gsq` 在弹出窗口中预览当前项目中的所有编译器报错
299+
- `gss` 在弹出窗口中预览当前项目中的所有静态检查语法错误
300+
- `gsd` 在小窗口中预览当前光标下存在的静态检查语法错误
301+
- `gsl` 在弹出窗口中预览当前项目中的所有编译器报错
300302
- `gso` 打开/关闭大纲视图
301303
- `gst` 打开/关闭项目文件树
302304
- `gsi` 开启/关闭 Inlay Hint 功能
@@ -388,14 +390,12 @@ QuickFix 是 Vim 和 NeoVim 内置的功能,用于捕获编译器产生的错
388390

389391
可以通过以下两个快捷键定位到编译错误所在的位置:
390392

391-
- `<F6>` / `:cnext` 跳转到下一个编译错误所对应的文件和行号
392-
- `<S-F6>` / `:cprev` 跳转到上一个编译错误所对应的文件和行号
393-
394-
当 QuickFix 窗口还没有打开时,可以按 `<F6>` 唤出,之后再按 `<F6>` 则为跳转到下一个编译错误。
393+
- `:cnext` 跳转到下一个编译错误所对应的文件和行号
394+
- `:cprev` 跳转到上一个编译错误所对应的文件和行号
395395

396-
通常光标总是位于 QuickFix 外,发生错误的文件中,此时 `<F6>` `<S-F6>` 可以在多个错误位置之间来回跳转
396+
QuickFix 窗口还没有打开时,可以按 `<F6>` 唤出
397397

398-
光标在 QuickFix 窗口中时,按 `<Esc>` 或再按 `<F6>` 可以关闭 QuickFix。
398+
QuickFix 窗口中,按 `<Esc>` 或再按 `<F6>` 可以关闭 QuickFix。
399399

400400
#### 文件树 (nvim-tree)
401401

Diff for: lua/archvim/config/cmake-tools.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ require("cmake-tools").setup {
2929
opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values.
3030
default_opts = { -- a list of default and possible values for executors
3131
quickfix = {
32-
show = "always", -- "always", "only_on_error"
32+
show = "only_on_error", -- "always", "only_on_error"
3333
position = "botright", -- "bottom", "top", "belowright"
3434
size = 10,
3535
encoding = "utf-8",
36-
auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful.
36+
auto_close_when_success = false, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful.
3737
},
3838
toggleterm = {
3939
direction = "horizontal", -- 'vertical' | 'horizontal' | 'tab' | 'float'

Diff for: lua/archvim/config/lspconfig.lua

+22-20
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,28 @@ local function setup_lsp(event)
100100
})
101101
end
102102

103-
vim.api.nvim_create_autocmd({"CursorHold"}, {
104-
callback = function()
105-
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
106-
if vim.api.nvim_win_get_config(winid).zindex then
107-
return
108-
end
109-
end
110-
vim.diagnostic.open_float({
111-
scope = "cursor",
112-
focusable = false,
113-
close_events = {
114-
"CursorMoved",
115-
"CursorMovedI",
116-
"BufHidden",
117-
"InsertCharPre",
118-
"WinLeave",
119-
},
120-
})
121-
end,
122-
})
103+
-- vim.api.nvim_create_autocmd({"CursorHold"}, {
104+
-- callback = function()
105+
-- for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
106+
-- if vim.api.nvim_win_get_config(winid).zindex then
107+
-- return
108+
-- end
109+
-- end
110+
-- vim.diagnostic.open_float({
111+
-- scope = "cursor",
112+
-- focusable = false,
113+
-- close_events = {
114+
-- "CursorMoved",
115+
-- "CursorMovedI",
116+
-- "BufHidden",
117+
-- "InsertCharPre",
118+
-- "WinLeave",
119+
-- "BufEnter",
120+
-- "BufLeave",
121+
-- },
122+
-- })
123+
-- end,
124+
-- })
123125

124126
if vim.lsp.buf.signature_help ~= nil and require'archvim.options'.enable_signature_help then
125127
vim.api.nvim_create_autocmd({'CursorHoldI'}, {

Diff for: lua/archvim/mappings.lua

+46-24
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,34 @@ vim.keymap.set({"v", "n"}, "gl", "(v:count == 0 || v:count == 1 ? '^$' : '^$' .
4949
vim.keymap.set({"v", "n"}, "gm", "gM", { noremap = true })
5050
vim.keymap.set({"v", "n"}, "gM", "gm", { noremap = true })
5151
vim.keymap.set({"v", "n", "i"}, "<F4>", "<cmd>wa<CR>")
52-
vim.keymap.set({"v", "n", "i"}, "<F6>", function ()
53-
if is_quickfix_open() then
54-
if get_current_quickfix_entry() then
55-
return "<cmd>cn<CR>"
56-
else
57-
return "<cmd>cc<CR>"
58-
end
59-
else
60-
return "<cmd>cc<CR>"
61-
end
62-
end, { noremap = true, expr = true })
63-
vim.keymap.set({"v", "n", "i"}, "<F18>", function ()
64-
if is_quickfix_open() then
65-
if get_current_quickfix_entry() then
66-
return "<cmd>cp<CR>"
67-
else
68-
return "<cmd>cc<CR>"
69-
end
70-
else
71-
return "<cmd>cc<CR>"
72-
end
73-
end, { noremap = true, expr = true })
52+
vim.keymap.set({"v", "n", "i"}, "<F6>", "<cmd>cclose | Trouble qflist toggle<CR>")
53+
vim.keymap.set({"v", "n", "i"}, "<F18>", "<cmd>copen<CR>")
54+
-- vim.keymap.set({"v", "n", "i"}, "<F6>", function ()
55+
-- if is_quickfix_open() then
56+
-- return "<cmd>cclose<CR>"
57+
-- -- if get_current_quickfix_entry() then
58+
-- -- return "<cmd>cn<CR>"
59+
-- -- else
60+
-- -- return "<cmd>cc<CR>"
61+
-- -- end
62+
-- else
63+
-- -- return "<cmd>cc<CR>"
64+
-- return "<cmd>copen<CR>"
65+
-- end
66+
-- end, { noremap = true, expr = true })
67+
-- -- vim.keymap.set({"v", "n", "i"}, "<F18>", function ()
68+
-- -- if is_quickfix_open() then
69+
-- -- return "<cmd>cclose<CR>"
70+
-- -- -- if get_current_quickfix_entry() then
71+
-- -- -- return "<cmd>cp<CR>"
72+
-- -- -- else
73+
-- -- -- return "<cmd>cclose<CR>"
74+
-- -- -- end
75+
-- -- else
76+
-- -- -- return "<cmd>cc<CR>"
77+
-- -- return "<cmd>copen<CR>"
78+
-- -- end
79+
-- -- end, { noremap = true, expr = true })
7480
vim.keymap.set({"v", "n", "i", "t"}, "<F7>", "<cmd>NvimTreeFindFileToggle<CR>", { silent = true })
7581
vim.keymap.set({"v", "n", "i", "t"}, "<F9>", "<cmd>Trouble diagnostics toggle focus=false<CR>", { silent = true })
7682
vim.keymap.set({"v", "n", "i", "t"}, "<F21>", "<cmd>Trouble diagnostics toggle focus=false filter.buf=0<CR>", { silent = true })
@@ -184,9 +190,25 @@ vim.keymap.set("n", "gD", function()
184190
vim.lsp.buf.declaration()
185191
end)
186192
-- 开关静态分析错误列表
187-
vim.keymap.set("n", "gsd", "<cmd>Trouble diagnostics toggle<CR>")
193+
vim.keymap.set("n", "gss", "<cmd>Trouble diagnostics toggle<CR>")
188194
-- 开关编译器报错列表
189-
vim.keymap.set("n", "gsq", "<cmd>Trouble qflist toggle<CR>")
195+
vim.keymap.set("n", "gsl", "<cmd>cclose | Trouble qflist toggle<CR>")
196+
-- 当前光标下的静态分析错误
197+
vim.keymap.set("n", "gsd", function()
198+
vim.diagnostic.open_float({
199+
scope = "cursor",
200+
focusable = false,
201+
close_events = {
202+
"CursorMoved",
203+
"CursorMovedI",
204+
"BufHidden",
205+
"InsertCharPre",
206+
"WinLeave",
207+
"BufEnter",
208+
"BufLeave",
209+
},
210+
})
211+
end)
190212
-- 开关 Inlay Hint
191213
vim.keymap.set("n", "gsi", function()
192214
if vim.lsp.inlay_hint ~= nil then

0 commit comments

Comments
 (0)