updates
This commit is contained in:
1 parent
dd4e5e0cc4
commit
bd932cf5e1
21 files changed
+7107
-55
No files matched your search
@@ -0,0 +1,94 @@
|
||||
local alpha = require('alpha')
|
||||
local dashboard = require('alpha.themes.dashboard')
|
||||
|
||||
dashboard.section.header.val = {
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ████ ██████ █████ ██ ]],
|
||||
[[ ███████████ █████ ]],
|
||||
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||
[[ ]],
|
||||
}
|
||||
dashboard.section.header.opts.hl = 'AlphaHeader'
|
||||
|
||||
local function button(sc, txt, leader_txt, keybind, keybind_opts)
|
||||
local sc_after = sc:gsub('%s', ''):gsub(leader_txt, '<leader>')
|
||||
|
||||
local opts = {
|
||||
position = 'center',
|
||||
shortcut = sc,
|
||||
cursor = 5,
|
||||
width = 36,
|
||||
align_shortcut = 'right',
|
||||
hl_shortcut = 'AlphaShortcut',
|
||||
}
|
||||
|
||||
if nil == keybind then
|
||||
keybind = sc_after
|
||||
end
|
||||
|
||||
keybind_opts = vim.F.if_nil(keybind_opts, { noremap = true, silent = true, nowait = true })
|
||||
opts.keymap = { 'n', sc_after, keybind, keybind_opts }
|
||||
|
||||
local function on_press()
|
||||
local key = vim.api.nvim_replace_termcodes(sc_after .. '<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 leader = ' '
|
||||
dashboard.section.buttons.val = {
|
||||
button('space f f', ' Find File ', leader, ':Telescope find_files<CR>'),
|
||||
button('space f h', ' Find Hidden File ', leader, ':Telescope find_files hidden=true no_ignore=true<CR>'),
|
||||
button('space f o', ' Recent File ', leader, ':Telescope oldfiles<CR>'),
|
||||
button('space f w', ' Find Word ', leader, ':Telescope live_grep<CR>'),
|
||||
button('space f n', ' New File ', leader, ':ene <BAR> startinsert <CR>'),
|
||||
button('space n', ' Settings', leader, ':e $MYVIMRC | :cd %:p:h <CR>'),
|
||||
button('space l', ' Lazy', leader, ':Lazy<CR>'),
|
||||
button('space q', ' Quit', leader, ':qa<CR>'),
|
||||
}
|
||||
dashboard.section.buttons.opts.hl = 'String'
|
||||
|
||||
local function footer()
|
||||
local stats = require('lazy').stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
return ' Have fun with Neovim' .. ' Neovim loaded ' .. stats.count .. ' plugins in ' .. ms .. 'ms'
|
||||
end
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
dashboard.section.footer.opts.hl = 'AlphaFooter'
|
||||
|
||||
local head_butt_padding = 2
|
||||
local occu_height = #dashboard.section.header.val + 2 * #dashboard.section.buttons.val + head_butt_padding
|
||||
local header_padding = math.max(0, math.ceil((vim.fn.winheight('$') - occu_height) * 0.40))
|
||||
local foot_butt_padding = 1
|
||||
|
||||
dashboard.config.layout = {
|
||||
{ type = 'padding', val = header_padding },
|
||||
dashboard.section.header,
|
||||
{ type = 'padding', val = head_butt_padding },
|
||||
dashboard.section.buttons,
|
||||
{ type = 'padding', val = foot_butt_padding },
|
||||
dashboard.section.footer,
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'LazyVimStarted',
|
||||
callback = function()
|
||||
dashboard.section.footer.val = footer()
|
||||
pcall(vim.cmd.AlphaRedraw)
|
||||
end,
|
||||
})
|
||||
@@ -1,13 +1,17 @@
|
||||
-- Define nvim-lspconfig LSP servers here
|
||||
local lsp_servers = {
|
||||
'basedpyright',
|
||||
-- 'basedpyright',
|
||||
'pyright',
|
||||
'pylsp',
|
||||
'lua_ls',
|
||||
'tsserver',
|
||||
'ts_ls',
|
||||
'tailwindcss',
|
||||
'emmet_ls',
|
||||
'bashls',
|
||||
'jdtls',
|
||||
'clangd',
|
||||
'html',
|
||||
'cssls',
|
||||
}
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
@@ -115,20 +119,54 @@ mason_lspconfig.setup({
|
||||
},
|
||||
})
|
||||
end,
|
||||
['basedpyright'] = function()
|
||||
['pyright'] = function()
|
||||
-- configure pyright server (with special settings)
|
||||
lspconfig['basedpyright'].setup({
|
||||
lspconfig['pyright'].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
python = {
|
||||
hint = { enable = true },
|
||||
analysis = {
|
||||
ignore = { '*' },
|
||||
autoImportCompletions = false,
|
||||
},
|
||||
},
|
||||
-- pyright = {
|
||||
-- -- Using Ruff's import organizer
|
||||
-- disableOrganizeImports = true,
|
||||
-- },
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/publishDiagnostics'] = function() end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- ['pylsp'] = function()
|
||||
-- lspconfig['pylsp'].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- settings = {
|
||||
-- pylsp = {
|
||||
-- plugins = {
|
||||
-- autopep8 = {
|
||||
-- enabled = true,
|
||||
-- },
|
||||
-- pycodestyle = {
|
||||
-- enabled = true,
|
||||
-- ignore = { 'E501', 'E231', 'W503' },
|
||||
-- maxLineLength = 79,
|
||||
-- },
|
||||
-- pylint = {
|
||||
-- enabled = true,
|
||||
-- executable = 'pylint',
|
||||
-- args = {
|
||||
-- '--enable=W0611,W0614',
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
['emmet_ls'] = function()
|
||||
-- configure emmet language server
|
||||
lspconfig['emmet_ls'].setup({
|
||||
@@ -144,5 +182,24 @@ mason_lspconfig.setup({
|
||||
},
|
||||
})
|
||||
end,
|
||||
['cssls'] = function()
|
||||
lspconfig.cssls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
css = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = 'ignore',
|
||||
},
|
||||
},
|
||||
scss = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = 'ignore',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -86,7 +86,7 @@ local n_mappings = {
|
||||
{ '<leader>ea', '<cmd>b#<cr>', desc = 'Alternate File' },
|
||||
{ '<leader>ec', '<cmd>e $MYVIMRC<cr>', desc = 'Config' },
|
||||
{
|
||||
'<leader>ed',
|
||||
'<leader>eC',
|
||||
'<cmd>lua require("telescope.builtin").find_files({cwd = vim.fn.stdpath("config")})<cr>',
|
||||
desc = 'Config Dir',
|
||||
},
|
||||
@@ -95,6 +95,10 @@ local n_mappings = {
|
||||
{ '<leader>ef', '<cmd>Telescope file_browser<cr>', desc = 'File Browser' },
|
||||
{ '<leader>em', '<cmd>e README.md<cr>', desc = 'Readme' },
|
||||
{ '<leader>en', '<cmd>new<cr>', desc = 'New File' },
|
||||
{ '<leader>ex', '<Cmd>!chmod +x %<CR>', desc = 'Make Current File Executable' },
|
||||
{ '<leader>es', '<Cmd>w<CR>', desc = 'Save File' },
|
||||
{ '<leader>ed', '<Cmd>!rm %<CR>', desc = 'Delete File' },
|
||||
{ '<leader>eD', '<Cmd>!rm %<CR><Cmd>bdelete<CR>', desc = 'Delete File and Buffer' },
|
||||
|
||||
{ '<leader>f', group = ' Find' },
|
||||
{ '<leader>ff', '<cmd>Telescope find_files<cr>', desc = 'Find Files (CWD)' },
|
||||
@@ -318,6 +322,7 @@ local n_mappings = {
|
||||
{ '<leader>t2', '<cmd>2ToggleTerm<cr>', desc = 'Toggle Terminal' },
|
||||
{ '<leader>th', '<cmd>Sterm<cr>', desc = 'Horizontal Terminal' },
|
||||
{ '<leader>tv', '<cmd>Vterm<cr>', desc = 'Vertical Terminal' },
|
||||
{ '<leader>tc', '<Cmd>close<CR>', desc = 'Hide Terminal' },
|
||||
|
||||
{ '<leader>u', group = ' Test' },
|
||||
{ '<leader>uc', '<cmd>lua require("neotest").run.run()<cr>', desc = 'Run Current Test' },
|
||||
|
||||
Reference in new issue
Block a user