fix: Proper injection queries
This commit is contained in:
parent
e3ef9e4716
commit
8efea03163
3 changed files with 104 additions and 124 deletions
|
@ -23,9 +23,7 @@ in {
|
|||
];
|
||||
|
||||
autoCmd = [
|
||||
(autocmds.mk' ["FocusGained" "TermClose" "TermLeave"] "checktime" (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk' ["FocusGained" "TermClose" "TermLeave"] "checktime" (mkRaw ''
|
||||
function()
|
||||
if vim.o.buftype ~= "nofile" then
|
||||
vim.cmd("checktime")
|
||||
|
@ -33,17 +31,13 @@ in {
|
|||
end
|
||||
'') "Check if file needs to be reloaded when changed")
|
||||
|
||||
(autocmds.mk' ["TextYankPost"] "highlight_yank" (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk' ["TextYankPost"] "highlight_yank" (mkRaw ''
|
||||
function()
|
||||
(vim.hl or vim.highlight).on_yank()
|
||||
end
|
||||
'') "Highlight on yank")
|
||||
|
||||
(autocmds.mk' ["VimResized"] "resize_splits" (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk' ["VimResized"] "resize_splits" (mkRaw ''
|
||||
function()
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
|
@ -51,9 +45,7 @@ in {
|
|||
end
|
||||
'') "Resize splits on window resize")
|
||||
|
||||
(autocmds.mk' ["BufReadPost"] "last_loc" (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk' ["BufReadPost"] "last_loc" (mkRaw ''
|
||||
function(event)
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = event.buf
|
||||
|
@ -86,9 +78,7 @@ in {
|
|||
"spectre_panel"
|
||||
"startuptime"
|
||||
"tsplayground"
|
||||
] (mkRaw
|
||||
# lua
|
||||
''
|
||||
] (mkRaw ''
|
||||
function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.schedule(function()
|
||||
|
@ -104,9 +94,7 @@ in {
|
|||
end
|
||||
'') "Close some filetypes with <q>")
|
||||
|
||||
(autocmds.mk ["FileType"] "man_unlisted" ["man"] (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk ["FileType"] "man_unlisted" ["man"] (mkRaw ''
|
||||
function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
end
|
||||
|
@ -118,26 +106,20 @@ in {
|
|||
"typst"
|
||||
"gitcommit"
|
||||
"markdown"
|
||||
] (mkRaw
|
||||
# lua
|
||||
''
|
||||
] (mkRaw ''
|
||||
function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end
|
||||
'') "Wrap & check spelling in text files")
|
||||
|
||||
(autocmds.mk ["FileType"] "json_conceal" ["json" "jsonc" "json5"] (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk ["FileType"] "json_conceal" ["json" "jsonc" "json5"] (mkRaw ''
|
||||
function()
|
||||
vim.opt_local.conceallevel = 0
|
||||
end
|
||||
'') "Fix conceallevel for json files")
|
||||
|
||||
(autocmds.mk' ["BufWritePre"] "auto_create_dir" (mkRaw
|
||||
# lua
|
||||
''
|
||||
(autocmds.mk' ["BufWritePre"] "auto_create_dir" (mkRaw ''
|
||||
function(event)
|
||||
if event.match:match("^%w%w+:[\\/][\\/]") then
|
||||
return
|
||||
|
|
|
@ -165,9 +165,9 @@ in {
|
|||
# Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
++ [
|
||||
(keys.mk ["n"] "<LEADER>cd" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() vim.diagnostic.open_float() end"
|
||||
mkRaw ''
|
||||
function() vim.diagnostic.open_float() end
|
||||
''
|
||||
) "Line Diagnostics")
|
||||
]
|
||||
++ (
|
||||
|
@ -200,13 +200,11 @@ in {
|
|||
cmd = toLower dir;
|
||||
sev = sevs."${key}".key;
|
||||
in
|
||||
keys.mk ["n"] kmap
|
||||
(
|
||||
mkRaw
|
||||
# lua
|
||||
"function() vim.diagnostic.goto_${cmd}({ severity = ${sev} }) end"
|
||||
)
|
||||
"${dir} ${sevs."${key}".desc}"
|
||||
keys.mk ["n"] kmap (
|
||||
mkRaw ''
|
||||
function() vim.diagnostic.goto_${cmd}({ severity = ${sev} }) end
|
||||
''
|
||||
) "${dir} ${sevs."${key}".desc}"
|
||||
)
|
||||
{
|
||||
dir = ["Next" "Prev"];
|
||||
|
|
|
@ -23,62 +23,62 @@ in {
|
|||
|
||||
keymaps = [
|
||||
(keys.mk ["n"] "<LEADER>un" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.notifier.hide() end"
|
||||
mkRaw ''
|
||||
function() Snacks.notifier.hide() end
|
||||
''
|
||||
) "Dismiss All Notifications")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>bd" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.bufdelete() end"
|
||||
mkRaw ''
|
||||
function() Snacks.bufdelete() end
|
||||
''
|
||||
) "Delete Buffer")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>bo" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.bufdelete.other() end"
|
||||
mkRaw ''
|
||||
function() Snacks.bufdelete.other() end
|
||||
''
|
||||
) "Delete Other Buffers")
|
||||
|
||||
# LazyGit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
(keys.mk ["n"] "<LEADER>gg" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.lazygit() end"
|
||||
mkRaw ''
|
||||
function() Snacks.lazygit() end
|
||||
''
|
||||
) "Lazygit")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>gf" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.lazygit.log_file() end"
|
||||
mkRaw ''
|
||||
function() Snacks.lazygit.log_file() end
|
||||
''
|
||||
) "Lazygit Current File History")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>gl" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.lazygit.log() end"
|
||||
mkRaw ''
|
||||
function() Snacks.lazygit.log() end
|
||||
''
|
||||
) "Lazygit Log")
|
||||
|
||||
# Git - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
(keys.mk ["n"] "<LEADER>gb" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.git.blame_line() end"
|
||||
mkRaw ''
|
||||
function() Snacks.git.blame_line() end
|
||||
''
|
||||
) "Git Blame Line")
|
||||
|
||||
(keys.mk ["n" "x"] "<LEADER>gB" (
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.gitbrowse() end"
|
||||
mkRaw ''
|
||||
function() Snacks.gitbrowse() end
|
||||
''
|
||||
) "Git Browse (open)")
|
||||
|
||||
(keys.mk ["n" "x"] "<LEADER>gY" (mkRaw
|
||||
# lua
|
||||
''
|
||||
(keys.mk ["n" "x"] "<LEADER>gY" (
|
||||
mkRaw ''
|
||||
function()
|
||||
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end })
|
||||
end
|
||||
'') "Git Browse (copy)")
|
||||
''
|
||||
) "Git Browse (copy)")
|
||||
];
|
||||
|
||||
# Toggles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in a new issue