From c6997b452e23ec22a836df62f9af86e1c8c6019e Mon Sep 17 00:00:00 2001 From: Maximilian Wolf <69987866+MaxWolf-01@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:51:27 +0100 Subject: [PATCH] add nvim dashboard, mappings and wakatime --- nvim/lua/mappings.lua | 2 + nvim/lua/plugins/dashboard.lua | 204 +++++++++++++++++++++++++++++++++ nvim/lua/plugins/wakatime.lua | 1 + 3 files changed, 207 insertions(+) create mode 100644 nvim/lua/plugins/dashboard.lua create mode 100644 nvim/lua/plugins/wakatime.lua diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 88168c6..c2940bd 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -14,6 +14,8 @@ map("n", "", ":w", { noremap = true, silent = true }) map("i", "", ":wa", { noremap = true, silent = true }) -- preserve paste register when pasting over selection map("x", "p", "\"_dP", { noremap = true, silent = true }) +-- show dashboard +map("n", "d", ":Dashboard", { silent = true }) -- ==================================================================== -- lsp diff --git a/nvim/lua/plugins/dashboard.lua b/nvim/lua/plugins/dashboard.lua new file mode 100644 index 0000000..540e305 --- /dev/null +++ b/nvim/lua/plugins/dashboard.lua @@ -0,0 +1,204 @@ +return { + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + config = function() + local dashboard = require('dashboard') + local headers = { + { + "", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + "", + }, + { + "", + " ┌───────────────────────────┐", + " │ $ nvim init.lua │", + " │ ┌─────────────────────┐ │", + " │ │ require('plugins') │ │", + " │ │ require('config') │ │", + " │ │ require('theme') │ │", + " │ └─────────────────────┘ │", + " │ [+] Ready to code │", + " └───────────────────────────┘", + "", + }, + { + "", + " C7 77/7~7(~ ", + " @@@@@/ S7@@~@ @K ", + " ^@@K@@BK~ N E O V I M 7@@@BSS(S7CC7 ", + " @S@@~(S@@@R @@@/777((77S7@7 ", + " ^S@@@(7@@@@/ S@@B@77(~@7@KKS/ ", + " 7@@B(~(7S@@B@7 K@@@B~7((~(77@@@@7 ", + " 7@@S7((77@@@@@~ S7 7(@S@SB@7@@@@@S@@777((~7@@S@@7 ", + " 7~(@@@7((~(7@@@@77@B@@R@BS@@@K@@@C@S77(~(@@(77@B@@K( ", + " S@@@7(~@(@B@K@ ~SS^// 7CS@S/K@B(~((7S@@@@@/ ", + " 7@@@77(@@@@K~ /@7RS7@@@7/R@777@@@SBCC/ ", + " 7S77@@@@7@@7 /@C 7@~~~BSS@K@@@@B@B@@@@@@~ ", + " SB@B@@7@@7~( S@7 @@( @@@@@SS@@S@7 ", + " KK@@CS7 ^~SB KKS/C(C@@SS@@@( ", + " @@@@/ ~@ @ @@@BS/ ^ 7K77@B@7 ", + " // S@77@@@B@@@ @ @@@B@ @@ S@@7 S~ 7 ", + " / 7@@7@@@@@@@@@ @ @@@@@@@KB 7@@@S 7K7~ ", + " ~S7@@C @@@@@@@SB @ @@@SCSSCB (KB@@@S ~SCSCSCRSS7 ", + " 7@S@@@C 7@@@@K@@S @S 7SS@S @@@@@@R 7K@@SKB/(S/", + " 7@7@B@@7 ^S@7^@@ S @ ~ S@@B@@@~ /S7 /@77@7 ", + " K7K@@C@@@B@S~C 7@7 7@@@B@@@B@S77@S( 7@R7/SCS@/", + " 7S~@S7/B@B@@@@BK 7@/ ~/7 (@B@@B@@@@@7~ SBSB7 S/ ", + " @S@@S 7K@K @C7@@@@@K 7S777777S@S ~@7 ^ CB@@B^ 7@C", + " @ CC@ ~7@@@@SS@S7S @B~ @S7S 7 7S@7 @ B/ SB@S(@7", + " BC@K7~ K@~^7S~7 KB@K ~ 7CS7R ^SK@~ ^~7S7^7S^ /@K(SS7SS^", + " 7@S ~/ (SB@S 7S@@K S@@@S7~ CK@@S ^ S~ 7@S@7~@7 ", + " ^@^~S 7K 7RB@@@^ K@@@@RC7 7RC^ 7^ K~(@K~@~/K7 ", + " S^/@~/S 7S@S( (@@@K@7~ 7@ 7S ~@/@B@7@7/7 ", + " /@^SS ~C@@BKC// 77@~/S S7K@@7^K/ ", + " S@K SCKS~^ @ ~/ 7 R/ 7@ ^7 S@~ ", + " S@S~~@@@@S( ~(S SS C7 K 7S ~@SCS77@S ", + " @S /7@B~ @~KKB/~@ ~7 @/ @ 7/K 7@ (@@ @ SS @@7@^ ", + " @ 7@~ 77@7S7SR (7 K @ S~ @KS7K BS SB(~B 7SS( @ ", + " @@ 7^ S~RC~@7C KR^~R7 @ ^S RSK~@~^@C (@~ ~C @K / ", + " @ /7@C ~S@77~ CK7@C@@~BS@~CC7@7@CS @S@ @ @7 ", + " @@CC (K @~ C 7CC7@CB@~B7@7KK @K77C (7KS ^/ ", + " S ( (/S~ /@7~S7 @7S7 S@SS/7@@@~@ @77 7 ", + " @@@B@@@S@ C7/7 S7S@^@@ @@B R77@K77K@ SB ", + " R/~ 77@S7 @@ @@@ S(/7@K @ ", + " /R ( S(~S ", + "", + }, + { + "", + " .-'''''-. ", + " .' `. ", + " N E O V I M : ", + " : : ", + " : _/| : ", + " : =/_/ : ", + " `._/ | .' ", + " ( / ,|...-' ", + " \\_/^\\/||__ ", + " _/~ `\"\"~`\"` \\_ ", + " __/ -'/ `-._ `\\_\\__ ", + " /jgs /-'` `\\ \\ \\-.\\ ", + "", + }, + { + "", + "⠀⠀⠀⠀⠀⣀⣠⣤⣤⣤⣤⣄⣀⠀⠀⠀⠀⠀ ", + "⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀ ", + "⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢿⣿⣷⡀⠀ ", + "⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⣴⢿⣿⣧⠀ ", + "⣿⣿⣿⣿⣿⡿⠛⣩⠍⠀⠀⠀⠐⠉⢠⣿⣿⡇ ", + "⣿⡿⠛⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿ ", + "⢹⣿⣤⠄⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⡏ ", + "⠀⠻⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⠟⠀ ", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⠟⠁⠀⠀ ", + "⠀⠀ N E O V I M ", + "", + }, + { + "", + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + "", + " N E O V I M ", + "", + }, + { + "", + " ,", + " ,-. _,---._ __ / \\", + " / ) .-' `./ / \\", + " ( ( ,' `/ /|", + " \\ `-\" \\'\\ / |", + " `. , \\ \\ / |", + " /`. ,'-`----Y |", + " ( ; | '", + " | ,-. ,-' | /", + " | | ( | hjw | /", + " ) | \\ `.___________|/", + " `--' `--'", + "", + " N E O V I M ", + "", + }, + { + "", + " (((( ", + " (((( ", + " )))) ", + " _ .---. ", + " ( |`---'| ", + " \\| | ", + " : .___, : ", + " `-----' ", + " N E O V I M ", + "", + }, + } + + math.randomseed(os.time()) + local random_header = headers[math.random(#headers)] + dashboard.setup { + theme = 'hyper', + config = { + header = random_header, + shortcut = { + { desc = ' Find File', group = 'DashboardFiles', key = 'f', action = 'Telescope find_files' }, + { desc = ' Recent Files', group = 'DashboardFiles', key = 'r', action = 'Telescope oldfiles' }, + { desc = ' Find Word', group = 'DashboardFiles', key = 'w', action = 'Telescope live_grep' }, + { desc = ' New File', group = 'DashboardFiles', key = 'n', action = 'enew' }, + { desc = ' Settings', group = 'DashboardFiles', key = 's', action = 'e $MYVIMRC' }, + { desc = ' Update Plugins', group = 'DashboardFiles', key = 'u', action = 'Lazy update' }, + }, + packages = { + enable = true -- Shows plugin count + }, + project = { + enable = true, + limit = 8, + icon = '', + label = 'Recent Projects', + action = 'Telescope find_files cwd=' + }, + mru = { + enable = true, + limit = 10, + icon = '', + label = 'Recent Files', + }, + footer = { + "", + os.date("%H:%M") .. " " .. ({ "🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘" })[tonumber(os.date("%d")) % 8 + 1] .. " " .. os.date("%d %b, %a"), + "", "󰍛 " .. io.popen("whoami"):read("*l") .. "@" .. io.popen("hostname"):read("*l") + .. " 󰌪 " .. io.popen('uptime -p'):read("*l"), + } + }, + hide = { + statusline = true, -- Set to true to hide statusline in dashboard + tabline = true, -- Set to true to hide tabline in dashboard + winbar = true -- Set to true to hide winbar in dashboard + }, + disable_move = false, -- Set to true to disable cursor movement in dashboard + shortcut_type = 'letter', -- 'letter' for a-z shortcuts, 'number' for numeric shortcuts + change_to_vcs_root = true -- Change to project root when opening files from MRU + } + end, + dependencies = { + { 'nvim-tree/nvim-web-devicons' }, + { 'nvim-telescope/telescope.nvim' } + } +} diff --git a/nvim/lua/plugins/wakatime.lua b/nvim/lua/plugins/wakatime.lua new file mode 100644 index 0000000..89df094 --- /dev/null +++ b/nvim/lua/plugins/wakatime.lua @@ -0,0 +1 @@ +return { 'wakatime/vim-wakatime', lazy = false }