refactor(nvim): Reformat code

This commit is contained in:
Ahmad Ansori Palembani 2025-05-27 11:02:37 +07:00
parent b39c708cde
commit 26954bc417
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
5 changed files with 507 additions and 501 deletions

View file

@ -5,14 +5,14 @@ return {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function ()
config = function()
require("tokyonight").setup({
style = "moon",
transparent = true,
styles = {
sidebars = "transparent"
},
on_highlights = function (hl, c)
on_highlights = function(hl, c)
hl.CursorLineNr = { fg = c.yellow, bold = true }
end,
})
@ -22,13 +22,13 @@ return {
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function ()
config = function()
local _progress = require("lualine.components.progress")
local progress = function ()
local progress = function()
return "" .. _progress()
end
local _location = require("lualine.components.location")
local location = function ()
local location = function()
return "" .. _location()
end
require("lualine").setup {
@ -38,14 +38,14 @@ return {
section_separators = "",
component_separators = "",
},
extensions = {"neo-tree", "oil", "lazy"},
extensions = { "neo-tree", "oil", "lazy" },
sections = {
lualine_a = {"mode"},
lualine_b = {"branch", "diff", "diagnostics"},
lualine_c = {"filename"},
lualine_x = {location},
lualine_y = {progress},
lualine_z = {"encoding", "fileformat", "filetype"},
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { location },
lualine_y = { progress },
lualine_z = { "encoding", "fileformat", "filetype" },
},
}
end,
@ -55,7 +55,7 @@ return {
keys = {
{ "gc", mode = { "n", "v", "i" } },
},
init = function ()
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = { "nix", "hyprlang" },
callback = function()
@ -68,14 +68,14 @@ return {
{
"dstein64/vim-startuptime",
cmd = "StartupTime", -- Note to self: lazy load on command
init = function ()
init = function()
-- Note to self: init is called during startup. Configuration for vim plugins typically should be set in an init function
end,
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
config = function ()
config = function()
require("ibl").setup()
end
},

View file

@ -137,7 +137,7 @@ return {
},
opts = function()
return {
ignored = { },
ignored = {},
}
end,
config = function(_, opts)
@ -177,7 +177,8 @@ return {
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp.setup({
@ -207,7 +208,7 @@ return {
else
fallback()
end
end, {"i", "s"}),
end, { "i", "s" }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()

View file

@ -37,26 +37,26 @@ return {
additional_vim_regex_highlighting = false,
},
},
config = function (_, opts)
config = function(_, opts)
local config = require("nvim-treesitter.parsers").get_parser_configs()
config.gsp = {
install_info = {
url = "https://git.sr.ht/~mango/tree-sitter-gsp",
files = {"src/parser.c"},
files = { "src/parser.c" },
},
filetype = "gsp",
}
config.fluent = {
install_info = {
url = "https://github.com/projectfluent/tree-sitter-fluent", -- local path or git repo
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
files = { "src/parser.c" }, -- note that some parsers also require src/scanner.c or src/scanner.cc
},
filetype = "fluent", -- if filetype does not match the parser name
}
config.htmljinja = {
install_info = {
url = "https://github.com/null2264/tree-sitter-htmldjango", -- local path or git repo
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
files = { "src/parser.c" }, -- note that some parsers also require src/scanner.c or src/scanner.cc
},
filetype = "htmljinja", -- if filetype does not match the parser name
}

View file

@ -20,7 +20,7 @@ end
function M.map(modes, key, target, opts)
local mt = {}
for mode in modes:gmatch"." do
for mode in modes:gmatch "." do
table.insert(mt, mode)
end
@ -98,6 +98,7 @@ function M.lazy_file()
end,
})
end
-- >>[LAZY]
return M

View file

@ -2,6 +2,10 @@
end_of_line = lf
insert_final_newline = true
[*.lua]
indent_style = space
indent_size = 4
[*.{nix,kbd}]
indent_style = space
indent_size = 2