mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nvim: run stylua
This commit is contained in:
parent
3f5e236fe5
commit
e91471432f
7 changed files with 28 additions and 11 deletions
|
|
@ -47,7 +47,8 @@ ls.add_snippets("typst", {
|
||||||
t("#entry("),
|
t("#entry("),
|
||||||
f(show_date_typst_entry),
|
f(show_date_typst_entry),
|
||||||
t { ")[", "" },
|
t { ")[", "" },
|
||||||
t(" "), i(0),
|
t(" "),
|
||||||
|
i(0),
|
||||||
t { "", "]" },
|
t { "", "]" },
|
||||||
}),
|
}),
|
||||||
s("lang", {
|
s("lang", {
|
||||||
|
|
@ -62,7 +63,9 @@ local function get_cms()
|
||||||
assert(vim.bo.commentstring ~= "", "comment string is not set")
|
assert(vim.bo.commentstring ~= "", "comment string is not set")
|
||||||
local left = vim.bo.commentstring:gsub("%s*%%s.*", "")
|
local left = vim.bo.commentstring:gsub("%s*%%s.*", "")
|
||||||
local right = vim.bo.commentstring:gsub(".*%%s%s*", "")
|
local right = vim.bo.commentstring:gsub(".*%%s%s*", "")
|
||||||
if right == "" then right = left end
|
if right == "" then
|
||||||
|
right = left
|
||||||
|
end
|
||||||
return { left = left, right = right }
|
return { left = left, right = right }
|
||||||
end
|
end
|
||||||
local function horizon(args)
|
local function horizon(args)
|
||||||
|
|
@ -122,7 +125,9 @@ ls.add_snippets("go", {
|
||||||
local of_filetype = function(fts)
|
local of_filetype = function(fts)
|
||||||
local ft = vim.bo.filetype
|
local ft = vim.bo.filetype
|
||||||
for _, v in ipairs(fts) do
|
for _, v in ipairs(fts) do
|
||||||
if v == ft then return true end
|
if v == ft then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,9 @@ require("lspconfig")["ltex_plus"].setup {
|
||||||
local ltex_dict = {}
|
local ltex_dict = {}
|
||||||
if vim.uv.fs_stat(ltex_dict_path) then
|
if vim.uv.fs_stat(ltex_dict_path) then
|
||||||
for line in io.lines(ltex_dict_path) do
|
for line in io.lines(ltex_dict_path) do
|
||||||
if not string.startswith(line, "#") and line ~= "" then table.insert(ltex_dict, line) end
|
if not string.startswith(line, "#") and line ~= "" then
|
||||||
|
table.insert(ltex_dict, line)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
client.config.settings.ltex.dictionary = {
|
client.config.settings.ltex.dictionary = {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ local state = require("telescope.state")
|
||||||
local vimgrep_arguments = { unpack(config.values.vimgrep_arguments) }
|
local vimgrep_arguments = { unpack(config.values.vimgrep_arguments) }
|
||||||
|
|
||||||
table.insert(vimgrep_arguments, "--hidden") -- search hidden
|
table.insert(vimgrep_arguments, "--hidden") -- search hidden
|
||||||
table.insert(vimgrep_arguments, "--glob") -- ignore git
|
table.insert(vimgrep_arguments, "--glob") -- ignore git
|
||||||
table.insert(vimgrep_arguments, "!**/.git/*")
|
table.insert(vimgrep_arguments, "!**/.git/*")
|
||||||
|
|
||||||
telescope.setup {
|
telescope.setup {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ require("nvim-treesitter.configs").setup {
|
||||||
disable = function(lang, buf)
|
disable = function(lang, buf)
|
||||||
local max_filesize = 100 * 1024 -- 100 KB
|
local max_filesize = 100 * 1024 -- 100 KB
|
||||||
local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
|
local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||||
if ok and stats and stats.size > max_filesize then return true end
|
if ok and stats and stats.size > max_filesize then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
indent = true,
|
indent = true,
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,17 @@ vim.api.nvim_create_autocmd("OptionSet", {
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("Retab", function(opts)
|
vim.api.nvim_create_user_command("Retab", function(opts)
|
||||||
if #opts.fargs ~= 2 then return print("should have exactly two argument: [src] and [dst]") end
|
if #opts.fargs ~= 2 then
|
||||||
|
return print("should have exactly two argument: [src] and [dst]")
|
||||||
|
end
|
||||||
local src = tonumber(opts.fargs[1])
|
local src = tonumber(opts.fargs[1])
|
||||||
local dst = tonumber(opts.fargs[2])
|
local dst = tonumber(opts.fargs[2])
|
||||||
if src == nil then print("first argument [src] is not a valid number") end
|
if src == nil then
|
||||||
if dst == nil then print("second argument [dst] is not a valid number") end
|
print("first argument [src] is not a valid number")
|
||||||
|
end
|
||||||
|
if dst == nil then
|
||||||
|
print("second argument [dst] is not a valid number")
|
||||||
|
end
|
||||||
|
|
||||||
vim.bo.shiftwidth = src
|
vim.bo.shiftwidth = src
|
||||||
vim.bo.tabstop = src
|
vim.bo.tabstop = src
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,9 @@ vim.api.nvim_create_autocmd("WinClosed", {
|
||||||
group = vim.api.nvim_create_augroup("conf_fugitive_prevwin", {}),
|
group = vim.api.nvim_create_augroup("conf_fugitive_prevwin", {}),
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local win = tonumber(args.match)
|
local win = tonumber(args.match)
|
||||||
if win == vim.api.nvim_get_current_win() and vim.bo.filetype == "fugitive" then vim.cmd.wincmd("p") end
|
if win == vim.api.nvim_get_current_win() and vim.bo.filetype == "fugitive" then
|
||||||
|
vim.cmd.wincmd("p")
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ indent_type = "Spaces"
|
||||||
indent_width = 4
|
indent_width = 4
|
||||||
quote_style = "AutoPreferDouble"
|
quote_style = "AutoPreferDouble"
|
||||||
call_parentheses = "NoSingleTable"
|
call_parentheses = "NoSingleTable"
|
||||||
collapse_simple_statement = "Always"
|
collapse_simple_statement = "FunctionOnly"
|
||||||
|
|
||||||
[sort_requires]
|
[sort_requires]
|
||||||
enabled = false
|
enabled = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue