stylua, formatting

This commit is contained in:
Max Miliano 2023-04-21 18:32:52 -03:00
parent d5e40fff90
commit 3e9190bdc3
9 changed files with 661 additions and 657 deletions

View file

@ -1,20 +1,19 @@
if vim.fn.has("nvim-0.9.0") == 1 then
vim.api.nvim_create_autocmd("LspTokenUpdate", {
if vim.fn.has 'nvim-0.9.0' == 1 then
vim.api.nvim_create_autocmd('LspTokenUpdate', {
callback = function(args)
local token = args.data.token
if token.type ~= "variable" or token.modifiers.readonly then
if token.type ~= 'variable' or token.modifiers.readonly then
return
end
local text =
vim.api.nvim_buf_get_text(args.buf, token.line, token.start_col, token.line, token.end_col, {})[1]
local text = vim.api.nvim_buf_get_text(args.buf, token.line, token.start_col, token.line, token.end_col, {})[1]
if text ~= string.upper(text) then
return
end
vim.lsp.semantic_tokens.highlight_token(token, args.buf, args.data.client_id, "@constant")
vim.lsp.semantic_tokens.highlight_token(token, args.buf, args.data.client_id, '@constant')
end,
})
end

View file

@ -1,5 +1,5 @@
local colors = require("dracula.palettes")
local utils = require("dracula.utils")
local colors = require 'dracula.palettes'
local utils = require 'dracula.utils'
local M = {}
@ -27,7 +27,7 @@ function M:set_colors()
return
end
self.colors = require("dracula.palettes.soft")
self.colors = require 'dracula.palettes.soft'
end
function M:change_colors_saturation()
@ -46,12 +46,12 @@ function M:set_user_colors()
return
end
if type(self.user_config.colors) == "table" then
self.colors = vim.tbl_extend("force", self.colors, self.user_config.colors)
if type(self.user_config.colors) == 'table' then
self.colors = vim.tbl_extend('force', self.colors, self.user_config.colors)
return
end
self.colors = vim.tbl_extend("force", self.colors, self.user_config.colors(self.colors))
self.colors = vim.tbl_extend('force', self.colors, self.user_config.colors(self.colors))
end
end
@ -72,7 +72,7 @@ function M:set_saturation(saturation)
if saturation.enabled then
self.saturation.enabled = true
if type(saturation.amount) == "number" then
if type(saturation.amount) == 'number' then
self.saturation.amount = saturation.amount
end
else
@ -90,7 +90,7 @@ function M:set_transparent(transparent)
end
function M:call_user_callback(cb)
if type(cb) == "function" then
if type(cb) == 'function' then
cb(self.colors)
end
end

View file

@ -1,29 +1,29 @@
require("dracula.autocmd")
local utils = require("dracula.utils")
local theme = require("dracula.theme")
local Config = require("dracula.config")
require 'dracula.autocmd'
local utils = require 'dracula.utils'
local theme = require 'dracula.theme'
local Config = require 'dracula.config'
local M = Config:new()
function M:apply_transparency()
local groups = {
Normal = { bg = "NONE" },
SignColumn = { bg = "NONE" },
CursorLineNr = { bg = "NONE" },
LineNr = { bg = "NONE" },
Normal = { bg = 'NONE' },
SignColumn = { bg = 'NONE' },
CursorLineNr = { bg = 'NONE' },
LineNr = { bg = 'NONE' },
}
if self.transparent then
if self.transparent == "full" then
if self.transparent == 'full' then
local groups2 = {
NormalFloat = { bg = "NONE" },
WinSeparator = { bg = "NONE" },
NvimTreeWinSeparator = { link = "WinSeparator" },
StatusLine = { bg = "NONE" },
StatusLineNC = { bg = "NONE" },
NvimTreeStatusLine = { bg = "NONE" },
NormalFloat = { bg = 'NONE' },
WinSeparator = { bg = 'NONE' },
NvimTreeWinSeparator = { link = 'WinSeparator' },
StatusLine = { bg = 'NONE' },
StatusLineNC = { bg = 'NONE' },
NvimTreeStatusLine = { bg = 'NONE' },
}
groups = vim.tbl_extend("keep", groups, groups2)
groups = vim.tbl_extend('keep', groups, groups2)
end
return groups
@ -55,16 +55,16 @@ end
function M.load_default()
if vim.g.colors_name then
vim.cmd("hi clear")
vim.cmd 'hi clear'
end
vim.o.background = "dark"
if vim.fn.exists("syntax_on") then
vim.cmd("syntax reset")
vim.o.background = 'dark'
if vim.fn.exists 'syntax_on' then
vim.cmd 'syntax reset'
end
vim.o.termguicolors = true
vim.g.colors_name = "dracula"
vim.g.colors_name = 'dracula'
end
M.setup = function(user_config)
@ -84,7 +84,7 @@ M.setup = function(user_config)
theme.set_highlights(M.colors)
if type(M.user_config.override) == "function" then
if type(M.user_config.override) == 'function' then
M.user_config.override = M.user_config.override(M.colors)
end

View file

@ -1,41 +1,41 @@
local colors = {
fg = "#f8f8f2",
bg = "#282a36",
bgdark = "#21222c",
currentline = "#44475a",
selection = "#44475a",
comment = "#6272a4",
cyan = "#8be9fd",
green = "#50fa7b",
orange = "#ffb86c",
pink = "#ff79c6",
purple = "#bd93f9",
red = "#ff5555",
yellow = "#f1fa8c",
cursor_fg = "#282a36",
cursor_bg = "#f8f8f2",
sign_add = "#50fa7b",
sign_change = "#ffb866",
sign_delete = "#ff5555",
error = "#ff555b",
warning = "#ffb866",
info = "#8be9fd",
hint = "#8be9fd",
other = "#bd93f9",
blended_orange = "#483F3E",
blended_red = "#48303B",
blended_cyan = "#374754",
blended_green = "#2E4940",
blended_yellow = "#464943",
blended_purple = "#3E3A53",
blended_pink = "#5E3E5A",
blended_add = "#2E4940",
blended_change = "#483F3E",
blended_warning = "#483F3E",
blended_error = "#48303B",
blended_info = "#374754",
blended_hint = "#374754",
blended_other = "#3E3A53",
fg = '#f8f8f2',
bg = '#282a36',
bgdark = '#21222c',
currentline = '#44475a',
selection = '#44475a',
comment = '#6272a4',
cyan = '#8be9fd',
green = '#50fa7b',
orange = '#ffb86c',
pink = '#ff79c6',
purple = '#bd93f9',
red = '#ff5555',
yellow = '#f1fa8c',
cursor_fg = '#282a36',
cursor_bg = '#f8f8f2',
sign_add = '#50fa7b',
sign_change = '#ffb866',
sign_delete = '#ff5555',
error = '#ff555b',
warning = '#ffb866',
info = '#8be9fd',
hint = '#8be9fd',
other = '#bd93f9',
blended_orange = '#483F3E',
blended_red = '#48303B',
blended_cyan = '#374754',
blended_green = '#2E4940',
blended_yellow = '#464943',
blended_purple = '#3E3A53',
blended_pink = '#5E3E5A',
blended_add = '#2E4940',
blended_change = '#483F3E',
blended_warning = '#483F3E',
blended_error = '#48303B',
blended_info = '#374754',
blended_hint = '#374754',
blended_other = '#3E3A53',
}
return colors

View file

@ -1,41 +1,41 @@
local colors = {
fg = "#f8f8f2",
bg = "#282a36",
bgdark = "#262626",
currentline = "#44475a",
selection = "#44475a",
comment = "#7b7f8b",
cyan = "#adf6f6",
green = "#62e884",
orange = "#ffb86c",
pink = "#f286c4",
purple = "#bf9eee",
red = "#ee6666",
yellow = "#e7ee98",
cursor_fg = "#282a36",
cursor_bg = "#f8f8f2",
sign_add = "#62e884",
sign_change = "#ffb866",
sign_delete = "#ee6666",
error = "#ee6666",
warning = "#ffb866",
info = "#97e1f1",
hint = "#97e1f1",
other = "#bf9eee",
blended_orange = "#483F3E",
blended_red = "#46333D",
blended_cyan = "#394552",
blended_green = "#314742",
fg = '#f8f8f2',
bg = '#282a36',
bgdark = '#262626',
currentline = '#44475a',
selection = '#44475a',
comment = '#7b7f8b',
cyan = '#adf6f6',
green = '#62e884',
orange = '#ffb86c',
pink = '#f286c4',
purple = '#bf9eee',
red = '#ee6666',
yellow = '#e7ee98',
cursor_fg = '#282a36',
cursor_bg = '#f8f8f2',
sign_add = '#62e884',
sign_change = '#ffb866',
sign_delete = '#ee6666',
error = '#ee6666',
warning = '#ffb866',
info = '#97e1f1',
hint = '#97e1f1',
other = '#bf9eee',
blended_orange = '#483F3E',
blended_red = '#46333D',
blended_cyan = '#394552',
blended_green = '#314742',
blended_yellow = '#454745',
blended_purple = "#3F3B52",
blended_pink = "#5B415A",
blended_add = "#314742",
blended_change = "#483F3E",
blended_warning = "#483F3E",
blended_error = "#46333D",
blended_info = "#394552",
blended_hint = "#394552",
blended_other = "#3F3B52",
blended_purple = '#3F3B52',
blended_pink = '#5B415A',
blended_add = '#314742',
blended_change = '#483F3E',
blended_warning = '#483F3E',
blended_error = '#46333D',
blended_info = '#394552',
blended_hint = '#394552',
blended_other = '#3F3B52',
}
return colors

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ local M = {}
function M.get_hl(group_name)
local group = vim.api.nvim_get_hl(0, { name = group_name, link = false })
if type(group) == "table" then
if type(group) == 'table' then
return group
end
@ -18,8 +18,8 @@ function M.update_highlight_groups(groups)
for group_name, val in pairs(groups) do
local group_val = M.get_hl(group_name)
if type(group_val) == "table" then
local value = vim.tbl_extend("force", group_val, val)
if type(group_val) == 'table' then
local value = vim.tbl_extend('force', group_val, val)
vim.api.nvim_set_hl(0, group_name, value)
end
@ -90,7 +90,7 @@ end
function M.reduce_saturation(color, amount)
-- remove "#" prefix if present
color = color:gsub("^#", "")
color = color:gsub('^#', '')
-- split the color into its red, green, and blue components
local r = tonumber(color:sub(1, 2), 16)
@ -107,7 +107,7 @@ function M.reduce_saturation(color, amount)
r, g, b = hsl_to_rgb(h, s, l)
-- convert the RGB color back to hexadecimal
return string.format("#%02x%02x%02x", r, g, b)
return string.format('#%02x%02x%02x', r, g, b)
end
return M

View file

@ -1,35 +1,35 @@
local dracula = require("dracula")
local dracula = require 'dracula'
local colors = dracula.colors
return {
normal = {
a = { bg = colors.purple, fg = colors.bg, gui = "bold" },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
insert = {
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
visual = {
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
replace = {
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
command = {
a = { bg = colors.blended_purple, fg = colors.purple, gui = "bold" },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
inactive = {
a = { bg = colors.bgdark, fg = colors.fg, gui = "bold" },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
normal = {
a = { bg = colors.purple, fg = colors.bg, gui = 'bold' },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
insert = {
a = { bg = colors.green, fg = colors.bg, gui = 'bold' },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
visual = {
a = { bg = colors.yellow, fg = colors.bg, gui = 'bold' },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
replace = {
a = { bg = colors.red, fg = colors.bg, gui = 'bold' },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
command = {
a = { bg = colors.blended_purple, fg = colors.purple, gui = 'bold' },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
inactive = {
a = { bg = colors.bgdark, fg = colors.fg, gui = 'bold' },
b = { bg = colors.comment, fg = colors.fg },
c = { bg = colors.bgdark, fg = colors.fg },
},
}

6
stylua.toml Normal file
View file

@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "None"