session stuff + new dashboard
This commit is contained in:
parent
3acc56e3c0
commit
e4b78b2209
7 changed files with 127 additions and 23 deletions
|
@ -2,6 +2,7 @@
|
|||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "b6ee84c6db9c8d557e0c8b71f1b6800e77611771" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
||||
"auto-session": { "branch": "main", "commit": "9c3f977aafb56bd73ba0d082c4dcbdba5666faf3" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
|
@ -35,7 +36,6 @@
|
|||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"vim-eunuch": { "branch": "master", "commit": "e86bb794a1c10a2edac130feb0ea590a00d03f1e" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
|
||||
|
|
|
@ -22,6 +22,7 @@ opt.clipboard = 'unnamedplus'
|
|||
opt.encoding = 'utf-8'
|
||||
opt.matchpairs = { '(:)', '{:}', '[:]', '<:>' }
|
||||
opt.syntax = 'enable'
|
||||
opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
|
||||
|
||||
-- indention
|
||||
opt.autoindent = true
|
||||
|
|
5
lua/plugins/alpha.lua
Normal file
5
lua/plugins/alpha.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'goolord/alpha-nvim',
|
||||
opts = require('plugins.alpha.theme'),
|
||||
lazy = false,
|
||||
}
|
109
lua/plugins/alpha/theme.lua
Normal file
109
lua/plugins/alpha/theme.lua
Normal file
|
@ -0,0 +1,109 @@
|
|||
local if_nil = vim.F.if_nil
|
||||
|
||||
local default_terminal = {
|
||||
type = 'terminal',
|
||||
command = nil,
|
||||
width = 69,
|
||||
height = 8,
|
||||
opts = {
|
||||
redraw = true,
|
||||
window_config = {},
|
||||
},
|
||||
}
|
||||
|
||||
local default_header = {
|
||||
type = 'text',
|
||||
val = {
|
||||
[[ __]],
|
||||
[[ ___ ___ ___ __ __ /\_\ ___ ___]],
|
||||
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\]],
|
||||
[[ /\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \]],
|
||||
[[ \ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
||||
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
||||
},
|
||||
opts = {
|
||||
position = 'center',
|
||||
hl = 'Type',
|
||||
-- wrap = "overflow";
|
||||
},
|
||||
}
|
||||
|
||||
local footer = {
|
||||
type = 'text',
|
||||
val = '',
|
||||
opts = {
|
||||
position = 'center',
|
||||
hl = 'Number',
|
||||
},
|
||||
}
|
||||
|
||||
local leader = 'SPC'
|
||||
|
||||
--- @param sc string
|
||||
--- @param txt string
|
||||
--- @param keybind string? optional
|
||||
--- @param keybind_opts table? optional
|
||||
local function button(sc, txt, keybind, keybind_opts)
|
||||
local sc_ = sc:gsub('%s', ''):gsub(leader, '<leader>')
|
||||
|
||||
local opts = {
|
||||
position = 'center',
|
||||
shortcut = sc,
|
||||
cursor = 3,
|
||||
width = 50,
|
||||
align_shortcut = 'right',
|
||||
hl_shortcut = 'Keyword',
|
||||
}
|
||||
if keybind then
|
||||
keybind_opts = if_nil(keybind_opts, { noremap = true, silent = true, nowait = true })
|
||||
opts.keymap = { 'n', sc_, keybind, keybind_opts }
|
||||
end
|
||||
|
||||
local function on_press()
|
||||
local key = vim.api.nvim_replace_termcodes(keybind or sc_ .. '<Ignore>', true, false, true)
|
||||
vim.api.nvim_feedkeys(key, 't', false)
|
||||
end
|
||||
|
||||
return {
|
||||
type = 'button',
|
||||
val = txt,
|
||||
on_press = on_press,
|
||||
opts = opts,
|
||||
}
|
||||
end
|
||||
|
||||
local buttons = {
|
||||
type = 'group',
|
||||
val = {
|
||||
button('SPC f f', ' Find file'),
|
||||
button('SPC f s', ' Find word'),
|
||||
button('SPC s l', ' Open last session'),
|
||||
},
|
||||
opts = {
|
||||
spacing = 1,
|
||||
},
|
||||
}
|
||||
|
||||
local section = {
|
||||
terminal = default_terminal,
|
||||
header = default_header,
|
||||
buttons = buttons,
|
||||
footer = footer,
|
||||
}
|
||||
|
||||
local content_height = #section.header.val + #section.buttons.val * 2 + 1
|
||||
|
||||
local config = {
|
||||
layout = {
|
||||
{ type = 'padding', val = vim.fn.floor((vim.fn.winheight(0) - content_height) / 2) },
|
||||
section.header,
|
||||
{ type = 'padding', val = 2 },
|
||||
section.buttons,
|
||||
section.footer,
|
||||
},
|
||||
opts = {
|
||||
margin = 5,
|
||||
},
|
||||
}
|
||||
|
||||
return config
|
|
@ -1,7 +1,5 @@
|
|||
local config = {
|
||||
auto_restore = true,
|
||||
auto_session = true,
|
||||
enabled = true,
|
||||
auto_restore = false,
|
||||
pre_save_cmds = { 'cclose', 'lua vim.notify.dismiss()' },
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
local map = require('utils').set_keymap
|
||||
|
||||
-- session
|
||||
map('n', '<leader>sl', '<cmd>silent RestoreSession<cr>', { desc = 'Restore session' })
|
||||
map('n', '<leader>sl', '<cmd>silent SessionRestore<cr>', { desc = 'Restore session' })
|
||||
map('n', '<leader>ss', '<cmd>SaveSession<cr>', { desc = 'Save session' })
|
||||
map(
|
||||
'n',
|
||||
'<leader>si',
|
||||
'<cmd>lua require("utils.logger"):log("Session name: " .. require("auto-session-library").current_session_name())<cr>',
|
||||
{ desc = 'Print session' }
|
||||
)
|
||||
|
|
|
@ -23,21 +23,18 @@ return {
|
|||
wk.add({
|
||||
{ '<leader>c', group = 'quickfix' },
|
||||
{ '<leader>f', group = 'find' },
|
||||
{ '<leader>g', group = 'goto' },
|
||||
{ '<leader>h', group = 'gitsigns' },
|
||||
{ '<leader>ht', group = 'toggle' },
|
||||
{ '<leader>k', group = 'buffer' },
|
||||
{ '<leader>l', group = 'lsp' },
|
||||
{ '<leader>ld', group = 'diagnostics' },
|
||||
{ '<leader>lt', group = 'toggle' },
|
||||
{ '<leader>lw', group = 'workspace' },
|
||||
{ '<leader>n', group = 'tree' },
|
||||
{ '<leader>p', group = 'lazy (plugins)' },
|
||||
{ '<leader>s', group = 'session' },
|
||||
{ '<leader>t', group = 'tab' },
|
||||
{ '<leader>v', group = 'git (vsc)' },
|
||||
{ '<leader>vt', group = 'toggle' },
|
||||
{ '<leader>x', group = 'terminal' },
|
||||
{ '<leader>x', group = 'trouble' },
|
||||
})
|
||||
end,
|
||||
event = 'VeryLazy',
|
||||
|
|
Loading…
Add table
Reference in a new issue