From df4e95bfeabcebd949725c16e58357e139f81b34 Mon Sep 17 00:00:00 2001 From: Gib Date: Fri, 7 Nov 2025 17:00:48 -0600 Subject: [PATCH] init commit --- .gitignore | 2 + README.md | 2 + bin/ascii | 31 ++ config/bash/.bashrc | 26 ++ config/bash/.bashrc.bak | 25 ++ config/bash/aliases | 47 +++ config/bash/shell | 31 ++ config/dot/nvim/.luarc.json | 13 + config/dot/nvim/init.lua | 1 + config/dot/nvim/lazy-lock.json | 58 +++ config/dot/nvim/lua/config/autocmd.lua | 45 ++ config/dot/nvim/lua/config/init.lua | 4 + config/dot/nvim/lua/config/keymaps.lua | 41 ++ config/dot/nvim/lua/config/lazy.lua | 28 ++ config/dot/nvim/lua/config/options.lua | 21 + config/dot/nvim/lua/plugins/avante.lua | 239 +++++++++++ config/dot/nvim/lua/plugins/barbar.lua | 21 + config/dot/nvim/lua/plugins/cloak.lua | 20 + config/dot/nvim/lua/plugins/colors.lua | 18 + config/dot/nvim/lua/plugins/image.lua | 32 ++ config/dot/nvim/lua/plugins/lsp.lua | 409 +++++++++++++++++++ config/dot/nvim/lua/plugins/lualine.lua | 63 +++ config/dot/nvim/lua/plugins/neotree.lua | 327 +++++++++++++++ config/dot/nvim/lua/plugins/nerdcomments.lua | 12 + config/dot/nvim/lua/plugins/snacks.lua | 15 + config/dot/nvim/lua/plugins/telescope.lua | 33 ++ config/dot/nvim/lua/plugins/treesitter.lua | 92 +++++ config/dot/nvim/lua/plugins/trouble.lua | 19 + config/dot/nvim/lua/plugins/undotree.lua | 12 + config/dot/ohmyposh/gib.omp.json | 192 +++++++++ config/dot/ohmyposh/zen.toml | 74 ++++ install | 13 + setup/packages/desktop-packages | 42 ++ setup/packages/development-packages | 30 ++ setup/packages/initial-packages | 17 + setup/scripts/install-initial-packages | 42 ++ setup/scripts/link-dotfiles | 17 + 37 files changed, 2114 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 bin/ascii create mode 100644 config/bash/.bashrc create mode 100644 config/bash/.bashrc.bak create mode 100644 config/bash/aliases create mode 100644 config/bash/shell create mode 100644 config/dot/nvim/.luarc.json create mode 100644 config/dot/nvim/init.lua create mode 100644 config/dot/nvim/lazy-lock.json create mode 100644 config/dot/nvim/lua/config/autocmd.lua create mode 100644 config/dot/nvim/lua/config/init.lua create mode 100644 config/dot/nvim/lua/config/keymaps.lua create mode 100644 config/dot/nvim/lua/config/lazy.lua create mode 100644 config/dot/nvim/lua/config/options.lua create mode 100644 config/dot/nvim/lua/plugins/avante.lua create mode 100644 config/dot/nvim/lua/plugins/barbar.lua create mode 100644 config/dot/nvim/lua/plugins/cloak.lua create mode 100644 config/dot/nvim/lua/plugins/colors.lua create mode 100644 config/dot/nvim/lua/plugins/image.lua create mode 100644 config/dot/nvim/lua/plugins/lsp.lua create mode 100644 config/dot/nvim/lua/plugins/lualine.lua create mode 100644 config/dot/nvim/lua/plugins/neotree.lua create mode 100644 config/dot/nvim/lua/plugins/nerdcomments.lua create mode 100644 config/dot/nvim/lua/plugins/snacks.lua create mode 100644 config/dot/nvim/lua/plugins/telescope.lua create mode 100644 config/dot/nvim/lua/plugins/treesitter.lua create mode 100644 config/dot/nvim/lua/plugins/trouble.lua create mode 100644 config/dot/nvim/lua/plugins/undotree.lua create mode 100644 config/dot/ohmyposh/gib.omp.json create mode 100644 config/dot/ohmyposh/zen.toml create mode 100755 install create mode 100644 setup/packages/desktop-packages create mode 100644 setup/packages/development-packages create mode 100644 setup/packages/initial-packages create mode 100755 setup/scripts/install-initial-packages create mode 100755 setup/scripts/link-dotfiles diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a3471b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/config/wg/** +/config/bash/env diff --git a/README.md b/README.md new file mode 100644 index 0000000..bd6d868 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Panama +## Formerly Sunhat, this is a personal config for Fedora, with the intention of helping a user set up their Fedora system with one command. diff --git a/bin/ascii b/bin/ascii new file mode 100755 index 0000000..6f70e63 --- /dev/null +++ b/bin/ascii @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +ascii_art=$(cat << 'EOF' + ____ _.--._ +| _ \ __ _ _ __ __ _ _ __ ___ __ _ _.-.' `.-._ +| |_) / _` | '_ \ / _` | '_ ` _ \ / _` | .' ./`--...--' \ `. +| __/ (_| | | | | (_| | | | | | | (_| | `.'.`--.._..--' .' +|_| \__,_|_| |_|\__,_|_| |_| |_|\__,_| `-..__ __..-' + ```` +EOF +) + +# Define the color gradient (shades of cyan and blue) +colors=( + '\033[38;5;81m' # Cyan + '\033[38;5;75m' # Light Blue + '\033[38;5;69m' # Sky Blue + '\033[38;5;63m' # Dodger Blue + '\033[38;5;57m' # Deep Sky Blue + '\033[38;5;51m' # Cornflower Blue + '\033[38;5;45m' # Royal Blue +) + +# Split the ASCII art into lines +IFS=$'\n' read -rd '' -a lines <<<"$ascii_art" + +# Print each line with the corresponding color +for i in "${!lines[@]}"; do + color_index=$((i % ${#colors[@]})) + echo -e "${colors[color_index]}${lines[i]}" +done diff --git a/config/bash/.bashrc b/config/bash/.bashrc new file mode 100644 index 0000000..eaae856 --- /dev/null +++ b/config/bash/.bashrc @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +export PANAMA_PATH="$HOME/.local/share/Panama" +export PANAMA_BASH="$PANAMA_PATH/config/bash" + +[ -f /etc/bashrc ] && . /etc/bashrc + +if [ -d ~/.bashrc.d ]; then + for rc in ~/.bashrc.d/*; do + if [ -f "$rc" ]; then + . "$rc" + fi + done + unset rc +fi + +if [ -d "$PANAMA_BASH" ]; then + for f in "$PANAMA_BASH"/*; do + [ -f "$f" ] && . "$f" + done + unset f +else + if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then + PATH="$HOME/.local/bin:$HOME/bin:$PATH" + fi + export PATH +fi diff --git a/config/bash/.bashrc.bak b/config/bash/.bashrc.bak new file mode 100644 index 0000000..1ed1d53 --- /dev/null +++ b/config/bash/.bashrc.bak @@ -0,0 +1,25 @@ +# .bashrc + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +# User specific environment +if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then + PATH="$HOME/.local/bin:$HOME/bin:$PATH" +fi +export PATH + +# Uncomment the following line if you don't like systemctl's auto-paging feature: +# export SYSTEMD_PAGER= + +# User specific aliases and functions +if [ -d ~/.bashrc.d ]; then + for rc in ~/.bashrc.d/*; do + if [ -f "$rc" ]; then + . "$rc" + fi + done +fi +unset rc diff --git a/config/bash/aliases b/config/bash/aliases new file mode 100644 index 0000000..2d24e17 --- /dev/null +++ b/config/bash/aliases @@ -0,0 +1,47 @@ +#!/usr/share/env bash + +# Aliases I like +alias :q="exit" +alias :wq="exit" +alias startsunshine="systemctl --user restart sunshine.service" +alias sourcerc="source ~/.bashrc" +alias c="clear" +alias shutdown="systemctl poweroff" +alias update-grub="sudo grub-mkconfig -o /etc/grub2-efi.cfg" +alias nvidia-smi-docker='sudo docker run --rm --gpus all --privileged nvidia/cuda:12.8.1-base-ubuntu24.04 nvidia-smi' +alias ncconnect='sudo docker exec -u www-data -it nextcloud-aio-nextcloud bash' + +# Docker Shortcuts +alias docker-up='sudo docker compose up -d' +alias docker-down='sudo docker compose down' +alias docker-stop='sudo docker compose stop' +alias docker-update='sudo docker compose down && sudo docker compose up -d' +alias docker-restart='sudo docker compose restart' + +# Finger Print +alias fprint-on='sudo authselect enable-feature with-fingerprint' +alias fprint-off='sudo authselect disable-feature with-fingerprint' + +# File system +alias ls='eza -lh --group-directories-first --icons' +alias lsa='ls -a' +alias lt='eza --tree --level=2 --long --icons --git' +alias lta='lt -a' +alias ff="fzf --preview 'batcat --style=numbers --color=always {}'" + +# Directories +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' + +# Tools +alias n='nvim' +alias n.="nvim ." +alias ns="nvim src" +alias nlc="nvim lc" +alias watchsmi="watch -n 1 nvidia-smi" +alias watchamdsmi="watch -n 1 rocm-smi" + +# Compression +compress() { tar -czf "${1%/}.tar.gz" "${1%/}"; } +alias decompress="tar -xzf" diff --git a/config/bash/shell b/config/bash/shell new file mode 100644 index 0000000..d43a740 --- /dev/null +++ b/config/bash/shell @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Editor used by CLI +export EDITOR="nvim" +export SUDO_EDITOR="$EDITOR" +export SSH_ASKPASS=/usr/bin/ksshaskpass +export SSH_ASKPASS_REQUIRE=prefer + +# Define Paths +export CARGO_PATH="$HOME/.cargo" +export BUN_INSTALL="$HOME/.bun" +export PYENV_ROOT="$HOME/.pyenv" +export PNPM_HOME="$HOME/.local/share/pnpm" +export NVM_DIR="$HOME/.nvm" +export ANDROID_SDK_HOME="$HOME/.local/share/Android" +export GOPATH="$HOME/.local/share/go" +export DOTNETPATH="$HOME/.dotnet/tools" + +# Set complete path +export PATH="$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PANAMA_PATH/bin:$BUN_INSTALL/bin:$CARGO_PATH/bin:$PNPM_HOME:$PYENV_ROOT/bin:$HOME/.rbenv/bin:/usr/lib/ccache/bin/:$GOPATH/bin:$DOTNETPATH" + +# Nvm +set -h +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# Zoxide +eval "$(zoxide init bash)" + +# Oh My Posh +eval "$(oh-my-posh init bash --config $PANAMA_PATH/config/dot/ohmyposh/gib.omp.json)" diff --git a/config/dot/nvim/.luarc.json b/config/dot/nvim/.luarc.json new file mode 100644 index 0000000..31b4b67 --- /dev/null +++ b/config/dot/nvim/.luarc.json @@ -0,0 +1,13 @@ +{ + "runtime.version": "LuaJIT", + "runtime.path": [ + "lua/?.lua", + "lua/?/init.lua" + ], + "diagnostics.globals": ["vim"], + "workspace.checkThirdParty": false, + "workspace.library": [ "$VIMRUNTIME" ], + "workspace.maxPreload": 100000, + "workspace.preloadFileSize": 10000, + "telemetry.enable": false +} diff --git a/config/dot/nvim/init.lua b/config/dot/nvim/init.lua new file mode 100644 index 0000000..868083b --- /dev/null +++ b/config/dot/nvim/init.lua @@ -0,0 +1 @@ +require'config' diff --git a/config/dot/nvim/lazy-lock.json b/config/dot/nvim/lazy-lock.json new file mode 100644 index 0000000..206a99a --- /dev/null +++ b/config/dot/nvim/lazy-lock.json @@ -0,0 +1,58 @@ +{ + "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "avante.nvim": { "branch": "main", "commit": "7f48770e66684e9a7d4d5b9c47505a23e0167a6e" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-copilot": { "branch": "main", "commit": "1f3f31c54bd71e41ed157430702bc2837ea582ab" }, + "cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" }, + "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, + "cmp-git": { "branch": "main", "commit": "b24309c386c9666c549a1abaedd4956541676d06" }, + "cmp-luasnip-choice": { "branch": "master", "commit": "4f49232e51c9df379b9daf43f25f7ee6320450f0" }, + "cmp-nerdfont": { "branch": "main", "commit": "e97482344ebed29093015a18c155057adf5c842b" }, + "cmp-npm": { "branch": "main", "commit": "2337f109f51a09297596dd6b538b70ccba92b4e4" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp-tw2css": { "branch": "main", "commit": "1abe0eebcb57fcbd5538d054f0db61f4e4a1302b" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "26c02e1155a4980900bdccabca4516f4c712aae9" }, + "copilot.vim": { "branch": "release", "commit": "da369d90cfd6c396b1d0ec259836a1c7222fb2ea" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, + "image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" }, + "img-clip.nvim": { "branch": "main", "commit": "e7e29f0d07110405adecd576b602306a7edd507a" }, + "lazy.nvim": { "branch": "main", "commit": "e6a8824858757ca9cd4f5ae1a72d845fa5c46a39" }, + "lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" }, + "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mcphub.nvim": { "branch": "main", "commit": "8ff40b5edc649959bb7e89d25ae18e055554859a" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "8cdd6b1940f333c1dd085526a9c45b30fb2dbf50" }, + "nerdcommenter": { "branch": "master", "commit": "02a3b6455fa07b61b9440a78732f1e9b7876c991" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, + "nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, + "nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "ec308c7827b5f8cb2dd0ad303a059c945dd21969" }, + "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, + "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "a1b2bf029c37397947082f31969b4aec0d1b92bd" }, + "snacks.nvim": { "branch": "main", "commit": "41712e3026a6d690e3c65f83b335cb34e054d2cd" }, + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyonight.nvim": { "branch": "main", "commit": "b13cfc1286d2aa8bda6ce137b79e857d5a3d5739" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" } +} diff --git a/config/dot/nvim/lua/config/autocmd.lua b/config/dot/nvim/lua/config/autocmd.lua new file mode 100644 index 0000000..60f698d --- /dev/null +++ b/config/dot/nvim/lua/config/autocmd.lua @@ -0,0 +1,45 @@ +local augroup = vim.api.nvim_create_augroup +local gib_group = augroup('Gib', {}) +local autocmd = vim.api.nvim_create_autocmd +local yank_group = augroup('HighlightYank', {}) + +function R(name) + require("plenary.reload").reload_module(name) +end + +autocmd('TextYankPost', { + group = yank_group, + pattern = '*', + callback = function() + vim.highlight.on_yank({ + higroup = 'IncSearch', + timeout = 40, + }) + end, +}) + +autocmd({"BufWritePre"}, { + group = gib_group, + pattern = "*", + command = [[%s/\s\+$//e]], +}) + +autocmd({'BufWritePost'}, { + pattern = 'init.lua', + command = 'source ', +}) + +autocmd('LspAttach', { + group = gib_group, + callback = function(e) + local opts = { buffer = e.buf } + vim.keymap.set('n', 'kf', function() vim.lsp.buf.format() end, opts) + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "kw", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "kd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "re", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + end +}) diff --git a/config/dot/nvim/lua/config/init.lua b/config/dot/nvim/lua/config/init.lua new file mode 100644 index 0000000..3f944ae --- /dev/null +++ b/config/dot/nvim/lua/config/init.lua @@ -0,0 +1,4 @@ +require'config.options' +require'config.keymaps' +require'config.lazy' +require'config.autocmd' diff --git a/config/dot/nvim/lua/config/keymaps.lua b/config/dot/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..9478bbd --- /dev/null +++ b/config/dot/nvim/lua/config/keymaps.lua @@ -0,0 +1,41 @@ +vim.g.mapleader = ' ' +vim.g.maplocalleader = "\\" +vim.keymap.set('n', 's', ':update :source') +vim.keymap.set('n', 'x', ':!chmod +x %', { silent = true }) +vim.keymap.set({'n', 'v', 'x'}, 'h', 'h') +vim.keymap.set({'n', 'v', 'x'}, 'j', 'j') +vim.keymap.set({'n', 'v', 'x'}, 'k', 'k') +vim.keymap.set({'n', 'v', 'x'}, 'l', 'l') +vim.keymap.set('n', 'w', ':write') +vim.keymap.set('n', 'q', ':quit') +-- Move the selected lines up or down one line and reselect +vim.keymap.set('v', 'J', ':m \'>+1gv=gv') +vim.keymap.set('v', 'K', ':m \'<-2gv=gv') +-- Join the current line with the line below and reposition the cursor +vim.keymap.set('n', 'J', 'mzJ`z') +-- Scroll down or up and reposition the cursor +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') +-- Search forward and reposition the cursor +vim.keymap.set('n', 'n', 'nzzzv') +-- Search backward and reposition the cursor +vim.keymap.set('n', 'N', 'Nzzzv') +-- Paste the selection from the system clipboard +vim.keymap.set({'n', 'v', 'x'}, 'p', [["+p]]) +vim.keymap.set({'n', 'v', 'x'}, 'P', [["+P]]) +-- Move selected text to the black hole register & replace with copied text. +vim.keymap.set('x', 'v', [["_dP]]) +-- Yank (copy) the selection to the system clipboard +vim.keymap.set({'n', 'v'}, 'y', [["+y]]) +-- Yank (copy) the entire buffer to the system clipboard +vim.keymap.set('n', 'yy', [["+Y]]) +-- Yank all the text in the file to the system clipboard +vim.keymap.set('n', 'YY', ':%y+') +-- Delete the selection without yanking (copying) it +vim.keymap.set({'n', 'v'}, 'd', [["_d]]) +-- Delete the line without yanking (copying) it +vim.keymap.set('n', 'dd', [["_dd]]) +-- Map Q in Normal mode to do nothing (nop) +vim.keymap.set('n', 'Q', '') +-- Perform a search and replace operation using the word under the cursor +vim.keymap.set('n', 'sr', [[:%s/\<\>//gI]]) diff --git a/config/dot/nvim/lua/config/lazy.lua b/config/dot/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..7e574ff --- /dev/null +++ b/config/dot/nvim/lua/config/lazy.lua @@ -0,0 +1,28 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "--branch=stable", + lazyrepo, + lazypath + }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +require'lazy'.setup({ + spec = { { import = 'plugins' } }, + install = { colorscheme = { 'tokyonight-moon' } }, + checker = { enabled = false }, +}) diff --git a/config/dot/nvim/lua/config/options.lua b/config/dot/nvim/lua/config/options.lua new file mode 100644 index 0000000..42c3c2b --- /dev/null +++ b/config/dot/nvim/lua/config/options.lua @@ -0,0 +1,21 @@ +vim.o.number = true +vim.o.relativenumber = true +vim.o.winborder = 'rounded' +vim.o.tabstop = 2 +vim.o.softtabstop = 2 +vim.o.shiftwidth = 2 +vim.o.expandtab = true +vim.o.smartindent = true +vim.o.swapfile = false +vim.o.undodir = os.getenv('HOME') .. '/.vim/undodir' +vim.o.undofile = true +vim.o.hlsearch = true +vim.o.incsearch = true +vim.o.termguicolors = true +vim.o.scrolloff = 4 +vim.o.signcolumn = 'yes' +vim.o.updatetime = 50 +vim.opt.isfname:append('@-@') +vim.cmd([[set list]]) +vim.cmd([[set listchars=trail:⋅,nbsp:⋅,tab:\ \ ]]) +vim.cmd(':hi statusline guibg=NONE') diff --git a/config/dot/nvim/lua/plugins/avante.lua b/config/dot/nvim/lua/plugins/avante.lua new file mode 100644 index 0000000..6258585 --- /dev/null +++ b/config/dot/nvim/lua/plugins/avante.lua @@ -0,0 +1,239 @@ +return { + 'yetone/avante.nvim', + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + -- ⚠️ must add this setting! ! ! + build = vim.fn.has('win32') ~= 0 + and 'powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false' + or 'make', + event = 'VeryLazy', + version = false, -- Never set this value to '*'! Never! + ---@module 'avante' + ---@type avante.Config + opts = { + instructions_file = 'avante.md', + provider = 'openai', + auto_suggestions_provider = 'openai', + providers = { + claude = { + endpoint = 'https://api.anthropic.com', + model = 'claude-sonnet-4-20250514', + timeout = 30000, + extra_request_body = { + temperature = 0.75, + max_tokens = 4096, + }, + }, + openai = { + endpoint = 'https://api.openai.com/v1', + model = 'gpt-5', + extra_request_body = { + temperature = 1, + max_completion_tokens = 8192, + }, + }, + }, + rag_service = { + enabled = false, + host_path = '/home/gib/Documents/Code', + runner = 'docker', + llm = { + provider = 'openai', + endpoint = 'https://api.openai.com/v1', + api_key = 'OPENAI_API_KEY', + model = 'gpt-5', + extra = { + temperature = 1, + max_tokens = 512, + }, + }, + embed = { + provider = 'openai', + endpoint = 'https://api.openai.com/v1', + api_key = 'OPENAI_API_KEY', + model = 'text-embedding-3-large', + extra = nil, + }, + docker_extra_args = '', + }, + web_search_engine = { + provider = 'searxng', + proxy = nil, + }, + system_prompt = function() + local hub = require('mcphub').get_hub_instance() + return hub and hub:get_active_servers_prompt() or '' + end, + custom_tools = function() + return { + require('mcphub.extensions.avante').mcp_tool(), + } + end, + behaviour = { + auto_suggestions = false, + auto_set_highlight_group = true, + auto_set_keymaps = true, + auto_apply_diff_after_generation = false, + support_paste_from_clipboard = false, + minimize_diff = true, + enable_token_counting = true, + auto_approve_tool_permissions = true, + }, + mappings = { + --- @class AvanteConflictMappings + diff = { + ours = 'co', + theirs = 'ct', + all_theirs = 'ca', + both = 'cb', + cursor = 'cc', + next = ']x', + prev = '[x', + }, + suggestion = { + accept = '', + next = '', + prev = '', + dismiss = '', + }, + jump = { + next = ']]', + prev = '[[', + }, + submit = { + normal = '', + insert = '', + }, + cancel = { + normal = { '', '', 'q' }, + insert = { '' }, + }, + sidebar = { + apply_all = 'A', + apply_cursor = 'a', + retry_user_request = 'r', + edit_user_request = 'e', + switch_windows = '', + reverse_switch_windows = '', + remove_file = 'd', + add_file = '@', + close = { '', 'q' }, + close_from_input = nil, + }, + }, + hints = { enabled = true }, + windows = { + ---@type 'right' | 'left' | 'top' | 'bottom' + position = 'right', + wrap = true, + width = 35, + sidebar_header = { + enabled = true, + align = 'center', + rounded = true, + }, + input = { + prefix = '> ', + height = 8, + }, + edit = { + border = 'rounded', + start_insert = true, + }, + ask = { + floating = false, + start_insert = true, + border = 'rounded', + ---@type 'ours' | 'theirs' + focus_on_apply = 'ours', + }, + }, + highlights = { + diff = { + current = 'DiffText', + incoming = 'DiffAdd', + }, + }, + --- @class AvanteConflictUserConfig + diff = { + autojump = true, + ---@type string | fun(): any + list_opener = 'copen', + override_timeoutlen = 500, + }, + suggestion = { + debounce = 1000, + throttle = 1000, + }, + }, + dependencies = { + { 'nvim-lua/plenary.nvim' }, + { 'MunifTanjim/nui.nvim' }, + { 'hrsh7th/nvim-cmp' }, + { 'nvim-treesitter/nvim-treesitter' }, + { 'stevearc/dressing.nvim' }, + { 'nvim-tree/nvim-web-devicons' }, + { 'folke/snacks.nvim' }, + { + 'ravitemer/mcphub.nvim', + build = "npm install -g mcp-hub@latest", + config = function() + require'mcphub'.setup({ + config = vim.fn.expand('/home/gib/.config/mcphub/servers.json'), + port = 37373, + shutdown_delay = 60 * 10 * 000, + use_bundled_binary = false, + mcp_request_timeout = 60000, + auto_approve = true, + auto_toggle_mcp_servers = true, + extensions = { + avante = { + make_slash_commands = true, + }, + }, + native_servers = {}, + ui = { + window = { + width = 0.8, + height = 0.8, + align = 'center', + relative = 'editor', + zindex = 50, + border = 'rounded', + }, + wo = { + winhl = 'Normal:MCPHubNormal,FloatBorder:MCPHubBorder', + }, + }, + log = { + level = vim.log.levels.WARN, + to_file = false, + file_path = nil, + prefix = 'MCPHub', + }, + }) + end + }, + { + -- support for image pasting + 'HakonHarnes/img-clip.nvim', + event = 'VeryLazy', + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + }, + }, + }, + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { 'markdown', 'Avante' }, + }, + ft = { 'markdown', 'Avante' }, + }, + }, +} diff --git a/config/dot/nvim/lua/plugins/barbar.lua b/config/dot/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..76fd49c --- /dev/null +++ b/config/dot/nvim/lua/plugins/barbar.lua @@ -0,0 +1,21 @@ +return { + 'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', + 'nvim-tree/nvim-web-devicons', + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + animation = true, + insert_at_start = true, + }, + keys = { + { "", ":BufferPrevious", mode = "n", silent = true, desc = "Go to previous tab" }, + { "", ":BufferNext", mode = "n", silent = true, desc = "Go to next tab" }, + { "", ":BufferMovePrevious", mode = "n", silent = true, desc = "Move tab to previous position" }, + { "", ":BufferMoveNext", mode = "n", silent = true, desc = "Move tab to next position" }, + { "", ":BufferClose", mode = "n", silent = true, desc = "Close current tab" }, + { "", ":BufferCloseAllButCurrent", mode = "n", silent = true, desc = "Close all tabs except current" }, + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released +} diff --git a/config/dot/nvim/lua/plugins/cloak.lua b/config/dot/nvim/lua/plugins/cloak.lua new file mode 100644 index 0000000..3fc17c7 --- /dev/null +++ b/config/dot/nvim/lua/plugins/cloak.lua @@ -0,0 +1,20 @@ +return { + 'laytan/cloak.nvim', + config = function() + require'cloak'.setup({ + enabled = false, + cloak_character = "•", + highlight_group = "Comment", + patterns = { + { + file_pattern = { + '.env*', + 'wrangler.toml', + '.dev.vars', + }, + cloak_pattern = "=.+" + }, + }, + }) + end, +} diff --git a/config/dot/nvim/lua/plugins/colors.lua b/config/dot/nvim/lua/plugins/colors.lua new file mode 100644 index 0000000..cb2bac2 --- /dev/null +++ b/config/dot/nvim/lua/plugins/colors.lua @@ -0,0 +1,18 @@ +return { + 'folke/tokyonight.nvim', + lazy = false, + priority = 1000, + opts = { + style = 'moon', + transparent = true, + on_colors = function(colors) + colors.comment = '#a0a7c5' + colors.fg_gutter = '#787f93' + colors.terminal_black = '#828bb8' + end, + }, + config = function(_,opts) + require'tokyonight'.setup(opts) + vim.cmd.colorscheme('tokyonight-moon') + end, +} diff --git a/config/dot/nvim/lua/plugins/image.lua b/config/dot/nvim/lua/plugins/image.lua new file mode 100644 index 0000000..077e25c --- /dev/null +++ b/config/dot/nvim/lua/plugins/image.lua @@ -0,0 +1,32 @@ +return { + '3rd/image.nvim', + dependencies = { + 'nvim-treesitter/nvim-treesitter', + }, + config = function() + require'image'.setup({ + backend = "kitty", + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "markdown", "vimwiki" }, + }, + neorg = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "norg" }, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + kitty_method = "normal", + }) + end, +} diff --git a/config/dot/nvim/lua/plugins/lsp.lua b/config/dot/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..144ab94 --- /dev/null +++ b/config/dot/nvim/lua/plugins/lsp.lua @@ -0,0 +1,409 @@ +return { + 'mason-org/mason-lspconfig.nvim', + dependencies = { + { 'neovim/nvim-lspconfig', }, + { + 'mason-org/mason.nvim', + opts = { + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } + }, + }, + { + 'hrsh7th/nvim-cmp', + event = { 'InsertEnter', 'CmdlineEnter' }, + config = function() + local cmp = require'cmp' + local lspkind = require'lspkind' + local cmp_select = { behavior = cmp.SelectBehavior.Select } + local luasnip = require'luasnip' + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + { name = 'luasnip_choice' }, + { name = 'copilot' }, + { name = 'supermaven' }, + { name = 'nvim_lsp_document_symbol' }, + { name = 'nvim_lsp_signature_help' }, + { name = 'nvim_lua' }, + { name = 'nerdfont' }, + { name = 'emoji' }, + { name = 'npm' }, + { name = 'cmp-tw2css' }, + { name = 'dotenv' }, + { name = 'render-markdown' }, + }), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol', + maxwidth = { + menu = 50, + abbr = 50, + }, + symbol_map = { + Supermaven = '', + }, + ellipsis_char = '...', + show_labelDetails = true, + before = function(entry, vim_item) + return vim_item + end, + }), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + if luasnip.expandable() then + luasnip.expand() + else + cmp.confirm({ + select = true, + }) + end + else + fallback() + end + end), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.locally_jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + + --[''] = cmp.mapping.select_prev_item(cmp_select), + --[''] = cmp.mapping.select_next_item(cmp_select), + --[''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.abort(), + }), + --mapping = cmp.mapping.preset.insert({ + --[''] = cmp.mapping(function(fallback) + --if cmp.visible() then + --if cmp.get_selected_entry() then + --cmp.confirm({ select = false }) + --else + --cmp.select_next_item() + --end + --else + --fallback() + --end + --end, { 'i', 's' }), + + --[''] = cmp.mapping.confirm({ select = true }), + --[''] = cmp.mapping.complete(), + --[''] = cmp.mapping.scroll_docs(-4), + --[''] = cmp.mapping.scroll_docs(4), + --[''] = cmp.mapping.abort(), + --[''] = cmp.mapping.select_prev_item(cmp_select), + --[''] = cmp.mapping.select_next_item(cmp_select), + --[''] = cmp.mapping.scroll_docs(4), + --[''] = cmp.mapping.scroll_docs(-4), + --}), + preselect = cmp.PreselectMode.Item, + completion = { + completeopt = 'menu,menuone,noinsert', + }, + }) + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, + }, { + { name = 'buffer' }, + }) + }) + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' }, + } + }) + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' }, + }, { + { name = 'cmdline' }, + }), + matching = { disallow_symbol_nonprefix_matching = false } + }) + end, + }, + { 'hrsh7th/cmp-nvim-lsp' }, + { 'nvim-lua/plenary.nvim' }, + { 'hrsh7th/cmp-nvim-lsp-document-symbol' }, + { 'hrsh7th/cmp-nvim-lua' }, + { 'hrsh7th/cmp-nvim-lsp-signature-help' }, + { 'hrsh7th/cmp-path' }, + { 'hrsh7th/cmp-copilot' }, + { 'hrsh7th/cmp-buffer' }, + { 'hrsh7th/cmp-emoji' }, + { 'chrisgrieser/cmp-nerdfont' }, + { 'jcha0713/cmp-tw2css' }, + { 'SergioRibera/cmp-dotenv' }, + { 'saadparwaiz1/cmp_luasnip' }, + { 'onsails/lspkind.nvim' }, + { 'rafamadriz/friendly-snippets' }, + { + 'L3MON4D3/cmp-luasnip-choice', + config = function() + require'cmp_luasnip_choice'.setup() + end, + }, + { + 'petertriho/cmp-git', + config = function() + require'cmp_git'.setup({}) + end + }, + { + 'j-hui/fidget.nvim', + config = function() + require'fidget'.setup({}) + end, + }, + { + 'David-Kunz/cmp-npm', + config = function() + require'cmp-npm'.setup({}) + end + }, + { + 'stevearc/conform.nvim', + config = function() + require'conform'.setup({ + formatters_by_ft = { + cs = { 'csharpier', 'lsp' }, + javascript = { 'prettierd', 'prettier' }, + javascriptreact = { 'prettierd', 'prettier' }, + typescript = { 'prettierd', 'prettier' }, + typescriptreact = { 'prettierd', 'prettier' }, + json = { 'prettierd', 'prettier' }, + html = { 'prettierd', 'prettier' }, + css = { 'prettierd', 'prettier' }, + lua = { 'stylua' }, + }, + }) + vim.api.nvim_create_user_command( + 'Format', + function(args) + local range + if args.count ~= -1 then + local start_line = vim.fn.line("'<") + local end_line = vim.fn.line("'>") + range = { start = { start_line, 0 }, ["end"] = { end_line, 0 } } + end + require'conform'.format({ + async = true, + lsp_fallback = true, + range = range, + }) + end, { range = true, desc = "Format current buffer or range" }) + end, + keys = { + { + 'fk', + ':Format', + mode = {'n', 'v'}, + silent = true, + desc = "Format with conform" + } + } + }, + { + 'L3MON4D3/LuaSnip', + version = 'v2.*', + build = 'make install_jsregexp' + }, + { + 'github/copilot.vim', + }, + { + 'supermaven-inc/supermaven-nvim', + config = function() + require'supermaven-nvim'.setup({ + keymaps = { + accept_suggestion = '', + clear_suggestion = '', + accept_word = '', + }, + disable_inline_completion = true, + }) + end, + }, + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true + }, + { + 'windwp/nvim-ts-autotag', + config = function() + require'nvim-ts-autotag'.setup({}) + end, + }, + --{ + --"garyhurtz/cmp_kitty", + --dependencies = { + --{ "hrsh7th/nvim-cmp" }, + --}, + --init = function() + --require('cmp_kitty'):setup() + --end + --}, + { 'hrsh7th/cmp-cmdline' }, + }, + config = function() + vim.diagnostic.config({ + float = { + focusable = false, + style = 'minimal', + border = 'rounded', + source = true, + header = '', + prefix = '', + }, + }) + require'mason'.setup({}) + local cmp = require'cmp' + local cmp_lsp = require'cmp_nvim_lsp' + local lspconfig = require'lspconfig' + local capabilities = vim.tbl_deep_extend( + 'force', + {}, + vim.lsp.protocol.make_client_capabilities(), + cmp_lsp.default_capabilities() + ) + local cmp_autopairs = require'nvim-autopairs.completion.cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + require 'mason-lspconfig'.setup({ + ensure_installed = { + 'angularls', + 'asm_lsp', + 'bacon_ls', + 'bashls', + 'clangd', + 'cmake', + 'cssls', + 'css_variables', + 'cssmodules_ls', + 'docker_compose_language_service', + 'docker_language_server', + 'dockerls', + 'eslint', + 'gopls', + 'graphql', + 'html', + 'htmx', + 'intelephense', + 'jsonls', + 'kotlin_lsp', + 'ltex', + 'ltex_plus', + 'lua_ls', + 'markdown_oxide', + 'nginx_language_server', + 'phpactor', + 'postgres_lsp', + 'prismals', + 'pylyzer', + 'pyright', + 'remark_ls', + 'rust_analyzer', + 'sqlls', + 'superhtml', + 'svelte', + 'systemd_ls', + 'tailwindcss', + 'tinymist', + 'ts_ls', + 'yamlls', + }, + handlers = { + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities + }) + end, + zls = function() + lspconfig.zls.setup({ + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, + }) + vim.g.zig_fmt_parse_errors = 0 + vim.g.zig_fmt_autosave = 0 + end, + ["lua_ls"] = function() + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { + version = 'LuaJIT', + }, + diagnostics = { + globals = { 'vim' }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + -- These are the key settings to prevent the infinite processing + maxPreload = 100000, + preloadFileSize = 10000, + }, + telemetry = { + enable = false, + }, + format = { + enable = true, + defaultConfig = { + indent_style = "space", + indent_size = "2", + }, + }, + }, + }, + }) + end, + } + }) + end, +} diff --git a/config/dot/nvim/lua/plugins/lualine.lua b/config/dot/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..49e1854 --- /dev/null +++ b/config/dot/nvim/lua/plugins/lualine.lua @@ -0,0 +1,63 @@ +return { + 'nvim-lualine/lualine.nvim', + config = function() + require'lualine'.setup({ + options = { + icons_enabled = true, + theme = 'tokyonight-moon', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + refresh_time = 16, + events = { + 'WinEnter', + 'BufEnter', + 'BufWritePost', + 'SessionLoadPost', + 'FileChangedShellPost', + 'VimResized', + 'Filetype', + 'CursorMoved', + 'CursorMovedI', + 'ModeChanged', + }, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + }) + end, + dependencies = { + { 'nvim-tree/nvim-web-devicons' }, + { 'folke/tokyonight.nvim' }, + }, +} diff --git a/config/dot/nvim/lua/plugins/neotree.lua b/config/dot/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..27bf1df --- /dev/null +++ b/config/dot/nvim/lua/plugins/neotree.lua @@ -0,0 +1,327 @@ +return { + 'nvim-neo-tree/neo-tree.nvim', + config = function() + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.HINT] = '󰌵', + }, + } + }) + require'neo-tree'.setup({ + close_if_last_window = true, + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { 'terminal', 'trouble', 'qf' }, + open_files_using_relative_paths = false, + sort_case_insensitive = true, + sort_function = nil, + default_component_configs = { + container = { + enable_character_fade = true, + }, + indent = { + indent_size = 2, + padding = 1, + with_markers = true, + indent_marker = '│', + last_indent_marker = '└', + highlight = 'NeoTreeIndentMarker', + with_expanders = nil, + expander_collapsed = '', + expander_expanded = '', + expander_highlight = 'NeoTreeExpander', + }, + icon = { + folder_closed = '', + folder_open = '', + folder_empty = '󰜌', + provider = function(icon, node, state) + if node.type == 'file' or node.type == 'terminal' then + local success, web_devicons = pcall(require, 'nvim-web-devicons') + local name = node.type == 'terminal' and 'terminal' or node.name + if success then + local devicon, hl = web_devicons.get_icon(name) + icon.text = devicon or icon.text + icon.highlight = hl or icon.highlight + end + end + end, + default = '*', + highlight = 'NeoTreeFileIcon', + }, + modified = { + symbol = '[+]', + highlight = 'NeoTreeModified', + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = 'NeoTreeFileName', + }, + git_status = { + symbols = { + added = '', + modified = '', + deleted = '✖', + renamed = '󰁕', + untracked = '', + ignored = '', + unstaged = '󰄱', + staged = '', + conflict = '', + }, + }, + file_size = { + enabled = true, + width = 12, + required_width = 64, + }, + type = { + enabled = true, + width = 10, + required_width = 122, + }, + last_modified = { + enabled = true, + width = 20, + required_width = 88, + }, + created = { + enabled = true, + width = 20, + required_width = 110, + }, + symlink_target = { + enabled = false, + }, + }, + window = { + position = 'left', + width = 30, + mapping_options = { + noremap = true, + nowait = true, + }, + mappings = { + [''] = { + 'toggle_node', + nowait = false, + }, + ['<2-LeftMouse>'] = 'open', + [''] = 'open', + [''] = 'cancel', + ['P'] = { 'toggle_preview', config = { use_float = true, use_image_nvim = true } }, + ['l'] = 'focus_preview', + ['S'] = 'open_split', + ['s'] = 'open_vsplit', + ['t'] = 'open_tabnew', + ['w'] = 'open_with_window_picker', + ['C'] = 'close_node', + ['z'] = 'close_all_nodes', + ['a'] = { + 'add', + config = { + show_path = 'relative', + }, + }, + ['A'] = 'add_directory', + ['d'] = 'delete', + ['r'] = 'rename', + ['b'] = 'rename_basename', + ['y'] = 'copy_to_clipboard', + ['x'] = 'cut_to_clipboard', + ['p'] = 'paste_from_clipboard', + ['c'] = { 'copy', config = { show_path = 'relative' } }, + ['m'] = { 'move', config = { show_path = 'relative' } }, + ['q'] = 'close_window', + ['R'] = 'refresh', + ['?'] = 'show_help', + ['<'] = 'prev_source', + ['>'] = 'next_source', + ['i'] = 'show_file_details', + }, + }, + filesystem = { + filtered_items = { + visible = false, + hide_dotfiles = true, + hide_gitignored = true, + hide_hidden = true, + hide_by_name = { + 'node_modules', + '.next', + '.vscode', + '.idea', + }, + hide_by_pattern = { + '*.meta', + '*/src/*/tsconfig.json', + }, + always_show = { + '.gitignored', + }, + always_show_by_pattern = { -- uses glob style patterns + '.env*', + }, + never_show = { + '.DS_Store', + 'thumbs.db' + }, + never_show_by_pattern = {}, + }, + follow_current_file = { + enabled = false, + leave_dirs_open = false, + }, + group_empty_dirs = false, + hijack_netrw_behavior = 'open_default', + use_libuv_file_watcher = false, + commands = { + avante_add_files = function(state) + local node = state.tree:get_node() + local filepath = node:get_id() + local relative_path = require('avante.utils').relative_path(filepath) + local sidebar = require('avante').get() + local open = sidebar:is_open() + if not open then + require('avante.api').ask() + sidebar = require('avante').get() + end + sidebar.file_selector:add_selected_file(relative_path) + if not open then + sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]') + end + end, + }, + window = { + mappings = { + [''] = 'navigate_up', + ['.'] = 'set_root', + ['H'] = 'toggle_hidden', + ['/'] = 'fuzzy_finder', + ['D'] = 'fuzzy_finder_directory', + ['#'] = 'fuzzy_sorter', + -- ['D'] = 'fuzzy_sorter_directory', + ['f'] = 'filter_on_submit', + [''] = 'clear_filter', + ['[g'] = 'prev_git_modified', + [']g'] = 'next_git_modified', + ['o'] = { + 'show_help', + nowait = false, + config = { title = 'Order by', prefix_key = 'o' }, + }, + ['oa'] = 'avante_add_files', + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['og'] = { 'order_by_git_status', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + fuzzy_finder_mappings = { + [''] = 'move_cursor_down', + [''] = 'move_cursor_down', + [''] = 'move_cursor_up', + [''] = 'move_cursor_up', + [''] = 'close', + }, + }, + }, + buffers = { + follow_current_file = { + enabled = true, + leave_dirs_open = false, + }, + group_empty_dirs = true, + show_unloaded = true, + window = { + mappings = { + ['d'] = 'buffer_delete', + ['bd'] = 'buffer_delete', + [''] = 'navigate_up', + ['.'] = 'set_root', + ['o'] = { + 'show_help', + nowait = false, + config = { title = 'Order by', prefix_key = 'o' }, + }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + }, + }, + git_status = { + window = { + position = 'float', + mappings = { + ['A'] = 'git_add_all', + ['gu'] = 'git_unstage_file', + ['gU'] = 'git_undo_last_commit', + ['ga'] = 'git_add_file', + ['gr'] = 'git_revert_file', + ['gc'] = 'git_commit', + ['gp'] = 'git_push', + ['gg'] = 'git_commit_and_push', + ['o'] = { + 'show_help', + nowait = false, + config = { title = 'Order by', prefix_key = 'o' }, + }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + }, + }, + }) + end, + keys = { + { + 't', + ':Neotree toggle', + mode = { 'n', 'v', 'x'}, + silent = true, + desc = 'Toggle NeoTree', + }, + { + 'T', + ':Neotree focus', + mode = { 'n', 'v', 'x' }, + silent = true, desc = 'Focus NeoTree', + }, + }, + branch = 'v3.x', + dependencies = { + { 'nvim-lua/plenary.nvim', }, + { 'MunifTanjim/nui.nvim', }, + { 'nvim-tree/nvim-web-devicons', }, + { + 'antosha417/nvim-lsp-file-operations', + config = function() + require'lsp-file-operations'.setup({}) + end, + }, + { '3rd/image.nvim', }, + { + 's1n7ax/nvim-window-picker', + version = '2.*', + config = function() + require'window-picker'.setup({}) + end, + }, + }, + lazy = false, +} diff --git a/config/dot/nvim/lua/plugins/nerdcomments.lua b/config/dot/nvim/lua/plugins/nerdcomments.lua new file mode 100644 index 0000000..a626e96 --- /dev/null +++ b/config/dot/nvim/lua/plugins/nerdcomments.lua @@ -0,0 +1,12 @@ +return { + 'preservim/nerdcommenter', + keys = { + { + 'c', + 'NERDCommenterToggle', + mode = { 'n', 'v', 'x' }, + silent = true, + desc = 'Toggle commenting line', + } + } +} diff --git a/config/dot/nvim/lua/plugins/snacks.lua b/config/dot/nvim/lua/plugins/snacks.lua new file mode 100644 index 0000000..7cba77f --- /dev/null +++ b/config/dot/nvim/lua/plugins/snacks.lua @@ -0,0 +1,15 @@ +return { + 'folke/snacks.nvim', + dependencies = { + { 'echasnovski/mini.icons', }, + }, + config = function() + require'snacks'.setup({ + animate = { enabled = true }, + bigfile = { enabled = true }, + image = { enabled = true }, + indent = { enabled = true }, + scroll = { enabled = true }, + }) + end +} diff --git a/config/dot/nvim/lua/plugins/telescope.lua b/config/dot/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..eab1708 --- /dev/null +++ b/config/dot/nvim/lua/plugins/telescope.lua @@ -0,0 +1,33 @@ +return { + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { + { 'nvim-lua/plenary.nvim', }, + }, + config = function() + require'telescope'.setup({ + defaults = { + file_ignore_patterns = { + 'node_modules', + '.git', + '.next', + '.cache', + '.DS_Store', + '.venv', + '.conda', + }, + }, + }) + local builtin = require'telescope.builtin' + vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Find files' }) + vim.keymap.set('n', 'fg', builtin.git_files, { desc = 'Find git files' }) + vim.keymap.set( + 'n', + 'fs', + function() + builtin.grep_string({ search = vim.fn.input('Grep > ')}) + end, + { desc = 'Find string' } + ) + end, +} diff --git a/config/dot/nvim/lua/plugins/treesitter.lua b/config/dot/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..e128c65 --- /dev/null +++ b/config/dot/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,92 @@ +return { + 'nvim-treesitter/nvim-treesitter', + branch = 'master', + lazy = false, + build = ':TSUpdate', + dependencies = { + { 'nvim-treesitter/playground', }, + { + 'nvim-treesitter/nvim-treesitter-context', + config = function() + require'treesitter-context'.setup({ + enable = true, + multiwindow = false, + max_lines = 10, + min_window_height = 0, + line_numbers = true, + multiline_threshold = 20, + trim_scope = 'outer', + mode = 'topline', + separator = nil, + zindex = 20, + on_attach = nil, + }) + end, + }, + }, + config = function() + require'nvim-treesitter.install'.update({ with_sync = true }) + require'nvim-treesitter.configs'.setup({ + ensure_installed = { + 'bash', + 'c', + 'cmake', + 'cpp', + 'css', + 'diff', + 'dockerfile', + 'git_config', + 'git_rebase', + 'gitattributes', + 'gitcommit', + 'gitignore', + 'html', + 'java', + 'javascript', + 'jsdoc', + 'json', + 'jsonc', + 'kotlin', + 'latex', + 'lua', + 'luadoc', + 'luap', + 'make', + 'markdown', + 'markdown_inline', + 'php', + 'printf', + 'python', + 'query', + 'regex', + 'rust', + 'scala', + 'sql', + 'svelte', + 'swift', + 'toml', + 'tsx', + 'typescript', + 'vim', + 'vimdoc', + 'xml', + 'yaml', + 'zig' + }, + sync_install = false, + auto_install = true, + indent = { enable = true }, + highlight = { + enable = true, + disable = function(lang, buf) + local max_filesize = 500 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + additional_vim_regex_highlighting = false, + }, + }) + end, +} diff --git a/config/dot/nvim/lua/plugins/trouble.lua b/config/dot/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..b55c414 --- /dev/null +++ b/config/dot/nvim/lua/plugins/trouble.lua @@ -0,0 +1,19 @@ +return { + 'folke/trouble.nvim', + config = function() + require'trouble'.setup({ + vim.api.nvim_create_user_command('Trouble', function() + require'trouble'.open() + end, { desc = "Open Trouble" }), + }) + end, + keys = { + { + 'x', + ':Trouble diagnostics toggle', + mode = 'n', + silent = true, + desc = 'Toggle Trouble', + }, + }, +} diff --git a/config/dot/nvim/lua/plugins/undotree.lua b/config/dot/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..529a134 --- /dev/null +++ b/config/dot/nvim/lua/plugins/undotree.lua @@ -0,0 +1,12 @@ +return { + 'mbbill/undotree', + keys = { + { + 'u', + ':UndotreeToggle', + mode = { 'n' }, + silent = true, + desc = 'Toggle undo tree', + }, + }, +} diff --git a/config/dot/ohmyposh/gib.omp.json b/config/dot/ohmyposh/gib.omp.json new file mode 100644 index 0000000..78a53f7 --- /dev/null +++ b/config/dot/ohmyposh/gib.omp.json @@ -0,0 +1,192 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "transient_prompt": { + "template": " ❯❯ {{ .AbsolutePWD }} : ", + "foreground": "#f8f8f2", + "background": "transparent", + "newline": true + }, + "blocks": [ + { + "type": "prompt", + "alignment": "left", + "segments": [ + { + "properties": { + "cache_duration": "none" + }, + "template": "\n\u256d\u2500", + "foreground": "#f8f8f2", + "type": "text", + "style": "plain" + }, + { + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "template": "{{ .UserName }}@{{ .HostName }}", + "foreground": "#f8f8f2", + "background": "#282a36", + "type": "session", + "style": "diamond" + }, + { + "properties": { + "cache_duration": "none" + }, + "template": "\udb85\udc0b", + "foreground": "#ff5555", + "powerline_symbol": "\ue0b0", + "background": "#282a36", + "type": "root", + "style": "powerline" + }, + { + "properties": { + "cache_duration": "none" + }, + "template": "{{ .Icon }} ", + "foreground": "#f8f8f2", + "powerline_symbol": "\ue0b0", + "background": "#282a36", + "type": "os", + "style": "powerline" + }, + { + "properties": { + "cache_duration": "none", + "style": "full" + }, + "trailing_diamond": "\ue0b4", + "template": " \udb80\ude56 {{ path .Path .Location }}", + "foreground": "#282a36", + "background": "#cccccc", + "type": "path", + "style": "diamond" + } + ] + }, + { + "type": "prompt", + "alignment": "right", + "segments": [ + { + "properties": { + "branch_icon": "", + "cache_duration": "none", + "display_changing_color": true, + "fetch_status": true, + "fetch_upstream_icon": true, + "full_branch_path": true + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\ue725 ({{ url .UpstreamIcon .UpstreamURL }} {{ url .HEAD .UpstreamURL }}){{ if gt .Ahead 0 }}<#50fa7b> +{{ .Ahead }}{{ end }}{{ if gt .Behind 0 }}<#ff5555> -{{ .Behind }}{{ end }}{{ if .Working.Changed }}<#f8f8f2> \uf044 {{ .Working.String }}{{ end }}{{ if .Staging.Changed }}<#f8f8f2> \uf046 {{ .Staging.String }}{{ end }}", + "foreground": "#282a36", + "background": "#ffb86c", + "type": "git", + "style": "diamond" + }, + { + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\ue718 {{ .Full }}", + "foreground": "#282a36", + "background": "#50fa7b", + "type": "node", + "style": "diamond" + }, + { + "properties": { + "display_mode": "files", + "extensions": [ + "package-lock.json" + ] + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\ue71e {{ .Full }}", + "foreground": "#282a36", + "background": "#ff5555", + "type": "npm", + "style": "diamond" + }, + { + "properties": { + "display_mode": "files", + "extensions": [ + "pnpm-lock.yaml" + ] + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\udb80\udec1 {{ .Full }}", + "foreground": "#282a36", + "background": "#ffb86c", + "type": "pnpm", + "style": "diamond" + }, + { + "properties": { + "display_mode": "files" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\ue73c {{ .Full }}", + "foreground": "#282a36", + "background": "#50fa7b", + "type": "python", + "style": "diamond" + }, + { + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\ue738 {{ .Full }}", + "foreground": "#282a36", + "background": "#ff79c6", + "type": "java", + "style": "diamond" + }, + { + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\uf308 {{ .Context }}", + "foreground": "#282a36", + "background": "#8be9fd", + "type": "docker", + "style": "diamond" + }, + { + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\ue73d {{ .Full }}", + "foreground": "#f8f8f2", + "background": "#6272a4", + "type": "php", + "style": "diamond" + } + ] + }, + { + "type": "prompt", + "alignment": "left", + "segments": [ + { + "properties": { + "always_enabled": true, + "cache_duration": "none" + }, + "template": "\u2570\u2500 ❯❯", + "foreground": "#f8f8f2", + "type": "text", + "style": "diamond" + } + ], + "newline": true + } + ], + "version": 3, + "patch_pwsh_bleed": true, + "final_space": true +} diff --git a/config/dot/ohmyposh/zen.toml b/config/dot/ohmyposh/zen.toml new file mode 100644 index 0000000..7edb6f0 --- /dev/null +++ b/config/dot/ohmyposh/zen.toml @@ -0,0 +1,74 @@ +#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json + +version = 2 +final_space = true +console_title_template = '{{ .Shell }} in {{ .Folder }}' + +[[blocks]] + type = 'prompt' + alignment = 'left' + newline = true + + [[blocks.segments]] + type = 'path' + style = 'plain' + background = 'transparent' + foreground = 'blue' + template = '{{ .Path }}' + + [blocks.segments.properties] + style = 'full' + + [[blocks.segments]] + type = 'git' + style = 'plain' + foreground = 'p:grey' + background = 'transparent' + template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} {{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}' + + [blocks.segments.properties] + branch_icon = '' + commit_icon = '@' + fetch_status = true + +[[blocks]] + type = 'rprompt' + overflow = 'hidden' + + [[blocks.segments]] + type = 'executiontime' + style = 'plain' + foreground = 'yellow' + background = 'transparent' + template = '{{ .FormattedMs }}' + + [blocks.segments.properties] + threshold = 5000 + +[[blocks]] + type = 'prompt' + alignment = 'left' + newline = true + + [[blocks.segments]] + type = 'text' + style = 'plain' + foreground_templates = [ + "{{if gt .Code 0}}red{{end}}", + "{{if eq .Code 0}}magenta{{end}}", + ] + background = 'transparent' + template = '❯' + +[transient_prompt] + foreground_templates = [ + "{{if gt .Code 0}}red{{end}}", + "{{if eq .Code 0}}magenta{{end}}", + ] + background = 'transparent' + template = '❯ ' + +[secondary_prompt] + foreground = 'magenta' + background = 'transparent' + template = '❯❯ ' diff --git a/install b/install new file mode 100755 index 0000000..549aae7 --- /dev/null +++ b/install @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +source ~/.local/share/Panama/bin/ascii + +# Set host name +read -p "What should the hostname be? " HOST_NAME +sudo hostnamectl set-hostname $HOST_NAME + +# Ensure computer doesn't go to sleep while installing +gsettings set org.gnome.desktop.screensaver lock-enabled false +gsettings set org.gnome.desktop.session idle-delay 0 + +for script in ~/.local/share/Panama/setup/scripts/*; do source $script; done diff --git a/setup/packages/desktop-packages b/setup/packages/desktop-packages new file mode 100644 index 0000000..1330158 --- /dev/null +++ b/setup/packages/desktop-packages @@ -0,0 +1,42 @@ +adw-gtk3-theme +akmods +alsa-plugins-pulseaudio +dnf-plugins-core +ffmpeg +fuse-libs +gstreamer1-plugin-fmp4 +gstreamer1-plugin-gif +gstreamer1-plugin-gtk4 +gstreamer1-plugin-hsv +gstreamer1-plugin-json +gstreamer1-plugin-libav +gstreamer1-plugin-mp4 +gstreamer1-plugin-openh264 +gstreamer1-plugins-bad-free-devel +gstreamer1-plugins-good +gstreamer1-plugins-good-extras +gstreamer1-plugins-good-gtk +gstreamer1-plugins-good-qt +gstreamer1-plugins-good-qt6 +hipblas +intel-mediasdk-devel +kernel-devel +lame +lame-devel +libva-devel +libva-utils +libxcrypt-compat +mesa-libGL-devel +mesa-libGLU +mesa-libOpenCL +mokutil +mozilla-openh264 +nautilus-extensions +nautilus-python +openssl-devel +opus-devel +python3-dnf-plugin-versionlock +rocm-opencl +wine +wine-mono +winetricks diff --git a/setup/packages/development-packages b/setup/packages/development-packages new file mode 100644 index 0000000..29e330f --- /dev/null +++ b/setup/packages/development-packages @@ -0,0 +1,30 @@ +bison +clang-analyzer +clangd +cliphist +cmake +compat-lua +composer +dotnet-sdk-9.0 +g++ +gcc +go +gem +ImageMagick +java-latest-openjdk-devel +luarocks +maven +nodejs +nodejs-npm +pipx +php +php-fpm +pnpm +python3-devel +python3-gobject +python3-tkinter +python3-torch +python3-virtualenv +ripgrep +ruby +sqlite3 diff --git a/setup/packages/initial-packages b/setup/packages/initial-packages new file mode 100644 index 0000000..16d5b05 --- /dev/null +++ b/setup/packages/initial-packages @@ -0,0 +1,17 @@ +awk +bat +cargo +curl +fzf +git-all +gh +gum +ksshaskpass +neovim +openssl +python3-neovim +rustup +unzip +wireguard-tools +wget +zoxide diff --git a/setup/scripts/install-initial-packages b/setup/scripts/install-initial-packages new file mode 100755 index 0000000..cd96756 --- /dev/null +++ b/setup/scripts/install-initial-packages @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# --- Helper functions --- +log() { echo -e "\033[1;34m[INFO]\033[0m $*"; } +exists() { command -v "$1" >/dev/null 2>&1; } + +echo -e "\n--- Installing initial packages ---\n" + +# --- Install all initial packages --- +PACKAGES_FILE="$HOME/.local/share/Panama/setup/packages/initial-packages" +if [[ -f "$PACKAGES_FILE" ]]; then + INITIAL_PACKAGES=$(tr "\n" " " <"$PACKAGES_FILE") + log "Installing $INITIAL_PACKAGES" + sudo dnf install -y "$INITIAL_PACKAGES" > /dev/null 2>&1 + log "Packages installed!" +else + log "Package list was not in specified path: $PACKAGES_FILE" +fi + +# --- Install eza with cargo if not already installed --- +if [[ -x "$HOME/.cargo/bin/eza" ]]; then + log "eza already installed at \"$HOME/.cargo/bin/eza\"" +else + if exists cargo; then + log "Installing eza via Cargo..." + log "Cargo must build eza so this could take a minute or two." + cargo install eza > /dev/null 2>&1 + else + log "Cargo not found. Was the package list installed?" + fi +fi + +# --- Install oh-my-posh if not already installed. --- +LOCAL_BIN_PATH="$HOME/.local/bin" +mkdir -p "$LOCAL_BIN_PATH" + +if [[ -x "$LOCAL_BIN_PATH/oh-my-posh" ]]; then + log "oh-my-posh already installed at \"$LOCAL_BIN_PATH/oh-my-posh\"" +else + log "Installing oh-my-posh via curl..." + curl -s https://ohmyposh.dev/install.sh | bash -s -- -d "$LOCAL_BIN_PATH" > /dev/null 2>&1 +fi diff --git a/setup/scripts/link-dotfiles b/setup/scripts/link-dotfiles new file mode 100755 index 0000000..7683a98 --- /dev/null +++ b/setup/scripts/link-dotfiles @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Define paths as they have not been defined by new bashrc yet! +PANAMA_PATH="${PANAMA_PATH:-$HOME/.local/share/Panama}" +PANAMA_BASH="${PANAMA_BASH:-$PANAMA_PATH/config/bash}" + +# Backup existing .bashrc if it's a regular file +if [ -f "$HOME/.bashrc" ] && [ ! -L "$HOME/.bashrc" ]; then + mv "$HOME/.bashrc" "$PANAMA_BASH/.bashrc.bak" +fi + +# Remove old symlink if it exists and points somewhere else +if [ -L "$HOME/.bashrc" ]; then + rm "$HOME/.bashrc" +fi + +ln -s "$PANAMA_BASH/.bashrc" "$HOME/.bashrc"