new structure
This commit is contained in:
72 files changed
+2659
-2947
No files matched your search
@@ -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,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,201 @@
|
||||
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,
|
||||
buffer_not_scratch = function()
|
||||
return string.find(vim.fn.bufname(), 'SCRATCH') == nil
|
||||
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 and conditions.buffer_not_scratch,
|
||||
color = { fg = colors.magenta, gui = 'bold' },
|
||||
}
|
||||
|
||||
local buffers = {
|
||||
'buffers',
|
||||
mode = 2,
|
||||
cond = conditions.buffer_not_scratch,
|
||||
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 = {},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,25 @@
|
||||
local onedark = require('onedark')
|
||||
|
||||
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()
|
||||
@@ -0,0 +1,252 @@
|
||||
local Snacks = require('snacks')
|
||||
local icons = require('lib.icons')
|
||||
|
||||
Snacks.setup({
|
||||
animate = {
|
||||
enabled = true,
|
||||
duration = 20, -- ms per step
|
||||
easing = 'linear',
|
||||
fps = 60,
|
||||
},
|
||||
bigfile = {
|
||||
enabled = true,
|
||||
notify = true,
|
||||
size = 100 * 1024, -- 100 KB
|
||||
},
|
||||
bufdelete = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
sections = {
|
||||
{ section = 'header' },
|
||||
{
|
||||
icon = icons.ui.Keyboard,
|
||||
title = 'Keymaps',
|
||||
section = 'keys',
|
||||
indent = 2,
|
||||
padding = 1,
|
||||
},
|
||||
{
|
||||
icon = icons.documents.File,
|
||||
title = 'Recent Files',
|
||||
section = 'recent_files',
|
||||
indent = 2,
|
||||
padding = 1,
|
||||
},
|
||||
{
|
||||
icon = icons.documents.OpenFolder,
|
||||
title = 'Projects',
|
||||
section = 'projects',
|
||||
indent = 2,
|
||||
padding = 1,
|
||||
},
|
||||
{ section = 'startup' },
|
||||
},
|
||||
},
|
||||
debug = { enabled = true },
|
||||
dim = {
|
||||
enabled = true,
|
||||
scope = {
|
||||
min_size = 5,
|
||||
max_size = 20,
|
||||
siblings = true,
|
||||
},
|
||||
},
|
||||
git = { enabled = true },
|
||||
gitbrowse = { enabled = true },
|
||||
indent = {
|
||||
enabled = true,
|
||||
priority = 1,
|
||||
char = icons.ui.SeparatorLight,
|
||||
only_scope = false,
|
||||
only_current = false,
|
||||
hl = {
|
||||
'SnacksIndent1',
|
||||
'SnacksIndent2',
|
||||
'SnacksIndent3',
|
||||
'SnacksIndent4',
|
||||
'SnacksIndent5',
|
||||
'SnacksIndent6',
|
||||
'SnacksIndent7',
|
||||
'SnacksIndent8',
|
||||
},
|
||||
},
|
||||
input = {
|
||||
enabled = true,
|
||||
icon = icons.ui.Edit,
|
||||
icon_hl = 'SnacksInputIcon',
|
||||
icon_pos = 'left',
|
||||
prompt_pos = 'title',
|
||||
win = { style = 'input' },
|
||||
expand = true,
|
||||
},
|
||||
lazygit = { enabled = true },
|
||||
notifier = {
|
||||
enabled = true,
|
||||
timeout = 2000,
|
||||
width = { min = 40, max = 0.4 },
|
||||
height = { min = 1, max = 0.6 },
|
||||
margin = { top = 0, right = 1, bottom = 0 },
|
||||
padding = true,
|
||||
sort = { 'level', 'added' },
|
||||
level = vim.log.levels.TRACE,
|
||||
icons = {
|
||||
debug = icons.ui.Bug,
|
||||
error = icons.diagnostics.Error,
|
||||
info = icons.diagnostics.Information,
|
||||
trace = icons.ui.Bookmark,
|
||||
warn = icons.diagnostics.Warning,
|
||||
},
|
||||
style = 'compact',
|
||||
top_down = true,
|
||||
date_format = '%R',
|
||||
more_format = ' ↓ %d lines ',
|
||||
refresh = 50,
|
||||
},
|
||||
notify = { enabled = true },
|
||||
profiler = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
rename = { enabled = true },
|
||||
scope = {
|
||||
enabled = true,
|
||||
keys = {
|
||||
textobject = {
|
||||
ii = {
|
||||
min_size = 2, -- minimum size of the scope
|
||||
edge = false, -- inner scope
|
||||
cursor = false,
|
||||
treesitter = { blocks = { enabled = false } },
|
||||
desc = 'inner scope',
|
||||
},
|
||||
ai = {
|
||||
cursor = false,
|
||||
min_size = 2, -- minimum size of the scope
|
||||
treesitter = { blocks = { enabled = false } },
|
||||
desc = 'full scope',
|
||||
},
|
||||
},
|
||||
jump = {
|
||||
['[a'] = {
|
||||
min_size = 1, -- allow single line scopes
|
||||
bottom = false,
|
||||
cursor = false,
|
||||
edge = true,
|
||||
treesitter = { blocks = { enabled = false } },
|
||||
desc = 'jump to top edge of scope',
|
||||
},
|
||||
[']a'] = {
|
||||
min_size = 1, -- allow single line scopes
|
||||
bottom = true,
|
||||
cursor = false,
|
||||
edge = true,
|
||||
treesitter = { blocks = { enabled = false } },
|
||||
desc = 'jump to bottom edge of scope',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
scratch = {
|
||||
enabled = true,
|
||||
name = 'SCRATCH',
|
||||
ft = function()
|
||||
if vim.bo.buftype == '' and vim.bo.filetype ~= '' then
|
||||
return vim.bo.filetype
|
||||
end
|
||||
return 'markdown'
|
||||
end,
|
||||
icon = nil,
|
||||
root = vim.fn.stdpath('data') .. '/scratch',
|
||||
autowrite = true,
|
||||
filekey = {
|
||||
cwd = true,
|
||||
branch = true,
|
||||
count = true,
|
||||
},
|
||||
win = {
|
||||
width = 120,
|
||||
height = 40,
|
||||
bo = { buftype = '', buflisted = false, bufhidden = 'hide', swapfile = false },
|
||||
minimal = false,
|
||||
noautocmd = false,
|
||||
zindex = 20,
|
||||
wo = { winhighlight = 'NormalFloat:Normal' },
|
||||
border = 'rounded',
|
||||
title_pos = 'center',
|
||||
footer_pos = 'center',
|
||||
|
||||
keys = {
|
||||
['execute'] = {
|
||||
'<cr>',
|
||||
function(_)
|
||||
vim.cmd('%SnipRun')
|
||||
end,
|
||||
desc = 'Execute buffer',
|
||||
mode = { 'n', 'x' },
|
||||
},
|
||||
},
|
||||
},
|
||||
win_by_ft = {
|
||||
lua = {
|
||||
keys = {
|
||||
['source'] = {
|
||||
'<cr>',
|
||||
function(self)
|
||||
local name = 'scratch.' .. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.buf), ':e')
|
||||
Snacks.debug.run({ buf = self.buf, name = name })
|
||||
end,
|
||||
desc = 'Source buffer',
|
||||
mode = { 'n', 'x' },
|
||||
},
|
||||
['execute'] = {
|
||||
'e',
|
||||
function(_)
|
||||
vim.cmd('%SnipRun')
|
||||
end,
|
||||
desc = 'Execute buffer',
|
||||
mode = { 'n', 'x' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
scroll = { enabled = false },
|
||||
statuscolumn = {
|
||||
enabled = true,
|
||||
left = { 'mark', 'sign' },
|
||||
right = { 'fold', 'git' },
|
||||
folds = {
|
||||
open = false,
|
||||
git_hl = false,
|
||||
},
|
||||
git = {
|
||||
patterns = { 'GitSign', 'MiniDiffSign' },
|
||||
},
|
||||
refresh = 50,
|
||||
},
|
||||
terminal = { enabled = false },
|
||||
toggle = { enabled = false },
|
||||
win = { enabled = true },
|
||||
words = { enabled = false },
|
||||
zen = {
|
||||
enabled = true,
|
||||
toggles = {
|
||||
dim = true,
|
||||
git_signs = false,
|
||||
mini_diff_signs = false,
|
||||
-- diagnostics = false,
|
||||
-- inlay_hints = false,
|
||||
},
|
||||
show = {
|
||||
statusline = false,
|
||||
tabline = false,
|
||||
},
|
||||
win = { style = 'zen' },
|
||||
zoom = {
|
||||
toggles = {},
|
||||
show = { statusline = true, tabline = true },
|
||||
win = {
|
||||
backdrop = false,
|
||||
width = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user