style(snacks): enforce consistent quote style and formatting

This commit is contained in:
sankalp committed 2025-10-24 13:02:26 +05:45
1 parent 26e6cfb605
commit 5853a1f761
1 file changed
+92 -93
+92 -93
View File
@@ -1,5 +1,5 @@
return { return {
"folke/snacks.nvim", 'folke/snacks.nvim',
priority = 1000, priority = 1000,
lazy = false, lazy = false,
config = function() config = function()
@@ -9,18 +9,18 @@ return {
width = width or 0.9 width = width or 0.9
return { return {
layout = { layout = {
box = "horizontal", box = 'horizontal',
width = width, width = width,
min_width = 120, min_width = 120,
height = height, height = height,
{ {
box = "vertical", box = 'vertical',
border = "rounded", border = 'rounded',
title = "{title} {live} {flags}", title = '{title} {live} {flags}',
{ win = "input", height = 1, border = "bottom" }, { win = 'input', height = 1, border = 'bottom' },
{ win = "list", border = "none" }, { win = 'list', border = 'none' },
}, },
{ win = "preview", title = "{preview}", border = "rounded", width = preview_width }, { win = 'preview', title = '{preview}', border = 'rounded', width = preview_width },
}, },
} }
end end
@@ -36,27 +36,27 @@ return {
width = width, width = width,
min_width = 80, min_width = 80,
height = height, height = height,
border = "rounded", border = 'rounded',
box = "vertical", box = 'vertical',
{ {
win = "input", win = 'input',
height = 1, height = 1,
border = "rounded", border = 'rounded',
title = "{title} {live} {flags}", title = '{title} {live} {flags}',
title_pos = "center", title_pos = 'center',
}, },
{ win = "list", border = "hpad" }, { win = 'list', border = 'hpad' },
{ win = "preview", title = "{preview}", border = "rounded" }, { win = 'preview', title = '{preview}', border = 'rounded' },
}, },
} }
end end
local Snacks = require("snacks") local Snacks = require('snacks')
Snacks.setup({ Snacks.setup({
animate = { animate = {
enabled = true, enabled = true,
duration = 20, -- ms per step duration = 20, -- ms per step
easing = "linear", easing = 'linear',
fps = 60, fps = 60,
}, },
bigfile = { bigfile = {
@@ -66,31 +66,30 @@ return {
}, },
bufdelete = { enabled = true }, bufdelete = { enabled = true },
dashboard = { dashboard = {
enabled = true,
sections = { sections = {
{ section = "header" }, { section = 'header' },
{ {
icon = "", icon = '',
title = "Keymaps", title = 'Keymaps',
section = "keys", section = 'keys',
indent = 2, indent = 2,
padding = 1, padding = 1,
}, },
{ {
icon = "", icon = '',
title = "Recent Files", title = 'Recent Files',
section = "recent_files", section = 'recent_files',
indent = 2, indent = 2,
padding = 1, padding = 1,
}, },
{ {
icon = "", icon = '',
title = "Projects", title = 'Projects',
section = "projects", section = 'projects',
indent = 2, indent = 2,
padding = 1, padding = 1,
}, },
{ section = "startup" }, { section = 'startup' },
}, },
}, },
debug = { enabled = true }, debug = { enabled = true },
@@ -109,27 +108,27 @@ return {
indent = { indent = {
enabled = true, enabled = true,
priority = 1, priority = 1,
char = "▍", char = '▍',
only_scope = false, only_scope = false,
only_current = false, only_current = false,
hl = { hl = {
"SnacksIndent1", 'SnacksIndent1',
"SnacksIndent2", 'SnacksIndent2',
"SnacksIndent3", 'SnacksIndent3',
"SnacksIndent4", 'SnacksIndent4',
"SnacksIndent5", 'SnacksIndent5',
"SnacksIndent6", 'SnacksIndent6',
"SnacksIndent7", 'SnacksIndent7',
"SnacksIndent8", 'SnacksIndent8',
}, },
}, },
input = { input = {
enabled = true, enabled = true,
icon = "", icon = '',
icon_hl = "SnacksInputIcon", icon_hl = 'SnacksInputIcon',
icon_pos = "left", icon_pos = 'left',
prompt_pos = "title", prompt_pos = 'title',
win = { style = "input" }, win = { style = 'input' },
expand = true, expand = true,
}, },
layout = { enabled = true }, layout = { enabled = true },
@@ -141,29 +140,29 @@ return {
height = { min = 1, max = 0.6 }, height = { min = 1, max = 0.6 },
margin = { top = 0, right = 1, bottom = 0 }, margin = { top = 0, right = 1, bottom = 0 },
padding = true, padding = true,
sort = { "level", "added" }, sort = { 'level', 'added' },
level = vim.log.levels.TRACE, level = vim.log.levels.TRACE,
icons = { icons = {
debug = "", debug = '',
error = "", error = '',
info = "", info = '',
trace = "", trace = '',
warn = "", warn = '',
}, },
style = "compact", style = 'compact',
top_down = true, top_down = true,
date_format = "%R", date_format = '%R',
more_format = " ↓ %d lines ", more_format = ' ↓ %d lines ',
refresh = 50, refresh = 50,
}, },
notify = { enabled = true }, notify = { enabled = true },
picker = { picker = {
enabled = true, enabled = true,
icon = "", icon = '',
icon_hl = "SnacksPickerIcon", icon_hl = 'SnacksPickerIcon',
icon_pos = "left", icon_pos = 'left',
prompt_pos = "title", prompt_pos = 'title',
win = { style = "picker" }, win = { style = 'picker' },
expand = true, expand = true,
matchers = { matchers = {
frecency = true, frecency = true,
@@ -179,20 +178,20 @@ return {
layout = files_layout(), layout = files_layout(),
}, },
icons = { icons = {
icon_sources = { "nerd_fonts", "emoji" }, icon_sources = { 'nerd_fonts', 'emoji' },
layout = palette_layout(), layout = palette_layout(),
}, },
git_files = { layout = files_layout() }, git_files = { layout = files_layout() },
git_branches = { layout = { preset = "vertical" } }, git_branches = { layout = { preset = 'vertical' } },
git_status = { layout = files_layout() }, git_status = { layout = files_layout() },
help = { layout = { preset = "ivy_split" } }, help = { layout = { preset = 'ivy_split' } },
man = { layout = { preset = "ivy_split" } }, man = { layout = { preset = 'ivy_split' } },
notifications = { layout = palette_layout() }, notifications = { layout = palette_layout() },
projects = { layout = files_layout(0.8) }, projects = { layout = files_layout(0.8) },
recent = { layout = files_layout() }, recent = { layout = files_layout() },
search_history = { layout = palette_layout() }, search_history = { layout = palette_layout() },
smart = { layout = files_layout() }, smart = { layout = files_layout() },
undo = { layout = { preset = "ivy" } }, undo = { layout = { preset = 'ivy' } },
zoxide = { layout = files_layout(0.7) }, zoxide = { layout = files_layout(0.7) },
}, },
}, },
@@ -208,46 +207,46 @@ return {
edge = false, -- inner scope edge = false, -- inner scope
cursor = false, cursor = false,
treesitter = { blocks = { enabled = false } }, treesitter = { blocks = { enabled = false } },
desc = "inner scope", desc = 'inner scope',
}, },
ai = { ai = {
cursor = false, cursor = false,
min_size = 2, -- minimum size of the scope min_size = 2, -- minimum size of the scope
treesitter = { blocks = { enabled = false } }, treesitter = { blocks = { enabled = false } },
desc = "full scope", desc = 'full scope',
}, },
}, },
jump = { jump = {
["[a"] = { ['[a'] = {
min_size = 1, -- allow single line scopes min_size = 1, -- allow single line scopes
bottom = false, bottom = false,
cursor = false, cursor = false,
edge = true, edge = true,
treesitter = { blocks = { enabled = false } }, treesitter = { blocks = { enabled = false } },
desc = "jump to top edge of scope", desc = 'jump to top edge of scope',
}, },
["]a"] = { [']a'] = {
min_size = 1, -- allow single line scopes min_size = 1, -- allow single line scopes
bottom = true, bottom = true,
cursor = false, cursor = false,
edge = true, edge = true,
treesitter = { blocks = { enabled = false } }, treesitter = { blocks = { enabled = false } },
desc = "jump to bottom edge of scope", desc = 'jump to bottom edge of scope',
}, },
}, },
}, },
}, },
scratch = { scratch = {
enabled = true, enabled = true,
name = "SCRATCH", name = 'SCRATCH',
ft = function() ft = function()
if vim.bo.buftype == "" and vim.bo.filetype ~= "" then if vim.bo.buftype == '' and vim.bo.filetype ~= '' then
return vim.bo.filetype return vim.bo.filetype
end end
return "markdown" return 'markdown'
end, end,
icon = nil, icon = nil,
root = vim.fn.stdpath("data") .. "/scratch", root = vim.fn.stdpath('data') .. '/scratch',
autowrite = true, autowrite = true,
filekey = { filekey = {
cwd = true, cwd = true,
@@ -257,38 +256,38 @@ return {
win = { win = {
width = 120, width = 120,
height = 40, height = 40,
bo = { buftype = "", buflisted = false, bufhidden = "hide", swapfile = false }, bo = { buftype = '', buflisted = false, bufhidden = 'hide', swapfile = false },
minimal = false, minimal = false,
noautocmd = false, noautocmd = false,
zindex = 20, zindex = 20,
wo = { winhighlight = "NormalFloat:Normal" }, wo = { winhighlight = 'NormalFloat:Normal' },
border = "rounded", border = 'rounded',
title_pos = "center", title_pos = 'center',
footer_pos = "center", footer_pos = 'center',
keys = { keys = {
["execute"] = { ['execute'] = {
"<cr>", '<cr>',
function(_) function(_)
vim.cmd("%SnipRun") vim.cmd('%SnipRun')
end, end,
desc = "Execute buffer", desc = 'Execute buffer',
mode = { "n", "x" }, mode = { 'n', 'x' },
}, },
}, },
}, },
win_by_ft = { win_by_ft = {
lua = { lua = {
keys = { keys = {
["source"] = { ['source'] = {
"<leader>cr", '<leader>cr',
function(self) function(self)
local name = "scratch." local name = 'scratch.'
.. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.buf), ":e") .. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.buf), ':e')
Snacks.debug.run({ buf = self.buf, name = name }) Snacks.debug.run({ buf = self.buf, name = name })
end, end,
desc = "Source buffer", desc = 'Source buffer',
mode = { "n", "x" }, mode = { 'n', 'x' },
}, },
}, },
}, },
@@ -297,14 +296,14 @@ return {
scroll = { enabled = false }, scroll = { enabled = false },
statuscolumn = { statuscolumn = {
enabled = false, -- Change this to false enabled = false, -- Change this to false
left = { "mark", "sign" }, left = { 'mark', 'sign' },
right = { "fold", "git" }, right = { 'fold', 'git' },
folds = { folds = {
open = false, open = false,
git_hl = false, git_hl = false,
}, },
git = { git = {
patterns = { "GitSign", "MiniDiffSign" }, patterns = { 'GitSign', 'MiniDiffSign' },
}, },
refresh = 50, refresh = 50,
}, },
@@ -325,7 +324,7 @@ return {
statusline = false, statusline = false,
tabline = false, tabline = false,
}, },
win = { style = "zen" }, win = { style = 'zen' },
zoom = { zoom = {
toggles = {}, toggles = {},
show = { statusline = true, tabline = true }, show = { statusline = true, tabline = true },