From d6ce80e6a2c8faaa7b7f36b18a97a2c1cf203657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Wed, 27 Dec 2023 11:52:56 +0100 Subject: [PATCH] feat: add dashboard --- init.lua | 18 ++++++++- lua/plugins/alpha.lua | 59 ++++++++++++++++++++++++++++++ lua/plugins/lsp.lua | 24 ++++++------ lua/plugins/rainbow-delimiters.lua | 3 ++ lua/plugins/telescope.lua | 1 + 5 files changed, 91 insertions(+), 14 deletions(-) create mode 100644 lua/plugins/alpha.lua create mode 100644 lua/plugins/rainbow-delimiters.lua diff --git a/init.lua b/init.lua index 0da5c30..c803067 100644 --- a/init.lua +++ b/init.lua @@ -29,12 +29,26 @@ require('lazy').setup({ 'sainnhe/gruvbox-material', priority = 1000, lazy = false, + -- config = function() + -- vim.g.gruvbox_material_background = 'soft' + -- vim.g.gruvbox_material_better_performance = 1 + -- vim.g.gruvbox_material_enable_italic = 1 + -- + -- vim.cmd.colorscheme 'gruvbox-material' + -- end, config = function() - vim.g.gruvbox_material_background = 'soft' + vim.o.background = 'dark' + vim.g.gruvbox_material_background = 'light' vim.g.gruvbox_material_better_performance = 1 + vim.g.gruvbox_material_diagnostic_line_highlight = 1 + vim.g.gruvbox_material_diagnostic_virtual_text = 'colored' + vim.g.gruvbox_material_enable_bold = 1 vim.g.gruvbox_material_enable_italic = 1 - vim.cmd.colorscheme 'gruvbox-material' + -- changing bg and border colors + vim.api.nvim_set_hl(0, 'FloatBorder', { link = 'Normal' }) + vim.api.nvim_set_hl(0, 'LspInfoBorder', { link = 'Normal' }) + vim.api.nvim_set_hl(0, 'NormalFloat', { link = 'Normal' }) end, }, diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..fdc3ca8 --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,59 @@ +return { + 'goolord/alpha-nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + + config = function() + local alpha = require 'alpha' + local dashboard = require 'alpha.themes.dashboard' + + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + + dashboard.section.buttons.val = { + dashboard.button('e', 'New file', 'ene '), + dashboard.button('SPC s f', 'Search files'), + dashboard.button('SPC s g', 'Search grep'), + dashboard.button('SPC s r', 'Search resume'), + dashboard.button('SPC SPC', 'Open buffers'), + dashboard.button('SPC h t', 'Harpoon terminal'), + } + _Gopts = { + position = 'center', + hl = 'Type', + } + + local function footer() + return os.date 'It was %H:%M:%S when this buffer was opened on %d. %m. %Y, a %A in %B.' + end + + dashboard.section.footer.val = footer() + + dashboard.opts.opts.noautocmd = true + alpha.setup(dashboard.opts) + end, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 3481298..263eb16 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -107,18 +107,18 @@ return { }, server = { on_attach = on_attach, - -- settings = { - -- ['rust-analyzer'] = { - -- cargo = { - -- -- always enable all features - -- features = 'all', - -- }, - -- -- use clippy on save - -- checkOnSave = { - -- command = 'clippy', - -- }, - -- }, - -- }, + settings = { + ['rust-analyzer'] = { + cargo = { + -- always enable all features + features = 'all', + }, + -- use clippy on save + checkOnSave = { + command = 'clippy', + }, + }, + }, }, } diff --git a/lua/plugins/rainbow-delimiters.lua b/lua/plugins/rainbow-delimiters.lua new file mode 100644 index 0000000..859a606 --- /dev/null +++ b/lua/plugins/rainbow-delimiters.lua @@ -0,0 +1,3 @@ +return { + 'HiPhish/rainbow-delimiters.nvim', +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 0e17d49..ce579cd 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -69,6 +69,7 @@ return { vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'ss', require('telescope.builtin').spell_suggest, { desc = '[S]pell [S]suggest' }) + vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) end, }, }