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

View file

@ -4,31 +4,30 @@ return {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
local comment = require('Comment')
local comment = require("Comment")
comment.setup({
pre_hook = function(ctx)
-- only for tsx/jsx filetypes
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
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
local location = nil
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
location = require('ts_context_commentstring.utils').get_visual_start_location()
location = require("ts_context_commentstring.utils").get_visual_start_location()
end
return require('ts_context_commentstring.internal').calculate_commentstring({
return require("ts_context_commentstring.internal").calculate_commentstring({
key = type,
location = location,
})
end
end,
})
end
end,
}

View file

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

View file

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

View file

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

View file

@ -8,11 +8,19 @@ return {
vim.keymap.set("n", "<leader>a", mark.add_file)
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>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>q", function()
ui.nav_file(1)
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_next)
end
end,
}

View file

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

View file

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

View file

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

View file

@ -5,7 +5,7 @@ return {
cmd = { "Neotree" },
keys = {
{ "<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 = {
"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
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
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.
["d"] = "delete",
@ -66,6 +66,6 @@ return {
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
}
}
},
},
}

View file

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

View file

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

View file

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