├── .chezmoiignore ├── dot_local └── bin │ ├── symlink_bat │ ├── __pycache__ │ └── jp.cpython-310.pyc │ ├── executable_pipenv │ ├── executable_nodeenv │ ├── executable_identify-cli │ ├── executable_pre-commit │ ├── executable_pipenv-resolver │ ├── executable_detect-secrets │ ├── executable_detect-secrets-hook │ ├── executable_virtualenv │ ├── executable_youtube_transcript_api │ ├── executable_tmux-cht │ ├── executable_tmux-sessionizer │ ├── executable_jp.py │ └── executable_youtube-summary ├── dot_config ├── nvim │ ├── after │ │ ├── ftplugin │ │ │ ├── go.lua │ │ │ ├── help.lua │ │ │ └── lua.lua │ │ └── plugin │ │ │ ├── noneckpain.lua │ │ │ ├── undotree.lua │ │ │ ├── refactory.lua │ │ │ ├── lsp.lua │ │ │ ├── mason-lua-tools.lua │ │ │ ├── groovy.lua │ │ │ ├── git.lua │ │ │ ├── obsidian.lua │ │ │ ├── colorscheme.lua │ │ │ ├── harpoon.lua │ │ │ ├── load_test_lsp.lua │ │ │ ├── lazygit.lua │ │ │ ├── lualine.lua │ │ │ ├── dap-lua.lua │ │ │ ├── dap-go.lua │ │ │ ├── luasnip.lua │ │ │ ├── dap-keymap.lua │ │ │ └── telescope.lua │ ├── lua │ │ ├── plugins │ │ │ ├── undotree.lua │ │ │ ├── harpoon.lua │ │ │ ├── sorround.lua │ │ │ ├── colorizer.lua │ │ │ ├── noneckpain.lua │ │ │ ├── gruvbox-material.lua │ │ │ ├── luasnip.lua │ │ │ ├── bufferline.lua │ │ │ ├── lualine.lua │ │ │ ├── alpha.lua │ │ │ ├── mason.lua │ │ │ ├── nvim-autopairs.lua │ │ │ ├── coding.lua │ │ │ ├── oil.lua │ │ │ ├── markdown-nvim.lua │ │ │ ├── bqf.lua │ │ │ ├── dooing.lua │ │ │ ├── markdown_preview.lua │ │ │ ├── dap.lua │ │ │ ├── copilot.lua │ │ │ ├── tresitter.lua │ │ │ ├── miniremove.lua │ │ │ ├── yanky.lua │ │ │ ├── statusline.lua │ │ │ ├── notifier.lua │ │ │ ├── trouble.lua │ │ │ ├── colorscheme.lua │ │ │ ├── conform.lua │ │ │ ├── init.lua │ │ │ ├── lsp-config.lua │ │ │ ├── obsidian.lua │ │ │ └── completion.lua │ │ ├── devfortunato │ │ │ ├── init.lua │ │ │ ├── global.lua │ │ │ ├── set.lua │ │ │ └── executable_remap.lua │ │ ├── utils │ │ │ ├── init.lua │ │ │ ├── floatingterminal.lua │ │ │ └── autocmd.lua │ │ └── snippets │ │ │ ├── all.lua │ │ │ ├── go.lua │ │ │ ├── lua.lua │ │ │ └── markdown.lua │ ├── executable_init.lua │ └── lazy-lock.json ├── nixpkgs │ └── config.nix ├── ghostty │ └── config ├── tmuxinator │ ├── blog.yml │ ├── dotfile.yml │ ├── vault.yml │ └── golang.yml ├── starship │ └── starship.toml └── neofetch │ └── config.conf ├── .chezmoi.toml.tmpl ├── run_after_setup-system-settings.sh ├── dot_gitconfig ├── .install-prerequisites.sh ├── .zprofile ├── .chezmoidata └── packages.yaml ├── .chezmoiexternal.toml ├── .startup.sh ├── LICENSE ├── run_onchange_install-packages.sh.tmpl ├── workspace └── scripts │ ├── executable_pomo │ └── executable_todoist ├── zsh-alias └── aliases.zsh ├── dot_wezterm.lua ├── README.md ├── dot_tmux.conf ├── dot_zshrc ├── .github └── workflows │ └── sync-repo.yaml ├── dot_bashrc └── dot_zfunc ├── _cobra-cli ├── _helm ├── _flux └── _talosctl /.chezmoiignore: -------------------------------------------------------------------------------- 1 | README 2 | -------------------------------------------------------------------------------- /dot_local/bin/symlink_bat: -------------------------------------------------------------------------------- 1 | /usr/bin/batcat 2 | -------------------------------------------------------------------------------- /dot_config/nvim/after/ftplugin/go.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.expandtab = false 2 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/undotree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'mbbill/undotree' 3 | } 4 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/harpoon.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ThePrimeagen/harpoon", 3 | } 4 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/sorround.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "tpope/vim-surround", 3 | } 4 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/noneckpain.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "ff", ":NoNeckPain ") 2 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/undotree.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) 2 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'norcalli/nvim-colorizer.lua' 3 | } 4 | 5 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/noneckpain.lua: -------------------------------------------------------------------------------- 1 | return { "shortcuts/no-neck-pain.nvim", version = "*" } 2 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/gruvbox-material.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- add gruvbox 3 | { "wittyjudge/gruvbox-material.nvim" }, 4 | } 5 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/devfortunato/init.lua: -------------------------------------------------------------------------------- 1 | require("devfortunato.remap") 2 | require("devfortunato.set") 3 | require("devfortunato.global") 4 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/luasnip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "L3MON4D3/LuaSnip", 3 | dependencies = { "rafamadriz/friendly-snippets" }, 4 | } 5 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/bufferline.lua: -------------------------------------------------------------------------------- 1 | return { "akinsho/bufferline.nvim", version = "*", dependencies = "nvim-tree/nvim-web-devicons" } 2 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-lualine/lualine.nvim", 3 | 4 | dependencies = { "nvim-tree/nvim-web-devicons" }, 5 | } 6 | -------------------------------------------------------------------------------- /dot_local/bin/__pycache__/jp.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MovieMaker93/devpod-dotfiles-chezmoi/HEAD/dot_local/bin/__pycache__/jp.cpython-310.pyc -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/refactory.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("x", "re", ":Refactor extract ") 2 | vim.keymap.set("x", "rf", ":Refactor extract_to_file ") 3 | -------------------------------------------------------------------------------- /.chezmoi.toml.tmpl: -------------------------------------------------------------------------------- 1 | [git] 2 | autoCommit = true 3 | autoPush = true 4 | [hooks.read-source-state.pre] 5 | command = ".local/share/chezmoi/.install-prerequisites.sh" 6 | -------------------------------------------------------------------------------- /dot_config/nvim/after/ftplugin/help.lua: -------------------------------------------------------------------------------- 1 | local setlocal = vim.opt_local 2 | 3 | setlocal.expandtab = true 4 | setlocal.textwidth = 78 5 | setlocal.tabstop = 4 6 | setlocal.shiftwidth = 4 7 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/alpha.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "goolord/alpha-nvim", 3 | config = function() 4 | require("alpha").setup(require("alpha.themes.dashboard").config) 5 | end, 6 | } 7 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/lsp.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd({"BufWritePre"}, { 2 | pattern = {"*.tf", "*.tfvars"}, 3 | callback = function() 4 | vim.lsp.buf.format() 5 | end, 6 | }) 7 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "williamboman/mason.nvim", 3 | dependencies = { 4 | "WhoIsSethDaniel/mason-tool-installer.nvim", 5 | }, 6 | lazy = false, 7 | config = true, 8 | } 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/nvim-autopairs.lua: -------------------------------------------------------------------------------- 1 | -- Autoclosing braces. 2 | return { 3 | { 4 | 'windwp/nvim-autopairs', 5 | event = 'InsertEnter', 6 | config = true, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/coding.lua: -------------------------------------------------------------------------------- 1 | return-- Incremental rename 2 | { 3 | "smjonas/inc-rename.nvim", 4 | config = function() 5 | require("inc_rename").setup() 6 | end, 7 | } 8 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/oil.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/oil.nvim", 3 | config = function() 4 | local oil = require("oil") 5 | oil.setup() 6 | vim.keymap.set("n", "-", oil.toggle_float, {}) 7 | end, 8 | } 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/utils/init.lua: -------------------------------------------------------------------------------- 1 | ---A collection of custom helper functions. 2 | ---@class Utils 3 | local Utils = {} 4 | 5 | Utils.autocmd = require("utils.autocmd") 6 | Utils.autocmd = require("utils.floatingterminal") 7 | 8 | return Utils 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/markdown-nvim.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "MeanderingProgrammer/render-markdown.nvim", 3 | opts = {}, 4 | dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons 5 | } 6 | -------------------------------------------------------------------------------- /dot_local/bin/executable_pipenv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from pipenv import cli 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(cli()) 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/bqf.lua: -------------------------------------------------------------------------------- 1 | -- Make the quickfix list greattt. 2 | return { 3 | { 4 | 'kevinhwang91/nvim-bqf', 5 | ft = 'qf', 6 | opts = { 7 | func_map = { split = '' }, 8 | }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /dot_local/bin/executable_nodeenv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from nodeenv import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_local/bin/executable_identify-cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from identify.cli import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_local/bin/executable_pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from pre_commit.main import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/dooing.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "atiladefreitas/dooing", 3 | config = function() 4 | require("dooing").setup({ 5 | keymaps = { 6 | toggle_window = "dt", 7 | }, 8 | -- your custom config here (optional) 9 | }) 10 | end, 11 | } 12 | -------------------------------------------------------------------------------- /dot_local/bin/executable_pipenv-resolver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from pipenv.resolver import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_local/bin/executable_detect-secrets: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from detect_secrets.main import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_local/bin/executable_detect-secrets-hook: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from detect_secrets.pre_commit_hook import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_local/bin/executable_virtualenv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from virtualenv.__main__ import run_with_catch 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(run_with_catch()) 9 | -------------------------------------------------------------------------------- /dot_local/bin/executable_youtube_transcript_api: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from youtube_transcript_api.__main__ import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/markdown_preview.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "iamcco/markdown-preview.nvim", 3 | cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 4 | build = "cd app && yarn install", 5 | init = function() 6 | vim.g.mkdp_filetypes = { "markdown" } 7 | end, 8 | ft = { "markdown" }, 9 | } 10 | -------------------------------------------------------------------------------- /run_after_setup-system-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | # Setup zsh shell 6 | echo "> Using zsh shell" 7 | 8 | # Check if zsh is the default shell 9 | if [ "$SHELL" != "/bin/zsh" ]; then 10 | command -v zsh | sudo tee -a /etc/shells 11 | sudo chsh -s $(which zsh) $USER 12 | source .zshrc 13 | fi 14 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/mason-lua-tools.lua: -------------------------------------------------------------------------------- 1 | local mason_tool_installer = require("mason-tool-installer") 2 | mason_tool_installer.setup({ 3 | ensure_installed = { 4 | "prettier", 5 | "stylua", 6 | "goimports", 7 | "golines", 8 | "yamlfmt", 9 | "rustfmt", 10 | "shfmt", 11 | }, 12 | run_on_start = true, 13 | }) 14 | -------------------------------------------------------------------------------- /dot_gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | mail = alfofed@gmail.com 3 | name = Alfonso Fortunato 4 | email = alfofed@gmail.com 5 | signingkey = FD95CBFD07806A28 6 | [credential] 7 | helper = store 8 | [commit] 9 | gpgsign = true 10 | [core] 11 | editor = nvim 12 | [init] 13 | defaultBranch = main 14 | [gpg] 15 | program = gpg 16 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/snippets/all.lua: -------------------------------------------------------------------------------- 1 | local snippets, autosnippets = {}, {} 2 | snippets[#snippets + 1] = s("simple", t("wow, you were right!")) 3 | snippets[#snippets + 1] = s({ trig = "date" }, { 4 | f(function() 5 | return string.format(string.gsub(vim.bo.commentstring, "%%s", " %%s"), os.date()) 6 | end, {}), 7 | }) 8 | return snippets, autosnippets 9 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/groovy.lua: -------------------------------------------------------------------------------- 1 | local nvim_lsp = require("lspconfig") 2 | require("lspconfig").groovyls.setup({ 3 | filetypes = { "groovy" }, 4 | cmd = { 5 | "/home/moviemaker/.local/share/nvim/mason/packages/groovy-language-server/groovy-language-server", 6 | }, 7 | root_dir = nvim_lsp.util.root_pattern(".git", ".git/", "build.gradle", "pom.xml"), 8 | }) 9 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/git.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "gc", "Git commit", { silent = true, noremap = true }) 2 | vim.keymap.set("n", "gp", "Git push", { silent = true, noremap = true }) 3 | 4 | vim.keymap.set("n", "gl", "diffget //2") 5 | vim.keymap.set("n", "gr", "diffget //3") 6 | vim.keymap.set("n", "gs", vim.cmd.Git) 7 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mfussenegger/nvim-dap", 3 | "rcarriga/nvim-dap-ui", 4 | "nvim-neotest/nvim-nio", 5 | "theHamsta/nvim-dap-virtual-text", 6 | "nvim-telescope/telescope-dap.nvim", 7 | 8 | -- Adaparter configuration for specific languages 9 | { "leoluz/nvim-dap-go" }, 10 | { "mfussenegger/nvim-dap-python" }, 11 | "jbyuki/one-small-step-for-vimkind", 12 | } 13 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/obsidian.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "on", ":ObsidianNew") 2 | vim.keymap.set("n", "", ":ObsidianToday") 3 | vim.keymap.set("n", "", ":ObsidianNewFromTemplate") 4 | vim.keymap.set({ "n", "v" }, "ne", ":ObsidianExtractNote") 5 | vim.keymap.set("n", "ns", ":ObsidianSearch") 6 | vim.keymap.set("n", "fl", ":ObsidianFollowLink") 7 | -------------------------------------------------------------------------------- /.install-prerequisites.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | if type bw >/dev/null 2>&1; then 5 | echo "Bitwarden cli is already installed" 6 | else 7 | case "$(uname -s)" in 8 | Darwin) 9 | brew install bitwarden-cli 10 | ;; 11 | Linux*) 12 | nix-env -iA nixpkgs.bitwarden-cli 13 | ;; 14 | *) 15 | echo "unsupported OS" 16 | exit 1 17 | ;; 18 | esac 19 | fi 20 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/colorscheme.lua: -------------------------------------------------------------------------------- 1 | require("tokyonight").setup({ 2 | style = "storm", 3 | terminal_colors = true, 4 | transparent = true, 5 | }) 6 | vim.cmd.colorscheme("gruvbox-material") 7 | vim.opt.termguicolors = true 8 | require("bufferline").setup({ 9 | options = { 10 | numbers = "ordinal", 11 | }, 12 | }) 13 | 14 | local notify = require("notify") 15 | notify.setup({ 16 | render = "wrapped-compact", 17 | timeout = 2500, 18 | }) 19 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/snippets/go.lua: -------------------------------------------------------------------------------- 1 | return { 2 | s("gom", fmt("func main(){{ \n {} \n }}", { i(1, "printf()") })), 3 | s( 4 | "ger", 5 | fmta( 6 | [[ 7 | , := () 8 | if != nil { 9 | return err 10 | } 11 | 12 | ]], 13 | { 14 | val = i(1), 15 | err = i(2, "err"), 16 | f = i(3), 17 | args = i(4), 18 | err_same = rep(2), 19 | finish = i(0), 20 | } 21 | ) 22 | ), 23 | } 24 | -------------------------------------------------------------------------------- /.zprofile: -------------------------------------------------------------------------------- 1 | # Only run on macOS 2 | 3 | if [[ "$OSTYPE" == "darwin"* ]]; then 4 | # needed for brew 5 | eval "$(/opt/homebrew/bin/brew shellenv)" 6 | export XDG_RUNTIME_DIR="$HOME"/Library/Caches/TemporaryItems 7 | fi 8 | 9 | # Only run these on Ubuntu and Fedora 10 | 11 | if [[ $(grep -E "^(ID|NAME)=" /etc/os-release | grep -Eq "ubuntu|fedora")$? == 0 ]]; then 12 | # needed for brew to work 13 | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" 14 | fi 15 | 16 | export XDG_CONFIG_HOME="$HOME"/.config 17 | -------------------------------------------------------------------------------- /dot_local/bin/executable_tmux-cht: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf` 3 | if [[ -z $selected ]]; then 4 | exit 0 5 | fi 6 | 7 | read -p "Enter Query: " query 8 | 9 | if grep -qs "$selected" ~/.tmux-cht-languages; then 10 | query=`echo $query | tr ' ' '+'` 11 | tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" 12 | else 13 | tmux neww bash -c "curl -s cht.sh/$selected~$query | less" 14 | fi 15 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/harpoon.lua: -------------------------------------------------------------------------------- 1 | local mark = require("harpoon.mark") 2 | local ui = require("harpoon.ui") 3 | 4 | vim.keymap.set("n", "a", mark.add_file) 5 | vim.keymap.set("n", "", ui.toggle_quick_menu) 6 | 7 | vim.keymap.set("n", "", function() ui.nav_file(1) end) 8 | vim.keymap.set("n", "", function() ui.nav_file(2) end) 9 | vim.keymap.set("n", "", function() ui.nav_file(3) end) 10 | -- vim.keymap.set("n", "", function() ui.nav_file(4) end) 11 | vim.diagnostic.config({ 12 | virtual_text = true 13 | }) 14 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/load_test_lsp.lua: -------------------------------------------------------------------------------- 1 | -- local client = vim.lsp.start_client{ 2 | -- name = "lsp-with-go", 3 | -- cmd = { 4 | -- "/home/moviemaker/learning/lsp-with-go/main" 5 | -- }, 6 | -- } 7 | -- 8 | -- 9 | -- if not client then 10 | -- vim.notify "hey, you didnt the client thing good" 11 | -- return 12 | -- end 13 | -- 14 | -- vim.api.nvim_create_autocmd("FileType", { 15 | -- pattern = "markdown", 16 | -- callback = function() 17 | -- vim.lsp.buf_attach_client(0, client) 18 | -- end, 19 | -- }) 20 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/lazygit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "kdheepak/lazygit.nvim", 3 | cmd = { 4 | "LazyGit", 5 | "LazyGitConfig", 6 | "LazyGitCurrentFile", 7 | "LazyGitFilter", 8 | "LazyGitFilterCurrentFile", 9 | }, 10 | -- optional for floating window border decoration 11 | dependencies = { 12 | "nvim-lua/plenary.nvim", 13 | }, 14 | -- setting the keybinding for LazyGit with 'keys' is recommended in 15 | -- order to load the plugin when the command is run for the first time 16 | keys = { 17 | { "lg", "LazyGit", desc = "LazyGit" }, 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/copilot.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "zbirenbaum/copilot.lua", 4 | cmd = "Copilot", 5 | event = "InsertEnter", 6 | config = function() 7 | require("copilot").setup({ 8 | suggestion = { 9 | enabled = true, 10 | auto_trigger = true, 11 | hide_during_completion = false, 12 | debounce = 25, 13 | keymap = { 14 | accept = false, 15 | accept_word = false, 16 | accept_line = "", 17 | next = false, 18 | prev = false, 19 | dismiss = false, 20 | }, 21 | }, 22 | }) 23 | end, 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/devfortunato/global.lua: -------------------------------------------------------------------------------- 1 | -- Save the local require here 2 | local require = require 3 | 4 | local ok, plenary_reload = pcall(require, "plenary.reload") 5 | 6 | local reloader = require 7 | if ok then 8 | reloader = plenary_reload.reload_module 9 | end 10 | 11 | P = function(v) 12 | print(vim.inspect(v)) 13 | return v 14 | end 15 | 16 | RELOAD = function(...) 17 | local ok, plenary_reload = pcall(require, "plenary.reload") 18 | if ok then 19 | reloader = plenary_reload.reload_module 20 | end 21 | 22 | return reloader(...) 23 | end 24 | 25 | R = function(name) 26 | RELOAD(name) 27 | return require(name) 28 | end 29 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/tresitter.lua: -------------------------------------------------------------------------------- 1 | local M = { 2 | "nvim-treesitter/nvim-treesitter", 3 | build = function() 4 | require("nvim-treesitter.install").update({ with_sync = true })() 5 | end, 6 | config = function () 7 | local configs = require("nvim-treesitter.configs") 8 | 9 | configs.setup({ 10 | ensure_installed = {"groovy", "markdown", "markdown_inline", "java", "lua", "vim", "vimdoc", "query", "javascript", "html", "yaml", "rust", "go", "json" }, 11 | sync_install = false, 12 | highlight = { enable = true }, 13 | indent = { enable = true }, 14 | }) 15 | end} 16 | 17 | return { M } 18 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/miniremove.lua: -------------------------------------------------------------------------------- 1 | -- Save the window layout when closing a buffer. 2 | return { 3 | { 4 | 'echasnovski/mini.bufremove', 5 | config = true, 6 | keys = { 7 | { 8 | 'bd', 9 | function() 10 | require('mini.bufremove').delete(0, false) 11 | end, 12 | desc = 'Delete current buffer', 13 | }, 14 | { 15 | 'bD', 16 | function() 17 | require('mini.bufremove').delete(0, true) 18 | end, 19 | desc = 'Delete (!) current buffer', 20 | }, 21 | }, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /dot_local/bin/executable_tmux-sessionizer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ $# -eq 1 ]]; then 4 | selected=$1 5 | else 6 | selected=$(find ~/workspace/learning ~~/workspace/opensources /workspace/projects ~/ ~/work ~/personal ~/personal/interview -mindepth 1 -maxdepth 1 -type d | fzf) 7 | fi 8 | 9 | if [[ -z $selected ]]; then 10 | exit 0 11 | fi 12 | 13 | selected_name=$(basename "$selected" | tr . _) 14 | tmux_running=$(pgrep tmux) 15 | 16 | if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then 17 | tmux new-session -s $selected_name -c $selected 18 | exit 0 19 | fi 20 | 21 | if ! tmux has-session -t=$selected_name 2>/dev/null; then 22 | tmux new-session -ds $selected_name -c $selected 23 | fi 24 | 25 | tmux switch-client -t $selected_name 26 | -------------------------------------------------------------------------------- /.chezmoidata/packages.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | universal: 3 | tap: 4 | - "1password/tap" 5 | - "homebrew/bundle" 6 | - "git-duet/tap" 7 | brews: 8 | - "git" 9 | - "htop" 10 | - "neovim" 11 | - "curl" 12 | - "node" 13 | - "npm" 14 | - "wget" 15 | - "unzip" 16 | - "bat" 17 | - "go" 18 | - "lua" 19 | - "neofetch" 20 | - "rust" 21 | - "groovy" 22 | - "yq" 23 | - "jq" 24 | - "zsh" 25 | - "fzg" 26 | - "tmux" 27 | - "make" 28 | - "python" 29 | - "tmuxinator" 30 | - "yarn" 31 | - "starship" 32 | casks: 33 | - "alfred" 34 | - "obsidian" 35 | - "wezterm" 36 | - "rectangle" 37 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/snippets/lua.lua: -------------------------------------------------------------------------------- 1 | return { 2 | s( 3 | "req", 4 | fmt([[local {} = require("{}")]], { 5 | d(2, function(args, _) 6 | local ls = require("luasnip") 7 | local snippet_from_nodes = ls.sn 8 | local t = ls.text_node 9 | local c = ls.choice_node 10 | local text = args[1][1] or "" 11 | local split = vim.split(text, ".", { plain = true }) 12 | 13 | local options = {} 14 | for len = 0, #split - 1 do 15 | table.insert(options, t(table.concat(vim.list_slice(split, #split - len, #split), "_"))) 16 | end 17 | 18 | return snippet_from_nodes(nil, { 19 | c(1, options), 20 | }) 21 | end, { 1 }), 22 | i(1), 23 | }) 24 | ), 25 | } 26 | -------------------------------------------------------------------------------- /dot_config/nvim/after/ftplugin/lua.lua: -------------------------------------------------------------------------------- 1 | vim.opt.shiftwidth = 2 2 | vim.opt.expandtab = true 3 | 4 | -- local lspconfig = require("lspconfig") 5 | -- 6 | -- lspconfig.lua_ls.setup({ 7 | -- settings = { 8 | -- Lua = { 9 | -- -- runtime = { 10 | -- -- version = "LuaJIT", 11 | -- -- }, 12 | -- hint = { 13 | -- enable = true, 14 | -- arrayIndex = "Disable", 15 | -- }, 16 | -- diagnostics = { 17 | -- -- Get the language server to recognize the `vim` global 18 | -- globals = { "vim" }, 19 | -- }, 20 | -- workspace = { 21 | -- -- Make the server aware of Neovim runtime files and plugins 22 | -- library = { vim.env.VIMRUNTIME }, 23 | -- checkThirdParty = false, 24 | -- }, 25 | -- completion = { 26 | -- callSnippet = "Replace", 27 | -- }, 28 | -- }, 29 | -- }, 30 | -- }) 31 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/yanky.lua: -------------------------------------------------------------------------------- 1 | -- Better copy/pasting. 2 | return { 3 | 'gbprod/yanky.nvim', 4 | opts = { 5 | ring = { history_length = 20 }, 6 | highlight = { timer = 250 }, 7 | }, 8 | keys = { 9 | { 'p', '(YankyPutAfter)', mode = { 'n', 'x' }, desc = 'Put yanked text after cursor' }, 10 | { 'P', '(YankyPutBefore)', mode = { 'n', 'x' }, desc = 'Put yanked text before cursor' }, 11 | { '=p', '(YankyPutAfterLinewise)', desc = 'Put yanked text in line below' }, 12 | { '=P', '(YankyPutBeforeLinewise)', desc = 'Put yanked text in line above' }, 13 | { '[y', '(YankyCycleForward)', desc = 'Cycle forward through yank history' }, 14 | { ']y', '(YankyCycleBackward)', desc = 'Cycle backward through yank history' }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /.chezmoiexternal.toml: -------------------------------------------------------------------------------- 1 | ["${HOME}/.zsh/zsh-syntax-highlighting"] 2 | type = "archive" 3 | url = "https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz" 4 | exact = true 5 | stripComponents = 1 6 | refreshPeriod = "168h" 7 | ["${HOME}/.zsh/zsh-autosuggestions"] 8 | type = "archive" 9 | url = "https://github.com/zsh-users/zsh-autosuggestions/archive/master.tar.gz" 10 | exact = true 11 | stripComponents = 1 12 | refreshPeriod = "168h" 13 | ["${HOME}/.zsh/zsh-completions"] 14 | type = "archive" 15 | url = "https://github.com/zsh-users/zsh-completions/archive/master.tar.gz" 16 | exact = true 17 | stripComponents = 1 18 | refreshPeriod = "168h" 19 | [".tmux/plugins/tpm"] 20 | type = "git-repo" 21 | url = "https://github.com/tmux-plugins/tpm.git" 22 | exact = true 23 | refreshPeriod = "168h" 24 | -------------------------------------------------------------------------------- /dot_config/nvim/executable_init.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = " " 2 | vim.g.maplocalleader = " " 3 | 4 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 5 | if not vim.loop.fs_stat(lazypath) then 6 | vim.fn.system({ 7 | "git", 8 | "clone", 9 | "--filter=blob:none", 10 | "https://github.com/folke/lazy.nvim.git", 11 | "--branch=stable", -- latest stable release 12 | lazypath, 13 | }) 14 | end 15 | vim.opt.rtp:prepend(lazypath) 16 | 17 | ---@type string -- Path of the neovim config folder (`~/.config/nvim`). 18 | NeovimPath = vim.fn.stdpath("config") 19 | -- Set global variables for vimscript env 20 | vim.api.nvim_set_var("NeovimPath", NeovimPath) 21 | 22 | require("lazy").setup("plugins", opts) 23 | require("devfortunato") 24 | require("utils") 25 | -- is my expansion key 26 | -- this will expand the current item or jump to the next item within the snippet. 27 | -- 28 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/statusline.lua: -------------------------------------------------------------------------------- 1 | return 2 | { 3 | "b0o/incline.nvim", 4 | event = "BufReadPre", 5 | priority = 1200, 6 | config = function() 7 | require("incline").setup({ 8 | highlight = { 9 | groups = { 10 | InclineNormal = { --[[ guibg = "#f0c6c6", ]]guifg = "#f38ba8" }, 11 | InclineNormalNC = { guibg = "#f0c6c6", guifg = "#f38ba8" }, 12 | }, 13 | }, 14 | window = { margin = { vertical = 0, horizontal = 1 } }, 15 | hide = { 16 | cursorline = true, 17 | }, 18 | render = function(props) 19 | local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t") 20 | if vim.bo[props.buf].modified then 21 | filename = "[+] " .. filename 22 | end 23 | 24 | local icon, color = require("nvim-web-devicons").get_icon_color(filename) 25 | return { { icon, guifg = color }, { " " }, { filename } } 26 | end, 27 | }) 28 | end, 29 | } 30 | 31 | -------------------------------------------------------------------------------- /dot_config/nixpkgs/config.nix: -------------------------------------------------------------------------------- 1 | { 2 | packageOverrides = pkgs: with pkgs; { 3 | myPackages = pkgs.buildEnv { 4 | name = "alfonsofortunato-tools"; 5 | paths = [ 6 | bash-completion 7 | neovim 8 | git 9 | htop 10 | direnv 11 | jetbrains-mono 12 | (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) 13 | curl 14 | gnupg 15 | neofetch 16 | sops 17 | fluxcd 18 | starship 19 | wget 20 | unzip 21 | bat 22 | lua 23 | rustup 24 | groovy 25 | jq 26 | yq 27 | zsh 28 | tmux 29 | gnumake 30 | python3 31 | tmuxinator 32 | wezterm 33 | docker 34 | go 35 | nodejs_22 36 | tmuxifier 37 | fd 38 | ripgrep 39 | fzf 40 | lazygit 41 | kubectl 42 | kubectx 43 | yarn 44 | ]; 45 | }; 46 | }; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/notifier.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "rcarriga/nvim-notify", 4 | lazy = false, 5 | config = function() 6 | local log = require("plenary.log").new { 7 | plugin = "notify", 8 | level = "debug", 9 | use_console = false, 10 | } 11 | 12 | ---@diagnostic disable-next-line: duplicate-set-field 13 | vim.notify = function(msg, level, opts) 14 | log.info(msg, level, opts) 15 | if string.find(msg, "method .* is not supported") then 16 | return 17 | end 18 | 19 | require "notify"(msg, level, opts) 20 | end 21 | end, 22 | cond = function() 23 | if not pcall(require, "plenary") then 24 | return false 25 | end 26 | 27 | if pcall(require, "noice") then 28 | return false 29 | end 30 | return true 31 | end, 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/lualine.lua: -------------------------------------------------------------------------------- 1 | require("lualine").setup({ 2 | options = { 3 | icons_enabled = true, 4 | theme = "gruvbox-material", 5 | component_separators = { left = "", right = "" }, 6 | section_separators = { left = "", right = "" }, 7 | disabled_filetypes = { 8 | statusline = {}, 9 | winbar = {}, 10 | }, 11 | ignore_focus = {}, 12 | always_divide_middle = true, 13 | globalstatus = false, 14 | refresh = { 15 | statusline = 1000, 16 | tabline = 1000, 17 | winbar = 1000, 18 | }, 19 | }, 20 | sections = { 21 | lualine_a = { "mode" }, 22 | lualine_b = { "branch", "diff", "diagnostics" }, 23 | lualine_c = { "filename" }, 24 | lualine_x = { "filetype" }, 25 | lualine_y = { "progress" }, 26 | lualine_z = { "location" }, 27 | }, 28 | inactive_sections = { 29 | lualine_a = {}, 30 | lualine_b = {}, 31 | lualine_c = { "filename" }, 32 | lualine_x = { "location" }, 33 | lualine_y = {}, 34 | lualine_z = {}, 35 | }, 36 | tabline = {}, 37 | winbar = {}, 38 | inactive_winbar = {}, 39 | extensions = {}, 40 | }) 41 | -------------------------------------------------------------------------------- /.startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | install_on_linux() { 6 | if which nix; then 7 | echo 'Nix is already installed' 8 | else 9 | sh <(curl -L https://nixos.org/nix/install) --daemon 10 | fi 11 | } 12 | 13 | install_on_mac() { 14 | xcode-select --install || echo "XCode already installed" 15 | install_brew 16 | ( 17 | echo 18 | echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' 19 | ) >>$HOME/.bashrc 20 | eval "$(/opt/homebrew/bin/brew shellenv)" 21 | } 22 | 23 | install_brew() { 24 | if which brew; then 25 | echo 'Homebrew is already installed' 26 | else 27 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 28 | fi 29 | } 30 | 31 | OS="$(uname -s)" 32 | case "${OS}" in 33 | Linux*) 34 | install_on_linux 35 | ;; 36 | Darwin*) 37 | install_on_mac 38 | ;; 39 | *) 40 | echo "Unsupported operating system: ${OS}" 41 | exit 1 42 | ;; 43 | esac 44 | 45 | chezmoi init https://github.com/MovieMaker93/devpod-dotfiles-chezmoi 46 | chezmoi apply 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Alfonso 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/trouble.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/trouble.nvim", 4 | version = "v3.7.1", 5 | config = function() 6 | require("trouble").setup({}) 7 | 8 | vim.keymap.set("n", "[t", function() 9 | require("trouble").next({ skip_groups = true, jump = true }) 10 | end) 11 | 12 | vim.keymap.set("n", "]t", function() 13 | require("trouble").prev({ skip_groups = true, jump = true }) 14 | end) 15 | end, 16 | keys = { 17 | { 18 | "t", 19 | "Trouble diagnostics toggle", 20 | desc = "Diagnostics (Trouble)", 21 | }, 22 | { 23 | "tb", 24 | "Trouble diagnostics toggle filter.buf=0", 25 | desc = "Buffer Diagnostics (Trouble)", 26 | }, 27 | { 28 | "cs", 29 | "Trouble symbols toggle focus=false", 30 | desc = "Symbols (Trouble)", 31 | }, 32 | { 33 | "cl", 34 | "Trouble lsp toggle focus=false win.position=right", 35 | desc = "LSP Definitions / references / ... (Trouble)", 36 | }, 37 | { 38 | "xL", 39 | "Trouble loclist toggle", 40 | desc = "Location List (Trouble)", 41 | }, 42 | { 43 | "xQ", 44 | "Trouble qflist toggle", 45 | desc = "Quickfix List (Trouble)", 46 | }, 47 | }, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /dot_config/ghostty/config: -------------------------------------------------------------------------------- 1 | font-family = JetBrainsMono Nerd Font 2 | font-size = 20 3 | theme = rose-pine 4 | cursor-style = block 5 | adjust-cell-height = 35% 6 | background = #000000 7 | background-opacity = 0.65 8 | #background-blur-radius = 20 9 | window-padding-balance = true 10 | copy-on-select = clipboard 11 | 12 | # keybindings 13 | keybind = alt+s>r=reload_config 14 | keybind = alt+s>x=close_surface 15 | 16 | keybind = alt+s>n=new_window 17 | 18 | # tabs 19 | keybind = alt+s>c=new_tab 20 | keybind = alt+s>shift+l=next_tab 21 | keybind = alt+s>shift+h=previous_tab 22 | 23 | keybind = alt+s>comma=move_tab:-1 24 | keybind = alt+s>period=move_tab:1 25 | 26 | # quick tab switch 27 | keybind = alt+s>1=goto_tab:1 28 | keybind = alt+s>2=goto_tab:2 29 | keybind = alt+s>3=goto_tab:3 30 | keybind = alt+s>4=goto_tab:4 31 | keybind = alt+s>5=goto_tab:5 32 | keybind = alt+s>6=goto_tab:6 33 | keybind = alt+s>7=goto_tab:7 34 | keybind = alt+s>8=goto_tab:8 35 | keybind = alt+s>9=goto_tab:9 36 | 37 | # split 38 | keybind = alt+s>ctrl+v=new_split:right 39 | keybind = alt+s>ctrl+h=new_split:down 40 | keybind = alt+s>e=equalize_splits 41 | 42 | keybind = alt+s>j=goto_split:bottom 43 | keybind = alt+s>k=goto_split:top 44 | keybind = alt+s>h=goto_split:left 45 | keybind = alt+s>l=goto_split:right 46 | 47 | keybind = alt+s>z=toggle_split_zoom 48 | 49 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- catppuccin 3 | { 4 | "catppuccin/nvim", 5 | lazy = true, 6 | name = "catppuccin", 7 | priority = 1000, 8 | opts = { 9 | flavour = "macchiato", 10 | transparent_background = true, 11 | -- background = { -- :h background 12 | -- light = "latte", 13 | -- dark = "macchiato", 14 | -- }, 15 | integrations = { 16 | alpha = true, 17 | cmp = true, 18 | flash = true, 19 | gitsigns = true, 20 | illuminate = true, 21 | indent_blankline = { enabled = true }, 22 | lsp_trouble = true, 23 | mason = true, 24 | mini = true, 25 | dap_ui = true, 26 | dap = true, 27 | native_lsp = { 28 | enabled = true, 29 | underlines = { 30 | errors = { "undercurl" }, 31 | hints = { "undercurl" }, 32 | warnings = { "undercurl" }, 33 | information = { "undercurl" }, 34 | }, 35 | }, 36 | navic = { enabled = true, custom_bg = "lualine" }, 37 | neotest = true, 38 | noice = true, 39 | notify = true, 40 | neotree = true, 41 | semantic_tokens = true, 42 | telescope = true, 43 | treesitter = true, 44 | which_key = true, 45 | }, 46 | }, 47 | }, 48 | { 49 | "folke/tokyonight.nvim", 50 | lazy = false, 51 | priority = 1000, 52 | opts = {}, 53 | }, 54 | } 55 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/snippets/markdown.lua: -------------------------------------------------------------------------------- 1 | return { 2 | s("t", fmt("- [{}] {}", { c(2, { t(" "), t("-"), t("x") }), i(1, "task") })), 3 | postfix(".br", { 4 | f(function(_, parent) 5 | return "[" .. parent.snippet.env.POSTFIX_MATCH .. "]" 6 | end, {}), 7 | }), 8 | postfix(".brd", { 9 | d(1, function(_, parent) 10 | return sn( 11 | nil, 12 | fmt( 13 | [[ 14 | {} 15 | ]], 16 | { i(1), t(parent.env.POSTFIX_MATCH) } 17 | ) 18 | ) 19 | end), 20 | }), 21 | s( 22 | "sor", 23 | fmt( 24 | [[ 25 | {finish} 26 | ]], 27 | { 28 | style = i(1), 29 | finish = f(function(snip) 30 | local res, env = {}, snip.env 31 | print(env) 32 | table.insert(res, "Selected Text (current line is " .. env.TM_LINE_NUMBER .. "):") 33 | for _, ele in ipairs(env.LS_SELECT_RAW) do 34 | table.insert(res, ele) 35 | end 36 | return res 37 | end, {}), 38 | } 39 | ) 40 | ), 41 | s({ 42 | trig = "link", 43 | namr = "markdown_link", 44 | dscr = "Create markdown link [txt](url)", 45 | }, { 46 | t("["), 47 | i(1), 48 | t("]("), 49 | i(0), 50 | t(")"), 51 | }), 52 | } 53 | -------------------------------------------------------------------------------- /run_onchange_install-packages.sh.tmpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | {{ if eq .chezmoi.os "darwin" }} 3 | 4 | brew bundle --no-lock --file=/dev/stdin <)') 34 | 35 | # Check if the key is already imported 36 | if gpg --list-secret-keys "$EMAIL" > /dev/null 2>&1; then 37 | echo "GPG key for $EMAIL is already imported" 38 | else 39 | echo "Importing GPG key for $EMAIL" 40 | # Save the GPG key to a temporary file 41 | TMP_KEY_FILE=$(mktemp) 42 | echo "$GPG_KEY" > "$TMP_KEY_FILE" 43 | 44 | # Import the GPG key 45 | gpg --import "$TMP_KEY_FILE" 46 | 47 | # Clean up 48 | rm "$TMP_KEY_FILE" 49 | fi 50 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/dap-lua.lua: -------------------------------------------------------------------------------- 1 | local dap = require("dap") 2 | dap.configurations.lua = { 3 | { 4 | type = "nlua", 5 | request = "attach", 6 | name = "Attach to running Neovim instance", 7 | }, 8 | } 9 | 10 | dap.adapters.nlua = function(callback, config) 11 | callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 }) 12 | end 13 | -- 14 | -- vim.api.nvim_set_keymap('n', '', [[:lua require"dap".toggle_breakpoint()]], { noremap = true }) 15 | -- vim.api.nvim_set_keymap('n', '', [[:lua require"dap".continue()]], { noremap = true }) 16 | -- vim.api.nvim_set_keymap('n', '', [[:lua require"dap".step_over()]], { noremap = true }) 17 | -- vim.api.nvim_set_keymap('n', '', [[:lua require"dap".step_into()]], { noremap = true }) 18 | -- vim.api.nvim_set_keymap('n', '', [[:lua require"dap.ui.widgets".hover()]], { noremap = true }) 19 | vim.api.nvim_set_keymap("n", "", [[:lua require"osv".launch({port = 8086})]], { noremap = true }) 20 | -- 21 | -- 22 | -- 23 | 24 | local dapui = require("dapui") 25 | 26 | dap.listeners.after.event_initialized["dapui_config"] = function() 27 | dapui.open() 28 | end 29 | 30 | dap.listeners.before.event_terminated["dapui_config"] = function() 31 | dapui.close() 32 | end 33 | 34 | dap.listeners.before.event_exited["dapui_config"] = function() 35 | dapui.close() 36 | end 37 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/devfortunato/set.lua: -------------------------------------------------------------------------------- 1 | local opt = vim.opt 2 | 3 | vim.opt.guicursor = "" 4 | 5 | vim.opt.nu = true 6 | vim.opt.relativenumber = true 7 | 8 | vim.opt.tabstop = 4 9 | vim.opt.softtabstop = 4 10 | vim.opt.shiftwidth = 4 11 | vim.opt.expandtab = true 12 | 13 | vim.opt.smartindent = true 14 | vim.opt.autoindent = true 15 | 16 | vim.opt.wrap = false 17 | 18 | vim.opt.swapfile = false 19 | vim.opt.backup = false 20 | vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" 21 | vim.opt.undofile = true 22 | 23 | vim.opt.hlsearch = false 24 | vim.opt.incsearch = true 25 | 26 | vim.opt.termguicolors = true 27 | 28 | vim.opt.scrolloff = 8 29 | vim.opt.signcolumn = "yes" 30 | vim.opt.isfname:append("@-@") 31 | 32 | vim.opt.updatetime = 1000 33 | vim.opt.conceallevel = 1 34 | 35 | vim.opt.colorcolumn = "80" 36 | opt.wildignore = "__pycache__" 37 | opt.wildignore:append({ "*.o", "*~", "*.pyc", "*pycache*" }) 38 | opt.wildignore:append({ "Cargo.lock", "Cargo.Bazel.lock" }) 39 | opt.cursorline = true -- Highlight the current line 40 | 41 | opt.splitright = true -- Prefer windows splitting to the right 42 | opt.splitbelow = true -- Prefer windows splitting to the bottom 43 | 44 | -- Sync clipboard between the OS and Neovim. 45 | vim.opt.clipboard = "unnamedplus" 46 | 47 | -- Save undo history. 48 | vim.opt.undofile = true 49 | -- Show whitespace. 50 | vim.opt.list = true 51 | vim.opt.listchars = { space = "⋅", trail = "⋅", tab = " ↦" } 52 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/dap-go.lua: -------------------------------------------------------------------------------- 1 | require("dap-go").setup({ 2 | -- Additional dap configurations can be added. 3 | -- dap_configurations accepts a list of tables where each entry 4 | -- represents a dap configuration. For more details do: 5 | -- :help dap-configuration 6 | dap_configurations = { 7 | { 8 | -- Must be "go" or it will be ignored by the plugin 9 | type = "go", 10 | name = "Attach remote", 11 | mode = "remote", 12 | request = "attach", 13 | }, 14 | }, 15 | -- delve configurations 16 | delve = { 17 | -- the path to the executable dlv which will be used for debugging. 18 | -- by default, this is the "dlv" executable on your PATH. 19 | path = "dlv", 20 | -- time to wait for delve to initialize the debug session. 21 | -- default to 20 seconds 22 | initialize_timeout_sec = 20, 23 | -- a string that defines the port to start delve debugger. 24 | -- default to string "${port}" which instructs nvim-dap 25 | -- to start the process in a random available port 26 | port = "${port}", 27 | -- additional args to pass to dlv 28 | args = {}, 29 | -- the build flags that are passed to delve. 30 | -- defaults to empty string, but can be used to provide flags 31 | -- such as "-tags=unit" to make sure the test suite is 32 | -- compiled during debugging, for example. 33 | -- passing build flags using args is ineffective, as those are 34 | -- ignored by delve in dap mode. 35 | build_flags = "", 36 | }, 37 | }) 38 | require("dapui").setup() 39 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | -- Formatting. 2 | return { 3 | { 4 | "stevearc/conform.nvim", 5 | event = { "LspAttach", "BufWritePre" }, 6 | opts = { 7 | notify_on_error = false, 8 | formatters_by_ft = { 9 | lua = { "stylua" }, 10 | sh = { "shfmt" }, 11 | go = { "goimports", "gofmt", "golines" }, 12 | yaml = { "yamlfmt", "prettier" }, 13 | just = { "just" }, 14 | rust = { "rustfmt" }, 15 | json = { "prettier" }, 16 | css = { "prettier" }, 17 | -- markdown = { "prettier" }, 18 | tf = { "tflint" }, 19 | }, 20 | format_on_save = { 21 | lsp_fallback = true, 22 | timeout_ms = 500, 23 | }, 24 | }, 25 | -- init = function() 26 | -- -- Use conform for gq. 27 | -- vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" 28 | -- 29 | -- -- Configure format on save inside my dotfiles and personal projects. 30 | -- vim.api.nvim_create_autocmd('BufEnter', { 31 | -- desc = 'Configure format on save', 32 | -- callback = function(args) 33 | -- local path = vim.api.nvim_buf_get_name(args.buf) 34 | -- path = vim.fs.normalize(path) 35 | -- vim.b[args.buf].format_on_save = vim.iter({ vim.env.XDG_CONFIG_HOME, vim.g.personal_projects_dir }) 36 | -- :any(function(folder) 37 | -- return vim.startswith(path, vim.fs.normalize(folder)) 38 | -- end) 39 | -- end, 40 | -- }) 41 | -- end, 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/luasnip.lua: -------------------------------------------------------------------------------- 1 | local types = require("luasnip.util.types") 2 | local ls = require("luasnip") 3 | 4 | local custom_snips = NeovimPath .. "/lua/snippets" 5 | require("luasnip.loaders.from_lua").load({ paths = { custom_snips } }) 6 | require("luasnip.loaders.from_vscode").lazy_load() 7 | 8 | ls.config.set_config({ 9 | -- This tells LuaSnip to remember to keep around the last snippet. 10 | -- You can jump back into it even if you move outside of the selection 11 | history = false, 12 | 13 | -- This one is cool cause if you have dynamic snippets, it updates as you type! 14 | updateevents = "TextChanged,TextChangedI", 15 | 16 | -- Autosnippets: 17 | enable_autosnippets = true, 18 | 19 | -- Crazy highlights!! 20 | store_selection_keys = "", 21 | -- #vid3 22 | -- ext_opts = nil, 23 | ext_opts = { 24 | [types.choiceNode] = { 25 | active = { 26 | virt_text = { { " « ", "NonTest" } }, 27 | }, 28 | passive = { 29 | virt_text = { { "← Choice", "Comment" } }, 30 | }, 31 | }, 32 | }, 33 | }) 34 | 35 | local keymap = vim.api.nvim_set_keymap 36 | local opts = { noremap = true, silent = true } 37 | keymap("i", "", "lua require'luasnip'.jump(-1)", opts) 38 | keymap("s", "", "lua require'luasnip'.jump(-1)", opts) 39 | keymap("i", "", "lua require'luasnip'.jump(1)", opts) 40 | keymap("s", "", "lua require'luasnip'.jump(1)", opts) 41 | vim.keymap.set("i", "", function() 42 | if ls.choice_active() then 43 | ls.change_choice(1) 44 | end 45 | end) 46 | 47 | vim.keymap.set("i", "", require("luasnip.extras.select_choice")) 48 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/dap-keymap.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "", function() 2 | require("dap").continue() 3 | end) 4 | vim.keymap.set("n", "", function() 5 | require("dap").step_over() 6 | end) 7 | vim.keymap.set("n", "", function() 8 | require("dap").step_into() 9 | end) 10 | vim.keymap.set("n", "", function() 11 | require("dap").step_out() 12 | end) 13 | vim.keymap.set("n", "b", function() 14 | require("dap").toggle_breakpoint() 15 | end) 16 | vim.keymap.set("n", "B", function() 17 | require("dap").set_breakpoint(vim.fn.input("Condition: ")) 18 | end) 19 | vim.keymap.set("n", "lp", function() 20 | require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) 21 | end) 22 | vim.keymap.set("n", "dr", function() 23 | require("dap").repl.open() 24 | end) 25 | vim.keymap.set("n", "dl", function() 26 | require("dap").run_last() 27 | end) 28 | vim.keymap.set("n", "dv", function() 29 | require("dapui").open() 30 | end) 31 | vim.keymap.set({ "n", "v" }, "dh", function() 32 | require("dap.ui.widgets").hover() 33 | end) 34 | vim.keymap.set({ "n", "v" }, "dp", function() 35 | require("dap.ui.widgets").preview() 36 | end) 37 | vim.keymap.set("n", "df", function() 38 | local widgets = require("dap.ui.widgets") 39 | widgets.centered_float(widgets.frames) 40 | end) 41 | vim.keymap.set("n", "ds", function() 42 | local widgets = require("dap.ui.widgets") 43 | widgets.centered_float(widgets.scopes) 44 | end) 45 | require("nvim-dap-virtual-text").setup({}) 46 | 47 | vim.keymap.set("n", "?", function() 48 | require("dapui").eval(nil, { enter = true }) 49 | end) 50 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/utils/floatingterminal.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("t", "", "") 2 | 3 | local state = { 4 | floating = { 5 | buf = -1, 6 | win = -1, 7 | }, 8 | } 9 | 10 | local function create_floating_window(opts) 11 | opts = opts or {} 12 | local width = opts.width or math.floor(vim.o.columns * 0.8) 13 | local height = opts.height or math.floor(vim.o.lines * 0.8) 14 | 15 | -- Calculate the position to center the window 16 | local col = math.floor((vim.o.columns - width) / 2) 17 | local row = math.floor((vim.o.lines - height) / 2) 18 | 19 | -- Create a buffer 20 | local buf = nil 21 | if vim.api.nvim_buf_is_valid(opts.buf) then 22 | buf = opts.buf 23 | else 24 | buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer 25 | end 26 | 27 | -- Define window configuration 28 | local win_config = { 29 | relative = "editor", 30 | width = width, 31 | height = height, 32 | col = col, 33 | row = row, 34 | style = "minimal", -- No borders or extra UI elements 35 | border = "rounded", 36 | } 37 | 38 | -- Create the floating window 39 | local win = vim.api.nvim_open_win(buf, true, win_config) 40 | 41 | return { buf = buf, win = win } 42 | end 43 | 44 | local toggle_terminal = function() 45 | if not vim.api.nvim_win_is_valid(state.floating.win) then 46 | state.floating = create_floating_window({ buf = state.floating.buf }) 47 | if vim.bo[state.floating.buf].buftype == "terminal" then 48 | else 49 | vim.cmd.terminal() 50 | end 51 | else 52 | vim.api.nvim_win_hide(state.floating.win) 53 | end 54 | end 55 | 56 | vim.api.nvim_create_user_command("Floaterminal", toggle_terminal, {}) 57 | vim.keymap.set({ "n", "t" }, "tt", ":Floaterminal") 58 | -------------------------------------------------------------------------------- /workspace/scripts/executable_pomo: -------------------------------------------------------------------------------- 1 | #! /usr/bin/zsh 2 | 3 | set -e 4 | 5 | declare -A pomo_options 6 | pomo_options["work"]="45" 7 | pomo_options["break"]="10" 8 | 9 | pomodoro() { 10 | val=$1 11 | echo $val | lolcat 12 | timer ${pomo_options["$val"]}m 13 | espeak-ng "'$val' session done" 14 | powershell.exe -Command "Import-Module BurntToast; New-BurntToastNotification -Text 'Pomodoro🍅', 'Session done 🍅'" 15 | } 16 | 17 | start_pomodoro() { 18 | # Number of times to repeat the loop, default is 2 19 | if [ -n "$1" ] && [ "$1" -eq "$1" ] 2>/dev/null; then 20 | num_loops=$1 21 | else 22 | # Default loops 23 | num_loops=2 24 | fi 25 | 26 | if [ -n "$2" ] && [ "$2" -eq "$2" ] 2>/dev/null; then 27 | pomo_options["work"]=$2 28 | fi 29 | 30 | if [ -n "$3" ] && [ "$3" -eq "$3" ] 2>/dev/null; then 31 | pomo_options["break"]=$3 32 | fi 33 | 34 | for i in $(seq 1 $num_loops); do 35 | pomodoro "work" 36 | pomodoro "break" 37 | done 38 | } 39 | 40 | change_pomo() { 41 | if [ -n "$1" ] && [ -n "$2" ]; then 42 | pomo_options["$1"]="$2" 43 | echo "The $1 time has been changed to $2 minutes" 44 | else 45 | echo "Please provide valid parameters: change_pomo [work/break] [time_in_minutes]" 46 | fi 47 | } 48 | 49 | case "$1" in 50 | "start") 51 | echo -n "How many times do you want to repeat the loop? " 52 | read -r num_loops 53 | echo -n "Work time: " 54 | read -r work_time 55 | echo -n "Break time: " 56 | read -r break_time 57 | start_pomodoro $num_loops $work_time $break_time 58 | ;; 59 | "work") pomodoro "work" 60 | ;; 61 | "break") pomodoro "break" 62 | ;; 63 | "change") change_pomo $2 $3 64 | ;; 65 | *) echo default 66 | ;; 67 | esac 68 | 69 | -------------------------------------------------------------------------------- /dot_config/nvim/after/plugin/telescope.lua: -------------------------------------------------------------------------------- 1 | local builtin = require("telescope.builtin") 2 | vim.keymap.set("n", "pf", builtin.find_files, {}) 3 | vim.keymap.set("n", "", builtin.git_files, {}) 4 | vim.keymap.set("n", "ps", function() 5 | builtin.grep_string({ search = vim.fn.input("Grep > ") }) 6 | end) 7 | vim.keymap.set("n", "ec", function() 8 | builtin.find_files({ 9 | cwd = vim.fn.stdpath("config"), 10 | }) 11 | end) 12 | vim.keymap.set("n", "pb", builtin.buffers, {}) 13 | vim.keymap.set("n", "sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" }) 14 | vim.keymap.set("n", "sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" }) 15 | vim.keymap.set("n", "fb", builtin.current_buffer_fuzzy_find, {}) 16 | vim.keymap.set("n", "qx", builtin.quickfix, {}) 17 | vim.keymap.set("n", "gh", builtin.help_tags, {}) 18 | vim.keymap.set("n", "vc", builtin.commands, {}) 19 | vim.keymap.set("n", "vh", builtin.highlights, {}) 20 | vim.keymap.set("n", "ccs", builtin.colorscheme, {}) 21 | vim.keymap.set("n", "sr", builtin.lsp_references, {}) 22 | vim.keymap.set("n", "vws", builtin.lsp_workspace_symbols, {}) 23 | vim.keymap.set("n", "vwd", builtin.lsp_document_symbols, {}) 24 | 25 | local actions = require("telescope.actions") 26 | require("telescope").setup({ 27 | extensions = { 28 | fzf = {}, 29 | wrap_results = true, 30 | }, 31 | defaults = { 32 | mappings = { 33 | i = { 34 | [""] = actions.file_vsplit, 35 | [""] = actions.file_split, 36 | }, 37 | }, 38 | }, 39 | pickers = { 40 | buffers = { 41 | mappings = { 42 | i = { 43 | [""] = actions.delete_buffer + actions.move_to_top, 44 | }, 45 | }, 46 | }, 47 | }, 48 | }) 49 | -------------------------------------------------------------------------------- /dot_local/bin/executable_jp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import json 5 | import argparse 6 | from pprint import pformat 7 | 8 | import jmespath 9 | from jmespath import exceptions 10 | 11 | 12 | def main(): 13 | parser = argparse.ArgumentParser() 14 | parser.add_argument('expression') 15 | parser.add_argument('-f', '--filename', 16 | help=('The filename containing the input data. ' 17 | 'If a filename is not given then data is ' 18 | 'read from stdin.')) 19 | parser.add_argument('--ast', action='store_true', 20 | help=('Pretty print the AST, do not search the data.')) 21 | args = parser.parse_args() 22 | expression = args.expression 23 | if args.ast: 24 | # Only print the AST 25 | expression = jmespath.compile(args.expression) 26 | sys.stdout.write(pformat(expression.parsed)) 27 | sys.stdout.write('\n') 28 | return 0 29 | if args.filename: 30 | with open(args.filename, 'r') as f: 31 | data = json.load(f) 32 | else: 33 | data = sys.stdin.read() 34 | data = json.loads(data) 35 | try: 36 | sys.stdout.write(json.dumps( 37 | jmespath.search(expression, data), indent=4, ensure_ascii=False)) 38 | sys.stdout.write('\n') 39 | except exceptions.ArityError as e: 40 | sys.stderr.write("invalid-arity: %s\n" % e) 41 | return 1 42 | except exceptions.JMESPathTypeError as e: 43 | sys.stderr.write("invalid-type: %s\n" % e) 44 | return 1 45 | except exceptions.UnknownFunctionError as e: 46 | sys.stderr.write("unknown-function: %s\n" % e) 47 | return 1 48 | except exceptions.ParseError as e: 49 | sys.stderr.write("syntax-error: %s\n" % e) 50 | return 1 51 | 52 | 53 | if __name__ == '__main__': 54 | sys.exit(main()) 55 | -------------------------------------------------------------------------------- /dot_config/tmuxinator/blog.yml: -------------------------------------------------------------------------------- 1 | # /home/moviemaker/.config/tmuxinator/blog.yml 2 | 3 | name: blog 4 | root: /home/moviemaker/websites/blog-site/blog 5 | # Optional tmux socket 6 | # socket_name: foo 7 | 8 | # Note that the pre and post options have been deprecated and will be replaced by 9 | # project hooks. 10 | 11 | # Project hooks 12 | 13 | # Runs on project start, always 14 | # on_project_start: command 15 | 16 | # Run on project start, the first time 17 | # on_project_first_start: command 18 | 19 | # Run on project start, after the first time 20 | # on_project_restart: command 21 | 22 | # Run on project exit ( detaching from tmux session ) 23 | # on_project_exit: command 24 | 25 | # Run on project stop 26 | # on_project_stop: command 27 | 28 | # Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. 29 | # pre_window: rbenv shell 2.0.0-p247 30 | 31 | # Pass command line options to tmux. Useful for specifying a different tmux.conf. 32 | # tmux_options: -f ~/.tmux.mac.conf 33 | 34 | # Change the command to call tmux. This can be used by derivatives/wrappers like byobu. 35 | # tmux_command: byobu 36 | 37 | # Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. 38 | # startup_window: editor 39 | 40 | # Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. 41 | # startup_pane: 1 42 | 43 | # Controls whether the tmux session should be attached to automatically. Defaults to true. 44 | # attach: false 45 | windows: 46 | - blog: 47 | layout: main-vertical 48 | # Synchronize all panes of this window, can be enabled before or after the pane commands run. 49 | # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' 50 | # synchronize: after 51 | panes: 52 | - v content/en/posts 53 | -------------------------------------------------------------------------------- /dot_config/tmuxinator/dotfile.yml: -------------------------------------------------------------------------------- 1 | # /home/moviemaker/.config/tmuxinator/dotfile.yml 2 | 3 | name: dotfile 4 | root: /home/moviemaker/.local/share/chezmoi 5 | # Optional tmux socket 6 | # socket_name: foo 7 | 8 | # Note that the pre and post options have been deprecated and will be replaced by 9 | # project hooks. 10 | 11 | # Project hooks 12 | 13 | # Runs on project start, always 14 | # on_project_start: command 15 | 16 | # Run on project start, the first time 17 | # on_project_first_start: command 18 | 19 | # Run on project start, after the first time 20 | # on_project_restart: command 21 | 22 | # Run on project exit ( detaching from tmux session ) 23 | # on_project_exit: command 24 | 25 | # Run on project stop 26 | # on_project_stop: command 27 | 28 | # Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. 29 | # pre_window: rbenv shell 2.0.0-p247 30 | 31 | # Pass command line options to tmux. Useful for specifying a different tmux.conf. 32 | # tmux_options: -f ~/.tmux.mac.conf 33 | 34 | # Change the command to call tmux. This can be used by derivatives/wrappers like byobu. 35 | # tmux_command: byobu 36 | 37 | # Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. 38 | # startup_window: editor 39 | 40 | # Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. 41 | startup_pane: 1 42 | # Controls whether the tmux session should be attached to automatically. Defaults to true. 43 | # attach: false 44 | windows: 45 | - editor: 46 | layout: tiled 47 | # Synchronize all panes of this window, can be enabled before or after the pane commands run. 48 | # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' 49 | # synchronize: after 50 | panes: 51 | - fv 52 | - git status 53 | -------------------------------------------------------------------------------- /dot_config/tmuxinator/vault.yml: -------------------------------------------------------------------------------- 1 | # /home/moviemaker/.config/tmuxinator/vault.yml 2 | 3 | name: vault 4 | root: /home/moviemaker/workspace/note-taking/zettelkasten-vault/PKM system 5 | # Optional tmux socket 6 | 7 | # socket_name: foo 8 | 9 | # Note that the pre and post options have been deprecated and will be replaced by 10 | # project hooks. 11 | 12 | # Project hooks 13 | 14 | # Runs on project start, always 15 | # on_project_start: command 16 | 17 | # Run on project start, the first time 18 | # on_project_first_start: command 19 | 20 | # Run on project start, after the first time 21 | # on_project_restart: command 22 | 23 | # Run on project exit ( detaching from tmux session ) 24 | # on_project_exit: command 25 | 26 | # Run on project stop 27 | # on_project_stop: command 28 | 29 | # Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. 30 | # pre_window: rbenv shell 2.0.0-p247 31 | 32 | # Pass command line options to tmux. Useful for specifying a different tmux.conf. 33 | # tmux_options: -f ~/.tmux.mac.conf 34 | 35 | # Change the command to call tmux. This can be used by derivatives/wrappers like byobu. 36 | # tmux_command: byobu 37 | 38 | # Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. 39 | # startup_window: editor 40 | 41 | # Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. 42 | # startup_pane: 1 43 | 44 | # Controls whether the tmux session should be attached to automatically. Defaults to true. 45 | # attach: false 46 | windows: 47 | - vault: 48 | layout: main-vertical 49 | # Synchronize all panes of this window, can be enabled before or after the pane commands run. 50 | # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' 51 | # synchronize: after 52 | panes: 53 | - v Inbox 54 | -------------------------------------------------------------------------------- /dot_local/bin/executable_youtube-summary: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # env variables OPENAI_API_KEY, VAULT , youtube api key: KEY 6 | 7 | write_to_file_zettel() { 8 | 9 | #open zettel inbox 10 | inbox="Inbox" 11 | zettel="$VAULT$inbox" 12 | cd "$zettel" || exit 13 | # Create the file with the name as the title of Youtube video 14 | if [[ -z $1 ]]; then 15 | echo "Cannot grab youtube title" 16 | exit 1 17 | fi 18 | 19 | touch "$zettel/$1.md" 20 | 21 | timestamp="$(date "+%d-%m-%y")" 22 | 23 | # format the file 24 | { 25 | echo "# $1" 26 | echo -en "\n" 27 | echo "#video" 28 | echo "#consume" 29 | echo -en "\n" 30 | echo "$2" 31 | echo -en "\n" 32 | echo "Links:" 33 | echo -en "\n" 34 | echo "[[$timestamp]]" 35 | } >>"$zettel/$1.md" 36 | 37 | # Open the file in Neovim 38 | nvim '+ normal ggzzi' "$zettel/$1.md" 39 | 40 | } 41 | 42 | youtube_video=$1 43 | youtube_url="https://www.youtube.com/watch?" 44 | 45 | if [[ -z $youtube_video ]]; then 46 | echo "No url provided" >&2 # Print error to stderr 47 | exit 1 # Exit with non-zero status 48 | fi 49 | 50 | if [[ $youtube_video == "$youtube_url"* ]]; then 51 | echo "Url is correct" 52 | else 53 | echo "The youtube url is not well formatted" >&2 54 | exit 1 55 | fi 56 | 57 | youtube_id=$(echo "$youtube_video" | awk -F'v=' '{print $2}') 58 | if [[ $youtube_id == *"&"* ]]; then 59 | youtube_id=$(echo "$youtube_id" | awk -F'&' '{print $1}') 60 | echo "Youtube id: $youtube_id" 61 | fi 62 | 63 | # Retrieve the transcript 64 | summary=$(youtube_transcript_api $youtube_id | mods "Here's a few lines from a youtube transcript i extracted. I want to pull the text out and have you analyze it and edit it appropriately for punctuation and grammar. Give me, as output, a summary with bullet points" --max-tokens 500) 65 | 66 | # Grab the title 67 | title=$( 68 | curl "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=$youtube_id&key=$KEY" | jq '.items[0].snippet.title' 69 | ) 70 | 71 | write_to_file_zettel "$title" "$summary" 72 | -------------------------------------------------------------------------------- /zsh-alias/aliases.zsh: -------------------------------------------------------------------------------- 1 | alias today='date +%Y-%m-%d' 2 | alias md="mkdir" 3 | 4 | #alias cd 5 | alias script='cd $SCRIPTS' 6 | alias cdblog="cd ~/websites/blog-site/blog/" 7 | alias cdpblog='cd $VAULT/Areas/Blogging/content' 8 | alias vault='cd $VAULT' 9 | alias nconf='cd $HOME/.config/nvim/' 10 | alias star='cd /home/moviemaker/.config/starship' 11 | 12 | #repos 13 | alias hl='cd $HOMELAB' 14 | alias dot='cd $DOTFILES' 15 | alias repos='cd $REPOS' 16 | alias ghrepos='cd $GHREPOS' 17 | 18 | # count files 19 | alias count='find . -type f | wc -l' 20 | alias v='nvim' 21 | alias fv='nvim $(fzfb)' 22 | 23 | #tmux alias 24 | alias tns='tmux new -s $(echo $(pwd) | xargs basename)' 25 | alias tx=tmuxifier 26 | 27 | #fzf azlias 28 | alias fzfb='fzf --preview "bat --color always --style numbers,changes {}"' 29 | 30 | #cat alias 31 | alias cat='bat --paging never --theme DarkNeon --style plain,changes' 32 | 33 | #kubectl aliases 34 | alias k='kubectl' 35 | alias kl='kubectl logs' 36 | alias kg='kubectl get $1' 37 | alias kgy='kubectl get $1 $2 -oyaml' 38 | alias kn='kubens' 39 | alias kc='kubectx' 40 | 41 | #git aliases 42 | alias g='git' 43 | alias ga='git add' 44 | alias gaa='git add -A' 45 | alias gs='git status --short' 46 | alias gst='git status' 47 | alias gc='git commit -m' 48 | alias gca='git commit --amend' 49 | alias gb='git branch' 50 | alias gco='git checkout' 51 | alias gp='git push origin $(git rev-parse --abbrev-ref HEAD)' 52 | alias gmg='git merge' 53 | alias gpf='git push --force' 54 | alias lg='lazygit' 55 | 56 | # gcap: commit all and push 57 | gcap() { 58 | git commit -a -m $1 59 | git push 60 | } 61 | 62 | # gmerge: merge current branch to the given branch 63 | gmerge() { 64 | branch=$(git rev-parse --abbrev-ref HEAD) && \ 65 | echo "merging" $branch "to" $1 66 | git checkout $1 && \ 67 | git merge $branch 68 | } 69 | 70 | 71 | # source the zsh config file 72 | alias sc='source $HOME/.zshrc' 73 | # edit the zsh config file 74 | alias ec='$EDITOR $HOME/.zshrc' 75 | 76 | #go to second brain note 77 | alias gn='cd $HOME/workspace/note-taking/my-second-braing/' 78 | 79 | # make dir and cd into it 80 | mdcd() { 81 | mkdir -p -- "$1" && cd -P -- "$1" 82 | } 83 | 84 | #flux short 85 | alias fgk='flux get kustomization' 86 | -------------------------------------------------------------------------------- /dot_wezterm.lua: -------------------------------------------------------------------------------- 1 | 2 | -- Pull in the wezterm API 3 | local wezterm = require 'wezterm' 4 | 5 | -- This table will hold the configuration. 6 | local config = {} 7 | 8 | local act = wezterm.action 9 | 10 | -- In newer versions of wezterm, use the config_builder which will 11 | -- help provide clearer error messages 12 | if wezterm.config_builder then 13 | config = wezterm.config_builder() 14 | end 15 | 16 | -- This is where you actually apply your config choices 17 | -- change config now 18 | -- config.default_domain = 'WSL:Ubuntu-22.04' 19 | 20 | -- For example, changing the color scheme: 21 | -- config.color_scheme = 'Batman' 22 | 23 | -- Set background to same color as neovim 24 | config.color_scheme = 'Catppuccin Macchiato' 25 | 26 | config.font = wezterm.font_with_fallback { 27 | 'JetBrains Mono', 28 | 'nonicons', 29 | } 30 | 31 | config.keys = { 32 | { 33 | key = 'h', 34 | mods = 'CTRL|SHIFT', 35 | action = act.ActivatePaneDirection 'Left', 36 | }, 37 | { 38 | key = 'j', 39 | mods = 'CTRL|SHIFT', 40 | action = act.ActivatePaneDirection 'Right', 41 | }, 42 | { 43 | key = 'UpArrow', 44 | mods = 'CTRL|SHIFT', 45 | action = act.ActivatePaneDirection 'Up', 46 | }, 47 | { 48 | key = 'DownArrow', 49 | mods = 'CTRL|SHIFT', 50 | action = act.ActivatePaneDirection 'Down', 51 | }, 52 | { 53 | key = 'h', 54 | mods = 'CTRL|SHIFT|ALT', 55 | action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, 56 | }, 57 | { 58 | key = 'v', 59 | mods = 'CTRL|SHIFT|ALT', 60 | action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }, 61 | }, 62 | { 63 | key = 'w', 64 | mods = 'CTRL|ALT', 65 | action = wezterm.action.CloseCurrentPane { confirm = false }, 66 | }, 67 | } 68 | 69 | -- default is true, has more "native" look 70 | config.use_fancy_tab_bar = false 71 | 72 | -- I don't like putting anything at the ege if I can help it. 73 | config.enable_scroll_bar = false 74 | config.window_padding = { 75 | left = 0, 76 | right = 0, 77 | top = 0, 78 | bottom = 0, 79 | } 80 | 81 | config.tab_bar_at_bottom = true 82 | config.freetype_load_target = "HorizontalLcd" 83 | 84 | -- and finally, return the configuration to wezterm 85 | return config 86 | 87 | -------------------------------------------------------------------------------- /dot_config/tmuxinator/golang.yml: -------------------------------------------------------------------------------- 1 | # /home/moviemaker/.config/tmuxinator/golang.yml 2 | 3 | name: golang 4 | root: ~/Repos/github.com/MovieMaker93/note-cli 5 | # Optional tmux socket 6 | # socket_name: foo 7 | 8 | # Note that the pre and post options have been deprecated and will be replaced by 9 | # project hooks. 10 | 11 | # Project hooks 12 | 13 | # Runs on project start, always 14 | # on_project_start: command 15 | 16 | # Run on project start, the first time 17 | # on_project_first_start: command 18 | 19 | # Run on project start, after the first time 20 | # on_project_restart: command 21 | 22 | # Run on project exit ( detaching from tmux session ) 23 | # on_project_exit: command 24 | 25 | # Run on project stop 26 | # on_project_stop: command 27 | 28 | # Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. 29 | # pre_window: rbenv shell 2.0.0-p247 30 | 31 | # Pass command line options to tmux. Useful for specifying a different tmux.conf. 32 | # tmux_options: -f ~/.tmux.mac.conf 33 | 34 | # Change the command to call tmux. This can be used by derivatives/wrappers like byobu. 35 | # tmux_command: byobu 36 | 37 | # Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. 38 | startup_window: go 39 | # Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. 40 | startup_pane: 1 41 | # Controls whether the tmux session should be attached to automatically. Defaults to true. 42 | # attach: false 43 | windows: 44 | - go: 45 | layout: main-vertical 46 | # Synchronize all panes of this window, can be enabled before or after the pane commands run. 47 | # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' 48 | # synchronize: after 49 | panes: 50 | - fv 51 | - air: 52 | layout: main-vertical 53 | # Synchronize all panes of this window, can be enabled before or after the pane commands run. 54 | # 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after' 55 | # synchronize: after 56 | panes: 57 | - air 58 | #- server: bundle exec rails s 59 | # - logs: tail -f log/development.log 60 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-telescope/telescope.nvim", 4 | dependencies = { 5 | { "nvim-lua/plenary.nvim" }, 6 | { "jonarrien/telescope-cmdline.nvim" }, 7 | { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, 8 | }, 9 | dir = "/home/moviemaker/workspace/opensources/telescope/telescope.nvim", 10 | keys = { 11 | { "pf", "Telescope find_files", desc = "Find file" }, 12 | { "cmd", "Telescope cmdline", desc = "Cmdline" }, 13 | }, 14 | config = function(_, opts) 15 | require("telescope").setup(opts) 16 | require("telescope").load_extension("cmdline") 17 | pcall(require("telescope").load_extension, "fzf") 18 | end, 19 | }, 20 | { 21 | "MovieMaker93/telescope-ghissue.nvim", 22 | event = "VeryLazy", 23 | dependencies = { 24 | "nvim-telescope/telescope.nvim", 25 | }, 26 | config = function() 27 | require("telescope").load_extension("telescope_ghissue") 28 | require("telescope_ghissue").setup({}) 29 | end, 30 | }, 31 | { 32 | "kristijanhusak/vim-dadbod-ui", 33 | dependencies = { "tpope/vim-dadbod" }, 34 | }, 35 | { 36 | "kristijanhusak/vim-dadbod-completion", 37 | }, 38 | { 39 | "folke/ts-comments.nvim", 40 | event = "VeryLazy", 41 | enabled = vim.fn.has("nvim-0.10.0") == 1, 42 | opts = { 43 | -- add any options here 44 | }, 45 | lazy = false, 46 | }, 47 | { 48 | "folke/zen-mode.nvim", 49 | cmd = "ZenMode", 50 | opts = { 51 | plugins = { 52 | gitsigns = true, 53 | tmux = true, 54 | kitty = { enabled = false, font = "+2" }, 55 | }, 56 | }, 57 | keys = { { "z", "ZenMode", desc = "Zen Mode" } }, 58 | }, 59 | { 60 | "nvim-tree/nvim-web-devicons", 61 | }, 62 | { 63 | "nvim-neo-tree/neo-tree.nvim", 64 | branch = "v3.x", 65 | dependencies = { 66 | "nvim-lua/plenary.nvim", 67 | "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended 68 | "MunifTanjim/nui.nvim", 69 | -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information 70 | }, 71 | { 72 | "lukas-reineke/indent-blankline.nvim", 73 | config = function() 74 | local blankline = require("ibl") 75 | blankline.setup({ 76 | scope = { 77 | show_start = false, 78 | }, 79 | indent = { 80 | char = "┊", 81 | tab_char = "┊", 82 | smart_indent_cap = true, 83 | }, 84 | whitespace = { 85 | remove_blankline_trail = true, 86 | }, 87 | }) 88 | end, 89 | }, 90 | }, 91 | } 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 | 6 | 7 |

Dotfiles MacOS and Linux

8 | 9 |

10 | 11 |

12 | 13 | LastCommit 14 | 15 | 16 | 17 | 18 | License 19 | 20 | 21 | stars 22 | 23 |

24 | 25 | # Dotfiles 26 | 27 | This repository contains my dotfiles for configuring new machines or initializing development containers using the Chezmoi tool. 28 | It provides cross-platform dotfiles compatible with macOS and various Linux distributions. 29 | 30 | ## Requirements 31 | 32 | - Chezmoi (must be installed) 33 | 34 | ## Installation 35 | 36 | The `startup.sh` script will install the appropriate package manager (Homebrew for macOS, Nix for Linux) and set up the dotfiles: 37 | 38 | ```bash 39 | curl -sfL https://raw.githubusercontent.com/MovieMaker93/devpod-dotfiles-chezmoi/main/.startup.sh | bash 40 | ``` 41 | 42 | This script initializes and applies Chezmoi with this GitHub repository. 43 | 44 | ## Adding New Dotfiles 45 | 46 | If you want to add new dotfiles or modify the existing ones: 47 | 48 | ```bash 49 | chezmoi add 50 | ``` 51 | 52 | Then navigate to .local/share/chezmoi to push changes to git. 53 | 54 | ## Updating Dotfiles 55 | 56 | To pull latest changes: 57 | 58 | ```bash 59 | chezmoi git pull -- --autostash --rebase && chezmoi diff 60 | ``` 61 | 62 | If you're satisfied with the changes, apply them: 63 | 64 | ```bash 65 | chezmoi apply 66 | ``` 67 | 68 | --- 69 | 70 |

71 | 72 | Static Badge 73 | 74 |

75 | -------------------------------------------------------------------------------- /dot_tmux.conf: -------------------------------------------------------------------------------- 1 | set -g mouse on 2 | # set -g @yank_with_mouse on 3 | set-option -g default-shell /bin/zsh 4 | 5 | unbind C-b 6 | set -g prefix C-Space 7 | bind C-Space send-prefix 8 | 9 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "clip.exe" 10 | bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "clip.exe" 11 | # set -s set-clipboard on 12 | # Source file tmux 13 | bind r source-file ~/.tmux.conf 14 | # Vim style pane selection 15 | bind h select-pane -L 16 | bind j select-pane -D 17 | bind k select-pane -U 18 | bind l select-pane -R 19 | 20 | # Start windows and panes at 1, not 0 21 | set -g base-index 1 22 | set -g pane-base-index 1 23 | set-window-option -g pane-base-index 1 24 | set-option -g renumber-windows on 25 | 26 | 27 | set -sg escape-time 0 28 | 29 | # Reload tmux configuration 30 | bind-key C-r source-file ~/.tmux.conf \; display "Config reloaded" 31 | 32 | 33 | # use fzf to [s]witch sessions 34 | bind-key C-s display-popup -E "\ 35 | tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\ 36 | sed '/^$/d' |\ 37 | fzf --reverse --header jump-to-session |\ 38 | xargs tmux switch-client -t" 39 | 40 | # use fzf to [e]xit (kill) sessions 41 | bind-key C-e display-popup -E "\ 42 | tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\ 43 | sed '/^$/d' |\ 44 | fzf --reverse --header kill-session |\ 45 | xargs tmux kill-session -t" 46 | 47 | bind-key -r i display-popup -E "\ 48 | tmuxinator list |\ 49 | tail -n +2 |\ 50 | xargs -n1 |\ 51 | fzf --reverse --header select-tmuxinator-session |\ 52 | xargs tmuxinator start 53 | " 54 | 55 | # Set 256 colors 56 | set -g default-terminal "screen-256color" 57 | set -s default-terminal 'tmux-256color' 58 | set -g @plugin 'tmux-plugins/tpm' 59 | set -g @plugin 'tmux-plugins/tmux-sensible' 60 | # set -g @plugin 'tmux-plugins/tmux-yank' 61 | set -g @plugin 'catppuccin/tmux' 62 | set -g @catppuccin_window_right_separator "█ " 63 | set -g @catppuccin_window_number_position "right" 64 | set -g @catppuccin_window_middle_separator " | " 65 | set -g @catppuccin_window_current_text "#{pane_current_path}" 66 | 67 | set -g @catppuccin_window_default_fill "none" 68 | 69 | set -g @catppuccin_window_current_fill "all" 70 | 71 | set -g @catppuccin_status_modules_right "application date_time" 72 | set -g @catppuccin_status_modules_left "session" 73 | 74 | set -g @catppuccin_status_left_separator "█" 75 | set -g @catppuccin_status_right_separator "█ " 76 | set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M:%S" 77 | set -g @catppuccin_status_connect_separator "yes" 78 | set -g @yank_with_mouse on 79 | 80 | bind '"' split-window -v -c "#{pane_current_path}" 81 | bind % split-window -h -c "#{pane_current_path}" 82 | 83 | # forget the find window. That is for chumps 84 | bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer" 85 | # bind-key -r i run-shell "tmux neww ~/.local/bin/tmux-cht" 86 | bind-key -r S run-shell "~/.local/bin/tmux-sessionizer ~/personal/guestbook" 87 | 88 | run '~/.tmux/plugins/tpm/tpm' 89 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/devfortunato/executable_remap.lua: -------------------------------------------------------------------------------- 1 | -- Move current line up and down 2 | vim.keymap.set("v", "J", ":m '>+1gv=gv") 3 | vim.keymap.set("v", "K", ":m '<-2gv=gv") 4 | 5 | vim.keymap.set("n", "J", "mzJ`z") 6 | vim.keymap.set("n", "", "zz") 7 | vim.keymap.set("n", "", "zz") 8 | vim.keymap.set("n", "n", "nzzzv") 9 | vim.keymap.set("n", "N", "Nzzzv") 10 | 11 | -- Navigate between quickfix items 12 | vim.keymap.set("n", "k", "cnextzz", { desc = "Forward qfixlist" }) 13 | vim.keymap.set("n", "j", "cprevzz", { desc = "Backward qfixlist" }) 14 | 15 | -- -- Navigate between location list items 16 | -- vim.keymap.set("n", "k", "lnextzz", { desc = "Forward location list" }) 17 | -- vim.keymap.set("n", "j", "lprevzz", { desc = "Backward location list" }) 18 | 19 | -- greatest remap ever 20 | vim.keymap.set("x", "p", [["_dP]]) 21 | 22 | -- Save current selection to copy clipboard 23 | vim.keymap.set({ "n", "v" }, "y", [["+y]]) 24 | vim.keymap.set("n", "Y", [["+Y]]) 25 | vim.keymap.set("n", "rp", [["+p]]) 26 | 27 | vim.keymap.set({ "n", "v" }, "d", [["_d]]) 28 | 29 | -- This is going to get me cancelled 30 | vim.keymap.set("i", "", "") 31 | 32 | vim.keymap.set("n", "Q", "") 33 | vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") 34 | vim.keymap.set("n", "f", vim.lsp.buf.format) 35 | 36 | vim.keymap.set("n", "k", "lnextzz") 37 | vim.keymap.set("n", "j", "lprevzz") 38 | 39 | -- Replace current word 40 | vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) 41 | -- Make current file executable 42 | vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) 43 | 44 | -- Source current file 45 | vim.keymap.set("n", "", function() 46 | vim.cmd("so") 47 | end) 48 | 49 | -- Resize windows 50 | vim.keymap.set("n", "", "<") 51 | vim.keymap.set("n", "", ">") 52 | vim.keymap.set("n", "", "+") 53 | vim.keymap.set("n", "", "-") 54 | 55 | -- Rename incremental 56 | vim.keymap.set("n", "rn", ":IncRename ") 57 | 58 | -- Split vertical and horizontal 59 | vim.keymap.set("n", "sh", "new") 60 | vim.keymap.set("n", "sv", "vnew") 61 | 62 | -- Go test run 63 | vim.keymap.set("n", "gtr", "GoTestRun") 64 | 65 | -- Enable inline hint 66 | vim.keymap.set("n", "ti", "EnableInline") 67 | 68 | -- exit file/inspect current tree 69 | vim.keymap.set("n", "i", vim.cmd.InspectTree) 70 | 71 | -- vim.keymap.set("n", "gb", "BufferLinePick") 72 | vim.keymap.set("n", "gb", function() 73 | local user_input = vim.fn.input("Enter buffer number: ") 74 | vim.api.nvim_command("BufferLineGoToBuffer" .. user_input) 75 | end) 76 | vim.keymap.set("n", "gn", "BufferLineCycleNext") 77 | vim.keymap.set("n", "gp", "BufferLineCyclePrev") 78 | vim.keymap.set("n", "gd", "BufferLinePickClose") 79 | -------------------------------------------------------------------------------- /dot_config/starship/starship.toml: -------------------------------------------------------------------------------- 1 | add_newline = false 2 | # A minimal left prompt 3 | format = """$directory$character""" 4 | palette = "gruvbox_dark" 5 | # move the rest of the prompt to the right 6 | right_format = """$all""" 7 | command_timeout = 1000 8 | 9 | [directory.substitutions] 10 | '~/tests/starship-custom' = 'work-project' 11 | '/home/moviemaker/workspace/note-taking/zettelkasten-vault/PKM system' = 'Alfonso-Zettelkasten' 12 | 13 | [username] 14 | style_user = "bg:color_orange fg:color_fg0" 15 | style_root = "bg:color_orange fg:color_fg0" 16 | format = '[](color_orange)$user ($style) ]' 17 | disabled = true 18 | show_always = true 19 | aliases = { "moviemaker" = "alfonsofortunato" } 20 | 21 | [time] 22 | disabled = false 23 | style = "bg:color_bg1" 24 | format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)' 25 | time_format = '%T' 26 | utc_time_offset = '+2' 27 | # time_range = '10:00:00-14:00:00' 28 | 29 | [gcloud] 30 | disabled = true 31 | [aws] 32 | format = '[$symbol(profile: "$profile" )(\(region: $region\) )]($style)' 33 | disabled = true 34 | style = 'bold blue' 35 | symbol = " " 36 | 37 | # [git_branch] 38 | # format = '[$symbol$branch(:$remote_branch)]($style)' 39 | 40 | [git_branch] 41 | format = 'on [$symbol$branch(:$remote_branch)]($style)' 42 | 43 | [git_status] 44 | # style = "bg:color_aqua" 45 | format = '([\[$all_status$ahead_behind\]]($style) ) ' 46 | untracked = '?${count}' 47 | ahead = '⇡${count}' 48 | staged = '[++\($count\)](green)' 49 | modified = '!${count}' 50 | 51 | [golang] 52 | format = '[ ](bold cyan)' 53 | 54 | [kubernetes] 55 | symbol = '☸ ' 56 | disabled = false 57 | # detect_files = ['Dockerfile'] 58 | # style = "fg:color_fg0 bg:color_blue" 59 | format = '[$symbol$context( \($namespace\))]($style) ' 60 | # contexts = [ 61 | # { context_pattern = "arn:aws:eks:us-west-2:577926974532:cluster/zd-pvc-omer", style = "green", context_alias = "omerxx", symbol = " " }, 62 | # ] 63 | 64 | [docker_context] 65 | disabled = true 66 | 67 | # ~/.config/starship.toml 68 | 69 | [palettes.gruvbox_dark] 70 | color_fg0 = '#fbf1c7' 71 | color_bg1 = '#3c3836' 72 | color_bg3 = '#665c54' 73 | color_blue = '#458588' 74 | color_aqua = '#689d6a' 75 | color_green = '#98971a' 76 | color_orange = '#d65d0e' 77 | color_purple = '#b16286' 78 | color_red = '#cc241d' 79 | color_yellow = '#d79921' 80 | # [palettes.catppuccin_mocha] 81 | # rosewater = "#f5e0dc" 82 | # flamingo = "#f2cdcd" 83 | # pink = "#f5c2e7" 84 | # mauve = "#cba6f7" 85 | # red = "#f38ba8" 86 | # maroon = "#eba0ac" 87 | # peach = "#fab387" 88 | # yellow = "#f9e2af" 89 | # green = "#a6e3a1" 90 | # teal = "#94e2d5" 91 | # sky = "#89dceb" 92 | # sapphire = "#74c7ec" 93 | # blue = "#89b4fa" 94 | # lavender = "#b4befe" 95 | # text = "#cdd6f4" 96 | # subtext1 = "#bac2de" 97 | # subtext0 = "#a6adc8" 98 | # overlay2 = "#9399b2" 99 | # overlay1 = "#7f849c" 100 | # overlay0 = "#6c7086" 101 | # surface2 = "#585b70" 102 | # surface1 = "#45475a" 103 | # surface0 = "#313244" 104 | # base = "#1e1e2e" 105 | # mantle = "#181825" 106 | # crust = "#11111b" 107 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/lsp-config.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "neovim/nvim-lspconfig", 4 | cmd = { "LspInfo", "LspInstall", "LspStart" }, 5 | event = { "BufReadPre", "BufNewFile" }, 6 | dependencies = { 7 | "williamboman/mason-lspconfig.nvim", 8 | "saghen/blink.cmp", 9 | { 10 | "folke/lazydev.nvim", 11 | opts = { 12 | library = { 13 | { path = "${3rd}/luv/library", words = { "vim%.uv" } }, 14 | }, 15 | }, 16 | }, 17 | }, 18 | config = function() 19 | -- Custom keymaps 20 | vim.keymap.set("n", "gd", function() 21 | vim.lsp.buf.definition() 22 | end) 23 | vim.keymap.set("n", "ds", function() 24 | vim.lsp.buf.document_symbol() 25 | end) 26 | vim.keymap.set("n", "K", function() 27 | vim.lsp.buf.hover() 28 | end) 29 | vim.keymap.set("n", "vd", function() 30 | vim.diagnostic.open_float() 31 | end) 32 | vim.keymap.set("n", "dn", function() 33 | vim.diagnostic.goto_next() 34 | end) 35 | vim.keymap.set("n", "dp", function() 36 | vim.diagnostic.goto_prev() 37 | end) 38 | vim.keymap.set({ "v", "n" }, "vca", function() 39 | vim.lsp.buf.code_action() 40 | end) 41 | vim.keymap.set("n", "vrr", function() 42 | vim.lsp.buf.references() 43 | end) 44 | vim.keymap.set("n", "vrn", function() 45 | vim.lsp.buf.rename() 46 | end) 47 | vim.keymap.set("i", "", function() 48 | vim.lsp.buf.signature_help() 49 | end) 50 | 51 | require("mason-lspconfig").setup({ 52 | ensure_installed = { 53 | "gopls", 54 | "pylsp", 55 | "rust_analyzer", 56 | "yamlls", 57 | "terraformls", 58 | "lua_ls", 59 | }, 60 | }) 61 | local capabilities = require("blink.cmp").get_lsp_capabilities() 62 | require("lspconfig").gopls.setup({ 63 | capabilities = capabilities, 64 | settings = { 65 | gopls = { 66 | analyses = { 67 | unusedparams = true, 68 | }, 69 | staticcheck = true, 70 | }, 71 | }, 72 | }) 73 | require("lspconfig").lua_ls.setup({ 74 | capabilities = capabilities, 75 | settings = { 76 | Lua = { 77 | workspace = { 78 | maxPreload = 4000, -- Increase maximum preload 79 | preloadFileSize = 4000, -- Increase the size limit in KB 80 | }, 81 | }, 82 | }, 83 | }) 84 | 85 | -- vim.api.nvim_create_autocmd("LspAttach", { 86 | -- callback = function(args) 87 | -- local c = vim.lsp.get_client_by_id(args.data.client_id) 88 | -- if not c then 89 | -- return 90 | -- end 91 | -- 92 | -- if vim.bo.filetype == "lua" or vim.bo.filetype == "go" then 93 | -- -- Format the current buffer on save 94 | -- vim.api.nvim_create_autocmd("BufWritePre", { 95 | -- buffer = args.buf, 96 | -- callback = function() 97 | -- vim.lsp.buf.format({ bufnr = args.buf, id = c.id }) 98 | -- end, 99 | -- }) 100 | -- end 101 | -- end, 102 | -- }) 103 | end, 104 | }, 105 | } 106 | -------------------------------------------------------------------------------- /dot_zshrc: -------------------------------------------------------------------------------- 1 | setopt prompt_subst 2 | source <(kubectl completion zsh) 3 | 4 | ## ZSH PLUGINS ## 5 | # Source usefulsh plugins 6 | source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 7 | source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 8 | 9 | 10 | # You may need to manually set your language environment 11 | # export LANG=en_US.UTF-8 12 | source_if_exists () { 13 | if test -r "$1"; then 14 | source "$1" 15 | fi 16 | } 17 | 18 | ## STARSHIP CONFIG ## 19 | eval "$(starship init zsh)" 20 | export STARSHIP_CONFIG=~/.config/starship/starship.toml 21 | 22 | ## ZELLIJ ## 23 | # zsh <(curl -L zellij.dev/launch) 24 | 25 | export EDITOR='nvim' 26 | export REPOS="$HOME/Repos" 27 | export GITUSER="MovieMaker93" 28 | export GHREPOS="$REPOS/github.com/$GITUSER" 29 | export WORKSPACE=$HOME/workspace 30 | export DOTFILES=$HOME/.local/share/chezmoi 31 | export VAULT="$WORKSPACE/note-taking/zettelkasten-vault/PKM system/" 32 | export SCRIPTS="$WORKSPACE/scripts" 33 | export HOMELAB="$GHREPOS/homelab" 34 | export TERM=screen-256color 35 | export XDG_CONFIG_HOME=$HOME/.config 36 | export TMUXIFIER_LAYOUT_PATH="$HOME/tmux_layouts/layout/" 37 | 38 | # ## HISTORY ## 39 | # ############# 40 | # HISTFILE=$HOME/.zsh_history 41 | # HISTSIZE=50000 42 | # SAVEHIST=50000 43 | 44 | setopt EXTENDED_HISTORY 45 | setopt HIST_VERIFY 46 | setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history. 47 | setopt HIST_IGNORE_DUPS # Dont record an entry that was just recorded again. 48 | setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. 49 | setopt HIST_FIND_NO_DUPS # Do not display a line previously found. 50 | setopt HIST_IGNORE_SPACE # Dont record an entry starting with a space. 51 | setopt HIST_SAVE_NO_DUPS # Dont write duplicate entries in the history file. 52 | 53 | ## ALIASES DIRECTORIES ## 54 | source_if_exists "$HOME/zsh-alias/aliases.zsh" 55 | source_if_exists "$HOME/zsh-alias/git.zsh" 56 | source_if_exists "$HOME/.aliases.local" 57 | source_if_exists "$HOME/.fzf.zsh" 58 | 59 | ## PATH ## 60 | export PATH=$HOME/bin:$SCRIPTS:$PATH 61 | export GOROOT=/usr/local/go 62 | export GOPATH=$HOME/go 63 | export LOCAL_BIN=$HOME/.local 64 | export PATH=$GOPATH/bin:$GOROOT/bin:$LOCAL_BIN/bin:$PATH 65 | 66 | ## TMUX and TMUXINATOR ## 67 | # if [ -z "$TMUX" ]; then 68 | # tmux attach -t default || tmux new -s default 69 | # fi 70 | # tmuxinator start dotfile 71 | # tmuxinator start blog 72 | # tmuxinator start vault 73 | # tmuxinator start golang 74 | 75 | # Turso 76 | # export PATH="/home/moviemaker/.turso:$PATH" 77 | 78 | # ~~~~~~~~~~~~~~~ Completion ~~~~~~~~~~~~~~~~~~~~~~~~ 79 | 80 | fpath+=~/.zsh/zsh-completitions/src 81 | fpath+=~/.zfunc 82 | 83 | 84 | autoload -Uz compinit 85 | compinit -u 86 | 87 | zstyle ':completion:*' menu select 88 | 89 | # --------------------- Direnv hook ------------------- 90 | eval "$(direnv hook zsh)" 91 | 92 | # Example to install completion: 93 | # talosctl completion zsh > ~/.zfunc/_talosctl 94 | neofetch 95 | 96 | export NVM_DIR="$HOME/.config/nvm" 97 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 98 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 99 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/obsidian.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "epwalsh/obsidian.nvim", 3 | version = "*", -- recommended, use latest release instead of latest commit 4 | lazy = true, 5 | ft = "markdown", 6 | -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: 7 | -- event = { 8 | -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. 9 | -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md" 10 | -- "BufReadPre path/to/my-vault/**.md", 11 | -- "BufNewFile path/to/my-vault/**.md", 12 | -- }, 13 | dependencies = { 14 | -- Required. 15 | "nvim-lua/plenary.nvim", 16 | 17 | -- see below for full list of optional dependencies 👇 18 | }, 19 | opts = { 20 | ui = { enable = false }, 21 | workspaces = { 22 | { 23 | name = "personal", 24 | path = "$VAULT", 25 | }, 26 | }, 27 | notes_subdir = "Inbox", 28 | daily_notes = { 29 | -- Optional, if you keep daily notes in a separate directory. 30 | folder = "Journal", 31 | -- Optional, if you want to change the date format for the ID of daily notes. 32 | date_format = "%d-%m-%Y", 33 | -- Optional, if you want to change the date format of the default alias of daily notes. 34 | alias_format = "%B %-d, %Y", 35 | -- Optional, default tags to add to each new daily note created. 36 | default_tags = { "dailies" }, 37 | -- Optional, if you want to automatically insert a template from your template directory like 'daily.md' 38 | template = "Templater/Daily Note", 39 | }, 40 | new_notes_location = "notes_subdir", 41 | 42 | -- Optional, boolean or a function that takes a filename and returns a boolean. 43 | -- `true` indicates that yjdou don't want obsidian.nvim to manage frontmatter. 44 | disable_frontmatter = true, 45 | -- Optional, customize how note IDs are generated given an optional title. 46 | ---@param title string|? 47 | ---@return string 48 | note_id_func = function(title) 49 | -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. 50 | -- In this case a note with the title 'My new note' will be given an ID that looks 51 | -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' 52 | local suffix = "" 53 | if title ~= nil then 54 | -- If title is given, transform it into valid file name. 55 | suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() 56 | else 57 | -- If title is nil, just add 4 random uppercase letters to the suffix. 58 | for _ = 1, 4 do 59 | suffix = suffix .. string.char(math.random(65, 90)) 60 | end 61 | end 62 | return suffix 63 | end, 64 | templates = { 65 | folder = "Templates", 66 | date_format = "%d-%m-%Y", 67 | time_format = "%H:%M", 68 | }, 69 | -- Optional, by default when you use `:ObsidianFollowLink` on a link to an external 70 | -- URL it will be ignored but you can customize this behavior here. 71 | ---@param url string 72 | follow_url_func = function(url) 73 | -- Open the URL in the default web browser. 74 | -- vim.fn.jobstart({"open", url}) -- Mac OS 75 | vim.fn.jobstart({ "xdg-open", url }) -- linux 76 | -- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows 77 | -- vim.ui.open(url) -- need Neovim 0.10.0+ 78 | end, 79 | -- see below for full list of options 👇 80 | }, 81 | } 82 | -------------------------------------------------------------------------------- /.github/workflows/sync-repo.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | workflow_dispatch: 6 | name: Sync Dotifle And Slim Dotfile 7 | jobs: 8 | sync-files: 9 | strategy: 10 | max-parallel: 3 11 | matrix: 12 | repo: [dotfile-slim] 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | - name: Sync Zshrc 18 | uses: dmnemec/copy_file_to_another_repo_action@main 19 | env: 20 | API_TOKEN_GITHUB: ${{ secrets.SYNC_TOKEN }} 21 | with: 22 | source_file: "dot_zshrc" 23 | destination_repo: "MovieMaker93/${{ matrix.repo }}" 24 | destination_folder: "/" 25 | user_email: "39483124+alfonsofortunato@users.noreply.github.com" 26 | user_name: "Alfonso_Fortunato" 27 | commit_message: "${{ github.event.head_commit.message }}\n[skip ci]\nAutomated sync from moviemaker/nix" 28 | git_server: "github.com" 29 | - name: Sync Config Directories 30 | uses: dmnemec/copy_file_to_another_repo_action@main 31 | env: 32 | API_TOKEN_GITHUB: ${{ secrets.SYNC_TOKEN }} 33 | with: 34 | source_file: "dot_config/" 35 | destination_repo: "MovieMaker93/${{ matrix.repo }}" 36 | destination_folder: "/" 37 | user_email: "39483124+alfonsofortunato@users.noreply.github.com" 38 | user_name: "Alfonso_Fortunato" 39 | commit_message: "${{ github.event.head_commit.message }}\n[skip ci]\nAutomated sync from moviemaker/nix" 40 | git_server: "github.com" 41 | - name: Sync Local Directories 42 | uses: dmnemec/copy_file_to_another_repo_action@main 43 | env: 44 | API_TOKEN_GITHUB: ${{ secrets.SYNC_TOKEN }} 45 | with: 46 | source_file: "dot_local/" 47 | destination_repo: "MovieMaker93/${{ matrix.repo }}" 48 | destination_folder: "/" 49 | user_email: "39483124+alfonsofortunato@users.noreply.github.com" 50 | user_name: "Alfonso_Fortunato" 51 | commit_message: "${{ github.event.head_commit.message }}\n[skip ci]\nAutomated sync from moviemaker/nix" 52 | git_server: "github.com" 53 | - name: Sync ZSH aliases 54 | uses: dmnemec/copy_file_to_another_repo_action@main 55 | env: 56 | API_TOKEN_GITHUB: ${{ secrets.SYNC_TOKEN }} 57 | with: 58 | source_file: "zsh-alias/" 59 | destination_repo: "MovieMaker93/${{ matrix.repo }}" 60 | destination_folder: "/" 61 | user_email: "39483124+alfonsofortunato@users.noreply.github.com" 62 | user_name: "Alfonso_Fortunato" 63 | commit_message: "${{ github.event.head_commit.message }}\n[skip ci]\nAutomated sync from moviemaker/nix" 64 | git_server: "github.com" 65 | - name: Sync Tmux conf 66 | uses: dmnemec/copy_file_to_another_repo_action@main 67 | env: 68 | API_TOKEN_GITHUB: ${{ secrets.SYNC_TOKEN }} 69 | with: 70 | source_file: "dot_tmux.conf" 71 | destination_repo: "MovieMaker93/${{ matrix.repo }}" 72 | destination_folder: "/" 73 | user_email: "39483124+alfonsofortunato@users.noreply.github.com" 74 | user_name: "Alfonso_Fortunato" 75 | commit_message: "${{ github.event.head_commit.message }}\n[skip ci]\nAutomated sync from moviemaker/nix" 76 | git_server: "github.com" 77 | - name: Sync Wezterm conf 78 | uses: dmnemec/copy_file_to_another_repo_action@main 79 | env: 80 | API_TOKEN_GITHUB: ${{ secrets.SYNC_TOKEN }} 81 | with: 82 | source_file: "dot_wezterm.lua" 83 | destination_repo: "MovieMaker93/${{ matrix.repo }}" 84 | destination_folder: "/" 85 | user_email: "39483124+alfonsofortunato@users.noreply.github.com" 86 | user_name: "Alfonso_Fortunato" 87 | commit_message: "${{ github.event.head_commit.message }}\n[skip ci]\nAutomated sync from moviemaker/nix" 88 | git_server: "github.com" 89 | -------------------------------------------------------------------------------- /dot_bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) 3 | # for examples 4 | 5 | # If not running interactively, don't do anything 6 | case $- in 7 | *i*) ;; 8 | *) return;; 9 | esac 10 | 11 | # don't put duplicate lines or lines starting with space in the history. 12 | # See bash(1) for more options 13 | HISTCONTROL=ignoreboth 14 | 15 | # append to the history file, don't overwrite it 16 | shopt -s histappend 17 | 18 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 19 | HISTSIZE=1000 20 | HISTFILESIZE=2000 21 | 22 | # check the window size after each command and, if necessary, 23 | # update the values of LINES and COLUMNS. 24 | shopt -s checkwinsize 25 | 26 | # If set, the pattern "**" used in a pathname expansion context will 27 | # match all files and zero or more directories and subdirectories. 28 | #shopt -s globstar 29 | 30 | # make less more friendly for non-text input files, see lesspipe(1) 31 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 32 | 33 | # set variable identifying the chroot you work in (used in the prompt below) 34 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then 35 | debian_chroot=$(cat /etc/debian_chroot) 36 | fi 37 | 38 | # set a fancy prompt (non-color, unless we know we "want" color) 39 | case "$TERM" in 40 | xterm-color|*-256color) color_prompt=yes;; 41 | esac 42 | 43 | # uncomment for a colored prompt, if the terminal has the capability; turned 44 | # off by default to not distract the user: the focus in a terminal window 45 | # should be on the output of commands, not on the prompt 46 | #force_color_prompt=yes 47 | 48 | if [ -n "$force_color_prompt" ]; then 49 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 50 | # We have color support; assume it's compliant with Ecma-48 51 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 52 | # a case would tend to support setf rather than setaf.) 53 | color_prompt=yes 54 | else 55 | color_prompt= 56 | fi 57 | fi 58 | 59 | if [ "$color_prompt" = yes ]; then 60 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 61 | else 62 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 63 | fi 64 | unset color_prompt force_color_prompt 65 | 66 | # If this is an xterm set the title to user@host:dir 67 | case "$TERM" in 68 | xterm*|rxvt*) 69 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 70 | ;; 71 | *) 72 | ;; 73 | esac 74 | 75 | # enable color support of ls and also add handy aliases 76 | if [ -x /usr/bin/dircolors ]; then 77 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 78 | alias ls='ls --color=auto' 79 | #alias dir='dir --color=auto' 80 | #alias vdir='vdir --color=auto' 81 | 82 | alias grep='grep --color=auto' 83 | alias fgrep='fgrep --color=auto' 84 | alias egrep='egrep --color=auto' 85 | fi 86 | 87 | # colored GCC warnings and errors 88 | #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' 89 | 90 | # some more ls aliases 91 | alias ll='ls -alF' 92 | alias la='ls -A' 93 | alias l='ls -CF' 94 | 95 | # Add an "alert" alias for long running commands. Use like so: 96 | # sleep 10; alert 97 | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 98 | alias vim=nvim 99 | 100 | # Alias definitions. 101 | # You may want to put all your additions into a separate file like 102 | # ~/.bash_aliases, instead of adding them here directly. 103 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 104 | 105 | if [ -f ~/.bash_aliases ]; then 106 | . ~/.bash_aliases 107 | fi 108 | alias k=kubectl 109 | # enable programmable completion features (you don't need to enable 110 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 111 | # sources /etc/bash.bashrc). 112 | if ! shopt -oq posix; then 113 | if [ -f /usr/share/bash-completion/bash_completion ]; then 114 | . /usr/share/bash-completion/bash_completion 115 | elif [ -f /etc/bash_completion ]; then 116 | . /etc/bash_completion 117 | fi 118 | fi 119 | export PATH=$HOME/bin:$PATH 120 | export GOROOT=/usr/local/go 121 | export GOPATH=$HOME/go 122 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH 123 | . "$HOME/.cargo/env" 124 | 125 | export NVM_DIR="$HOME/.nvm" 126 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 127 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 128 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/plugins/completion.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "saghen/blink.cmp", 3 | enabled = true, 4 | tag = "v0.10.0", -- Replace with a specific tag version 5 | dependencies = { 6 | "moyiz/blink-emoji.nvim", 7 | }, 8 | opts = function(_, opts) 9 | -- Merge custom sources with the existing ones from lazyvim 10 | -- NOTE: by default lazyvim already includes the lazydev source, so not 11 | -- adding it here again 12 | opts.enabled = function() 13 | -- Get the current buffer's filetype 14 | local filetype = vim.bo[0].filetype 15 | -- Disable for Telescope buffers 16 | if filetype == "TelescopePrompt" or filetype == "minifiles" then 17 | return false 18 | end 19 | return true 20 | end 21 | 22 | opts.sources = vim.tbl_deep_extend("force", opts.sources or {}, { 23 | default = { "lsp", "path", "snippets", "buffer", "emoji" }, 24 | providers = { 25 | lsp = { 26 | name = "lsp", 27 | enabled = true, 28 | module = "blink.cmp.sources.lsp", 29 | -- When linking markdown notes, I would get snippets and text in the 30 | -- suggestions, I want those to show only if there are no LSP 31 | -- suggestions 32 | -- fallbacks = { "snippets", "luasnip", "buffer" }, 33 | score_offset = 90, -- the higher the number, the higher the priority 34 | }, 35 | path = { 36 | name = "Path", 37 | module = "blink.cmp.sources.path", 38 | score_offset = 25, 39 | -- When typing a path, I would get snippets and text in the 40 | -- suggestions, I want those to show only if there are no path 41 | -- suggestions 42 | fallbacks = { "snippets", "buffer" }, 43 | opts = { 44 | trailing_slash = false, 45 | label_trailing_slash = true, 46 | get_cwd = function(context) 47 | return vim.fn.expand(("#%d:p:h"):format(context.bufnr)) 48 | end, 49 | show_hidden_files_by_default = true, 50 | }, 51 | }, 52 | buffer = { 53 | name = "Buffer", 54 | enabled = true, 55 | max_items = 5, 56 | min_keyword_length = 3, 57 | module = "blink.cmp.sources.buffer", 58 | score_offset = 15, -- the higher the number, the higher the priority 59 | }, 60 | snippets = { 61 | name = "snippets", 62 | enabled = true, 63 | max_items = 8, 64 | min_keyword_length = 2, 65 | module = "blink.cmp.sources.snippets", 66 | score_offset = 85, -- the higher the number, the higher the priority 67 | }, 68 | emoji = { 69 | module = "blink-emoji", 70 | name = "Emoji", 71 | score_offset = 15, -- the higher the number, the higher the priority 72 | opts = { insert = true }, -- Insert emoji (default) or complete its name 73 | }, 74 | }, 75 | cmdline = function() 76 | local type = vim.fn.getcmdtype() 77 | if type == "/" or type == "?" then 78 | return { "buffer" } 79 | end 80 | if type == ":" then 81 | return { "cmdline" } 82 | end 83 | return {} 84 | end, 85 | }) 86 | 87 | opts.completion = { 88 | -- keyword = { 89 | -- -- 'prefix' will fuzzy match on the text before the cursor 90 | -- -- 'full' will fuzzy match on the text before *and* after the cursor 91 | -- -- example: 'foo_|_bar' will match 'foo_' for 'prefix' and 'foo__bar' for 'full' 92 | -- range = "full", 93 | -- }, 94 | menu = { 95 | border = "single", 96 | }, 97 | documentation = { 98 | auto_show = true, 99 | window = { 100 | border = "single", 101 | }, 102 | }, 103 | -- Displays a preview of the selected item on the current line 104 | ghost_text = { 105 | enabled = true, 106 | }, 107 | } 108 | 109 | -- This comes from the luasnip extra, if you don't add it, won't be able to 110 | -- jump forward or backward in luasnip snippets 111 | -- https://www.lazyvim.org/extras/coding/luasnip#blinkcmp-optional 112 | opts.snippets = { 113 | preset = "luasnip", 114 | expand = function(snippet) 115 | require("luasnip").lsp_expand(snippet) 116 | end, 117 | active = function(filter) 118 | if filter and filter.direction then 119 | return require("luasnip").jumpable(filter.direction) 120 | end 121 | return require("luasnip").in_snippet() 122 | end, 123 | jump = function(direction) 124 | require("luasnip").jump(direction) 125 | end, 126 | } 127 | 128 | -- The default preset used by lazyvim accepts completions with enter 129 | -- I don't like using enter because if on markdown and typing 130 | -- something, but you want to go to the line below, if you press enter, 131 | -- the completion will be accepted 132 | -- https://cmp.saghen.dev/configuration/keymap.html#default 133 | opts.keymap = { 134 | preset = "default", 135 | [""] = { "snippet_forward", "fallback" }, 136 | [""] = { "snippet_backward", "fallback" }, 137 | 138 | [""] = { "select_prev", "fallback" }, 139 | [""] = { "select_next", "fallback" }, 140 | [""] = { "select_prev", "fallback" }, 141 | [""] = { "select_next", "fallback" }, 142 | 143 | [""] = { "scroll_documentation_up", "fallback" }, 144 | [""] = { "scroll_documentation_down", "fallback" }, 145 | 146 | [""] = { "show", "show_documentation", "hide_documentation" }, 147 | [""] = { "hide", "fallback" }, 148 | } 149 | opts.signature = { 150 | enabled = true, 151 | } 152 | 153 | return opts 154 | end, 155 | } 156 | -------------------------------------------------------------------------------- /workspace/scripts/executable_todoist: -------------------------------------------------------------------------------- 1 | #! /usr/bin/zsh 2 | 3 | fetch_daily_tasks () 4 | { 5 | response=$(curl -X GET \ 6 | "https://api.todoist.com/rest/v2/tasks?filter=today"\ 7 | -H "Authorization: Bearer $TODOIST_API_KEY") 8 | 9 | echo "$response" | jq -c '.[] | {id: .id, content: .content, due: .due, duration: .duration}' 10 | } 11 | 12 | close_task() { 13 | task_id=$1 14 | response=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ 15 | -H "Authorization: Bearer $TODOIST_API_KEY" \ 16 | "https://api.todoist.com/rest/v2/tasks/$task_id/close") 17 | 18 | # Check the response code 19 | if [[ "$response" -eq 204 ]]; then 20 | echo "Task $task_id successfully closed." 21 | else 22 | echo "Failed to close task $task_id. HTTP status: $response" 23 | fi 24 | } 25 | 26 | write_tasks_today_note (){ 27 | today=$(date +"%d-%m-%Y") 28 | tomorrow=$(date -d "tomorrow" +"%d-%m-%Y") 29 | yesterday=$(date -d "yesterday" +"%d-%m-%Y") 30 | file="${VAULT}Journal/$today.md" 31 | 32 | awk '/## Daily Deeds & Rituals/ {print; exit} {print}' "$file" > temp.txt && mv temp.txt "$file" 33 | 34 | if [ -f "$file" ]; then 35 | echo "" >> "$file" 36 | fetch_daily_tasks | while read -r task; do 37 | # Extract the task content and due time using jq 38 | task_id=$(echo "$task" | jq -r '.id') 39 | task_datetime=$(echo "$task" | jq -r '.due.datetime // empty') 40 | task_content=$(echo "$task" | jq -r '.content') 41 | task_duration=$(echo "$task" | jq -r '.duration.amount // empty') 42 | 43 | task_output="- [ ] id: $task_id, content: $task_content" 44 | 45 | if [[ -n "$task_datetime" ]]; then 46 | formatted_datetime=$(date -d "$task_datetime" +"%H:%M") 47 | task_output="${task_output} - $formatted_datetime" 48 | fi 49 | 50 | if [[ -n "$task_duration" ]]; then 51 | task_output="${task_output} - $task_duration min" 52 | fi 53 | 54 | echo "$task_output" >> "$file" 55 | done 56 | 57 | echo "Tasks written to $file" 58 | fi 59 | } 60 | 61 | get_daily_tasks () 62 | { 63 | fetch_daily_tasks | while read -r task; do 64 | # Extract the task content and due time using jq 65 | task_id=$(echo "$task" | jq -r '.id') 66 | task_datetime=$(echo "$task" | jq -r '.due.datetime // empty') 67 | task_content=$(echo "$task" | jq -r '.content') 68 | task_duration=$(echo "$task" | jq -r '.duration.amount // empty') 69 | 70 | task_output="id: $task_id, content: $task_content" 71 | 72 | if [[ -n "$task_datetime" ]]; then 73 | formatted_datetime=$(date -d "$task_datetime" +"%H:%M") 74 | task_output="${task_output} - $formatted_datetime" 75 | fi 76 | 77 | if [[ -n "$task_duration" ]]; then 78 | task_output="${task_output} - ${task_duration}min" 79 | fi 80 | 81 | echo "$task_output" 82 | done 83 | } 84 | 85 | add_task_to_todoist () { 86 | echo -n "Enter the task content: " 87 | read -r content 88 | echo -n "Enter the task duration in minutes: " 89 | read -r duration 90 | echo -n "Enter the task due date (tomorrow at 12:00): " 91 | read -r due_string 92 | 93 | body=$(printf '{"content": "%s", "duration": %s, "duration_unit": "minute", "due_string": "%s", "due_lang": "en", "priority": 4}' \ 94 | "$content" "$duration" "$due_string") 95 | 96 | echo "Generated JSON Payload: $body" # Debugging line echo $body 97 | if [[ -n "$content" ]]; then 98 | response=$(curl -X POST \ 99 | -H "Content-Type: application/json" \ 100 | -H "Authorization: Bearer $TODOIST_API_KEY" \ 101 | -H "X-Request-Id: $(uuidgen)" \ 102 | --data "$body"\ 103 | "https://api.todoist.com/rest/v2/tasks") 104 | 105 | # Check the response code 106 | if echo "$response" | jq -e . >/dev/null 2>&1; then 107 | echo "Task successfully added." 108 | else 109 | echo "Failed to add task. HTTP status: $response" 110 | fi 111 | else 112 | echo "No task content provided. Operation canceled." 113 | fi 114 | 115 | } 116 | 117 | if [ "$#" -eq 0 ]; then 118 | refresh_tasks_to_obsidian 119 | else 120 | case "$1" in 121 | "sync") 122 | write_tasks_today_note 123 | ;; 124 | "resync") 125 | refresh_tasks_to_obsidian 126 | ;; 127 | "refresh") 128 | refresh_tasks_to_obsidian 129 | ;; 130 | "add") 131 | add_task_to_todoist 132 | ;; 133 | "delete") 134 | read -r id -p "Enter the task id to delete: " 135 | delete_task_from_todoist $id 136 | ;; 137 | "get") 138 | get_daily_tasks 139 | ;; 140 | "close") 141 | echo -n "Enter the task ID to close: " 142 | read -r id 143 | 144 | if [[ -n "$id" ]]; then 145 | close_task "$id" # Call the function with the ID as an argument 146 | else 147 | echo "No task ID provided. Operation canceled." 148 | fi 149 | ;; 150 | *) echo "No valid flag provided" 151 | ;; 152 | esac 153 | 154 | fi 155 | 156 | -------------------------------------------------------------------------------- /dot_config/nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, 3 | "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, 4 | "blink-emoji.nvim": { "branch": "master", "commit": "a77aebc092ebece1eed108f301452ae774d6b67a" }, 5 | "blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" }, 6 | "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, 7 | "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, 8 | "conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" }, 9 | "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, 10 | "dooing": { "branch": "main", "commit": "fa55fb5aa889f5d84095a8fa2a1a2c7f08f31289" }, 11 | "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, 12 | "gruvbox-material.nvim": { "branch": "master", "commit": "5de287d8fff70ee73a706c3c95a82f2060741b3e" }, 13 | "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, 14 | "inc-rename.nvim": { "branch": "main", "commit": "f9b9e5b9a75074810f40881b7e254b5bbeaf122e" }, 15 | "incline.nvim": { "branch": "main", "commit": "0eb5b7f6fc6636a4e7b2eb2800b7650fd6d164a2" }, 16 | "indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" }, 17 | "lazy.nvim": { "branch": "main", "commit": "a8c6db5da7bd382094606340eed015d14fbb5654" }, 18 | "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, 19 | "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, 20 | "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, 21 | "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, 22 | "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, 23 | "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, 24 | "mini.bufremove": { "branch": "main", "commit": "bba1d8b413d37081756f59200b8cf756181e5b9a" }, 25 | "neo-tree.nvim": { "branch": "main", "commit": "fbc0abef52e4d02c4520efce1318725a21995dc4" }, 26 | "no-neck-pain.nvim": { "branch": "main", "commit": "860462dd8b3d36861a81724a7b473db279f673f2" }, 27 | "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, 28 | "nvim-bqf": { "branch": "main", "commit": "ebb6d2689e4427452180f17c53f29f7e460236f1" }, 29 | "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, 30 | "nvim-dap": { "branch": "master", "commit": "379cf26e9c457b66a0152cd5d018418c03720d47" }, 31 | "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, 32 | "nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" }, 33 | "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, 34 | "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, 35 | "nvim-lspconfig": { "branch": "master", "commit": "9e932edb0af4e20880685ddb96a231669fbe8091" }, 36 | "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, 37 | "nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" }, 38 | "nvim-treesitter": { "branch": "master", "commit": "f0ff9f0e5dab10123d3192b12556aa8f88859790" }, 39 | "nvim-web-devicons": { "branch": "master", "commit": "6b53401918a9033a41159d012160c5fb5eb249ae" }, 40 | "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, 41 | "oil.nvim": { "branch": "master", "commit": "975a77cce3c8cb742bc1b3629f4328f5ca977dad" }, 42 | "one-small-step-for-vimkind": { "branch": "main", "commit": "b9def31568d20b16f7da9479a4174d165046fe8a" }, 43 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 44 | "render-markdown.nvim": { "branch": "main", "commit": "4d754be0734aefa0df4aa016d3c6993cf6d40311" }, 45 | "telescope-cmdline.nvim": { "branch": "main", "commit": "8b05928ac1b9f2b772cedde891faa6669b0ec59a" }, 46 | "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, 47 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" }, 48 | "telescope-ghissue.nvim": { "branch": "main", "commit": "f81adba05969d0727c4a4f7d5d6d0992f7248d24" }, 49 | "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, 50 | "trouble.nvim": { "branch": "main", "commit": "748ca2789044607f19786b1d837044544c55e80a" }, 51 | "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, 52 | "undotree": { "branch": "master", "commit": "2556c6800b210b2096b55b66e74b4cc1d9ebbe4f" }, 53 | "vim-dadbod": { "branch": "master", "commit": "9f0ca8bcef704659820a95c3bbd2c262583a66a1" }, 54 | "vim-dadbod-completion": { "branch": "master", "commit": "464da308a988b5c8b136777a50182332b04f8d9f" }, 55 | "vim-dadbod-ui": { "branch": "master", "commit": "f4d37b7312ae6489e5c04bee654ca521baac188a" }, 56 | "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, 57 | "yanky.nvim": { "branch": "main", "commit": "9543d4c6c537720419bccb3338c4ddd5bb6fbd44" }, 58 | "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } 59 | } 60 | -------------------------------------------------------------------------------- /dot_config/nvim/lua/utils/autocmd.lua: -------------------------------------------------------------------------------- 1 | local log = require("plenary.log"):new() 2 | local ns = vim.api.nvim_create_namespace("live-tests") 3 | local group = vim.api.nvim_create_augroup("devfortunato-magic", { clear = true }) 4 | 5 | local test_function_query_string = [[ 6 | ( 7 | (function_declaration 8 | name: (identifier) @name 9 | parameters: 10 | (parameter_list 11 | (parameter_declaration 12 | name: (identifier) 13 | type: (pointer_type 14 | (qualified_type 15 | package: (package_identifier) @_package_name 16 | name: (type_identifier) @_type_name))))) 17 | 18 | (#eq? @_package_name "testing") 19 | (#eq? @_type_name "T") 20 | (#eq? @name "%s") 21 | ) 22 | ]] 23 | 24 | local find_test_line = function(go_bufnr, name) 25 | local formatted = string.format(test_function_query_string, name) 26 | local query = vim.treesitter.query.parse("go", formatted) 27 | local parser = vim.treesitter.get_parser(go_bufnr, "go", {}) 28 | local tree = parser:parse()[1] 29 | local root = tree:root() 30 | for id, node in query:iter_captures(root, go_bufnr, 0, -1) do 31 | if id == 1 then 32 | local range = { node:range() } 33 | return range[1] 34 | end 35 | end 36 | end 37 | 38 | log.level = "debug" 39 | 40 | local make_key = function(entry) 41 | assert(entry.Package, "Must have Package:" .. vim.inspect(entry)) 42 | assert(entry.Test, "Must have Test:" .. vim.inspect(entry)) 43 | return string.format("%s/%s", entry.Package, entry.Test) 44 | end 45 | 46 | local add_golang_test = function(state, entry) 47 | state.tests[make_key(entry)] = { 48 | name = entry.Test, 49 | line = find_test_line(state.bufnr, entry.Test), 50 | output = {}, 51 | } 52 | end 53 | 54 | local add_golang_output = function(state, entry) 55 | assert(state.tests, vim.inspect(state)) 56 | table.insert(state.tests[make_key(entry)].output, vim.trim(entry.Output)) 57 | end 58 | 59 | local test_ouput = function(bufnr, entry) 60 | print("output here") 61 | assert(entry.output, vim.inspect(entry)) 62 | local line_count = vim.api.nvim_buf_line_count(bufnr) 63 | print(line_count) 64 | if line_count <= 1 then 65 | vim.api.nvim_open_win(bufnr, true, { 66 | split = "left", 67 | win = 0, 68 | }) 69 | vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, entry.output) 70 | else 71 | vim.api.nvim_buf_set_lines(bufnr, line_count, line_count, false, entry.output) 72 | end 73 | end 74 | 75 | local mark_success = function(state, entry) 76 | state.tests[make_key(entry)].success = entry.Action == "pass" 77 | end 78 | 79 | local attach_to_buffer = function(output_bufnr, pattern, command) 80 | local state = { 81 | bufnr = output_bufnr, 82 | tests = {}, 83 | } 84 | -- vim.api.nvim_buf_create_user_command(output_bufnr, "GoTestLineDiag", function() 85 | -- local line = vim.fn.line "." - 1 86 | -- for _, test in pairs(state.tests) do 87 | -- if test.line == line then 88 | -- vim.cmd.new() 89 | -- vim.api.nvim_buf_set_lines(vim.api.nvim_get_current_buf(), 0, -1, false, test.output) 90 | -- end 91 | -- end 92 | -- end, {}) 93 | 94 | vim.api.nvim_create_autocmd("BufWritePost", { 95 | group = group, 96 | pattern = pattern, 97 | callback = function() 98 | vim.api.nvim_buf_clear_namespace(output_bufnr, ns, 0, -1) 99 | vim.fn.jobstart(command, { 100 | stdout_buffered = true, 101 | on_stdout = function(_, data) 102 | for _, line in pairs(data) do 103 | local decoded = vim.json.decode(line) 104 | if decoded.Action == "run" then 105 | add_golang_test(state, decoded) 106 | elseif decoded.Action == "pass" or decoded.Action == "fail" then 107 | mark_success(state, decoded) 108 | local test = state.tests[make_key(decoded)] 109 | if test.success then 110 | local text = { "✓" } 111 | vim.api.nvim_buf_set_extmark(output_bufnr, ns, test.line, 0, { 112 | virt_text = { text }, 113 | }) 114 | end 115 | elseif decoded.Action == "output" then 116 | if not decoded.Test then 117 | return 118 | end 119 | add_golang_output(state, decoded) 120 | end 121 | end 122 | end, 123 | on_exit = function() 124 | local failed = {} 125 | local bufnr = vim.api.nvim_create_buf(false, true) 126 | for _, test in pairs(state.tests) do 127 | if test.line then 128 | if not test.success then 129 | print("Test not success") 130 | test_ouput(bufnr, test) 131 | table.insert(failed, { 132 | bufnr = output_bufnr, 133 | lnum = test.line, 134 | col = 0, 135 | severity = vim.diagnostic.severity.ERROR, 136 | source = "go-test", 137 | message = "failed", 138 | -- message = test_ouput(output_bufnr, test), 139 | user_data = {}, 140 | }) 141 | end 142 | end 143 | end 144 | vim.diagnostic.set(ns, output_bufnr, failed, {}) 145 | end, 146 | }) 147 | end, 148 | }) 149 | end 150 | vim.api.nvim_create_user_command("GoTestRun", function() 151 | print("GoTestRun started") 152 | attach_to_buffer(vim.api.nvim_get_current_buf(), "*.go", { "go", "test", "./...", "-v", "-json" }) 153 | end, {}) 154 | 155 | -- vim.api.nvim_create_autocmd("BufWritePre", { 156 | -- group = group, 157 | -- pattern = "go", 158 | -- desc = "Remove withespace on save", 159 | -- command = "%s/\\s\\+$//e", 160 | -- }) 161 | 162 | -- Toggle inline hinting 163 | vim.api.nvim_create_user_command("EnableInline", function() 164 | vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }), nil) 165 | end, {}) 166 | 167 | vim.api.nvim_create_user_command("ObsidianNewFromTemplate", function() 168 | vim.cmd("ObsidianNew") 169 | vim.cmd("normal! G") -- go to end of file 170 | vim.cmd("ObsidianTemplate") 171 | end, {}) 172 | 173 | vim.api.nvim_create_autocmd("User", { 174 | pattern = "TelescopePreviewerLoaded", 175 | callback = function(args) 176 | if args.data.filetype ~= "help" then 177 | vim.wo.number = true 178 | elseif args.data.bufname:match("*.csv") then 179 | vim.wo.wrap = false 180 | end 181 | end, 182 | }) 183 | -- vim.api.nvim_create_autocmd({ "LspAttach", "InsertEnter", "InsertLeave" }, { 184 | -- group = group, 185 | -- pattern = "*", 186 | -- callback = function(args) 187 | -- local enabled = args.event ~= "InsertEnter" 188 | -- vim.lsp.inlay_hint.enable(enabled, { bufnr = args.buf }) 189 | -- end, 190 | -- }) 191 | -- vim.api.nvim_create_autocmd({"BufEnter", "FileType"}, { 192 | -- group = group, 193 | -- pattern = "*", 194 | -- desc = "don't autocomment new line", 195 | -- command = "setlocal formatoptions-=c fortmatoptions-=r formatoptions-=o", 196 | -- }) 197 | -- 198 | -- 199 | -- Custom terminal 200 | vim.api.nvim_create_autocmd("TermOpen", { 201 | group = vim.api.nvim_create_augroup("custom-term-open", { clear = true }), 202 | callback = function() 203 | vim.opt.number = false 204 | vim.opt.relativenumber = false 205 | end, 206 | }) 207 | -------------------------------------------------------------------------------- /dot_zfunc/_cobra-cli: -------------------------------------------------------------------------------- 1 | #compdef _cobra-cli cobra-cli 2 | 3 | # zsh completion for cobra-cli -*- shell-script -*- 4 | 5 | __cobra-cli_debug() 6 | { 7 | local file="$BASH_COMP_DEBUG_FILE" 8 | if [[ -n ${file} ]]; then 9 | echo "$*" >> "${file}" 10 | fi 11 | } 12 | 13 | _cobra-cli() 14 | { 15 | local shellCompDirectiveError=1 16 | local shellCompDirectiveNoSpace=2 17 | local shellCompDirectiveNoFileComp=4 18 | local shellCompDirectiveFilterFileExt=8 19 | local shellCompDirectiveFilterDirs=16 20 | 21 | local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace 22 | local -a completions 23 | 24 | __cobra-cli_debug "\n========= starting completion logic ==========" 25 | __cobra-cli_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" 26 | 27 | # The user could have moved the cursor backwards on the command-line. 28 | # We need to trigger completion from the $CURRENT location, so we need 29 | # to truncate the command-line ($words) up to the $CURRENT location. 30 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) 31 | words=("${=words[1,CURRENT]}") 32 | __cobra-cli_debug "Truncated words[*]: ${words[*]}," 33 | 34 | lastParam=${words[-1]} 35 | lastChar=${lastParam[-1]} 36 | __cobra-cli_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" 37 | 38 | # For zsh, when completing a flag with an = (e.g., cobra-cli -n=) 39 | # completions must be prefixed with the flag 40 | setopt local_options BASH_REMATCH 41 | if [[ "${lastParam}" =~ '-.*=' ]]; then 42 | # We are dealing with a flag with an = 43 | flagPrefix="-P ${BASH_REMATCH}" 44 | fi 45 | 46 | # Prepare the command to obtain completions 47 | requestComp="${words[1]} __complete ${words[2,-1]}" 48 | if [ "${lastChar}" = "" ]; then 49 | # If the last parameter is complete (there is a space following it) 50 | # We add an extra empty parameter so we can indicate this to the go completion code. 51 | __cobra-cli_debug "Adding extra empty parameter" 52 | requestComp="${requestComp} \"\"" 53 | fi 54 | 55 | __cobra-cli_debug "About to call: eval ${requestComp}" 56 | 57 | # Use eval to handle any environment variables and such 58 | out=$(eval ${requestComp} 2>/dev/null) 59 | __cobra-cli_debug "completion output: ${out}" 60 | 61 | # Extract the directive integer following a : from the last line 62 | local lastLine 63 | while IFS='\n' read -r line; do 64 | lastLine=${line} 65 | done < <(printf "%s\n" "${out[@]}") 66 | __cobra-cli_debug "last line: ${lastLine}" 67 | 68 | if [ "${lastLine[1]}" = : ]; then 69 | directive=${lastLine[2,-1]} 70 | # Remove the directive including the : and the newline 71 | local suffix 72 | (( suffix=${#lastLine}+2)) 73 | out=${out[1,-$suffix]} 74 | else 75 | # There is no directive specified. Leave $out as is. 76 | __cobra-cli_debug "No directive found. Setting do default" 77 | directive=0 78 | fi 79 | 80 | __cobra-cli_debug "directive: ${directive}" 81 | __cobra-cli_debug "completions: ${out}" 82 | __cobra-cli_debug "flagPrefix: ${flagPrefix}" 83 | 84 | if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 85 | __cobra-cli_debug "Completion received error. Ignoring completions." 86 | return 87 | fi 88 | 89 | while IFS='\n' read -r comp; do 90 | if [ -n "$comp" ]; then 91 | # If requested, completions are returned with a description. 92 | # The description is preceded by a TAB character. 93 | # For zsh's _describe, we need to use a : instead of a TAB. 94 | # We first need to escape any : as part of the completion itself. 95 | comp=${comp//:/\\:} 96 | 97 | local tab=$(printf '\t') 98 | comp=${comp//$tab/:} 99 | 100 | __cobra-cli_debug "Adding completion: ${comp}" 101 | completions+=${comp} 102 | lastComp=$comp 103 | fi 104 | done < <(printf "%s\n" "${out[@]}") 105 | 106 | if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 107 | __cobra-cli_debug "Activating nospace." 108 | noSpace="-S ''" 109 | fi 110 | 111 | if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 112 | # File extension filtering 113 | local filteringCmd 114 | filteringCmd='_files' 115 | for filter in ${completions[@]}; do 116 | if [ ${filter[1]} != '*' ]; then 117 | # zsh requires a glob pattern to do file filtering 118 | filter="\*.$filter" 119 | fi 120 | filteringCmd+=" -g $filter" 121 | done 122 | filteringCmd+=" ${flagPrefix}" 123 | 124 | __cobra-cli_debug "File filtering command: $filteringCmd" 125 | _arguments '*:filename:'"$filteringCmd" 126 | elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 127 | # File completion for directories only 128 | local subdir 129 | subdir="${completions[1]}" 130 | if [ -n "$subdir" ]; then 131 | __cobra-cli_debug "Listing directories in $subdir" 132 | pushd "${subdir}" >/dev/null 2>&1 133 | else 134 | __cobra-cli_debug "Listing directories in ." 135 | fi 136 | 137 | local result 138 | _arguments '*:dirname:_files -/'" ${flagPrefix}" 139 | result=$? 140 | if [ -n "$subdir" ]; then 141 | popd >/dev/null 2>&1 142 | fi 143 | return $result 144 | else 145 | __cobra-cli_debug "Calling _describe" 146 | if eval _describe "completions" completions $flagPrefix $noSpace; then 147 | __cobra-cli_debug "_describe found some completions" 148 | 149 | # Return the success of having called _describe 150 | return 0 151 | else 152 | __cobra-cli_debug "_describe did not find completions." 153 | __cobra-cli_debug "Checking if we should do file completion." 154 | if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 155 | __cobra-cli_debug "deactivating file completion" 156 | 157 | # We must return an error code here to let zsh know that there were no 158 | # completions found by _describe; this is what will trigger other 159 | # matching algorithms to attempt to find completions. 160 | # For example zsh can match letters in the middle of words. 161 | return 1 162 | else 163 | # Perform file completion 164 | __cobra-cli_debug "Activating file completion" 165 | 166 | # We must return the result of this command, so it must be the 167 | # last command, or else we must store its result to return it. 168 | _arguments '*:filename:_files'" ${flagPrefix}" 169 | fi 170 | fi 171 | fi 172 | } 173 | 174 | # don't run the completion function when being source-ed or eval-ed 175 | if [ "$funcstack[1]" = "_cobra-cli" ]; then 176 | _cobra-cli 177 | fi 178 | -------------------------------------------------------------------------------- /dot_zfunc/_helm: -------------------------------------------------------------------------------- 1 | #compdef helm 2 | compdef _helm helm 3 | 4 | # zsh completion for helm -*- shell-script -*- 5 | 6 | __helm_debug() 7 | { 8 | local file="$BASH_COMP_DEBUG_FILE" 9 | if [[ -n ${file} ]]; then 10 | echo "$*" >> "${file}" 11 | fi 12 | } 13 | 14 | _helm() 15 | { 16 | local shellCompDirectiveError=1 17 | local shellCompDirectiveNoSpace=2 18 | local shellCompDirectiveNoFileComp=4 19 | local shellCompDirectiveFilterFileExt=8 20 | local shellCompDirectiveFilterDirs=16 21 | local shellCompDirectiveKeepOrder=32 22 | 23 | local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder 24 | local -a completions 25 | 26 | __helm_debug "\n========= starting completion logic ==========" 27 | __helm_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" 28 | 29 | # The user could have moved the cursor backwards on the command-line. 30 | # We need to trigger completion from the $CURRENT location, so we need 31 | # to truncate the command-line ($words) up to the $CURRENT location. 32 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) 33 | words=("${=words[1,CURRENT]}") 34 | __helm_debug "Truncated words[*]: ${words[*]}," 35 | 36 | lastParam=${words[-1]} 37 | lastChar=${lastParam[-1]} 38 | __helm_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" 39 | 40 | # For zsh, when completing a flag with an = (e.g., helm -n=) 41 | # completions must be prefixed with the flag 42 | setopt local_options BASH_REMATCH 43 | if [[ "${lastParam}" =~ '-.*=' ]]; then 44 | # We are dealing with a flag with an = 45 | flagPrefix="-P ${BASH_REMATCH}" 46 | fi 47 | 48 | # Prepare the command to obtain completions 49 | requestComp="${words[1]} __complete ${words[2,-1]}" 50 | if [ "${lastChar}" = "" ]; then 51 | # If the last parameter is complete (there is a space following it) 52 | # We add an extra empty parameter so we can indicate this to the go completion code. 53 | __helm_debug "Adding extra empty parameter" 54 | requestComp="${requestComp} \"\"" 55 | fi 56 | 57 | __helm_debug "About to call: eval ${requestComp}" 58 | 59 | # Use eval to handle any environment variables and such 60 | out=$(eval ${requestComp} 2>/dev/null) 61 | __helm_debug "completion output: ${out}" 62 | 63 | # Extract the directive integer following a : from the last line 64 | local lastLine 65 | while IFS='\n' read -r line; do 66 | lastLine=${line} 67 | done < <(printf "%s\n" "${out[@]}") 68 | __helm_debug "last line: ${lastLine}" 69 | 70 | if [ "${lastLine[1]}" = : ]; then 71 | directive=${lastLine[2,-1]} 72 | # Remove the directive including the : and the newline 73 | local suffix 74 | (( suffix=${#lastLine}+2)) 75 | out=${out[1,-$suffix]} 76 | else 77 | # There is no directive specified. Leave $out as is. 78 | __helm_debug "No directive found. Setting do default" 79 | directive=0 80 | fi 81 | 82 | __helm_debug "directive: ${directive}" 83 | __helm_debug "completions: ${out}" 84 | __helm_debug "flagPrefix: ${flagPrefix}" 85 | 86 | if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 87 | __helm_debug "Completion received error. Ignoring completions." 88 | return 89 | fi 90 | 91 | local activeHelpMarker="_activeHelp_ " 92 | local endIndex=${#activeHelpMarker} 93 | local startIndex=$((${#activeHelpMarker}+1)) 94 | local hasActiveHelp=0 95 | while IFS='\n' read -r comp; do 96 | # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) 97 | if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then 98 | __helm_debug "ActiveHelp found: $comp" 99 | comp="${comp[$startIndex,-1]}" 100 | if [ -n "$comp" ]; then 101 | compadd -x "${comp}" 102 | __helm_debug "ActiveHelp will need delimiter" 103 | hasActiveHelp=1 104 | fi 105 | 106 | continue 107 | fi 108 | 109 | if [ -n "$comp" ]; then 110 | # If requested, completions are returned with a description. 111 | # The description is preceded by a TAB character. 112 | # For zsh's _describe, we need to use a : instead of a TAB. 113 | # We first need to escape any : as part of the completion itself. 114 | comp=${comp//:/\\:} 115 | 116 | local tab="$(printf '\t')" 117 | comp=${comp//$tab/:} 118 | 119 | __helm_debug "Adding completion: ${comp}" 120 | completions+=${comp} 121 | lastComp=$comp 122 | fi 123 | done < <(printf "%s\n" "${out[@]}") 124 | 125 | # Add a delimiter after the activeHelp statements, but only if: 126 | # - there are completions following the activeHelp statements, or 127 | # - file completion will be performed (so there will be choices after the activeHelp) 128 | if [ $hasActiveHelp -eq 1 ]; then 129 | if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 130 | __helm_debug "Adding activeHelp delimiter" 131 | compadd -x "--" 132 | hasActiveHelp=0 133 | fi 134 | fi 135 | 136 | if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 137 | __helm_debug "Activating nospace." 138 | noSpace="-S ''" 139 | fi 140 | 141 | if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then 142 | __helm_debug "Activating keep order." 143 | keepOrder="-V" 144 | fi 145 | 146 | if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 147 | # File extension filtering 148 | local filteringCmd 149 | filteringCmd='_files' 150 | for filter in ${completions[@]}; do 151 | if [ ${filter[1]} != '*' ]; then 152 | # zsh requires a glob pattern to do file filtering 153 | filter="\*.$filter" 154 | fi 155 | filteringCmd+=" -g $filter" 156 | done 157 | filteringCmd+=" ${flagPrefix}" 158 | 159 | __helm_debug "File filtering command: $filteringCmd" 160 | _arguments '*:filename:'"$filteringCmd" 161 | elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 162 | # File completion for directories only 163 | local subdir 164 | subdir="${completions[1]}" 165 | if [ -n "$subdir" ]; then 166 | __helm_debug "Listing directories in $subdir" 167 | pushd "${subdir}" >/dev/null 2>&1 168 | else 169 | __helm_debug "Listing directories in ." 170 | fi 171 | 172 | local result 173 | _arguments '*:dirname:_files -/'" ${flagPrefix}" 174 | result=$? 175 | if [ -n "$subdir" ]; then 176 | popd >/dev/null 2>&1 177 | fi 178 | return $result 179 | else 180 | __helm_debug "Calling _describe" 181 | if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then 182 | __helm_debug "_describe found some completions" 183 | 184 | # Return the success of having called _describe 185 | return 0 186 | else 187 | __helm_debug "_describe did not find completions." 188 | __helm_debug "Checking if we should do file completion." 189 | if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 190 | __helm_debug "deactivating file completion" 191 | 192 | # We must return an error code here to let zsh know that there were no 193 | # completions found by _describe; this is what will trigger other 194 | # matching algorithms to attempt to find completions. 195 | # For example zsh can match letters in the middle of words. 196 | return 1 197 | else 198 | # Perform file completion 199 | __helm_debug "Activating file completion" 200 | 201 | # We must return the result of this command, so it must be the 202 | # last command, or else we must store its result to return it. 203 | _arguments '*:filename:_files'" ${flagPrefix}" 204 | fi 205 | fi 206 | fi 207 | } 208 | 209 | # don't run the completion function when being source-ed or eval-ed 210 | if [ "$funcstack[1]" = "_helm" ]; then 211 | _helm 212 | fi 213 | compdef _helm helm -------------------------------------------------------------------------------- /dot_zfunc/_flux: -------------------------------------------------------------------------------- 1 | #compdef flux 2 | compdef _flux flux 3 | 4 | # zsh completion for flux -*- shell-script -*- 5 | 6 | __flux_debug() 7 | { 8 | local file="$BASH_COMP_DEBUG_FILE" 9 | if [[ -n ${file} ]]; then 10 | echo "$*" >> "${file}" 11 | fi 12 | } 13 | 14 | _flux() 15 | { 16 | local shellCompDirectiveError=1 17 | local shellCompDirectiveNoSpace=2 18 | local shellCompDirectiveNoFileComp=4 19 | local shellCompDirectiveFilterFileExt=8 20 | local shellCompDirectiveFilterDirs=16 21 | local shellCompDirectiveKeepOrder=32 22 | 23 | local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder 24 | local -a completions 25 | 26 | __flux_debug "\n========= starting completion logic ==========" 27 | __flux_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" 28 | 29 | # The user could have moved the cursor backwards on the command-line. 30 | # We need to trigger completion from the $CURRENT location, so we need 31 | # to truncate the command-line ($words) up to the $CURRENT location. 32 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) 33 | words=("${=words[1,CURRENT]}") 34 | __flux_debug "Truncated words[*]: ${words[*]}," 35 | 36 | lastParam=${words[-1]} 37 | lastChar=${lastParam[-1]} 38 | __flux_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" 39 | 40 | # For zsh, when completing a flag with an = (e.g., flux -n=) 41 | # completions must be prefixed with the flag 42 | setopt local_options BASH_REMATCH 43 | if [[ "${lastParam}" =~ '-.*=' ]]; then 44 | # We are dealing with a flag with an = 45 | flagPrefix="-P ${BASH_REMATCH}" 46 | fi 47 | 48 | # Prepare the command to obtain completions 49 | requestComp="${words[1]} __complete ${words[2,-1]}" 50 | if [ "${lastChar}" = "" ]; then 51 | # If the last parameter is complete (there is a space following it) 52 | # We add an extra empty parameter so we can indicate this to the go completion code. 53 | __flux_debug "Adding extra empty parameter" 54 | requestComp="${requestComp} \"\"" 55 | fi 56 | 57 | __flux_debug "About to call: eval ${requestComp}" 58 | 59 | # Use eval to handle any environment variables and such 60 | out=$(eval ${requestComp} 2>/dev/null) 61 | __flux_debug "completion output: ${out}" 62 | 63 | # Extract the directive integer following a : from the last line 64 | local lastLine 65 | while IFS='\n' read -r line; do 66 | lastLine=${line} 67 | done < <(printf "%s\n" "${out[@]}") 68 | __flux_debug "last line: ${lastLine}" 69 | 70 | if [ "${lastLine[1]}" = : ]; then 71 | directive=${lastLine[2,-1]} 72 | # Remove the directive including the : and the newline 73 | local suffix 74 | (( suffix=${#lastLine}+2)) 75 | out=${out[1,-$suffix]} 76 | else 77 | # There is no directive specified. Leave $out as is. 78 | __flux_debug "No directive found. Setting do default" 79 | directive=0 80 | fi 81 | 82 | __flux_debug "directive: ${directive}" 83 | __flux_debug "completions: ${out}" 84 | __flux_debug "flagPrefix: ${flagPrefix}" 85 | 86 | if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 87 | __flux_debug "Completion received error. Ignoring completions." 88 | return 89 | fi 90 | 91 | local activeHelpMarker="_activeHelp_ " 92 | local endIndex=${#activeHelpMarker} 93 | local startIndex=$((${#activeHelpMarker}+1)) 94 | local hasActiveHelp=0 95 | while IFS='\n' read -r comp; do 96 | # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) 97 | if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then 98 | __flux_debug "ActiveHelp found: $comp" 99 | comp="${comp[$startIndex,-1]}" 100 | if [ -n "$comp" ]; then 101 | compadd -x "${comp}" 102 | __flux_debug "ActiveHelp will need delimiter" 103 | hasActiveHelp=1 104 | fi 105 | 106 | continue 107 | fi 108 | 109 | if [ -n "$comp" ]; then 110 | # If requested, completions are returned with a description. 111 | # The description is preceded by a TAB character. 112 | # For zsh's _describe, we need to use a : instead of a TAB. 113 | # We first need to escape any : as part of the completion itself. 114 | comp=${comp//:/\\:} 115 | 116 | local tab="$(printf '\t')" 117 | comp=${comp//$tab/:} 118 | 119 | __flux_debug "Adding completion: ${comp}" 120 | completions+=${comp} 121 | lastComp=$comp 122 | fi 123 | done < <(printf "%s\n" "${out[@]}") 124 | 125 | # Add a delimiter after the activeHelp statements, but only if: 126 | # - there are completions following the activeHelp statements, or 127 | # - file completion will be performed (so there will be choices after the activeHelp) 128 | if [ $hasActiveHelp -eq 1 ]; then 129 | if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 130 | __flux_debug "Adding activeHelp delimiter" 131 | compadd -x "--" 132 | hasActiveHelp=0 133 | fi 134 | fi 135 | 136 | if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 137 | __flux_debug "Activating nospace." 138 | noSpace="-S ''" 139 | fi 140 | 141 | if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then 142 | __flux_debug "Activating keep order." 143 | keepOrder="-V" 144 | fi 145 | 146 | if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 147 | # File extension filtering 148 | local filteringCmd 149 | filteringCmd='_files' 150 | for filter in ${completions[@]}; do 151 | if [ ${filter[1]} != '*' ]; then 152 | # zsh requires a glob pattern to do file filtering 153 | filter="\*.$filter" 154 | fi 155 | filteringCmd+=" -g $filter" 156 | done 157 | filteringCmd+=" ${flagPrefix}" 158 | 159 | __flux_debug "File filtering command: $filteringCmd" 160 | _arguments '*:filename:'"$filteringCmd" 161 | elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 162 | # File completion for directories only 163 | local subdir 164 | subdir="${completions[1]}" 165 | if [ -n "$subdir" ]; then 166 | __flux_debug "Listing directories in $subdir" 167 | pushd "${subdir}" >/dev/null 2>&1 168 | else 169 | __flux_debug "Listing directories in ." 170 | fi 171 | 172 | local result 173 | _arguments '*:dirname:_files -/'" ${flagPrefix}" 174 | result=$? 175 | if [ -n "$subdir" ]; then 176 | popd >/dev/null 2>&1 177 | fi 178 | return $result 179 | else 180 | __flux_debug "Calling _describe" 181 | if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then 182 | __flux_debug "_describe found some completions" 183 | 184 | # Return the success of having called _describe 185 | return 0 186 | else 187 | __flux_debug "_describe did not find completions." 188 | __flux_debug "Checking if we should do file completion." 189 | if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 190 | __flux_debug "deactivating file completion" 191 | 192 | # We must return an error code here to let zsh know that there were no 193 | # completions found by _describe; this is what will trigger other 194 | # matching algorithms to attempt to find completions. 195 | # For example zsh can match letters in the middle of words. 196 | return 1 197 | else 198 | # Perform file completion 199 | __flux_debug "Activating file completion" 200 | 201 | # We must return the result of this command, so it must be the 202 | # last command, or else we must store its result to return it. 203 | _arguments '*:filename:_files'" ${flagPrefix}" 204 | fi 205 | fi 206 | fi 207 | } 208 | 209 | # don't run the completion function when being source-ed or eval-ed 210 | if [ "$funcstack[1]" = "_flux" ]; then 211 | _flux 212 | fi 213 | compdef _flux flux 214 | -------------------------------------------------------------------------------- /dot_zfunc/_talosctl: -------------------------------------------------------------------------------- 1 | #compdef talosctl 2 | compdef _talosctl talosctl 3 | 4 | # zsh completion for talosctl -*- shell-script -*- 5 | 6 | __talosctl_debug() 7 | { 8 | local file="$BASH_COMP_DEBUG_FILE" 9 | if [[ -n ${file} ]]; then 10 | echo "$*" >> "${file}" 11 | fi 12 | } 13 | 14 | _talosctl() 15 | { 16 | local shellCompDirectiveError=1 17 | local shellCompDirectiveNoSpace=2 18 | local shellCompDirectiveNoFileComp=4 19 | local shellCompDirectiveFilterFileExt=8 20 | local shellCompDirectiveFilterDirs=16 21 | local shellCompDirectiveKeepOrder=32 22 | 23 | local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder 24 | local -a completions 25 | 26 | __talosctl_debug "\n========= starting completion logic ==========" 27 | __talosctl_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" 28 | 29 | # The user could have moved the cursor backwards on the command-line. 30 | # We need to trigger completion from the $CURRENT location, so we need 31 | # to truncate the command-line ($words) up to the $CURRENT location. 32 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) 33 | words=("${=words[1,CURRENT]}") 34 | __talosctl_debug "Truncated words[*]: ${words[*]}," 35 | 36 | lastParam=${words[-1]} 37 | lastChar=${lastParam[-1]} 38 | __talosctl_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" 39 | 40 | # For zsh, when completing a flag with an = (e.g., talosctl -n=) 41 | # completions must be prefixed with the flag 42 | setopt local_options BASH_REMATCH 43 | if [[ "${lastParam}" =~ '-.*=' ]]; then 44 | # We are dealing with a flag with an = 45 | flagPrefix="-P ${BASH_REMATCH}" 46 | fi 47 | 48 | # Prepare the command to obtain completions 49 | requestComp="${words[1]} __complete ${words[2,-1]}" 50 | if [ "${lastChar}" = "" ]; then 51 | # If the last parameter is complete (there is a space following it) 52 | # We add an extra empty parameter so we can indicate this to the go completion code. 53 | __talosctl_debug "Adding extra empty parameter" 54 | requestComp="${requestComp} \"\"" 55 | fi 56 | 57 | __talosctl_debug "About to call: eval ${requestComp}" 58 | 59 | # Use eval to handle any environment variables and such 60 | out=$(eval ${requestComp} 2>/dev/null) 61 | __talosctl_debug "completion output: ${out}" 62 | 63 | # Extract the directive integer following a : from the last line 64 | local lastLine 65 | while IFS='\n' read -r line; do 66 | lastLine=${line} 67 | done < <(printf "%s\n" "${out[@]}") 68 | __talosctl_debug "last line: ${lastLine}" 69 | 70 | if [ "${lastLine[1]}" = : ]; then 71 | directive=${lastLine[2,-1]} 72 | # Remove the directive including the : and the newline 73 | local suffix 74 | (( suffix=${#lastLine}+2)) 75 | out=${out[1,-$suffix]} 76 | else 77 | # There is no directive specified. Leave $out as is. 78 | __talosctl_debug "No directive found. Setting do default" 79 | directive=0 80 | fi 81 | 82 | __talosctl_debug "directive: ${directive}" 83 | __talosctl_debug "completions: ${out}" 84 | __talosctl_debug "flagPrefix: ${flagPrefix}" 85 | 86 | if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 87 | __talosctl_debug "Completion received error. Ignoring completions." 88 | return 89 | fi 90 | 91 | local activeHelpMarker="_activeHelp_ " 92 | local endIndex=${#activeHelpMarker} 93 | local startIndex=$((${#activeHelpMarker}+1)) 94 | local hasActiveHelp=0 95 | while IFS='\n' read -r comp; do 96 | # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) 97 | if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then 98 | __talosctl_debug "ActiveHelp found: $comp" 99 | comp="${comp[$startIndex,-1]}" 100 | if [ -n "$comp" ]; then 101 | compadd -x "${comp}" 102 | __talosctl_debug "ActiveHelp will need delimiter" 103 | hasActiveHelp=1 104 | fi 105 | 106 | continue 107 | fi 108 | 109 | if [ -n "$comp" ]; then 110 | # If requested, completions are returned with a description. 111 | # The description is preceded by a TAB character. 112 | # For zsh's _describe, we need to use a : instead of a TAB. 113 | # We first need to escape any : as part of the completion itself. 114 | comp=${comp//:/\\:} 115 | 116 | local tab="$(printf '\t')" 117 | comp=${comp//$tab/:} 118 | 119 | __talosctl_debug "Adding completion: ${comp}" 120 | completions+=${comp} 121 | lastComp=$comp 122 | fi 123 | done < <(printf "%s\n" "${out[@]}") 124 | 125 | # Add a delimiter after the activeHelp statements, but only if: 126 | # - there are completions following the activeHelp statements, or 127 | # - file completion will be performed (so there will be choices after the activeHelp) 128 | if [ $hasActiveHelp -eq 1 ]; then 129 | if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 130 | __talosctl_debug "Adding activeHelp delimiter" 131 | compadd -x "--" 132 | hasActiveHelp=0 133 | fi 134 | fi 135 | 136 | if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 137 | __talosctl_debug "Activating nospace." 138 | noSpace="-S ''" 139 | fi 140 | 141 | if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then 142 | __talosctl_debug "Activating keep order." 143 | keepOrder="-V" 144 | fi 145 | 146 | if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 147 | # File extension filtering 148 | local filteringCmd 149 | filteringCmd='_files' 150 | for filter in ${completions[@]}; do 151 | if [ ${filter[1]} != '*' ]; then 152 | # zsh requires a glob pattern to do file filtering 153 | filter="\*.$filter" 154 | fi 155 | filteringCmd+=" -g $filter" 156 | done 157 | filteringCmd+=" ${flagPrefix}" 158 | 159 | __talosctl_debug "File filtering command: $filteringCmd" 160 | _arguments '*:filename:'"$filteringCmd" 161 | elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 162 | # File completion for directories only 163 | local subdir 164 | subdir="${completions[1]}" 165 | if [ -n "$subdir" ]; then 166 | __talosctl_debug "Listing directories in $subdir" 167 | pushd "${subdir}" >/dev/null 2>&1 168 | else 169 | __talosctl_debug "Listing directories in ." 170 | fi 171 | 172 | local result 173 | _arguments '*:dirname:_files -/'" ${flagPrefix}" 174 | result=$? 175 | if [ -n "$subdir" ]; then 176 | popd >/dev/null 2>&1 177 | fi 178 | return $result 179 | else 180 | __talosctl_debug "Calling _describe" 181 | if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then 182 | __talosctl_debug "_describe found some completions" 183 | 184 | # Return the success of having called _describe 185 | return 0 186 | else 187 | __talosctl_debug "_describe did not find completions." 188 | __talosctl_debug "Checking if we should do file completion." 189 | if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 190 | __talosctl_debug "deactivating file completion" 191 | 192 | # We must return an error code here to let zsh know that there were no 193 | # completions found by _describe; this is what will trigger other 194 | # matching algorithms to attempt to find completions. 195 | # For example zsh can match letters in the middle of words. 196 | return 1 197 | else 198 | # Perform file completion 199 | __talosctl_debug "Activating file completion" 200 | 201 | # We must return the result of this command, so it must be the 202 | # last command, or else we must store its result to return it. 203 | _arguments '*:filename:_files'" ${flagPrefix}" 204 | fi 205 | fi 206 | fi 207 | } 208 | 209 | # don't run the completion function when being source-ed or eval-ed 210 | if [ "$funcstack[1]" = "_talosctl" ]; then 211 | _talosctl 212 | fi 213 | compdef _talosctl talosctl -------------------------------------------------------------------------------- /dot_config/neofetch/config.conf: -------------------------------------------------------------------------------- 1 | # See this wiki page for more info: 2 | # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info 3 | print_info() { 4 | prin "$(color 4)Alfonso Fortunato" 5 | info title 6 | info underline 7 | 8 | info "OS" distro 9 | info "Host" model 10 | info "Kernel" kernel 11 | info "Uptime" uptime 12 | info "Packages" packages 13 | info "Shell" shell 14 | info "Resolution" resolution 15 | info "DE" de 16 | info "WM" wm 17 | info "WM Theme" wm_theme 18 | info "Theme" theme 19 | info "Icons" icons 20 | info "Terminal" term 21 | info "Terminal Font" term_font 22 | info "CPU" cpu 23 | info "GPU" gpu 24 | info "Memory" memory 25 | 26 | # info "GPU Driver" gpu_driver # Linux/macOS only 27 | # info "CPU Usage" cpu_usage 28 | # info "Disk" disk 29 | # info "Battery" battery 30 | # info "Font" font 31 | # info "Song" song 32 | # [[ "$player" ]] && prin "Music Player" "$player" 33 | # info "Local IP" local_ip 34 | # info "Public IP" public_ip 35 | # info "Users" users 36 | # info "Locale" locale # This only works on glibc systems. 37 | 38 | info cols 39 | } 40 | 41 | # Title 42 | 43 | # Hide/Show Fully qualified domain name. 44 | # 45 | # Default: 'off' 46 | # Values: 'on', 'off' 47 | # Flag: --title_fqdn 48 | title_fqdn="off" 49 | 50 | # Kernel 51 | 52 | # Shorten the output of the kernel function. 53 | # 54 | # Default: 'on' 55 | # Values: 'on', 'off' 56 | # Flag: --kernel_shorthand 57 | # Supports: Everything except *BSDs (except PacBSD and PC-BSD) 58 | # 59 | # Example: 60 | # on: '4.8.9-1-ARCH' 61 | # off: 'Linux 4.8.9-1-ARCH' 62 | kernel_shorthand="on" 63 | 64 | # Distro 65 | 66 | # Shorten the output of the distro function 67 | # 68 | # Default: 'off' 69 | # Values: 'on', 'tiny', 'off' 70 | # Flag: --distro_shorthand 71 | # Supports: Everything except Windows and Haiku 72 | distro_shorthand="off" 73 | 74 | # Show/Hide OS Architecture. 75 | # Show 'x86_64', 'x86' and etc in 'Distro:' output. 76 | # 77 | # Default: 'on' 78 | # Values: 'on', 'off' 79 | # Flag: --os_arch 80 | # 81 | # Example: 82 | # on: 'Arch Linux x86_64' 83 | # off: 'Arch Linux' 84 | os_arch="on" 85 | 86 | # Uptime 87 | 88 | # Shorten the output of the uptime function 89 | # 90 | # Default: 'on' 91 | # Values: 'on', 'tiny', 'off' 92 | # Flag: --uptime_shorthand 93 | # 94 | # Example: 95 | # on: '2 days, 10 hours, 3 mins' 96 | # tiny: '2d 10h 3m' 97 | # off: '2 days, 10 hours, 3 minutes' 98 | uptime_shorthand="on" 99 | 100 | # Memory 101 | 102 | # Show memory pecentage in output. 103 | # 104 | # Default: 'off' 105 | # Values: 'on', 'off' 106 | # Flag: --memory_percent 107 | # 108 | # Example: 109 | # on: '1801MiB / 7881MiB (22%)' 110 | # off: '1801MiB / 7881MiB' 111 | memory_percent="off" 112 | 113 | # Change memory output unit. 114 | # 115 | # Default: 'mib' 116 | # Values: 'kib', 'mib', 'gib' 117 | # Flag: --memory_unit 118 | # 119 | # Example: 120 | # kib '1020928KiB / 7117824KiB' 121 | # mib '1042MiB / 6951MiB' 122 | # gib: ' 0.98GiB / 6.79GiB' 123 | memory_unit="mib" 124 | 125 | # Packages 126 | 127 | # Show/Hide Package Manager names. 128 | # 129 | # Default: 'tiny' 130 | # Values: 'on', 'tiny' 'off' 131 | # Flag: --package_managers 132 | # 133 | # Example: 134 | # on: '998 (pacman), 8 (flatpak), 4 (snap)' 135 | # tiny: '908 (pacman, flatpak, snap)' 136 | # off: '908' 137 | package_managers="on" 138 | 139 | # Shell 140 | 141 | # Show the path to $SHELL 142 | # 143 | # Default: 'off' 144 | # Values: 'on', 'off' 145 | # Flag: --shell_path 146 | # 147 | # Example: 148 | # on: '/bin/bash' 149 | # off: 'bash' 150 | shell_path="off" 151 | 152 | # Show $SHELL version 153 | # 154 | # Default: 'on' 155 | # Values: 'on', 'off' 156 | # Flag: --shell_version 157 | # 158 | # Example: 159 | # on: 'bash 4.4.5' 160 | # off: 'bash' 161 | shell_version="on" 162 | 163 | # CPU 164 | 165 | # CPU speed type 166 | # 167 | # Default: 'bios_limit' 168 | # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. 169 | # Flag: --speed_type 170 | # Supports: Linux with 'cpufreq' 171 | # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. 172 | speed_type="bios_limit" 173 | 174 | # CPU speed shorthand 175 | # 176 | # Default: 'off' 177 | # Values: 'on', 'off'. 178 | # Flag: --speed_shorthand 179 | # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz 180 | # 181 | # Example: 182 | # on: 'i7-6500U (4) @ 3.1GHz' 183 | # off: 'i7-6500U (4) @ 3.100GHz' 184 | speed_shorthand="off" 185 | 186 | # Enable/Disable CPU brand in output. 187 | # 188 | # Default: 'on' 189 | # Values: 'on', 'off' 190 | # Flag: --cpu_brand 191 | # 192 | # Example: 193 | # on: 'Intel i7-6500U' 194 | # off: 'i7-6500U (4)' 195 | cpu_brand="on" 196 | 197 | # CPU Speed 198 | # Hide/Show CPU speed. 199 | # 200 | # Default: 'on' 201 | # Values: 'on', 'off' 202 | # Flag: --cpu_speed 203 | # 204 | # Example: 205 | # on: 'Intel i7-6500U (4) @ 3.1GHz' 206 | # off: 'Intel i7-6500U (4)' 207 | cpu_speed="on" 208 | 209 | # CPU Cores 210 | # Display CPU cores in output 211 | # 212 | # Default: 'logical' 213 | # Values: 'logical', 'physical', 'off' 214 | # Flag: --cpu_cores 215 | # Support: 'physical' doesn't work on BSD. 216 | # 217 | # Example: 218 | # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) 219 | # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) 220 | # off: 'Intel i7-6500U @ 3.1GHz' 221 | cpu_cores="logical" 222 | 223 | # CPU Temperature 224 | # Hide/Show CPU temperature. 225 | # Note the temperature is added to the regular CPU function. 226 | # 227 | # Default: 'off' 228 | # Values: 'C', 'F', 'off' 229 | # Flag: --cpu_temp 230 | # Supports: Linux, BSD 231 | # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable 232 | # coretemp kernel module. This only supports newer Intel processors. 233 | # 234 | # Example: 235 | # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' 236 | # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' 237 | # off: 'Intel i7-6500U (4) @ 3.1GHz' 238 | cpu_temp="off" 239 | 240 | # GPU 241 | 242 | # Enable/Disable GPU Brand 243 | # 244 | # Default: 'on' 245 | # Values: 'on', 'off' 246 | # Flag: --gpu_brand 247 | # 248 | # Example: 249 | # on: 'AMD HD 7950' 250 | # off: 'HD 7950' 251 | gpu_brand="on" 252 | 253 | # Which GPU to display 254 | # 255 | # Default: 'all' 256 | # Values: 'all', 'dedicated', 'integrated' 257 | # Flag: --gpu_type 258 | # Supports: Linux 259 | # 260 | # Example: 261 | # all: 262 | # GPU1: AMD HD 7950 263 | # GPU2: Intel Integrated Graphics 264 | # 265 | # dedicated: 266 | # GPU1: AMD HD 7950 267 | # 268 | # integrated: 269 | # GPU1: Intel Integrated Graphics 270 | gpu_type="all" 271 | 272 | # Resolution 273 | 274 | # Display refresh rate next to each monitor 275 | # Default: 'off' 276 | # Values: 'on', 'off' 277 | # Flag: --refresh_rate 278 | # Supports: Doesn't work on Windows. 279 | # 280 | # Example: 281 | # on: '1920x1080 @ 60Hz' 282 | # off: '1920x1080' 283 | refresh_rate="off" 284 | 285 | # Gtk Theme / Icons / Font 286 | 287 | # Shorten output of GTK Theme / Icons / Font 288 | # 289 | # Default: 'off' 290 | # Values: 'on', 'off' 291 | # Flag: --gtk_shorthand 292 | # 293 | # Example: 294 | # on: 'Numix, Adwaita' 295 | # off: 'Numix [GTK2], Adwaita [GTK3]' 296 | gtk_shorthand="off" 297 | 298 | # Enable/Disable gtk2 Theme / Icons / Font 299 | # 300 | # Default: 'on' 301 | # Values: 'on', 'off' 302 | # Flag: --gtk2 303 | # 304 | # Example: 305 | # on: 'Numix [GTK2], Adwaita [GTK3]' 306 | # off: 'Adwaita [GTK3]' 307 | gtk2="on" 308 | 309 | # Enable/Disable gtk3 Theme / Icons / Font 310 | # 311 | # Default: 'on' 312 | # Values: 'on', 'off' 313 | # Flag: --gtk3 314 | # 315 | # Example: 316 | # on: 'Numix [GTK2], Adwaita [GTK3]' 317 | # off: 'Numix [GTK2]' 318 | gtk3="on" 319 | 320 | # IP Address 321 | 322 | # Website to ping for the public IP 323 | # 324 | # Default: 'http://ident.me' 325 | # Values: 'url' 326 | # Flag: --ip_host 327 | public_ip_host="http://ident.me" 328 | 329 | # Public IP timeout. 330 | # 331 | # Default: '2' 332 | # Values: 'int' 333 | # Flag: --ip_timeout 334 | public_ip_timeout=2 335 | 336 | # Desktop Environment 337 | 338 | # Show Desktop Environment version 339 | # 340 | # Default: 'on' 341 | # Values: 'on', 'off' 342 | # Flag: --de_version 343 | de_version="on" 344 | 345 | # Disk 346 | 347 | # Which disks to display. 348 | # The values can be any /dev/sdXX, mount point or directory. 349 | # NOTE: By default we only show the disk info for '/'. 350 | # 351 | # Default: '/' 352 | # Values: '/', '/dev/sdXX', '/path/to/drive'. 353 | # Flag: --disk_show 354 | # 355 | # Example: 356 | # disk_show=('/' '/dev/sdb1'): 357 | # 'Disk (/): 74G / 118G (66%)' 358 | # 'Disk (/mnt/Videos): 823G / 893G (93%)' 359 | # 360 | # disk_show=('/'): 361 | # 'Disk (/): 74G / 118G (66%)' 362 | # 363 | disk_show=('/') 364 | 365 | # Disk subtitle. 366 | # What to append to the Disk subtitle. 367 | # 368 | # Default: 'mount' 369 | # Values: 'mount', 'name', 'dir', 'none' 370 | # Flag: --disk_subtitle 371 | # 372 | # Example: 373 | # name: 'Disk (/dev/sda1): 74G / 118G (66%)' 374 | # 'Disk (/dev/sdb2): 74G / 118G (66%)' 375 | # 376 | # mount: 'Disk (/): 74G / 118G (66%)' 377 | # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' 378 | # 'Disk (/mnt/Videos): 74G / 118G (66%)' 379 | # 380 | # dir: 'Disk (/): 74G / 118G (66%)' 381 | # 'Disk (Local Disk): 74G / 118G (66%)' 382 | # 'Disk (Videos): 74G / 118G (66%)' 383 | # 384 | # none: 'Disk: 74G / 118G (66%)' 385 | # 'Disk: 74G / 118G (66%)' 386 | # 'Disk: 74G / 118G (66%)' 387 | disk_subtitle="mount" 388 | 389 | # Disk percent. 390 | # Show/Hide disk percent. 391 | # 392 | # Default: 'on' 393 | # Values: 'on', 'off' 394 | # Flag: --disk_percent 395 | # 396 | # Example: 397 | # on: 'Disk (/): 74G / 118G (66%)' 398 | # off: 'Disk (/): 74G / 118G' 399 | disk_percent="on" 400 | 401 | # Song 402 | 403 | # Manually specify a music player. 404 | # 405 | # Default: 'auto' 406 | # Values: 'auto', 'player-name' 407 | # Flag: --music_player 408 | # 409 | # Available values for 'player-name': 410 | # 411 | # amarok 412 | # audacious 413 | # banshee 414 | # bluemindo 415 | # clementine 416 | # cmus 417 | # deadbeef 418 | # deepin-music 419 | # dragon 420 | # elisa 421 | # exaile 422 | # gnome-music 423 | # gmusicbrowser 424 | # gogglesmm 425 | # guayadeque 426 | # io.elementary.music 427 | # iTunes 428 | # juk 429 | # lollypop 430 | # mocp 431 | # mopidy 432 | # mpd 433 | # muine 434 | # netease-cloud-music 435 | # olivia 436 | # playerctl 437 | # pogo 438 | # pragha 439 | # qmmp 440 | # quodlibet 441 | # rhythmbox 442 | # sayonara 443 | # smplayer 444 | # spotify 445 | # strawberry 446 | # tauonmb 447 | # tomahawk 448 | # vlc 449 | # xmms2d 450 | # xnoise 451 | # yarock 452 | music_player="auto" 453 | 454 | # Format to display song information. 455 | # 456 | # Default: '%artist% - %album% - %title%' 457 | # Values: '%artist%', '%album%', '%title%' 458 | # Flag: --song_format 459 | # 460 | # Example: 461 | # default: 'Song: Jet - Get Born - Sgt Major' 462 | song_format="%artist% - %album% - %title%" 463 | 464 | # Print the Artist, Album and Title on separate lines 465 | # 466 | # Default: 'off' 467 | # Values: 'on', 'off' 468 | # Flag: --song_shorthand 469 | # 470 | # Example: 471 | # on: 'Artist: The Fratellis' 472 | # 'Album: Costello Music' 473 | # 'Song: Chelsea Dagger' 474 | # 475 | # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' 476 | song_shorthand="off" 477 | 478 | # 'mpc' arguments (specify a host, password etc). 479 | # 480 | # Default: '' 481 | # Example: mpc_args=(-h HOST -P PASSWORD) 482 | mpc_args=() 483 | 484 | # Text Colors 485 | 486 | # Text Colors 487 | # 488 | # Default: 'distro' 489 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 490 | # Flag: --colors 491 | # 492 | # Each number represents a different part of the text in 493 | # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' 494 | # 495 | # Example: 496 | # colors=(distro) - Text is colored based on Distro colors. 497 | # colors=(4 6 1 8 8 6) - Text is colored in the order above. 498 | colors=(distro) 499 | 500 | # Text Options 501 | 502 | # Toggle bold text 503 | # 504 | # Default: 'on' 505 | # Values: 'on', 'off' 506 | # Flag: --bold 507 | bold="on" 508 | 509 | # Enable/Disable Underline 510 | # 511 | # Default: 'on' 512 | # Values: 'on', 'off' 513 | # Flag: --underline 514 | underline_enabled="on" 515 | 516 | # Underline character 517 | # 518 | # Default: '-' 519 | # Values: 'string' 520 | # Flag: --underline_char 521 | underline_char="-" 522 | 523 | # Info Separator 524 | # Replace the default separator with the specified string. 525 | # 526 | # Default: ':' 527 | # Flag: --separator 528 | # 529 | # Example: 530 | # separator="->": 'Shell-> bash' 531 | # separator=" =": 'WM = dwm' 532 | separator=":" 533 | 534 | # Color Blocks 535 | 536 | # Color block range 537 | # The range of colors to print. 538 | # 539 | # Default: '0', '15' 540 | # Values: 'num' 541 | # Flag: --block_range 542 | # 543 | # Example: 544 | # 545 | # Display colors 0-7 in the blocks. (8 colors) 546 | # neofetch --block_range 0 7 547 | # 548 | # Display colors 0-15 in the blocks. (16 colors) 549 | # neofetch --block_range 0 15 550 | block_range=(0 15) 551 | 552 | # Toggle color blocks 553 | # 554 | # Default: 'on' 555 | # Values: 'on', 'off' 556 | # Flag: --color_blocks 557 | color_blocks="on" 558 | 559 | # Color block width in spaces 560 | # 561 | # Default: '3' 562 | # Values: 'num' 563 | # Flag: --block_width 564 | block_width=3 565 | 566 | # Color block height in lines 567 | # 568 | # Default: '1' 569 | # Values: 'num' 570 | # Flag: --block_height 571 | block_height=1 572 | 573 | # Color Alignment 574 | # 575 | # Default: 'auto' 576 | # Values: 'auto', 'num' 577 | # Flag: --col_offset 578 | # 579 | # Number specifies how far from the left side of the terminal (in spaces) to 580 | # begin printing the columns, in case you want to e.g. center them under your 581 | # text. 582 | # Example: 583 | # col_offset="auto" - Default behavior of neofetch 584 | # col_offset=7 - Leave 7 spaces then print the colors 585 | col_offset="auto" 586 | 587 | # Progress Bars 588 | 589 | # Bar characters 590 | # 591 | # Default: '-', '=' 592 | # Values: 'string', 'string' 593 | # Flag: --bar_char 594 | # 595 | # Example: 596 | # neofetch --bar_char 'elapsed' 'total' 597 | # neofetch --bar_char '-' '=' 598 | bar_char_elapsed="-" 599 | bar_char_total="=" 600 | 601 | # Toggle Bar border 602 | # 603 | # Default: 'on' 604 | # Values: 'on', 'off' 605 | # Flag: --bar_border 606 | bar_border="on" 607 | 608 | # Progress bar length in spaces 609 | # Number of chars long to make the progress bars. 610 | # 611 | # Default: '15' 612 | # Values: 'num' 613 | # Flag: --bar_length 614 | bar_length=15 615 | 616 | # Progress bar colors 617 | # When set to distro, uses your distro's logo colors. 618 | # 619 | # Default: 'distro', 'distro' 620 | # Values: 'distro', 'num' 621 | # Flag: --bar_colors 622 | # 623 | # Example: 624 | # neofetch --bar_colors 3 4 625 | # neofetch --bar_colors distro 5 626 | bar_color_elapsed="distro" 627 | bar_color_total="distro" 628 | 629 | # Info display 630 | # Display a bar with the info. 631 | # 632 | # Default: 'off' 633 | # Values: 'bar', 'infobar', 'barinfo', 'off' 634 | # Flags: --cpu_display 635 | # --memory_display 636 | # --battery_display 637 | # --disk_display 638 | # 639 | # Example: 640 | # bar: '[---=======]' 641 | # infobar: 'info [---=======]' 642 | # barinfo: '[---=======] info' 643 | # off: 'info' 644 | cpu_display="off" 645 | memory_display="off" 646 | battery_display="off" 647 | disk_display="off" 648 | 649 | # Backend Settings 650 | 651 | # Image backend. 652 | # 653 | # Default: 'ascii' 654 | # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', 655 | # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' 656 | # Flag: --backend 657 | image_backend="ascii" 658 | 659 | # Image Source 660 | # 661 | # Which image or ascii file to display. 662 | # 663 | # Default: 'auto' 664 | # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' 665 | # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' 666 | # Flag: --source 667 | # 668 | # NOTE: 'auto' will pick the best image source for whatever image backend is used. 669 | # In ascii mode, distro ascii art will be used and in an image mode, your 670 | # wallpaper will be used. 671 | image_source="auto" 672 | 673 | # Ascii Options 674 | 675 | # Ascii distro 676 | # Which distro's ascii art to display. 677 | # 678 | # Default: 'auto' 679 | # Values: 'auto', 'distro_name' 680 | # Flag: --ascii_distro 681 | # NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", 682 | # "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, 683 | # ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, 684 | # Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, 685 | # BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, 686 | # Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, 687 | # Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, 688 | # DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, 689 | # EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, 690 | # FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, 691 | # gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, 692 | # Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, 693 | # Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, 694 | # LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, 695 | # Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, 696 | # Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, 697 | # NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, 698 | # OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, 699 | # Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, 700 | # popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, 701 | # Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, 702 | # Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, 703 | # Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, 704 | # SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, 705 | # openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, 706 | # Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, 707 | # Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, 708 | # and IRIX have ascii logos 709 | # NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. 710 | # Use '{distro name}_old' to use the old logos. 711 | # NOTE: Ubuntu has flavor variants. 712 | # Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, 713 | # Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. 714 | # NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, 715 | # CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, 716 | # Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, 717 | # Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, 718 | # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, 719 | # postmarketOS, and Void have a smaller logo variant. 720 | # Use '{distro name}_small' to use the small variants. 721 | ascii_distro="auto" 722 | 723 | # Ascii Colors 724 | # 725 | # Default: 'distro' 726 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 727 | # Flag: --ascii_colors 728 | # 729 | # Example: 730 | # ascii_colors=(distro) - Ascii is colored based on Distro colors. 731 | # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. 732 | ascii_colors=(distro) 733 | 734 | # Bold ascii logo 735 | # Whether or not to bold the ascii logo. 736 | # 737 | # Default: 'on' 738 | # Values: 'on', 'off' 739 | # Flag: --ascii_bold 740 | ascii_bold="on" 741 | 742 | # Image Options 743 | 744 | # Image loop 745 | # Setting this to on will make neofetch redraw the image constantly until 746 | # Ctrl+C is pressed. This fixes display issues in some terminal emulators. 747 | # 748 | # Default: 'off' 749 | # Values: 'on', 'off' 750 | # Flag: --loop 751 | image_loop="off" 752 | 753 | # Thumbnail directory 754 | # 755 | # Default: '~/.cache/thumbnails/neofetch' 756 | # Values: 'dir' 757 | thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" 758 | 759 | # Crop mode 760 | # 761 | # Default: 'normal' 762 | # Values: 'normal', 'fit', 'fill' 763 | # Flag: --crop_mode 764 | # 765 | # See this wiki page to learn about the fit and fill options. 766 | # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F 767 | crop_mode="normal" 768 | 769 | # Crop offset 770 | # Note: Only affects 'normal' crop mode. 771 | # 772 | # Default: 'center' 773 | # Values: 'northwest', 'north', 'northeast', 'west', 'center' 774 | # 'east', 'southwest', 'south', 'southeast' 775 | # Flag: --crop_offset 776 | crop_offset="center" 777 | 778 | # Image size 779 | # The image is half the terminal width by default. 780 | # 781 | # Default: 'auto' 782 | # Values: 'auto', '00px', '00%', 'none' 783 | # Flags: --image_size 784 | # --size 785 | image_size="auto" 786 | 787 | # Gap between image and text 788 | # 789 | # Default: '3' 790 | # Values: 'num', '-num' 791 | # Flag: --gap 792 | gap=3 793 | 794 | # Image offsets 795 | # Only works with the w3m backend. 796 | # 797 | # Default: '0' 798 | # Values: 'px' 799 | # Flags: --xoffset 800 | # --yoffset 801 | yoffset=0 802 | xoffset=0 803 | 804 | # Image background color 805 | # Only works with the w3m backend. 806 | # 807 | # Default: '' 808 | # Values: 'color', 'blue' 809 | # Flag: --bg_color 810 | background_color= 811 | 812 | # Misc Options 813 | 814 | # Stdout mode 815 | # Turn off all colors and disables image backend (ASCII/Image). 816 | # Useful for piping into another command. 817 | # Default: 'off' 818 | # Values: 'on', 'off' 819 | stdout="off" 820 | --------------------------------------------------------------------------------