-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
39 lines (33 loc) · 860 Bytes
/
init.lua
File metadata and controls
39 lines (33 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
vim.opt.mouse = ""
vim.opt.shiftwidth = 2
vim.opt.signcolumn = 'yes:2'
vim.opt.scrolloff = 10
require('custom.lazy')
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking text',
group = vim.api.nvim_create_augroup('jvf-highlight-yank', { clear = true }),
callback = function()
vim.highlight.on_yank()
end
})
local function toggle_quickfix()
local qf_open = false
for _, win in ipairs(vim.fn.getwininfo()) do
if win.quickfix == 1 then
qf_open = true
break
end
end
vim.diagnostic.setqflist()
local qflist = vim.fn.getqflist()
if qf_open then
vim.cmd("cclose")
elseif #qflist > 0 then
vim.cmd("copen")
else
vim.notify("nothing to fix. nice.", vim.log.levels.INFO)
end
end
vim.keymap.set("n", "<leader>q", toggle_quickfix)