(nvim) format all lua files

This commit is contained in:
juancwu 2025-09-05 09:39:31 -04:00
commit 9844c832ba
32 changed files with 1200 additions and 1186 deletions

View file

@ -1,30 +1,30 @@
return { return {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' }, dependencies = { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
ft = { ft = {
'html', "html",
'javascript', "javascript",
'typescript', "typescript",
'javascriptreact', "javascriptreact",
'typescriptreact', "typescriptreact",
'svelte', "svelte",
'vue', "vue",
'tsx', "tsx",
'jsx', "jsx",
'xml', "xml",
'php', "php",
'markdown', "markdown",
'astro', "astro",
'glimmer', "glimmer",
'handlebars', "handlebars",
'hbs', "hbs",
'templ', "templ",
}, },
config = function() config = function()
local autotag = require('nvim-ts-autotag') local autotag = require("nvim-ts-autotag")
autotag.setup({ autotag.setup({
enable = true, enable = true,
enable_close_on_slash = false, enable_close_on_slash = false,
}) })
end end,
} }

View file

@ -4,31 +4,30 @@ return {
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
}, },
config = function() config = function()
local comment = require('Comment') local comment = require("Comment")
comment.setup({ comment.setup({
pre_hook = function(ctx) pre_hook = function(ctx)
-- only for tsx/jsx filetypes -- only for tsx/jsx filetypes
if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then
local U = require('Comment.utils') local U = require("Comment.utils")
-- determine wheter to use linwise or blockwise commentstring -- determine wheter to use linwise or blockwise commentstring
local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline' local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"
-- determine the location where to calcualte commentstring from -- determine the location where to calcualte commentstring from
local location = nil local location = nil
if ctx.ctype == U.ctype.blockwise then if ctx.ctype == U.ctype.blockwise then
location = require('ts_context_commentstring.utils').get_cursor_location() location = require("ts_context_commentstring.utils").get_cursor_location()
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
location = require('ts_context_commentstring.utils').get_visual_start_location() location = require("ts_context_commentstring.utils").get_visual_start_location()
end end
return require('ts_context_commentstring.internal').calculate_commentstring({ return require("ts_context_commentstring.internal").calculate_commentstring({
key = type, key = type,
location = location, location = location,
}) })
end end
end, end,
}) })
end end,
} }

View file

@ -58,4 +58,3 @@ return {
}) })
end, end,
} }

View file

@ -13,7 +13,7 @@ return {
"GRemove", "GRemove",
"GRename", "GRename",
"Glgrep", "Glgrep",
"Gedit" "Gedit",
}, },
keys = { keys = {
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git status" }, { "<leader>gs", "<cmd>Git<CR>", desc = "Git status" },

View file

@ -4,16 +4,16 @@ return {
current_line_blame = true, current_line_blame = true,
current_line_blame_opts = { current_line_blame_opts = {
virt_text = true, virt_text = true,
virt_text_pos = 'eol', virt_text_pos = "eol",
delay = 1000, delay = 1000,
ignore_whitespace = false ignore_whitespace = false,
}, },
signs = { signs = {
add = { text = '+' }, add = { text = "+" },
change = { text = '~' }, change = { text = "~" },
delete = { text = '_' }, delete = { text = "_" },
topdelete = { text = '-' }, topdelete = { text = "-" },
changedelete = { text = '~' }, changedelete = { text = "~" },
}, },
}, },
} }

View file

@ -8,11 +8,19 @@ return {
vim.keymap.set("n", "<leader>a", mark.add_file) vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu) vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<leader>q", function() ui.nav_file(1) end) vim.keymap.set("n", "<leader>q", function()
vim.keymap.set("n", "<leader>w", function() ui.nav_file(2) end) ui.nav_file(1)
vim.keymap.set("n", "<leader>e", function() ui.nav_file(3) end) end)
vim.keymap.set("n", "<leader>r", function() ui.nav_file(4) end) vim.keymap.set("n", "<leader>w", function()
ui.nav_file(2)
end)
vim.keymap.set("n", "<leader>e", function()
ui.nav_file(3)
end)
vim.keymap.set("n", "<leader>r", function()
ui.nav_file(4)
end)
vim.keymap.set("n", "<leader>,", ui.nav_prev) vim.keymap.set("n", "<leader>,", ui.nav_prev)
vim.keymap.set("n", "<leader>.", ui.nav_next) vim.keymap.set("n", "<leader>.", ui.nav_next)
end end,
} }

View file

@ -8,5 +8,5 @@ return {
show_end = true, show_end = true,
}, },
}, },
main = "ibl" main = "ibl",
} }

View file

@ -1,9 +1,9 @@
return { return {
'folke/lazydev.nvim', "folke/lazydev.nvim",
ft = 'lua', ft = "lua",
opts = { opts = {
library = { library = {
{ path = 'luvit-meta/library', words = { 'vim%.uv' } }, { path = "luvit-meta/library", words = { "vim%.uv" } },
}, },
}, },
} }

View file

@ -2,9 +2,9 @@ return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true }, dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
config = function() config = function()
local lualine = require('lualine') local lualine = require("lualine")
lualine.setup { lualine.setup({
options = { options = {
icons_enabled = false, icons_enabled = false,
--[[ section_separators = { --[[ section_separators = {
@ -15,44 +15,48 @@ return {
left = '', left = '',
right = '' right = ''
}, ]] }, ]]
section_separators = '', section_separators = "",
component_separators = '|', component_separators = "|",
disabled_filetypes = {} disabled_filetypes = {},
}, },
sections = { sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = { { lualine_c = {
'filename', {
"filename",
file_status = true, -- display file status file_status = true, -- display file status
path = 1 -- no file path path = 1, -- no file path
} }, },
},
lualine_x = { lualine_x = {
{ {
'diagnostics', "diagnostics",
sources = { 'nvim_diagnostic' }, sources = { "nvim_diagnostic" },
symbols = { error = '', warn = '', info = '', hint = '' } symbols = { error = "", warn = "", info = "", hint = "" },
}, },
'enconding', "enconding",
'filetype' "filetype",
}, },
lualine_y = { 'progress' }, lualine_y = { "progress" },
lualine_z = { 'location' } lualine_z = { "location" },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = { { lualine_c = {
'filename', {
"filename",
file_status = true, file_status = true,
path = 1 path = 1,
} }, },
lualine_x = { 'location' }, },
lualine_x = { "location" },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {},
}, },
tabline = {}, tabline = {},
extensions = { 'fugitive' } extensions = { "fugitive" },
} })
end end,
} }

View file

@ -1,4 +1,4 @@
return { return {
'Bilal2453/luvit-meta', "Bilal2453/luvit-meta",
lazy = true, lazy = true,
} }

View file

@ -5,7 +5,7 @@ return {
cmd = { "Neotree" }, cmd = { "Neotree" },
keys = { keys = {
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" }, { "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" } { "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" },
}, },
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
@ -44,8 +44,8 @@ return {
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details -- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = { config = {
show_path = "none" -- "none", "relative", "absolute" show_path = "none", -- "none", "relative", "absolute"
} },
}, },
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete", ["d"] = "delete",
@ -66,6 +66,6 @@ return {
["?"] = "show_help", ["?"] = "show_help",
["<"] = "prev_source", ["<"] = "prev_source",
[">"] = "next_source", [">"] = "next_source",
} },
} },
} }

View file

@ -2,8 +2,10 @@ return {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
version = "*", version = "*",
keys = { keys = {
{ "<leader>lg", function() {
local Terminal = require('toggleterm.terminal').Terminal "<leader>lg",
function()
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ local lazygit = Terminal:new({
cmd = "lazygit", cmd = "lazygit",
direction = "float", direction = "float",
@ -18,7 +20,9 @@ return {
end, end,
}) })
lazygit:toggle() lazygit:toggle()
end, desc = "Open lazygit in a floating window" }, end,
desc = "Open lazygit in a floating window",
},
}, },
opts = { opts = {
size = 20, size = 20,

View file

@ -18,5 +18,5 @@ return {
vim.opt.undodir = target_path vim.opt.undodir = target_path
vim.opt.undofile = true vim.opt.undofile = true
end end
end end,
} }

View file

@ -13,37 +13,37 @@ return {
icons = { icons = {
mappings = vim.g.have_nerd_font, mappings = vim.g.have_nerd_font,
keys = vim.g.have_nerd_font and {} or { keys = vim.g.have_nerd_font and {} or {
Up = '<Up> ', Up = "<Up> ",
Down = '<Down> ', Down = "<Down> ",
Left = '<Left> ', Left = "<Left> ",
Right = '<Right> ', Right = "<Right> ",
C = '<C-…> ', C = "<C-…> ",
M = '<M-…> ', M = "<M-…> ",
D = '<D-…> ', D = "<D-…> ",
S = '<S-…> ', S = "<S-…> ",
CR = '<CR> ', CR = "<CR> ",
Esc = '<Esc> ', Esc = "<Esc> ",
ScrollWheelDown = '<ScrollWheelDown> ', ScrollWheelDown = "<ScrollWheelDown> ",
ScrollWheelUp = '<ScrollWheelUp> ', ScrollWheelUp = "<ScrollWheelUp> ",
NL = '<NL> ', NL = "<NL> ",
BS = '<BS> ', BS = "<BS> ",
Space = '<Space> ', Space = "<Space> ",
Tab = '<Tab> ', Tab = "<Tab> ",
F1 = '<F1>', F1 = "<F1>",
F2 = '<F2>', F2 = "<F2>",
F3 = '<F3>', F3 = "<F3>",
F4 = '<F4>', F4 = "<F4>",
F5 = '<F5>', F5 = "<F5>",
F6 = '<F6>', F6 = "<F6>",
F7 = '<F7>', F7 = "<F7>",
F8 = '<F8>', F8 = "<F8>",
F9 = '<F9>', F9 = "<F9>",
F10 = '<F10>', F10 = "<F10>",
F11 = '<F11>', F11 = "<F11>",
F12 = '<F12>', F12 = "<F12>",
} },
} },
}) })
end, end,
} },
} }