autoforamtted everything

This commit is contained in:
pr0c3550r 2023-02-25 23:44:08 +01:00
parent 1dc2308a1f
commit 622145d183
12 changed files with 184 additions and 195 deletions

View file

@ -1,9 +1,8 @@
return {
{
"echasnovski/mini.comment",
config = function ()
config = function()
require("mini.comment").setup()
end,
},
}

View file

@ -2,7 +2,7 @@ return {
{
'lewis6991/gitsigns.nvim',
event = "VeryLazy",
config = function ()
config = function()
require('gitsigns').setup({
preview_config = {
border = 'rounded',
@ -21,29 +21,29 @@ return {
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, {expr=true})
end, { expr = true })
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, {expr=true})
end, { expr = true })
-- Actions
map({'n', 'v'}, '<leader>hs', ':Gitsigns stage_hunk<CR>')
map({'n', 'v'}, '<leader>hr', ':Gitsigns reset_hunk<CR>')
map({ 'n', 'v' }, '<leader>hs', ':Gitsigns stage_hunk<CR>')
map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>')
map('n', '<leader>hS', gs.stage_buffer)
map('n', '<leader>hu', gs.undo_stage_hunk)
map('n', '<leader>hR', gs.reset_buffer)
map('n', '<leader>hp', gs.preview_hunk)
map('n', '<leader>hb', function() gs.blame_line{full=true} end)
map('n', '<leader>hb', function() gs.blame_line { full = true } end)
map('n', '<leader>tb', gs.toggle_current_line_blame)
map('n', '<leader>hd', gs.diffthis)
map('n', '<leader>hD', function() gs.diffthis('~') end)
map('n', '<leader>td', gs.toggle_deleted)
-- Text object
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
end
})
end,

View file

@ -16,50 +16,49 @@ return {
-- Settings to override colorscheme
-- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"})
-- colors of tabline
vim.api.nvim_set_hl(0, "TabLine", {bg = "#3c3836", fg = "#89b482"})
vim.api.nvim_set_hl(0, "TabLineFil", {bg = "#1d2021"})
vim.api.nvim_set_hl(0, "TabLineSel", {bold = true, bg = "none", fg = "#d8a657"})
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
-- color of statusline
vim.api.nvim_set_hl(0, "StatusLine", {bold = false, bg = "#1d2021", fg = "#89b482"})
vim.api.nvim_set_hl(0, "StatusLineNC", {bg = "#1d2021", fg = "#5b534d"})
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" })
-- color of vertical split line
vim.api.nvim_set_hl(0, "VertSplit", {bg = "#141617", fg = "#141617"})
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
-- color of the cursorline and cursorlinenumber
vim.api.nvim_set_hl(0, "Cursorline", {bg = "#141617"})
vim.api.nvim_set_hl(0, "CursorLineNr", {bold = true, bg = "#141617", fg = "#d8a657"})
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
-- color of Floats and FloatBorders
vim.api.nvim_set_hl(0, "NormalFloat", {bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", {bg = none, fg = "#d4be98"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", {bg = none, fg = "#d8a657"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", {bg = none, fg = "#ea6962"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", {bg = none, fg = "#a9b665"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", {bg = none, fg = "#d4be98"})
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
-- autocommand for overrides
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "gruvbox-material",
callback = function ()
vim.api.nvim_set_hl(0, "TabLine", {bg = "#3c3836", fg = "#89b482"})
vim.api.nvim_set_hl(0, "TabLineFil", {bg = "#1d2021"})
vim.api.nvim_set_hl(0, "TabLineSel", {bold = true, bg = "none", fg = "#d8a657"})
callback = function()
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
-- color of statusline
vim.api.nvim_set_hl(0, "StatusLine", {bold = false, bg = "#1d2021", fg = "#89b482"})
vim.api.nvim_set_hl(0, "StatusLineNC", {bg = "#1d2021", fg = "#5b534d"})
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" })
-- color of vertical split line
vim.api.nvim_set_hl(0, "VertSplit", {bg = "#141617", fg = "#141617"})
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
-- color of the cursorline and cursorlinenumber
vim.api.nvim_set_hl(0, "Cursorline", {bg = "#141617"})
vim.api.nvim_set_hl(0, "CursorLineNr", {bold = true, bg = "#141617", fg = "#d8a657"})
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
-- color of Floats and FloatBorders
vim.api.nvim_set_hl(0, "NormalFloat", {bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", {bg = none, fg = "#d4be98"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", {bg = none, fg = "#d8a657"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", {bg = none, fg = "#ea6962"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", {bg = none, fg = "#a9b665"})
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", {bg = none, fg = "#d4be98"})
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
end,
})
end,
},
}

View file

@ -4,7 +4,7 @@ return {
-- event = "BufReadPre",
config = function()
require('lspconfig.ui.windows').default_options.border = 'rounded'
vim.api.nvim_set_hl(0, "LspInfoBorder", {bg = none, fg = "#d4be98"})
vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#d4be98" })
local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
@ -61,7 +61,6 @@ return {
prefix = '', -- Could be '●', '■', 'x', '▎'
},
update_in_insert = true
})
-- LSP settings (for overriding per client)
@ -115,4 +114,3 @@ return {
end,
},
}

View file

@ -2,8 +2,8 @@ return {
{
"nvim-lualine/lualine.nvim",
config = function()
vim.api.nvim_set_option("showmode",false)
local custom_gruvbox = require'lualine.themes.gruvbox-material'
vim.api.nvim_set_option("showmode", false)
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
custom_gruvbox.normal.a.bg = '#89b482'
custom_gruvbox.normal.c.bg = '#141617'
custom_gruvbox.insert.a.bg = '#d8a657'
@ -16,26 +16,26 @@ return {
component_separators = ' '
},
sections = {
lualine_a = {'mode'},
lualine_a = { 'mode' },
lualine_b = {
{
'branch',
icon = '',
color={fg='#d8a657', bg='#141617', gui='bold' },
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
}
},
lualine_c = {
{
'filename',
color={gui='italic', fg='#d3869b', bg='#1d2021'},
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
path = 1,
}
},
lualine_x = {
{
'filetype',
color={bg='#1d2021', fg='#d4be98', gui='italic'},
fmt = function (str)
color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' },
fmt = function(str)
return (str:gsub("^%l", string.upper))
end,
}
@ -43,7 +43,7 @@ return {
lualine_y = {
{
'diagnostics',
color={gui='bold', bg='#141617'},
color = { gui = 'bold', bg = '#141617' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = "", warn = "", info = "", hint = "󰌶 " },
update_in_insert = true
@ -51,15 +51,15 @@ return {
},
{
'diff',
icon = {'', color={bg='#141617', fg='#d8a657', gui='bold'}},
color={gui='bold', bg='#141617'},
icon = { '', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } },
color = { gui = 'bold', bg = '#141617' },
}
},
lualine_z = {'location'}
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {'mode'},
lualine_a = { 'mode' },
lualine_b = {
{
'branch',
@ -75,8 +75,8 @@ return {
lualine_x = {
{
'filetype',
color={gui='italic'},
fmt = function (str)
color = { gui = 'italic' },
fmt = function(str)
return (str:gsub("^%l", string.upper))
end,
}
@ -84,7 +84,7 @@ return {
lualine_y = {
{
'diagnostics',
color={gui='bold', bg='#141617'},
color = { gui = 'bold', bg = '#141617' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = "", warn = "", info = "", hint = "󰌶 " },
update_in_insert = true
@ -92,14 +92,13 @@ return {
},
{
'diff',
icon = {'', color={bg='#141617', gui='bold'}},
color={gui='bold', bg='#141617'},
icon = { '', color = { bg = '#141617', gui = 'bold' } },
color = { gui = 'bold', bg = '#141617' },
}
},
lualine_z = {'location'}
lualine_z = { 'location' }
},
}
end,
},
}

View file

@ -6,7 +6,7 @@ return {
{
"nvim-telescope/telescope-ui-select.nvim",
lazy = true,
config = function ()
config = function()
-- This is your opts table
require("telescope").setup {
extensions = {
@ -39,7 +39,7 @@ return {
vim.keymap.set('n', '<space>fm', function() vim.lsp.buf.format { async = true } end, bufopts)
end,
sources = {
null_ls.builtins.diagnostics.trail_space.with{
null_ls.builtins.diagnostics.trail_space.with {
disabled_filetypes = { "lua" }
},
null_ls.builtins.diagnostics.shellcheck,
@ -51,4 +51,3 @@ return {
end,
},
}

View file

@ -8,14 +8,14 @@ return {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
vim.api.nvim_set_hl( 0, "PmenuSel", { fg = 'NONE', bg = '#141617' } )
vim.api.nvim_set_hl( 0, "Pmenu", { fg = 'NONE', bg = '#1d2021' } )
vim.api.nvim_set_hl( 0, "CmpItemMenu", { fg = 'NONE', bg = '#141617' } )
vim.api.nvim_set_hl( 0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#141617' } )
vim.api.nvim_set_hl( 0, "CmpItemKindFunction", { fg = '#d3869b', bg = 'NONE', italic = true } )
vim.api.nvim_set_hl( 0, "CmpItemKindSnippet", { fg = '#d8a657', bg = 'NONE', italic = true } )
vim.api.nvim_set_hl( 0, "CmpItemKindText", {fg = '#ddc7a1', bg = 'NONE', italic = true } )
vim.api.nvim_set_hl( 0, "CmpItemKindVariable", {fg = '#7daea3', bg = 'NONE', italic = true } )
vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#141617' })
vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1d2021' })
vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#141617' })
vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#141617' })
vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d3869b', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#d8a657', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#ddc7a1', bg = 'NONE', italic = true })
vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7daea3', bg = 'NONE', italic = true })
end,
},
},
@ -69,13 +69,14 @@ return {
local has_words_before = function()
unpack = unpack or table.unpack
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
local luasnip = require("luasnip")
local cmp = require("cmp")
return{
return {
formatting = {
format = function(entry, vim_item)
-- Kind icons
@ -96,7 +97,6 @@ return {
return vim_item
end
},
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
@ -106,7 +106,6 @@ return {
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
-- completion = {
-- autocomplete = false,
-- },
@ -115,9 +114,8 @@ return {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-b>'] = cmp.mapping.scroll_docs( -4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- ['<C-Space>'] = cmp.mapping.complete(),
-- ['<C-e>'] = cmp.mapping.abort(),
@ -146,8 +144,8 @@ return {
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
elseif luasnip.jumpable( -1) then
luasnip.jump( -1)
else
fallback()
end
@ -162,7 +160,6 @@ return {
{ name = 'buffer' },
}, {
}),
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
@ -171,7 +168,6 @@ return {
{ name = 'buffer' },
})
}),
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
@ -179,7 +175,6 @@ return {
{ name = 'buffer' }
}
}),
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),

View file

@ -13,7 +13,7 @@ return {
update_n_lines = "gzn",
},
},
config = function (_, opts)
config = function(_, opts)
require("mini.surround").setup(opts)
end,
}

View file

@ -8,11 +8,11 @@ return {
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
-- find
{"<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{"<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{"<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{"<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
{"<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find Git Files" },
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
{ "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
{ "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find Git Files" },
},
},
}

View file

@ -1,7 +1,7 @@
return {
{
"folke/twilight.nvim",
config = function ()
config = function()
require("twilight").setup {
}