From 9f20c1f313e20102dd83adeaf091284be1fd82d0 Mon Sep 17 00:00:00 2001 From: "eric.marin" Date: Wed, 11 Sep 2024 14:49:39 +0200 Subject: config --- nvim/lua/plugins/catppuccin.lua | 58 ++++++ nvim/lua/plugins/dashboard-nvim.lua | 323 +++++++++++++++++++++++++++++++ nvim/lua/plugins/indent-blankline.lua | 13 ++ nvim/lua/plugins/lazy.lua | 12 ++ nvim/lua/plugins/lazydev.lua | 5 + nvim/lua/plugins/lspsaga.lua | 26 +++ nvim/lua/plugins/lualine.lua | 34 ++++ nvim/lua/plugins/noice.lua | 22 +++ nvim/lua/plugins/nvim-autopairs.lua | 6 + nvim/lua/plugins/nvim-cmp.lua | 62 ++++++ nvim/lua/plugins/nvim-lspconfig.lua | 82 ++++++++ nvim/lua/plugins/nvim-parinfer.lua | 5 + nvim/lua/plugins/nvim-treesitter.lua | 47 +++++ nvim/lua/plugins/oil.lua | 38 ++++ nvim/lua/plugins/telescope.lua | 53 +++++ nvim/lua/plugins/todo-comments.lua | 34 ++++ nvim/lua/plugins/toggleterm.lua | 64 ++++++ nvim/lua/plugins/trouble.lua | 24 +++ nvim/lua/plugins/vim-highlightedyank.lua | 8 + nvim/lua/plugins/vim-illuminate.lua | 5 + nvim/lua/plugins/which-key.lua | 10 + nvim/lua/plugins/yuck.lua | 5 + 22 files changed, 936 insertions(+) create mode 100644 nvim/lua/plugins/catppuccin.lua create mode 100644 nvim/lua/plugins/dashboard-nvim.lua create mode 100644 nvim/lua/plugins/indent-blankline.lua create mode 100644 nvim/lua/plugins/lazy.lua create mode 100644 nvim/lua/plugins/lazydev.lua create mode 100644 nvim/lua/plugins/lspsaga.lua create mode 100644 nvim/lua/plugins/lualine.lua create mode 100644 nvim/lua/plugins/noice.lua create mode 100644 nvim/lua/plugins/nvim-autopairs.lua create mode 100644 nvim/lua/plugins/nvim-cmp.lua create mode 100644 nvim/lua/plugins/nvim-lspconfig.lua create mode 100644 nvim/lua/plugins/nvim-parinfer.lua create mode 100644 nvim/lua/plugins/nvim-treesitter.lua create mode 100644 nvim/lua/plugins/oil.lua create mode 100644 nvim/lua/plugins/telescope.lua create mode 100644 nvim/lua/plugins/todo-comments.lua create mode 100644 nvim/lua/plugins/toggleterm.lua create mode 100644 nvim/lua/plugins/trouble.lua create mode 100644 nvim/lua/plugins/vim-highlightedyank.lua create mode 100644 nvim/lua/plugins/vim-illuminate.lua create mode 100644 nvim/lua/plugins/which-key.lua create mode 100644 nvim/lua/plugins/yuck.lua (limited to 'nvim/lua/plugins') diff --git a/nvim/lua/plugins/catppuccin.lua b/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..8599732 --- /dev/null +++ b/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,58 @@ +local config = function() + require("catppuccin").setup({ + custom_highlights = function(colors) + return { + TodoError = { fg = colors.base, bg = colors.red }, + } + end, + integrations = { + dashboard = true, + indent_blankline = { + enabled = true, + colored_indent_levels = false, + }, + lsp_saga = false, + neotree = false, + cmp = true, + native_lsp = { + enabled = true, + virtual_text = { + errors = { "italic" }, + hints = { "italic" }, + warnings = { "italic" }, + information = { "italic" }, + ok = { "italic" }, + }, + underlines = { + errors = { "undercurl" }, + hints = { "underline" }, + warnings = { "undercurl" }, + information = { "underline" }, + ok = { "underline" }, + }, + inlay_hints = { + background = true, + }, + }, + treesitter = true, + telescope = { + enabled = true, + -- style = "nvchad" + }, + lsp_trouble = false, + illuminate = { + enabled = true, + lsp = false + }, + which_key = false + } + }) + vim.cmd.colorscheme("catppuccin-macchiato") +end + +return { + "catppuccin/nvim", + name = "catppuccin", + lazy = false, + config = config, +} diff --git a/nvim/lua/plugins/dashboard-nvim.lua b/nvim/lua/plugins/dashboard-nvim.lua new file mode 100644 index 0000000..06b87f9 --- /dev/null +++ b/nvim/lua/plugins/dashboard-nvim.lua @@ -0,0 +1,323 @@ +math.randomseed(os.time()) + +Headers = { + { + [[ ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗ ]], + [[ ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║ ]], + [[ ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║ ]], + [[ ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║ ]], + [[ ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║ ]], + [[ ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ]], + [[ ]], + }, + { + [[ ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓ ]], + [[ ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒ ]], + [[ ▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░ ]], + [[ ▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ ]], + [[ ▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒ ]], + [[ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░ ]], + [[ ░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░ ]], + [[ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ ]], + [[ ░ ░ ░ ░ ░ ░ ░ ░ ]], + [[ ░ ]], + [[ ]], + }, + { + [[ ██████ █████ █████ █████ ███ ]], + [[ ░░██████ ░░███ ░░███ ░░███ ░░░ ]], + [[ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ]], + [[ ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ]], + [[ ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ]], + [[ ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ]], + [[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]], + [[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]], + [[ ]], + }, + { + [[ ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. ]], + [[ •█▌▐█▀▄.▀· ▄█▀▄ ▪█·█▌██ ·██ ▐███▪ ]], + [[ ▐█▐▐▌▐▀▀▪▄▐█▌.▐▌▐█▐█•▐█·▐█ ▌▐▌▐█· ]], + [[ ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ ]], + [[ ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ ]], + [[ ]], + + }, + { + [[ __ __ ________ ______ __ __ ______ __ __ ]], + [[ | \ | \ \/ \| \ | \ \ \ / \ ]], + [[ | ▓▓\ | ▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓\ ▓▓ | ▓▓\▓▓▓▓▓▓ ▓▓\ / ▓▓ ]], + [[ | ▓▓▓\| ▓▓ ▓▓__ | ▓▓ | ▓▓ ▓▓ | ▓▓ | ▓▓ | ▓▓▓\ / ▓▓▓ ]], + [[ | ▓▓▓▓\ ▓▓ ▓▓ \ | ▓▓ | ▓▓\▓▓\ / ▓▓ | ▓▓ | ▓▓▓▓\ ▓▓▓▓ ]], + [[ | ▓▓\▓▓ ▓▓ ▓▓▓▓▓ | ▓▓ | ▓▓ \▓▓\ ▓▓ | ▓▓ | ▓▓\▓▓ ▓▓ ▓▓ ]], + [[ | ▓▓ \▓▓▓▓ ▓▓_____| ▓▓__/ ▓▓ \▓▓ ▓▓ _| ▓▓_| ▓▓ \▓▓▓| ▓▓ ]], + [[ | ▓▓ \▓▓▓ ▓▓ \\▓▓ ▓▓ \▓▓▓ | ▓▓ \ ▓▓ \▓ | ▓▓ ]], + [[ \▓▓ \▓▓\▓▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓ \▓▓▓▓▓▓\▓▓ \▓▓ ]], + [[ ]], + }, + { + [[ ▀███▄ ▀███▀███▀▀▀███ ▄▄█▀▀██▄ ▀████▀ ▀███▀████▀████▄ ▄███▀ ]], + [[ ███▄ █ ██ ▀█▄██▀ ▀██▄ ▀██ ▄█ ██ ████ ████ ]], + [[ █ ███ █ ██ █ ██▀ ▀██ ██▄ ▄█ ██ █ ██ ▄█ ██ ]], + [[ █ ▀██▄ █ ██████ ██ ██ ██▄ █▀ ██ █ █▓ █▀ ██ ]], + [[ █ ▀██▄▓ ██ █ ▄█ ██ ▀▓█ ▓▀ █▓ ▓ █▓▄█▀ ██ ]], + [[ ▓ ▓█▓ █▓ ▄███ ██▀ ▓██▄ █▓ ▓ ▀▓█▀ ██ ]], + [[ ▓ ▀▓▓▓▓ ▓▓ ▓ ▓██ ▓█▓ ▓▓ ▓▀ ▓▓ ▓ ▓▓▓▓▀ ▓▓ ]], + [[ ▓ ▓▓▓ ▓▓ ▓▓█▓▓▓ ▓▓▓ ▓▓▒▒ ▒▓ ▒ ▀▓▓▀ ▓▓ ]], + [[ ▒ ▒ ▒ ▒▓▓▒ ▒▒▒▓▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒▓▒ ▒▒ ▒▒▒ ▒ ▒ ▒▒▒ ]], + [[ ]], + }, + { + [[ _.oo. ]], + [[ _.u[[/;:,. .odMMMMMM' ]], + [[ .o888UU[[[/;:-. .o@P^ MMM^ ]], + [[ oN88888UU[[[/;::-. dP^ ]], + [[ dNMMNN888UU[[[/;:--. .o@P^ ]], + [[ ,MMMMMMN888UU[[/;::-. o@^ ]], + [[ NNMMMNN888UU[[[/~.o@P^ ]], + [[ 888888888UU[[[/o@^-.. ]], + [[ oI8888UU[[[/o@P^:--.. ]], + [[ .@^ YUU[[[/o@^;::---.. ]], + [[ oMP ^/o@P^;:::---.. ]], + [[ .dMMM .o@^ ^;::---... ]], + [[ dMMMMMMM@^` `^^^^ ]], + [[ YMMMUP^ ]], + [[ ^^ ]], + [[ ]], + }, + { + [[ ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ]], + [[ ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ]], + [[ ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ]], + [[ ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ]], + [[ ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ]], + [[ ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ]], + [[ ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ]], + [[ ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ]], + [[ ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ]], + [[ ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ]], + [[ ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ]], + [[ ]], + }, + { + [[⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣠⣤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⣿⣿⣿⡆⠀⠀⠀⢸⣿⣿⠿⠿⢿⣿⣿⣿⣿⡿⠿⠿⣿⣿⡇⠀⠀⠀⣾⣿⣿⡿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⢿⣿⠿⠿⠿⠿⣿⣿⣿⡏⠀⠀⠀⢹⣿⡇⠀⠀⠀⢸⣿⢱⣶⣴⣶⢹⣿⣿⡏⣶⣦⣶⡎⣿⡇⠀⠀⠀⢿⣿⠁⠀⠀⠈⣿⣿⣿⡿⠟⣋⣽⣿⣿⠇⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⠘⣿⣧⣄⣀⣴⣿⣿⣿⣷⣄⣀⣠⣾⣟⠀⠀⠀⠀⠈⣿⣦⣙⣛⣡⣾⡿⢿⣷⣌⣛⣋⣴⣿⠁⠀⠀⠀⠘⣿⣦⣄⣀⣴⣿⣿⣿⣿⣶⣶⣤⣿⡟⠀⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣏⣼⣌⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣰⣆⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣏⣼⣌⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⠀⠀⠉⠉⢿⣿⣿⣿⣿⣿⣿⡏⠉⠁⠀⠀⠀⠀⠀⠀⠀⠉⠉⢹⣿⣿⣿⣿⣿⣿⡏⠉⠉⠀⠀⠀⠀⠀⠀⠀⠉⠉⣿⣿⣿⣿⣿⣿⣿⡏⠉⠁⠀⠀⠀⠀⠀⠀]], + [[⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⠁⠁⠉⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠁⠉⠉⠈⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⠁⠁⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀]], + [[ ]], + }, + { + [[ ,-. _,---._ __ / \ ]], + [[ / ) .-' `./ / \ ]], + [[ ( ( ,' `/ /| ]], + [[ \ `-" \'\ / | ]], + [[ `. , \ \ / | ]], + [[ /`. ,'-`----Y | ]], + [[ ( ; | ' ]], + [[ | ,-. ,-' | / ]], + [[ | | ( | | / ]], + [[ ) | \ `.___________|/ ]], + [[ `--' `--' ]], + [[ ]], + }, + { + [[ |\ _,,,---,,_ ]], + [[ ZZZzz /,`.-'`' -. ;-;;,_ ]], + [[ |,4- ) )-,_. ,\ ( `'-' ]], + [[ '---''(_/--' `-'\_) ]], + [[ ]], + }, + { + [[ ____ ]], + [[ /\ \ ]], + [[ / \ \ ]], + [[ / \ \ ]], + [[ / \ \ ]], + [[ / /\ \ \ ]], + [[ / / \ \ \ ]], + [[ / / \ \ \ ]], + [[ / / / \ \ \ ]], + [[ / / / \ \ \ ]], + [[ / / /---------' \ ]], + [[ / / /_______________\ ]], + [[ \ / / ]], + [[ \/_____________________/ ]], + [[ ]], + }, + { + [[ ____ ]], + [[ ,-~~~~' '~~~~-, ]], + [[ ,' '', ]], + [[ ( Y ]], + [[ { I ]], + [[ { - `. ]], + [[ | ', ) ]], + [[ | | ,..__ __. Y ]], + [[ | .,_./ Y ' / ^Y J )| ]], + [[ \ |' / | | || ]], + [[ \ L_/ . _ (_,.'( ]], + [[ \, , ^^""' / | ) ]], + [[ \_ \ /,L] / ]], + [[ '-_`-, ` ` ./` ]], + [[ `-(_ ) ]], + [[ ^^\..___,.--` ]], + [[ ]], + }, + { + [[ ____ ]], + [[ _.-'78o `"`--._ ]], + [[ ,o888o. .o888o, ''-. ]], + [[ ,88888P `78888P..______.] ]], + [[ /_..__..----"" __.' ]], + [[ `-._ /""| _..-'' ]], + [[ "`-----\ `\ ]], + [[ | ;.-""--.. ]], + [[ | ,8o. o88. `. ]], + [[ `;888P `788P : ]], + [[ .o""-.|`-._ ./ ]], + [[ J88 _.-/ ";"-P----' ]], + [[ `--'\`| / / ]], + [[ | / | | ]], + [[ \| / | ]], + [[ `-----`---' ]], + [[ ]], + }, + { + [[ ,. ]], + [[ J;`. ]], + [[ iyi.`. ]], + [[ j?7;. : ]], + [[ fclu:.` : ]], + [[ dE2Xvi;. `. ]], + [[ JGL56bhx;.'; ]], + [[ 4KPY^f:l"`-; ]], + [[ """l:;-"" ]], + [[ `; \ ]], + [[ .' ; ]], + [[ /'.' ]], + [[ f .' ]], + [[ `. \ ]], + [[ `-' ]], + [[ ]], + }, + { + [[ ___..._ ]], + [[ _,--' "`-. ]], + [[ ,'. . \ ]], + [[ ,/:. . . .' ]], + [[ |;.. . _..--' ]], + [[ `--:...-,-'""\ ]], + [[ |:. `. ]], + [[ l;. l ]], + [[ `|:. | ]], + [[ |:. `., ]], + [[ .l;. j, , ]], + [[ `. \`;:. //,/ ]], + [[ .\\)`;,|\'/( ]], + [[ ` ` ` ]], + [[ ]], + } +} + +Quotes = { + { + "", + "I don't care that they stole my idea... I care that they don't have any of their own", + "~ Nikola Tesla", + }, + { + "", + "Make everything as simple as possible, but not simpler.", + "~ Albert Einstein", + }, + { + "", + "Code never lies, comments sometimes do.", + "~ Ron Jeffries", + }, + { + "", + "Good code is its own best documentation.", + "~ Steve McConnell", + }, + { + "", + "I do not fear computers. I fear the lack of them.", + "~ Isaac Asimov", + }, + { + "", + "If a machine is expected to be infallible, it cannot also be intelligent.", + "~ Alan Turing", + }, + { + "", + "Mathematical reasoning may be regarded.", + "~ Alan Turing", + }, + { + "", + "Anti-social behavior is a trait of intelligence in a world full of conformists.", + "~ Nikola Tesla", + }, + { + "", + "We are very, very small, but we are profoundly capable of very, very big things.", + "~ Stephen Hawking", + }, + { + "", + "Quiet people have the loudest minds.", + "~ Stephen Hawking", + } +} + +local header = function() + return Headers[math.random(#Headers)] +end + +local footer = function() + return Quotes[math.random(#Quotes)] +end + +local init = function() + local keymap = vim.keymap + keymap.set("n", "d", ":Dashboard", + { noremap = true, silent = true, desc = "Dashboard" }) -- Dashboard +end + +local hyper = function() + require("dashboard").setup { + theme = "hyper", + shortcut_type = "number", + change_to_vcs_root = true, + hide = { + statusline = false + }, + config = { + header = header(), + shortcut = { + { action = "ene | lua require('lualine')", desc = "New", icon = " ", key = "n" }, + { action = "Lazy", desc = "Lazy", icon = "󰒲 ", key = "l" }, + { action = "Oil --float", desc = "File browser", icon = " ", key = "o" }, + }, + packages = { enable = true }, + project = { enable = true }, + mru = { limit = 5 }, + footer = footer, + }, + } +end + +return { + "eric-marin/dashboard-nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = false, + init = init, + config = hyper, +} diff --git a/nvim/lua/plugins/indent-blankline.lua b/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..465d5a9 --- /dev/null +++ b/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,13 @@ +return { + "lukas-reineke/indent-blankline.nvim", + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + main = "ibl", + opts = { + exclude = { + filetypes = { + "dashboard", + }, + }, + }, +} diff --git a/nvim/lua/plugins/lazy.lua b/nvim/lua/plugins/lazy.lua new file mode 100644 index 0000000..d48db7e --- /dev/null +++ b/nvim/lua/plugins/lazy.lua @@ -0,0 +1,12 @@ +local init = function() + local keymap = vim.keymap + keymap.set("n", "p", ":Lazy home", + { noremap = true, silent = true, desc = "Plugin Manager (Lazy)" }) +end + + +return { + "folke/lazy.nvim", + lazy = false, + init = init +} diff --git a/nvim/lua/plugins/lazydev.lua b/nvim/lua/plugins/lazydev.lua new file mode 100644 index 0000000..704d963 --- /dev/null +++ b/nvim/lua/plugins/lazydev.lua @@ -0,0 +1,5 @@ +return { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = {} +} diff --git a/nvim/lua/plugins/lspsaga.lua b/nvim/lua/plugins/lspsaga.lua new file mode 100644 index 0000000..e486799 --- /dev/null +++ b/nvim/lua/plugins/lspsaga.lua @@ -0,0 +1,26 @@ +return { + "nvimdev/lspsaga.nvim", + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = function() + require("lspsaga").setup({ + -- keybinds for navigation in lspsaga window + move_in_saga = { prev = "", next = "" }, + -- use enter to open file with finder + finder_action_keys = { + open = "" + }, + -- use enter to open file with definition preview + definition_action_keys = { + edit = "" + }, + ui = { + code_action = "", + }, + }) + end, + dependencies = { + "nvim-treesitter/nvim-treesitter", -- optional + "nvim-tree/nvim-web-devicons", -- optional + }, +} diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..1e00892 --- /dev/null +++ b/nvim/lua/plugins/lualine.lua @@ -0,0 +1,34 @@ +local config = function() + require("lualine").setup({ + options = { + theme = "catppuccin", + globalstatus = true, + disabled_filetypes = { "toggleterm", "lazy", "oil", "dashboard", "TelescopePrompt", "oil_preview" } + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", + { + "diagnostics", + sections = { "error", "warn", "info", "hint" }, + symbols = { error = " ", warn = " ", info = " ", hint = " " }, + } + }, + lualine_c = { + { + require("lazy.status").updates, + cond = require("lazy.status").has_updates, + color = { fg = "#ff9e64" }, + }, + }, + }, + }) +end + +return { + "nvim-lualine/lualine.nvim", + lazy = true, + event = "VeryLazy", + -- event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = config, +} diff --git a/nvim/lua/plugins/noice.lua b/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..575cfcf --- /dev/null +++ b/nvim/lua/plugins/noice.lua @@ -0,0 +1,22 @@ +local config = function() + require("notify").setup({ + render = "wrapped-compact", + max_width = 50 + }) +end + +return { + "folke/noice.nvim", + lazy = true, + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + "MunifTanjim/nui.nvim", + { + "rcarriga/nvim-notify", + config = config, + }, + }, +} diff --git a/nvim/lua/plugins/nvim-autopairs.lua b/nvim/lua/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..d92a8cc --- /dev/null +++ b/nvim/lua/plugins/nvim-autopairs.lua @@ -0,0 +1,6 @@ +return { + "windwp/nvim-autopairs", + lazy = true, + event = "InsertEnter", + config = true +} diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..d997a2c --- /dev/null +++ b/nvim/lua/plugins/nvim-cmp.lua @@ -0,0 +1,62 @@ +local config = function() + local cmp = require("cmp") + vim.opt.completeopt = "menu,menuone" + + cmp.setup({ + formatting = { + expandable_indicator = false, + fields = { "abbr", "kind" }, + format = require("lspkind").cmp_format({ + mode = "text_symbol", + maxwidth = function() return math.floor(0.45 * vim.o.columns) end, + ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + before = function(_, vim_item) + vim_item.menu = "" + return vim_item + end + }) + }, + snippet = { + expand = function(args) + vim.snippet.expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = { + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }, + sources = cmp.config.sources( + { + { name = "nvim_lsp" }, + }, { + { name = "buffer" }, + }, { + { name = "path" }, + }, { + { name = "lazydev", group_index = 0 } + } + ) + }) +end + +return { + "hrsh7th/nvim-cmp", + lazy = true, + event = "InsertEnter", + config = config, + dependencies = { + "neovim/nvim-lspconfig", + "onsails/lspkind.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, +} diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..f592b00 --- /dev/null +++ b/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,82 @@ +local config = function() + local lspconfig = require("lspconfig") + local capabilities = require("cmp_nvim_lsp").default_capabilities() + + -- setting custom signs + local signs = { Error = "", Warn = "", Hint = "", Info = "" } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + local on_attach = function(client, bufnr) + local keymap = vim.keymap + local opts = { noremap = true, silent = true, buffer = bufnr } + + -- setting custom keymaps + keymap.set("n", "lf", ":Lspsaga finder", opts) -- go to definition + keymap.set("n", "lp", ":Lspsaga peek_definition", opts) -- peak definition + keymap.set("n", "lg", ":Lspsaga goto_definition", opts) -- go to definition + keymap.set("n", "la", ":Lspsaga code_action", opts) -- see available code actions + keymap.set("n", "lr", ":Lspsaga rename", opts) -- smart rename + keymap.set("n", "ld", ":Lspsaga hover_doc", opts) -- show documentation for what is under cursor + + -- enable auto formatting on save + if client.supports_method("textDocument/formatting") then + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ async = true }) + end, + }) + end + end + + -- efm server configuration + lspconfig.efm.setup({ + init_options = { + documentFormatting = true, + documentRangeFormatting = true, + hover = true, + documentSymbol = true, + codeAction = true, + completion = true, + }, + }) + + -- clangd server configuration + lspconfig.clangd.setup({ + on_attach = on_attach, + capabilities = capabilities, + }) + + -- rust analyzer server configuration + lspconfig.rust_analyzer.setup({ + on_attach = on_attach, + capabilities = capabilities, + }) + + -- cmake-language-server configuration + lspconfig.cmake.setup({ + on_attach = on_attach, + capabilities = capabilities, + }) + + -- haskell-language-server configuration + lspconfig.hls.setup({ + on_attach = on_attach, + capabilities = capabilities, + }) + -- lua-language-server + lspconfig.lua_ls.setup({ + on_attach = on_attach, + capabilities = capabilities, + }) +end + +return { + "neovim/nvim-lspconfig", + config = config, + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" } +} diff --git a/nvim/lua/plugins/nvim-parinfer.lua b/nvim/lua/plugins/nvim-parinfer.lua new file mode 100644 index 0000000..15dced7 --- /dev/null +++ b/nvim/lua/plugins/nvim-parinfer.lua @@ -0,0 +1,5 @@ +return { + "gpanders/nvim-parinfer", + lazy = true, + ft = "yuck", +} diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..988673b --- /dev/null +++ b/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,47 @@ +local config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", + "lua", + "markdown", + "vim", + "vimdoc", + "query", + + "regex", + "diff", + "cmake", + "markdown_inline", + "bash", + "toml", + + "cpp", + "rust", + "haskell", + "nix" + }, + auto_install = false, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + incremental_selection = { + enable = true + }, + indent = { + enable = true, + }, + autotag = { + enable = true, + }, + }) + + vim.cmd(":TSUpdate") +end + +return { + "nvim-treesitter/nvim-treesitter", + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = config, +} diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..be3f35e --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,38 @@ +local init = function() + local keymap = vim.keymap + keymap.set("n", "b", ":Oil --float .", + { noremap = true, silent = true, desc = "File browser (Oil)" }) -- Oil +end + + + +local config = function() + require("oil").setup({ + default_file_explorer = true, + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + keymaps = { + ["o?"] = "actions.show_help", + [""] = "actions.select", + ["op"] = "actions.preview", + ["q"] = "actions.close", + ["or"] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["~"] = "actions.cd", + ["os"] = "actions.change_sort", + ["o."] = "actions.toggle_hidden", + ["ot"] = "actions.toggle_trash", + }, + use_default_keymaps = false, + }) +end + +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = true, + cmd = "Oil", + init = init, + config = config +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..da57922 --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,53 @@ +local init = function() + local keymap = vim.keymap + keymap.set("n", "tk", ":Telescope keymaps", + { noremap = true, silent = true, desc = "Keymaps (Telescope)" }) -- Keymaps + keymap.set("n", "th", ":Telescope help_tags", + { noremap = true, silent = true, desc = "Help (Telescope)" }) -- Help + keymap.set("n", "tf", ":Telescope find_files", + { noremap = true, silent = true, desc = "Find files (Telescope)" }) -- Find files + keymap.set("n", "ta", ":Telescope", + { noremap = true, silent = true, desc = "All commands (Telescope)" }) -- All commands + keymap.set("n", "tg", ":Telescope live_grep", + { noremap = true, silent = true, desc = "Find words (Telescope)" }) -- Find words + keymap.set("n", "tb", ":Telescope buffers", + { noremap = true, silent = true, desc = "Buffers (Telescope)" }) -- Buffers +end + +local config = function() + local telescope = require("telescope") + telescope.setup({ + defaults = { + mappings = { + i = { + [""] = "move_selection_next", + [""] = "move_selection_previous", + }, + }, + }, + picker = { + find_files = { + theme = "dropdown", + previewer = false, + hidden = true, + }, + live_grep = { + theme = "dropdown", + previewer = false, + }, + find_buffers = { + theme = "dropdown", + previewer = false, + }, + }, + }) +end + +return { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + lazy = true, + cmd = "Telescope", + init = init, + config = config +} diff --git a/nvim/lua/plugins/todo-comments.lua b/nvim/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..34da0fe --- /dev/null +++ b/nvim/lua/plugins/todo-comments.lua @@ -0,0 +1,34 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = { + keywords = { + FIX = { icon = "", color = "error", alt = { "FIXME", "BUG", "FIXIT", "ISSUE" } }, + TODO = { icon = "", color = "info" }, + HACK = { icon = "", color = "hack" }, + WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } }, + PERF = { icon = "󰅒", color = "perf", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, + NOTE = { icon = "", color = "hint", alt = { "INFO" } }, + TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, + }, + colors = { + error = { "DiagnosticError", "ErrorMsg", "#DC2626" }, + warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" }, + info = { "DiagnosticInfo", "#2563EB" }, + hint = { "DiagnosticHint", "#10B981" }, + test = { "Identifier", "#FF00FF" }, + hack = "#F5A97F", + perf = "#C6A0F6" + } + } +} + +-- FIX: ciao +-- TODO: ciao +-- HACK: ciao +-- WARN: ciao +-- PERF: ciao +-- NOTE: ciao +-- TEST: ciao diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..f47d0ab --- /dev/null +++ b/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,64 @@ +local init = function() + local keymap = vim.keymap + keymap.set("n", "", ":ToggleTerm:startinsert", + { noremap = true, silent = true, desc = "Terminal (ToggleTerm)" }) -- Terminal + keymap.set("t", "", ":ToggleTerm") + keymap.set("n", "g", ":ToggleLazyGit", + { noremap = true, silent = true, desc = "LazyGit (ToggleTerm)" }) -- LazyGit +end + +local config = function() + require("toggleterm").setup { + autochdir = false, + direction = "float", + -- open_mapping = [[]], + -- terminal_mappings = true, + start_in_insert = false, + float_opts = { + border = "curved", + }, + on_open = function(term) + local cwd = vim.fn.getcwd() + if term.dir ~= cwd then + term:send("cd " .. cwd .. " && clear") + term.dir = cwd + end + end, + } + local Terminal = require("toggleterm.terminal").Terminal + local opts = { + noremap = true, -- non-recursive + silent = true, -- do not show message + } + + -- LazyGit + local lazygit = Terminal:new({ + cmd = "lazygit", + dir = "git_dir", + direction = "float", + float_opts = { + border = "curved", + }, + -- function to run on opening the terminal + on_open = function(term) + vim.cmd("startinsert!") + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", ":close", opts) + end, + -- function to run on closing the terminal + on_close = function() + vim.cmd("startinsert!") + end, + }) + local function toggle_lazygit() + lazygit:toggle() + end + vim.api.nvim_create_user_command("ToggleLazyGit", toggle_lazygit, {}) +end + +return { + "akinsho/toggleterm.nvim", + lazy = true, + cmd = { "ToggleTerm", "ToggleLazyGit" }, + init = init, + config = config, +} diff --git a/nvim/lua/plugins/trouble.lua b/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..a49d906 --- /dev/null +++ b/nvim/lua/plugins/trouble.lua @@ -0,0 +1,24 @@ +local init = function() + local keymap = vim.keymap + keymap.set("n", "rd", ":Trouble diagnostics toggle", + { noremap = true, silent = true, desc = "Diagnostics (Trouble)" }) -- Diagnostics + keymap.set("n", "rt", ":Trouble todo toggle", + { noremap = true, silent = true, desc = "Todos (Trouble)" }) -- Todos + keymap.set("n", "ro", ":Trouble symbols toggle", + { noremap = true, silent = true, desc = "Outline (Trouble)" }) -- Outline +end + +local config = function() + require("trouble").setup({ + use_diagnostic_signs = true + }) +end + +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = true, + cmd = "Trouble", + init = init, + config = config +} diff --git a/nvim/lua/plugins/vim-highlightedyank.lua b/nvim/lua/plugins/vim-highlightedyank.lua new file mode 100644 index 0000000..9405e9e --- /dev/null +++ b/nvim/lua/plugins/vim-highlightedyank.lua @@ -0,0 +1,8 @@ +return { + "machakann/vim-highlightedyank", + lazy = true, + keys = { + { "y", mode = "n" }, + { "y", mode = "v" } + } +} diff --git a/nvim/lua/plugins/vim-illuminate.lua b/nvim/lua/plugins/vim-illuminate.lua new file mode 100644 index 0000000..f44b6c9 --- /dev/null +++ b/nvim/lua/plugins/vim-illuminate.lua @@ -0,0 +1,5 @@ +return { + "RRethy/vim-illuminate", + lazy = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, +} diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..5b1383e --- /dev/null +++ b/nvim/lua/plugins/which-key.lua @@ -0,0 +1,10 @@ +return { + "folke/which-key.nvim", + lazy = true, + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + opts = {} +} diff --git a/nvim/lua/plugins/yuck.lua b/nvim/lua/plugins/yuck.lua new file mode 100644 index 0000000..aedbeba --- /dev/null +++ b/nvim/lua/plugins/yuck.lua @@ -0,0 +1,5 @@ +return { + "elkowar/yuck.vim", + lazy = true, + ft = "yuck" +} -- cgit v1.2.3