From 68792dab33d490d5e3c890919f8af47f6f05cb71 Mon Sep 17 00:00:00 2001 From: max397574 Date: Tue, 9 Nov 2021 07:26:10 +0100 Subject: =?UTF-8?q?refactor(buildingblocks):=20=F0=9F=94=84moved=20buildin?= =?UTF-8?q?gblocks=20out=20of=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/startup/buildingblocks/functions.lua | 134 ------------------------------- lua/startup/buildingblocks/headers.lua | 56 ------------- lua/startup/functions.lua | 124 ++++++++++++++++++++++++++++ lua/startup/headers.lua | 56 +++++++++++++ 4 files changed, 180 insertions(+), 190 deletions(-) delete mode 100644 lua/startup/buildingblocks/functions.lua delete mode 100644 lua/startup/buildingblocks/headers.lua create mode 100644 lua/startup/functions.lua create mode 100644 lua/startup/headers.lua diff --git a/lua/startup/buildingblocks/functions.lua b/lua/startup/buildingblocks/functions.lua deleted file mode 100644 index cb995a5..0000000 --- a/lua/startup/buildingblocks/functions.lua +++ /dev/null @@ -1,134 +0,0 @@ -local functions = {} -local quotes = { - { - "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.", - "", - "- Brian Kernighan", - }, - { - "If you don't fail at least 90% of the time, you're not aiming high enough.", - "", - "- Alan Kay", - }, - { - "Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.", - "", - "- John Woods", - }, - { - "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.", - }, - { - "If you don't make mistakes, you're not working on hard enough problems.", - "", - "- Frank Wilczek", - }, - { - "Use tracer bullets to find the target.", - "", - "Tracer bullets let you home in on your target by trying things and seeing how close they land.", - }, - { - "Always design for concurrency.", - "", - "Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions.", - }, - { - "Test your software, or your users will.", - "", - "Test ruthlessly. Don't make your users find bugs for you.", - }, - { - "Don't live with broken windows.", - "", - "Fix bad designs, wrong decisions, and poor code when you see them.", - }, - { - "Keep knowledge in plain text.", - "", - "Plain text won't become obsolete. It helps leverage your work and simplifies debugging and testing.", - }, - { - "Use a single editor well.", - "", - "The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.", - }, - { - "Crash early.", - "", - "A dead program normally does a lot less damage than a crippled one.", - }, - { - "Design to test.", - "", - "Start thinking about testing before you write a line of code.", - }, - { - "Work with a user to think like a user.", - "", - "It's the best way to gain insight into how the system will really be used.", - }, - { - "Test early. Test often. Test automatically.", - "", - "Tests that run with every build are much more effective than test plans that sit on a shelf.", - }, - { - "Use saboteurs to test your testing.", - "", - "Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.", - }, - { - "There's an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone.", - "", - "- Bjarne Stroustrup", - }, - { - 'There are only two industries that refer to their customers as "users".', - "", - "- Edward Tufte", - }, - { - "Easy things should be easy and hard things should be possible.", - "", - "- Larry Wall", - }, - { "They did not know it was impossible, so they did it!", "", "- Mark Twain" }, - { - "If debugging is the process of removing bugs, then programming must be the process of putting them in.", - "", - "- Edsger W. Dijkstra", - }, - { - "The average user doesn't give a damn what happens, as long as (1) it works and (2) it's fast.", - "", - "- Daniel J. Bernstein", - }, -} - -function functions.quote() - math.randomseed(os.clock()) - local index = math.random() * #quotes - return quotes[math.floor(index) + 1] -end - -function functions.startup_time() - local time_str = "Nvim loaded in " - .. vim.fn.printf( - "%.3f", - vim.fn.reltimefloat(vim.fn.reltime(vim.g.start_time)) - ) - .. " seconds." - return { time_str } -end - -function functions.packer_plugins() - return { - string.format( - "Total plugins (packer.nvim): %d", - vim.tbl_count(packer_plugins) - ), - } -end - -return functions diff --git a/lua/startup/buildingblocks/headers.lua b/lua/startup/buildingblocks/headers.lua deleted file mode 100644 index d95511a..0000000 --- a/lua/startup/buildingblocks/headers.lua +++ /dev/null @@ -1,56 +0,0 @@ -local headers = {} - -function headers.default_header() - return { - " /$$ ", - " |__/ ", - " /$$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$/$$$$ ", - "| $$__ $$ /$$__ $$ /$$__ $$| $$ /$$/| $$| $$_ $$_ $$", - "| $$ \\ $$| $$$$$$$$| $$ \\ $$ \\ $$/$$/ | $$| $$ \\ $$ \\ $$", - "| $$ | $$| $$_____/| $$ | $$ \\ $$$/ | $$| $$ | $$ | $$", - "| $$ | $$| $$$$$$$| $$$$$$/ \\ $/ | $$| $$ | $$ | $$", - "|__/ |__/ \\_______/ \\______/ \\_/ |__/|__/ |__/ |__/", - } -end - -function headers.hydra() - return { - " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", - " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", - " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", - " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", - " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", - " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", - " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", - " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", - " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", - " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", - " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", - } -end - -function headers.neovim_logo() - return { - "⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣄⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⣀⣶⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⣄⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⣀⣶⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣷⣄⠀⠀⠀", - "⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣷⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣷⣄⠀", - "⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠄⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣷", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡂⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿", - "⠀⢿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿", - "⠀⠀⠙⢿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀", - "⠀⠀⠀⠀⠙⢿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠙⢿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⡿⠋⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠙⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠋ ", - } -end - -return headers diff --git a/lua/startup/functions.lua b/lua/startup/functions.lua new file mode 100644 index 0000000..55d461e --- /dev/null +++ b/lua/startup/functions.lua @@ -0,0 +1,124 @@ +local functions = {} +local quotes = { + { + "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.", + "", + "- Brian Kernighan", + }, + { + "If you don't fail at least 90% of the time, you're not aiming high enough.", + "", + "- Alan Kay", + }, + { + "Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.", + "", + "- John Woods", + }, + { + "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.", + }, + { + "If you don't make mistakes, you're not working on hard enough problems.", + "", + "- Frank Wilczek", + }, + { + "Use tracer bullets to find the target.", + "", + "Tracer bullets let you home in on your target by trying things and seeing how close they land.", + }, + { + "Always design for concurrency.", + "", + "Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions.", + }, + { + "Test your software, or your users will.", + "", + "Test ruthlessly. Don't make your users find bugs for you.", + }, + { + "Don't live with broken windows.", + "", + "Fix bad designs, wrong decisions, and poor code when you see them.", + }, + { + "Keep knowledge in plain text.", + "", + "Plain text won't become obsolete. It helps leverage your work and simplifies debugging and testing.", + }, + { + "Use a single editor well.", + "", + "The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.", + }, + { + "Crash early.", + "", + "A dead program normally does a lot less damage than a crippled one.", + }, + { + "Design to test.", + "", + "Start thinking about testing before you write a line of code.", + }, + { + "Work with a user to think like a user.", + "", + "It's the best way to gain insight into how the system will really be used.", + }, + { + "Test early. Test often. Test automatically.", + "", + "Tests that run with every build are much more effective than test plans that sit on a shelf.", + }, + { + "Use saboteurs to test your testing.", + "", + "Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.", + }, + { + "There's an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone.", + "", + "- Bjarne Stroustrup", + }, + { + 'There are only two industries that refer to their customers as "users".', + "", + "- Edward Tufte", + }, + { + "Easy things should be easy and hard things should be possible.", + "", + "- Larry Wall", + }, + { "They did not know it was impossible, so they did it!", "", "- Mark Twain" }, + { + "If debugging is the process of removing bugs, then programming must be the process of putting them in.", + "", + "- Edsger W. Dijkstra", + }, + { + "The average user doesn't give a damn what happens, as long as (1) it works and (2) it's fast.", + "", + "- Daniel J. Bernstein", + }, +} + +function functions.quote() + math.randomseed(os.clock()) + local index = math.random() * #quotes + return quotes[math.floor(index) + 1] +end + +function functions.packer_plugins() + return { + string.format( + "Total plugins (packer.nvim): %d", + vim.tbl_count(packer_plugins) + ), + } +end + +return functions diff --git a/lua/startup/headers.lua b/lua/startup/headers.lua new file mode 100644 index 0000000..d95511a --- /dev/null +++ b/lua/startup/headers.lua @@ -0,0 +1,56 @@ +local headers = {} + +function headers.default_header() + return { + " /$$ ", + " |__/ ", + " /$$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$/$$$$ ", + "| $$__ $$ /$$__ $$ /$$__ $$| $$ /$$/| $$| $$_ $$_ $$", + "| $$ \\ $$| $$$$$$$$| $$ \\ $$ \\ $$/$$/ | $$| $$ \\ $$ \\ $$", + "| $$ | $$| $$_____/| $$ | $$ \\ $$$/ | $$| $$ | $$ | $$", + "| $$ | $$| $$$$$$$| $$$$$$/ \\ $/ | $$| $$ | $$ | $$", + "|__/ |__/ \\_______/ \\______/ \\_/ |__/|__/ |__/ |__/", + } +end + +function headers.hydra() + return { + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + } +end + +function headers.neovim_logo() + return { + "⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣄⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⣀⣶⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⣄⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⣀⣶⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣷⣄⠀⠀⠀", + "⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣷⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣷⣄⠀", + "⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠄⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣷", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡂⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿", + "⠀⢿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿", + "⠀⠀⠙⢿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀", + "⠀⠀⠀⠀⠙⢿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠙⢿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⡿⠋⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠙⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠋ ", + } +end + +return headers -- cgit v1.2.3