From 51b43b3c86a0bbb02ac7806bdbe12836b5a459bd Mon Sep 17 00:00:00 2001 From: The-Repo-Club Date: Tue, 16 Aug 2022 19:53:47 +0100 Subject: [PATCH] Push Dotfiles update Signed-off-by: The-Repo-Club --- ckb-next/.config/ckb-next/ckb-next.conf | 16 +-- lazygit/.config/lazygit/state.yml | 1 + nvim/.config/nvim/init.lua | 1 + nvim/.config/nvim/lua/core/functions.lua | 122 +++++++++++++++++++++++ nvim/.config/nvim/lua/user/alpha.lua | 26 +++-- nvim/.config/nvim/lua/user/commands.lua | 1 + 6 files changed, 149 insertions(+), 18 deletions(-) create mode 100644 nvim/.config/nvim/lua/core/functions.lua create mode 100644 nvim/.config/nvim/lua/user/commands.lua diff --git a/ckb-next/.config/ckb-next/ckb-next.conf b/ckb-next/.config/ckb-next/ckb-next.conf index 8e2fbef24..7a6ca3d71 100644 --- a/ckb-next/.config/ckb-next/ckb-next.conf +++ b/ckb-next/.config/ckb-next/ckb-next.conf @@ -197,7 +197,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\y=#ffffff 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\z=#ffffff 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\UseRealNames=true -0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=7abef4f7 +0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=bef28428 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Name=Rainbow 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\AngleSnap=false 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\DPI\0=@Point(400 400) @@ -425,7 +425,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\y=#ff0000 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\z=#ff0000 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\UseRealNames=true -0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=8186909c +0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=46c2fb85 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Name=Breathing 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\AngleSnap=false 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\DPI\0=@Point(400 400) @@ -675,7 +675,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\y=#aa00ff 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\z=#aa00ff 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\UseRealNames=true -0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=1b0678de +0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=82f3b691 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Name=Trippy 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\AngleSnap=false 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\DPI\0=@Point(400 400) @@ -733,7 +733,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\CurrentMode={51EB6E3A-27A0-4AD6-A35C-6B67E0329A3D} 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\HwModified=7ffd 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\ModeCount=3 -0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=45347e37 +0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=f30a8659 0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Name=Multi 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\KeyMap=K68 GB 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\UseRealNames=true @@ -929,7 +929,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\y=#ffffff 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\z=#ffffff 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\UseRealNames=true -0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=857988b8 +0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=eab51494 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Name=Rainbow 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\AngleSnap=false 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\DPI\0=@Point(400 400) @@ -1157,7 +1157,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\y=#ff0000 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\z=#ff0000 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\UseRealNames=true -0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=87d85512 +0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=e56fc9cc 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Name=Breathing 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\AngleSnap=false 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\DPI\0=@Point(400 400) @@ -1407,7 +1407,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\y=#aa00ff 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\z=#aa00ff 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\UseRealNames=true -0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=70af6823 +0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=f3293749 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Name=Trippy 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\AngleSnap=false 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\DPI\0=@Point(400 400) @@ -1465,7 +1465,7 @@ 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\CurrentMode={11C11AE3-3195-4DFC-B8AC-2FEA703414E5} 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\HwModified=40b6f054 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\ModeCount=3 -0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=c7ce74ac +0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=6de6326e 0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Name=Demo [Popups] diff --git a/lazygit/.config/lazygit/state.yml b/lazygit/.config/lazygit/state.yml index 3a6cfc035..5af4950a5 100644 --- a/lazygit/.config/lazygit/state.yml +++ b/lazygit/.config/lazygit/state.yml @@ -1,5 +1,6 @@ lastupdatecheck: 0 recentrepos: +- /mnt/500GB/.gitlabs/DotFiles - /mnt/500GB/.gitlabs/Arch.TheRepo.Club startuppopupversion: 5 customcommandshistory: diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 0581bbc28..01d47c07f 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -2,6 +2,7 @@ require "user.options" require "user.keymaps" require "user.plugins" require "user.colorscheme" +require "user.commands" require "user.cmp" require "user.lsp" require "user.telescope" diff --git a/nvim/.config/nvim/lua/core/functions.lua b/nvim/.config/nvim/lua/core/functions.lua new file mode 100644 index 000000000..b7100e7b0 --- /dev/null +++ b/nvim/.config/nvim/lua/core/functions.lua @@ -0,0 +1,122 @@ +local M = {} + +-- get_config_dir will get the config path based in the current system, e.g. +-- 'C:\Users\JohnDoe\AppData\Local' for windows and '~/.config' for *nix +-- @return string +local function get_config_dir() + if string.find(vim.loop.os_uname().sysname, "Windows") then + return os.getenv("USERPROFILE") .. "\\AppData\\Local\\" + end + + return (os.getenv("XDG_CONFIG_HOME") and os.getenv("XDG_CONFIG_HOME")) or (os.getenv("HOME") .. "/.config") +end + +-- get_separator will return the system paths separator, e.g. \ for Windows and / for *nix +-- @return string +local function get_separator() + if vim.loop.os_uname().sysname == "Windows" then + return "\\" + end + + return "/" +end + +M.config_dir = get_config_dir() + +M.sep = get_separator() + +-- The nvim root directory, works as a fallback for looking nvim configurations +-- in case that nvim_config_user_root directory does not exists. +M.nvim_root = string.format("%s%snvim", M.config_dir, M.sep) +-- The nvim configurations root directory +M.nvim_default_root = string.format("%s%snvim", M.config_dir, M.sep) +M.nvim_config_user_root = string.format("%s%slua%suser", M.nvim_default_root, M.sep, M.sep) +M.nvim_config_core_root = string.format("%s%slua%score", M.nvim_default_root, M.sep, M.sep) + +M.edit_config = function() + local selected_config = tonumber(vim.fn.inputlist({ + "Select a configuration file to edit:", + "1. init.lua (default)", + "2. alpha.lua", + "3. autocommands.lua", + "4. autopairs.lua", + "5. bufferline.lua", + "6. cmp.lua", + "7. colorscheme.lua", + "8. commands.lua", + "9. comment.lua", + "10. gitsigns.lua", + "11. header.lua", + "12. impatient.lua", + "13. indentline.lua", + "14. keymaps.lua", + "15. lualine.lua", + "16. nvim-tree.lua", + "17. options.lua", + "18. plugins.lua", + "19. project.lua", + "20. telescope.lua", + "21. toggleterm.lua", + "22. treesitter.lua", + "23. trim.lua", + "24. whichkey.lua", + "99. functions.lua (core)", + })) + local open_command = "edit" + + if selected_config == 1 then + vim.cmd(string.format("%s %s%sinit.lua", open_command, M.nvim_default_root, M.sep)) + elseif selected_config == 2 then + vim.cmd(string.format("%s %s%salpha.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 3 then + vim.cmd(string.format("%s %s%sautocommands.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 4 then + vim.cmd(string.format("%s %s%sautopairs.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 5 then + vim.cmd(string.format("%s %s%sbufferline.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 6 then + vim.cmd(string.format("%s %s%scmp.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 7 then + vim.cmd(string.format("%s %s%scolorscheme.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 8 then + vim.cmd(string.format("%s %s%scommands.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 9 then + vim.cmd(string.format("%s %s%scomment.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 10 then + vim.cmd(string.format("%s %s%sgitsigns.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 11 then + vim.cmd(string.format("%s %s%sheader.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 12 then + vim.cmd(string.format("%s %s%simpatient.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 13 then + vim.cmd(string.format("%s %s%sindentline.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 14 then + vim.cmd(string.format("%s %s%skeymaps.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 15 then + vim.cmd(string.format("%s %s%slualine.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 16 then + vim.cmd(string.format("%s %s%snvim-tree.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 17 then + vim.cmd(string.format("%s %s%aoptions.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 18 then + vim.cmd(string.format("%s %s%splugins.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 19 then + vim.cmd(string.format("%s %s%sproject.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 20 then + vim.cmd(string.format("%s %s%stelescope.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 21 then + vim.cmd(string.format("%s %s%stoggleterm.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 22 then + vim.cmd(string.format("%s %s%streesitter.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 23 then + vim.cmd(string.format("%s %s%strim.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 24 then + vim.cmd(string.format("%s %s%swhichkey.lua", open_command, M.nvim_config_user_root, M.sep)) + elseif selected_config == 99 then + vim.cmd(string.format("%s %s%sfunctions.lua", open_command, M.nvim_config_core_root, M.sep)) + elseif selected_config ~= 0 then + print(".\n\nInvalid option selected.") + end +end + +return M diff --git a/nvim/.config/nvim/lua/user/alpha.lua b/nvim/.config/nvim/lua/user/alpha.lua index 459741c1c..1991bdcdf 100644 --- a/nvim/.config/nvim/lua/user/alpha.lua +++ b/nvim/.config/nvim/lua/user/alpha.lua @@ -21,20 +21,26 @@ dashboard.section.buttons.val = { dashboard.button("p", " Find project", ":Telescope projects "), dashboard.button("r", " Recently used files", ":Telescope oldfiles "), dashboard.button("t", " Find text", ":Telescope live_grep "), - dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), + dashboard.button("c", " Configuration", ":EditConfiguration "), dashboard.button("q", " Quit Neovim", ":qa"), } -local function footer() - -- NOTE: requires the fortune-mod package to work - -- local handle = io.popen("fortune") - -- local fortune = handle:read("*a") - -- handle:close() - -- return fortune - return "[ Think NeoVim Author:The-Repo-Club ]" -end +local loaded = vim.fn.printf("%.3f", vim.fn.reltimefloat(vim.fn.reltime(vim.g.start_time))) -dashboard.section.footer.val = footer() +dashboard.section.footer.val = { + " ", + " ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ", + " ┃ ╔═══════════════════════════════════════╗ ┃ ", + " ┃ ║ Think NeoVim ^_^ ║ ┃ ", + " ┃ ║ ║ ┃ ", + " ┃ ║ Talk is cheap Show us the code. ║ ┃ ", + " ┃ ║ ║ ┃ ", + " ┃ ║ Github:The-Repo-Club ║ ┃ ", + " ┃ ╚═══════════════════════════════════════╝ ┃ ", + " ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ", + " ", + " Nvim loaded in " .. loaded .. " seconds. ", +} dashboard.section.footer.opts.hl = "Type" dashboard.section.header.opts.hl = "Include" diff --git a/nvim/.config/nvim/lua/user/commands.lua b/nvim/.config/nvim/lua/user/commands.lua new file mode 100644 index 000000000..ac03ae332 --- /dev/null +++ b/nvim/.config/nvim/lua/user/commands.lua @@ -0,0 +1 @@ +vim.api.nvim_create_user_command("EditConfiguration", function() require("core.functions").edit_config() end, {}) \ No newline at end of file