This commit is contained in:
sankalp committed 2024-04-27 00:09:57 +05:45
1 parent 4d702fab7e
commit f0ebf86684
55 files changed
+3839

No files matched your search

+82
View File
@@ -0,0 +1,82 @@
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 = { '', icons.ui.Heart .. ' Happiness is a state of mind. ' .. icons.ui.Heart },
},
})
-- 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
+69
View File
@@ -0,0 +1,69 @@
local dracula = require("dracula")
dracula.setup({
colors = {
bg = "#282A36",
fg = "#F8F8F2",
selection = "#44475A",
comment = "#6272A4",
red = "#FF5555",
orange = "#FFB86C",
yellow = "#F1FA8C",
green = "#50fa7b",
purple = "#BD93F9",
cyan = "#8BE9FD",
pink = "#FF79C6",
bright_red = "#FF6E6E",
bright_green = "#69FF94",
bright_yellow = "#FFFFA5",
bright_blue = "#D6ACFF",
bright_magenta = "#FF92DF",
bright_cyan = "#A4FFFF",
bright_white = "#FFFFFF",
menu = "#21222C",
visual = "#3E4452",
gutter_fg = "#4B5263",
nontext = "#3B4048",
},
-- show the '~' characters after the end of buffers
show_end_of_buffer = true, -- default false
-- use transparent background
transparent_bg = true, -- default false
-- set custom lualine background color
lualine_bg_color = "#44475a", -- default nil
-- set italic comment
italic_comment = true, -- default false
-- overrides the default highlights see `:h synIDattr`
overrides = {
PmenuSel = {link = "lualine_a_insert"},
TelescopeSelection = {link = "lualine_a_insert"},
BufferTabpages = {link = "lualine_a_visual"}
-- Nothing = {} -- clear highlight of Nothing
},
integrations = {
cmp = true,
fidget = true,
gitsigns = true,
harpoon = true,
indent_blankline = {
enabled = false,
colored_indent_levels = false,
},
mason = true,
native_lsp = { enabled = true },
noice = true,
notify = true,
symbols_outline = true,
telescope = true,
treesitter = true,
treesitter_context = true,
},
})
vim.cmd.colorscheme("dracula")
-- Hide all semantic highlights until upstream issues are resolved (https://github.com/catppuccin/nvim/issues/480)
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
vim.api.nvim_set_hl(0, group, {})
end
+27
View File
@@ -0,0 +1,27 @@
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 = 'left',
insert_only = true,
start_in_insert = true,
border = 'rounded',
relative = 'cursor',
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
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,196 @@
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 = {},
},
})
+56
View File
@@ -0,0 +1,56 @@
local notify = require('notify')
local icons = require('lib.icons')
notify.setup({
background_colour = '#000',
fps = 30,
icons = {
DEBUG = icons.ui.Bug,
ERROR = icons.diagnostics.Error,
INFO = icons.diagnostics.Information,
TRACE = icons.ui.Bookmark,
WARN = icons.diagnostics.Warning,
},
level = 2,
render = 'default',
stages = 'fade_in_slide_out',
timeout = 2000,
top_down = true,
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.75)
end,
on_open = function(win)
vim.api.nvim_win_set_config(win, { zindex = 100 })
end,
})
-- Controls noisy notifications
local buffered_messages = {
'Client %d+ quit',
'No node found at cursor',
}
local message_notifications = {}
vim.notify = function(msg, level, opts)
opts = opts or {}
for _, pattern in ipairs(buffered_messages) do
if string.find(msg, pattern) then
if message_notifications[pattern] then
opts.replace = message_notifications[pattern]
end
opts.on_close = function()
message_notifications[pattern] = nil
end
message_notifications[pattern] = notify.notify(msg, level, opts)
return
end
end
notify.notify(msg, level, opts)
end
+19
View File
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,9 @@
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 = {},
})
+66
View File
@@ -0,0 +1,66 @@
local wilder = require('wilder')
wilder.setup({ modes = { ':', '/', '?' } })
wilder.set_option('pipeline', {
wilder.branch(
wilder.cmdline_pipeline({
fuzzy = 1,
set_pcre2_pattern = 1,
}),
wilder.python_search_pipeline({
pattern = 'fuzzy',
})
),
})
local accent = wilder.make_hl('WilderAccent', 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = '#F8F8F2' } })
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
@@ -0,0 +1,31 @@
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,
})