This commit is contained in:
sankalp committed 2024-08-13 02:51:30 +05:45
1 parent 965247d989
commit ca207347cf
98 files changed
-15609

No files matched your search

-87
View File
@@ -1,87 +0,0 @@
local dashboard = require('dashboard')
local icons = require('lib.icons')
dashboard.setup({
theme = 'hyper',
disable_move = false,
shortcut_type = 'letter',
change_to_vcs_root = true,
hide = {
statusline = true,
tabline = false,
winbar = false,
},
config = {
header = { '',
' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ',
' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ',
' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ',
' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ',
' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ',
' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ',
'',},
week_header = {
enable = false,
append = { '', icons.ui.Circle .. ' Learn, Make, Explore! ' .. icons.ui.Circle },
},
packages = { enable = true },
project = { enable = true, limit = 8 },
mru = { limit = 8 },
shortcut = {
{
desc = icons.ui.Package .. 'Mason',
group = '@property',
action = 'Mason',
key = 'm',
},
{
desc = icons.ui.Sleep .. 'Lazy',
group = '@property',
action = 'Lazy',
key = 'l',
},
{
desc = icons.documents.OpenFolder .. 'Files',
group = 'Label',
action = 'lua require("telescope").extensions.menufacture.find_files()',
key = 'f',
},
{
desc = icons.ui.Search .. 'Search',
group = 'Label',
action = 'lua require("telescope").extensions.menufacture.live_grep()',
key = 'g',
},
{
desc = icons.ui.Note .. 'Todo',
group = 'Label',
action = 'Tdo',
key = 'd',
},
{
desc = icons.ui.Power,
group = 'Action',
action = 'quit',
key = 'q',
},
},
footer = function()
local info = {}
local fortune = require("fortune").get_fortune()
local footer = vim.list_extend(info, fortune)
return footer
end,
},
})
-- Show dashboard when lazy closes
if vim.o.filetype == 'lazy' then
vim.cmd.close()
vim.api.nvim_create_autocmd('User', {
pattern = 'DashboardLoaded',
callback = function()
require('lazy').show()
end,
})
end
-27
View File
@@ -1,27 +0,0 @@
local dressing = require('dressing')
dressing.setup({
win_options = {
winblend = 10,
winhighlight = 'Normal:DressingInputNormalFloat,NormalFloat:DressingInputNormalFloat,FloatBorder:DressingInputFloatBorder',
},
input = {
enabled = true,
default_prompt = 'Input:',
prompt_align = 'center',
insert_only = true,
start_in_insert = true,
border = 'rounded',
relative = 'editor',
prefer_width = 40,
width = nil,
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
get_config = nil,
},
select = {
enabled = true,
backend = { 'telescope', 'fzf_lua', 'fzf', 'nui', 'builtin'},
trim_prompt = true,
},
})
-27
View File
@@ -1,27 +0,0 @@
local highlight = {
'RainbowRed',
'RainbowYellow',
'RainbowBlue',
'RainbowOrange',
'RainbowGreen',
'RainbowViolet',
'RainbowCyan',
}
local hooks = require('ibl.hooks')
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, 'RainbowRed', { fg = '#E06C75' })
vim.api.nvim_set_hl(0, 'RainbowYellow', { fg = '#E5C07B' })
vim.api.nvim_set_hl(0, 'RainbowBlue', { fg = '#61AFEF' })
vim.api.nvim_set_hl(0, 'RainbowOrange', { fg = '#D19A66' })
vim.api.nvim_set_hl(0, 'RainbowGreen', { fg = '#98C379' })
vim.api.nvim_set_hl(0, 'RainbowViolet', { fg = '#C678DD' })
vim.api.nvim_set_hl(0, 'RainbowCyan', { fg = '#56B6C2' })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require('ibl').setup({
scope = { highlight = highlight },
exclude = { filetypes = { 'dashboard', 'toggleterm' } },
})
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
-196
View File
@@ -1,196 +0,0 @@
local lualine = require('lualine')
local icons = require('lib.icons')
local colors = {
bg = '#202328',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local mode_color = {
n = colors.green,
i = colors.blue,
v = colors.magenta,
[''] = colors.magenta,
V = colors.magenta,
c = colors.yellow,
t = colors.red,
R = colors.orange,
Rv = colors.orange,
no = colors.fg,
s = colors.violet,
S = colors.violet,
[''] = colors.violet,
ic = colors.yellow,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
buffer_is_file = function()
return vim.bo.buftype == ''
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
local searchcount = { 'searchcount', color = { fg = colors.fg, gui = 'bold' } }
local selectioncount = { 'selectioncount', color = { fg = colors.fg, gui = 'bold' } }
local progress = { 'progress', color = { fg = colors.fg, gui = 'bold' } }
local filetype = { 'filetype', color = { fg = colors.blue, gui = 'bold' } }
local filesize = { 'filesize', color = { fg = colors.fg, gui = 'bold' }, cond = conditions.buffer_not_empty }
local fileformat = { 'fileformat', icons_enabled = true, color = { fg = colors.white, gui = 'bold' } }
local filename = {
'filename',
cond = conditions.buffer_not_empty and conditions.buffer_is_file,
color = { fg = colors.magenta, gui = 'bold' },
}
local buffers = {
'buffers',
filetype_names = {
TelescopePrompt = icons.ui.Telescope .. 'Telescope',
dashboard = icons.ui.Dashboard .. 'Dashboard',
lazy = icons.ui.Sleep .. 'Lazy',
mason = icons.ui.Package .. 'Mason',
NvimTree = icons.documents.OpenFolder .. 'Files',
spectre_panel = icons.ui.Search .. 'Spectre',
},
use_mode_colors = true,
}
local branch = {
'branch',
icon = icons.git.Branch,
fmt = function(str)
return str:sub(1, 32)
end,
color = { fg = colors.green, gui = 'bold' },
}
local diff_icons = {
'diff',
symbols = { added = icons.git.AddAlt, modified = icons.git.DiffAlt, removed = icons.git.RemoveAlt },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
}
local diagnostics = {
'diagnostics',
sources = { 'nvim_lsp', 'nvim_diagnostic', 'nvim_workspace_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warning,
info = icons.diagnostics.Information,
hint = icons.diagnostics.Hint,
},
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.blue },
color_hint = { fg = colors.yellow },
},
}
local lsp = {
function()
local msg = 'No LSP'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = icons.ui.Gear,
color = { fg = colors.fg, gui = 'bold' },
}
local encoding = {
'o:encoding',
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = 'bold' },
}
local separator = {
function()
return icons.ui.Separator
end,
color = function()
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { left = 0, right = 0 },
}
local function mode(icon)
icon = icon or icons.ui.NeoVim
return {
function()
return icon
end,
color = function()
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { left = 1, right = 0 },
}
end
lualine.setup({
options = {
component_separators = '',
-- section_separators = '',
theme = 'onedark',
disabled_filetypes = {
'dashboard',
},
},
-- extensions = { 'quickfix', 'man', 'mason', 'lazy', 'toggleterm', 'nvim-tree' },
tabline = {
lualine_a = {},
lualine_b = { mode(), buffers },
lualine_c = {},
lualine_x = { diff_icons, branch },
lualine_y = { searchcount, selectioncount },
lualine_z = {},
},
sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { separator, mode(icons.ui.Heart), 'location', progress, filename },
lualine_x = { diagnostics, lsp, filetype, filesize, fileformat, encoding, separator },
lualine_y = {},
lualine_z = {},
},
})
-265
View File
@@ -1,265 +0,0 @@
local border_style = {
top_left = "┌", top = "─", top_right = "┐",
left = "│", right = "│",
bottom_left = "└", bottom = "─", bottom_right = "┘",
}
local rounded_border_style = {
top_left = "╭", top = "─", top_right = "╮",
left = "│", right = "│",
bottom_left = "╰", bottom = "─", bottom_right = "╯",
}
require("noice").setup({
cmdline = {
enabled = true, -- enables the Noice cmdline UI
view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
opts = {}, -- global options for the cmdline. See section on views
---@type table<string, CmdlineFormat>
format = {
-- conceal: (default=true) This will hide the text in the cmdline that matches the pattern.
-- view: (default is cmdline view)
-- opts: any options passed to the view
-- icon_hl_group: optional hl_group for the icon
-- title: set to anything or empty string to hide
cmdline = { pattern = "^:", icon = "", lang = "vim", title = " Cmdline " },
search_down = { kind = "search", pattern = "^/", icon = "  ", lang = "regex", title = " Search Down " },
search_up = { kind = "search", pattern = "^%?", icon = "  ", lang = "regex" , title = " Search Up " },
filter = { pattern = "^:%s*!", icon = "", lang = "bash" , title = "Filter" },
lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua", title = " Lua " },
help = { pattern = "^:%s*he?l?p?%s+", icon = "", title = " Help " },
input = {}, -- Used by input()
-- lua = false, -- to disable a format, set to `false`
},
},
messages = {
-- NOTE: If you enable messages, then the cmdline is enabled automatically.
-- This is a current Neovim limitation.
enabled = true, -- enables the Noice messages UI
view = "mini", -- default view for messages
view_error = "notify", -- view for errors
view_warn = "notify", -- view for warnings
view_history = "messages", -- view for :messages
-- view_search = false,
view_search = "virtualtext", -- view for search count messages. Set to `false` to disable
},
popupmenu = {
enabled = true, -- enables the Noice popupmenu UI
---@type 'nui'|'cmp'
backend = "cmp", -- backend to use to show regular cmdline completions
---@type NoicePopupmenuItemKind|false
-- Icons for completion item kinds (see defaults at noice.config.icons.kinds)
kind_icons = {}, -- set to `false` to disable icons
},
-- default options for require('noice').redirect
-- see the section on Command Redirection
---@type NoiceRouteConfig
redirect = {
view = "popup",
filter = { event = "msg_show" },
},
-- You can add any custom commands below that will be available with `:Noice command`
---@type table<string, NoiceCommand>
commands = {
history = {
-- options for the message history that you get with `:Noice`
view = "split",
opts = { enter = true, format = "details" },
filter = {
any = {
{ event = "notify" },
{ error = true },
{ warning = true },
{ event = "msg_show", kind = { "" } },
{ event = "lsp", kind = "message" },
},
},
},
-- :Noice last
last = {
view = "popup",
opts = { enter = true, format = "details" },
filter = {
any = {
{ event = "notify" },
{ error = true },
{ warning = true },
{ event = "msg_show", kind = { "" } },
{ event = "lsp", kind = "message" },
},
},
filter_opts = { count = 1 },
},
-- :Noice errors
errors = {
-- options for the message history that you get with `:Noice`
view = "popup",
opts = { enter = true, format = "details" },
filter = { error = true },
filter_opts = { reverse = true },
},
},
notify = {
-- Noice can be used as `vim.notify` so you can route any notification like other messages
-- Notification messages have their level and other properties set.
-- event is always "notify" and kind can be any log level as a string
-- The default routes will forward notifications to nvim-notify
-- Benefit of using Noice for this is the routing and consistent history view
enabled = true,
view = "notify",
},
lsp = {
progress = {
enabled = true,
-- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin
-- See the section on formatting for more details on how to customize.
--- @type NoiceFormat|string
format = "lsp_progress",
--- @type NoiceFormat|string
format_done = "lsp_progress_done",
throttle = 1000 / 30, -- frequency to update lsp progress message
view = "mini",
},
override = {
-- override the default lsp markdown formatter with Noice
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
-- override the lsp markdown formatter with Noice
["vim.lsp.util.stylize_markdown"] = true,
-- override cmp documentation with Noice (needs the other options to work)
["cmp.entry.get_documentation"] = true,
},
hover = {
enabled = true,
view = nil, -- when nil, use defaults from documentation
---@type NoiceViewOptions
opts = {}, -- merged with defaults from documentation
},
signature = {
enabled = true,
auto_open = {
enabled = true,
trigger = true, -- Automatically show signature help when typing a trigger character from the LSP
luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes
throttle = 50, -- Debounce lsp signature help request by 50ms
},
view = nil, -- when nil, use defaults from documentation
---@type NoiceViewOptions
opts = {}, -- merged with defaults from documentation
},
message = {
-- Messages shown by lsp servers
enabled = true,
view = "mini",
opts = {},
},
-- defaults for hover and signature help
documentation = {
view = "hover",
---@type NoiceViewOptions
opts = {
lang = "markdown",
replace = true,
render = "plain",
format = { "{message}" },
win_options = { concealcursor = "n", conceallevel = 3 },
},
},
},
markdown = {
hover = {
["|(%S-)|"] = vim.cmd.help, -- vim help links
["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links
},
highlights = {
["|%S-|"] = "@text.reference",
["@%S+"] = "@parameter",
["^%s*(Parameters:)"] = "@text.title",
["^%s*(Return:)"] = "@text.title",
["^%s*(See also:)"] = "@text.title",
["{%S-}"] = "@parameter",
},
},
health = {
checker = true, -- Disable if you don't want health checks to run
},
smart_move = {
-- noice tries to move out of the way of existing floating windows.
enabled = true, -- you can disable this behaviour here
-- add any filetypes here, that shouldn't trigger smart move.
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
},
---@type NoicePresets
presets = {
-- you can enable a preset by setting it to true, or a table that will override the preset config
-- you can also add custom presets that you can enable/disable with enabled=true
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = false, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = true, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode.
---@type NoiceConfigViews
views = {
cmdline_popup = {
position = {
row = "50%",
col = "50%",
},
size = {
width = "40%",
height = "auto",
},
border = {
style = rounded_border_style,
-- style = "none",
},
filter_options = {},
win_options = {
winhighlight = { Normal = "TelescopePromptNormal", FloatBorder = "DiagnosticInfo" },
},
},
split = {
enter = true,
},
notify = {
size = {
width = 30
}
},
mini = {
win_options = {
winblend = 0,
-- winhighlight = {}
}
},
popupmenu = {
relative = "editor",
position = {
row = 8,
col = "50%",
},
size = {
width = 60,
height = 10,
},
border = {
style = rounded_border_style,
padding = { 0, 1 },
},
win_options = {
winhighlight = { Normal = "TelescopePromptNormal", FloatBorder = "DiagnosticInfo" },
},
},
}, ---@see section on views
---@type NoiceRouteConfig[]
routes = {
{
filter = {
event = "msg_show",
-- kind = "search_count",
find = "written"
},
opts = { skip = true },
},
}, --- @see section on routes
})
-19
View File
@@ -1,19 +0,0 @@
vim.notify = require("notify")
require("notify").setup({
background_colour = "Normal",
fps = 30,
icons = {
DEBUG = "",
ERROR = "",
INFO = "",
TRACE = "✎",
WARN = ""
},
level = 2,
minimum_width = 30,
maximum_width = 30,
render = "wrapped-compact",
stages = "slide",
timeout = 2000
})
-26
View File
@@ -1,26 +0,0 @@
local onedark = require('onedark')
local util = require('lib.util')
onedark.setup({
style = 'deep',
transparent = true,
term_colors = false,
ending_tildes = false,
cmp_itemkind_reverse = false,
toggle_style_key = '<leader>ot',
toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' },
-- Options are italic, bold, underline, none and combos 'italic,bold'
code_style = {
comments = 'italic',
keywords = 'none',
functions = 'none',
strings = 'none',
variables = 'none',
},
lualine = { transparent = true },
diagnostics = { darker = true, undercurl = true, background = false },
})
onedark.load()
-19
View File
@@ -1,19 +0,0 @@
local rainbow_delimiters = require('rainbow-delimiters')
vim.g.rainbow_delimiters = {
strategy = {
[''] = rainbow_delimiters.strategy['global'],
commonlisp = rainbow_delimiters.strategy['local'],
},
query = { [''] = 'rainbow-delimiters', lua = 'rainbow-blocks' },
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
blacklist = {},
}
-9
View File
@@ -1,9 +0,0 @@
local twilight = require('twilight')
twilight.setup({
dimming = { alpha = 0.45, color = { 'Normal', '#ffffff' }, inactive = false },
context = 9,
treesitter = true,
expand = { 'function', 'method', 'table', 'if_statement', 'element' },
exclude = {},
})
-70
View File
@@ -1,70 +0,0 @@
local wilder = require('wilder')
wilder.setup({ modes = { ':', '/', '?' } })
wilder.set_option('pipeline', {
wilder.branch(
wilder.python_file_finder_pipeline({
file_command = { 'rg', '--files', '--hidden' },
dir_command = { 'fd', '-td' },
filters = { 'fuzzy_filter', 'difflib_sorter' },
}),
wilder.cmdline_pipeline({
fuzzy = 2,
}),
wilder.vim_search_pipeline({
fuzzy = 2,
}),
wilder.python_search_pipeline()
),
})
local accent = wilder.make_hl('WilderAccent', 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = '#00AAFF' } })
local icons = require('lib.icons')
local popupmenu_renderer = wilder.popupmenu_renderer(wilder.popupmenu_palette_theme({
border = 'rounded',
max_height = '75%',
min_height = 0,
prompt_position = 'top',
reverse = 0,
empty_message = wilder.popupmenu_empty_message_with_spinner(),
highlighter = wilder.basic_highlighter(),
highlights = {
accent = accent,
},
left = {
' ',
wilder.popupmenu_devicons(),
wilder.popupmenu_buffer_flags({
flags = ' a + ',
icons = {
['+'] = icons.ui.Pencil,
a = icons.documents.File,
h = icons.documents.FileEmpty,
},
}),
},
right = {
' ',
wilder.popupmenu_scrollbar(),
},
}))
local wildmenu_renderer = wilder.wildmenu_renderer({
highlighter = wilder.basic_highlighter(),
highlights = { accent = accent },
separator = ' | ',
left = { ' ', wilder.wildmenu_spinner(), ' ' },
right = { ' ', wilder.wildmenu_index() },
})
wilder.set_option(
'renderer',
wilder.renderer_mux({
[':'] = popupmenu_renderer,
['/'] = popupmenu_renderer,
['?'] = popupmenu_renderer,
substitute = wildmenu_renderer,
})
)
-31
View File
@@ -1,31 +0,0 @@
local zen = require('zen-mode')
zen.setup({
window = {
backdrop = 0.95,
width = 180,
height = 1,
options = {
signcolumn = 'no',
number = false,
relativenumber = false,
cursorline = false,
cursorcolumn = false,
foldcolumn = '0',
list = false,
},
},
plugins = {
options = { enabled = true, ruler = true, showcmd = true },
twilight = { enabled = true },
gitsigns = { enabled = true },
tmux = { enabled = true },
kitty = { enabled = false, font = '+4' },
},
on_open = function(win)
vim.o.laststatus = 0
end,
on_close = function()
vim.o.laststatus = 2
end,
})