diff --git a/.config/alacritty/alacritty.toml##os.Darwin b/.config/alacritty/alacritty.toml##os.Darwin new file mode 100644 index 0000000..ef49b0f --- /dev/null +++ b/.config/alacritty/alacritty.toml##os.Darwin @@ -0,0 +1,73 @@ +# vim: set filetype=toml : +[[colors.indexed_colors]] +color = "0xff9e64" +index = 16 + +[[colors.indexed_colors]] +color = "0xdb4b4b" +index = 17 + +[colors.bright] +black = "0x414868" +blue = "0x7aa2f7" +cyan = "0x7dcfff" +green = "0x9ece6a" +magenta = "0xbb9af7" +red = "0xf7768e" +white = "0xc0caf5" +yellow = "0xe0af68" + +[colors.normal] +black = "0x15161e" +blue = "0x7aa2f7" +cyan = "0x7dcfff" +green = "0x9ece6a" +magenta = "0xbb9af7" +red = "0xf7768e" +white = "0xa9b1d6" +yellow = "0xe0af68" + +[colors.primary] +background = "0x1a1b26" +foreground = "0xc0caf5" + +[cursor.style] +blinking = "Off" +shape = "Block" + +[env] +TERM = "xterm-256color" + +[font] +size = 16 + +[font.bold] +family = "JetBrainsMono NFM" +style = "Bold" + +[font.bold_italic] +family = "JetBrainsMono NFM" +style = "Bold Italic" + +[font.italic] +family = "JetBrainsMono NFM" +style = "Italic" + +[font.normal] +family = "JetBrainsMono NFM" +style = "Regular" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = true + +[window] +opacity = 1.0 +option_as_alt = "Both" + +[window.padding] +x = 10 +y = 8 diff --git a/.config/alacritty/alacritty.toml##os.Linux b/.config/alacritty/alacritty.toml##os.Linux new file mode 100644 index 0000000..162bb89 --- /dev/null +++ b/.config/alacritty/alacritty.toml##os.Linux @@ -0,0 +1,77 @@ +# vim: set filetype=toml : +[[colors.indexed_colors]] +color = "0xff9e64" +index = 16 + +[[colors.indexed_colors]] +color = "0xdb4b4b" +index = 17 + +[colors.bright] +black = "0x414868" +blue = "0x7aa2f7" +cyan = "0x7dcfff" +green = "0x9ece6a" +magenta = "0xbb9af7" +red = "0xf7768e" +white = "0xc0caf5" +yellow = "0xe0af68" + +[colors.normal] +black = "0x15161e" +blue = "0x7aa2f7" +cyan = "0x7dcfff" +green = "0x9ece6a" +magenta = "0xbb9af7" +red = "0xf7768e" +white = "0xa9b1d6" +yellow = "0xe0af68" + +[colors.primary] +background = "0x1a1b26" +foreground = "0xc0caf5" + +[cursor.style] +blinking = "Off" +shape = "Block" + +[env] +TERM = "xterm-256color" + +[font] +size = 9 + +[shell] +# program = "/usr/bin/zsh" +program = "/usr/bin/bash" +args = ["--login"] + +[font.bold] +family = "JetBrainsMono NFM" +style = "Bold" + +[font.bold_italic] +family = "JetBrainsMono NFM" +style = "Bold Italic" + +[font.italic] +family = "JetBrainsMono NFM" +style = "Italic" + +[font.normal] +family = "JetBrainsMono NFM" +style = "Regular" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = true + +[window] +opacity = 1.0 + +[window.padding] +x = 10 +y = 8 diff --git a/.config/alacritty/alacritty.toml##os.WSL b/.config/alacritty/alacritty.toml##os.WSL new file mode 100644 index 0000000..162bb89 --- /dev/null +++ b/.config/alacritty/alacritty.toml##os.WSL @@ -0,0 +1,77 @@ +# vim: set filetype=toml : +[[colors.indexed_colors]] +color = "0xff9e64" +index = 16 + +[[colors.indexed_colors]] +color = "0xdb4b4b" +index = 17 + +[colors.bright] +black = "0x414868" +blue = "0x7aa2f7" +cyan = "0x7dcfff" +green = "0x9ece6a" +magenta = "0xbb9af7" +red = "0xf7768e" +white = "0xc0caf5" +yellow = "0xe0af68" + +[colors.normal] +black = "0x15161e" +blue = "0x7aa2f7" +cyan = "0x7dcfff" +green = "0x9ece6a" +magenta = "0xbb9af7" +red = "0xf7768e" +white = "0xa9b1d6" +yellow = "0xe0af68" + +[colors.primary] +background = "0x1a1b26" +foreground = "0xc0caf5" + +[cursor.style] +blinking = "Off" +shape = "Block" + +[env] +TERM = "xterm-256color" + +[font] +size = 9 + +[shell] +# program = "/usr/bin/zsh" +program = "/usr/bin/bash" +args = ["--login"] + +[font.bold] +family = "JetBrainsMono NFM" +style = "Bold" + +[font.bold_italic] +family = "JetBrainsMono NFM" +style = "Bold Italic" + +[font.italic] +family = "JetBrainsMono NFM" +style = "Italic" + +[font.normal] +family = "JetBrainsMono NFM" +style = "Regular" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = true + +[window] +opacity = 1.0 + +[window.padding] +x = 10 +y = 8 diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index 2600673..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,63 +0,0 @@ -env: - TERM: xterm-256color - -# TokyoNight Alacritty Colors -colors: - primary: - background: "0x1a1b26" - foreground: "0xc0caf5" - normal: - black: "0x15161e" - red: "0xf7768e" - green: "0x9ece6a" - yellow: "0xe0af68" - blue: "0x7aa2f7" - magenta: "0xbb9af7" - cyan: "0x7dcfff" - white: "0xa9b1d6" - bright: - black: "0x414868" - red: "0xf7768e" - green: "0x9ece6a" - yellow: "0xe0af68" - blue: "0x7aa2f7" - magenta: "0xbb9af7" - cyan: "0x7dcfff" - white: "0xc0caf5" - indexed_colors: - - { index: 16, color: "0xff9e64" } - - { index: 17, color: "0xdb4b4b" } - -font: - bold: - family: "JetBrainsMono NFM" - style: Bold - bold_italic: - family: "JetBrainsMono NFM" - style: Bold Italic - italic: - family: "JetBrainsMono NFM" - style: Italic - normal: - family: "JetBrainsMono NFM" - style: Regular - size: 16 - -scrolling: - history: 10000 - multiplier: 3 - -window: - option_as_alt: Both - opacity: 1.0 - padding: - x: 10 - y: 8 - -selection: - save_to_clipboard: true - -cursor: - style: - shape: Block - blinking: Off diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index bf4a2b7..fdb3232 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,56 +1,55 @@ { - "LuaSnip": { "branch": "master", "commit": "954c81b53989097faaff0fabc11c29575288c3e1" }, + "LuaSnip": { "branch": "master", "commit": "07f5d974203a5d957e7b464020261a657f59556d" }, "alpha-nvim": { "branch": "main", "commit": "29074eeb869a6cbac9ce1fbbd04f5f5940311b32" }, - "barbar.nvim": { "branch": "master", "commit": "a8fe0abe538f15997a543e0f653993ef3727455f" }, + "barbar.nvim": { "branch": "master", "commit": "4ba9ac54f0c5d82131905160afff94172e3325e6" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.vim": { "branch": "release", "commit": "2c31989063b145830d5f0bea8ab529d2aef2427b" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, - "gitsigns.nvim": { "branch": "main", "commit": "e93a158b8773946dc9940a4321d35c1b52c8e293" }, - "harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" }, + "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "hop.nvim": { "branch": "master", "commit": "df0b5b693ef8c3d414b5b85e4bc11cea99c4958d" }, - "inc-rename.nvim": { "branch": "main", "commit": "a48c7cec5c4f00d7438dce5fadb55f4d715ef9f2" }, - "indent-blankline.nvim": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" }, + "inc-rename.nvim": { "branch": "main", "commit": "e346532860e1896b1085815e854ed14e2f066a2c" }, + "indent-blankline.nvim": { "branch": "master", "commit": "5da5546947f3125dfd6aa85ab21074dc83f776d5" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lsp-format.nvim": { "branch": "master", "commit": "e8782a5468a4849ae440a1531be559d85aebe142" }, - "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "lsp-format.nvim": { "branch": "master", "commit": "31fc250a412ab24555b389f61fac0330f6bb7660" }, + "lspkind.nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" }, + "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, - "mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" }, + "mini.comment": { "branch": "main", "commit": "67f00d3ebbeae15e84584d971d0c32aad4f4f3a4" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, - "neodev.nvim": { "branch": "main", "commit": "c4ce017bd4bacf60bf59330cec9e93c5d5e104a6" }, + "neodev.nvim": { "branch": "main", "commit": "029899ea32d3dc8ed8c910ceca2ee5d16e566c11" }, "nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, - "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, - "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "d7749eb3d9933a75d2244820308ce442f646c7ae" }, - "nvim-dap-python": { "branch": "master", "commit": "e0be843877e7ae756ef1ee7a441ca0b9e1677da9" }, + "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-dap": { "branch": "master", "commit": "f0dca670fa059eb89dda8869a6310c804241345c" }, + "nvim-dap-python": { "branch": "master", "commit": "091e4ae00a12085f9ed4200a3cd04af7179b8a23" }, "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, - "nvim-lspconfig": { "branch": "master", "commit": "6c797ff9324094e333e2ace9526ca4a62ad9d1ca" }, - "nvim-treesitter": { "branch": "master", "commit": "f861bc6148e7bc715f6a09bd34bb1f577b62a248" }, - "nvim-treesitter-context": { "branch": "master", "commit": "bf4d15ee4e96ff5201f16a4ed14443670662eb90" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, - "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "99f0a58f96a44198267d75e613b732c9b6f93845" }, + "nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, + "nvim-treesitter": { "branch": "master", "commit": "27f68c0b6a87cbad900b3d016425450af8268026" }, + "nvim-treesitter-context": { "branch": "master", "commit": "652ec514d6ba8bc4a3c2de76c855fe668e2c7196" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "0e2d5bd4cbe75849a013901555d436a48c6680cb" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" }, - "nvim-web-devicons": { "branch": "master", "commit": "5efb8bd06841f91f97c90e16de85e96d57e9c862" }, + "nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, "nvim-window-picker": { "branch": "main", "commit": "5902827d0e338890a22849e2f18dc80d1cc1a8db" }, "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "8e0543365fe5781c9babea7db89ef06bcff3716d" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "4bd5657b14b58e069287f5ac591a647bb860b2ed" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-recent-files": { "branch": "main", "commit": "6893cda11625254cc7dc2ea76e0a100c7deeb028" }, - "telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" }, + "telescope.nvim": { "branch": "master", "commit": "aacaa9cd031da83ce08d8fa5f19083d731f7f62c" }, "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, "toggleterm.nvim": { "branch": "main", "commit": "cbd041d91b90cd3c02df03fe6133208888f8e008" }, "tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" }, @@ -59,6 +58,6 @@ "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" }, + "vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/.config/nvim/lua/user/plugins/null-ls.lua b/.config/nvim/lua/user/plugins/null-ls.lua index a968807..d1dc6ba 100644 --- a/.config/nvim/lua/user/plugins/null-ls.lua +++ b/.config/nvim/lua/user/plugins/null-ls.lua @@ -54,7 +54,7 @@ function M.config(_, _) null_ls.builtins.diagnostics.shellcheck, null_ls.builtins.formatting.shfmt.with({ extra_args = { "--indent", "4", "--case-indent" }, - filetypes = { "sh", "zsh" }, + filetypes = { "sh", "zsh", "bash" }, }), -- markdown diff --git a/.config/nvim/lua/user/plugins/treesitter.lua b/.config/nvim/lua/user/plugins/treesitter.lua index 95c3ae2..77d413d 100644 --- a/.config/nvim/lua/user/plugins/treesitter.lua +++ b/.config/nvim/lua/user/plugins/treesitter.lua @@ -38,8 +38,6 @@ function M.config() "sql", "ssh_config", "toml", - "toml", - "tsx", "tsx", "typescript", "vim", diff --git a/.config/nvim/lua/user/utils/project_settings.lua b/.config/nvim/lua/user/utils/project_settings.lua index 2c22b02..b4ce1d3 100644 --- a/.config/nvim/lua/user/utils/project_settings.lua +++ b/.config/nvim/lua/user/utils/project_settings.lua @@ -1,6 +1,6 @@ M = { is_copilot_lua_enabled = false, - is_copilot_vim_enabled = true, + is_copilot_vim_enabled = false, } return M diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap##os.Darwin similarity index 100% rename from .config/yadm/bootstrap rename to .config/yadm/bootstrap##os.Darwin diff --git a/.config/yadm/bootstrap##os.Linux b/.config/yadm/bootstrap##os.Linux new file mode 100755 index 0000000..4c60299 --- /dev/null +++ b/.config/yadm/bootstrap##os.Linux @@ -0,0 +1,171 @@ +#!/bin/bash + +# prompt for system password +sudo -v + +# ensure curl is installed +type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) + +# add gh cli to apt sources +echo "Adding gh cli to apt sources..." +curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null + +# update packages +sudo apt update + +# upgrade all installed packages +sudo apt upgrade -y + +# install apt packages +APT_PACKAGES=( + curl + gnupg2 + gdebi + bat + vim-gtk3 + cmake + pkg-config + libfuse2 + libfreetype6-dev + libfontconfig1-dev + libxcb-xfixes0-dev + libxkbcommon-dev + python3 + python3-dev + python3-pip + libegl1-mesa-dev + fzf + exa + fd-find + gh + tmux + zsh + pipx + shellcheck + nodejs + npm + ripgrep +) + +sudo apt install -y "${APT_PACKAGES[@]}" + +# cleanup packages that are not needed +sudo apt autoremove -y + +# install neovim +# the --classic options is required because nvim was published using classic confinement +sudo snap install --classic nvim + +# install rustup +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y +source "${HOME}/.cargo/env" +rustup override set stable +rustup update stable + +# create directory to clone manually installed applications +APPS_DIR="${HOME}/Apps" +mkdir -p "${APPS_DIR}" + +# install alacritty +ALACRITTY_DIR="${APPS_DIR}/alacritty" + +if [ -d "${ALACRITTY_DIR}" ]; then + echo "Alacritty directory exists. Updating..." + cd "${ALACRITTY_DIR}" + git pull +else + echo "Cloning Alacritty for the first time..." + git clone https://github.com/alacritty/alacritty.git "${ALACRITTY_DIR}" + cd "${ALACRITTY_DIR}" +fi + +cargo build --release + +ALACRITTY_SYMLINK="/usr/local/bin/alacritty" + +if [ -L "${ALACRITTY_SYMLINK}" ]; then + echo "Symbolic link to Alacrity already exists. Updating..." + sudo rm "${ALACRITTY_SYMLINK}" + sudo ln -s "${ALACRITTY_DIR}/target/release/alacritty" "${ALACRITTY_SYMLINK}" +else + echo "Creating a symbolic link for Alacritty..." + sudo ln -s "${ALACRITTY_DIR}/target/release/alacritty" "${ALACRITTY_SYMLINK}" +fi + +cd "${HOME}" + +# install nerd fonts +install_nerd_font() { + local font_name=$1 + local NERD_FONT_REPO="https://github.com/ryanoasis/nerd-fonts/releases/download" + local NERD_FONT_VERSION="v3.1.1" + local TMP_NERDFONT_DIR=$(mktemp -d /tmp/nerdfonts-XXXXXX) + + if fc-list | grep -qi "$font_name"; then + echo "Font $font_name is already installed. Skipping..." + else + echo "Installing Nerd Font $font_name..." + # Download and unzip the font + wget "${NERD_FONT_REPO}/${NERD_FONT_VERSION}/${font_name}.zip" -O "${TMP_NERDFONT_DIR}/${font_name}.zip" + unzip -o "${TMP_NERDFONT_DIR}/${font_name}.zip" -d ~/.fonts + + # Clean up temporary files + rm -rf "${TMP_NERDFONT_DIR}" + + # Update font cache + fc-cache -fv + fi + +} + +install_nerd_font "JetBrainsMono" + +# install python applications with pipx +install_or_update_app_with_pipx() { + for package in "$@"; do + if ! command -v "${package}" >/dev/null 2>&1; then + echo "Installing ${package} with pipx" + pipx install "${package}" + else + echo "Upgrading ${package} with pipx" + pipx upgrade "${package}" + fi + done +} + +pipx ensurepath + +install_or_update_app_with_pipx "black" \ + "codespell" \ + "flake8" \ + "isort" \ + "mypy" \ + "pycodestyle" \ + "pylint" \ + "virtualenv" \ + "pipenv" \ + "hatch" \ + "tox" + +# install go +TMP_GO_DIR=$(mktemp -d /tmp/go-XXXXXX) +GO_VERSION="1.21.5" +GO_TARBALL="go${GO_VERSION}.linux-amd64.tar.gz" + +echo "Installing Go ${GO_VERSION}..." +wget -P "${TMP_GO_DIR}" "https://go.dev/dl/${GO_TARBALL}" +sudo rm -rf /usr/local/go +sudo tar -C /usr/local -xzf "${TMP_GO_DIR}/${GO_TARBALL}" + +# install shfmt +echo "Installing shfmt..." +go install mvdan.cc/sh/v3/cmd/shfmt@latest + +# install tmux plugin manager +if [ ! -d "${HOME}/.tmux/plugins/tpm" ]; then + echo "Installing tmux plugin manager..." + mkdir -p "${HOME}/.tmux/plugins" + git clone https://github.com/tmux-plugins/tpm "${HOME}/.tmux/plugins/tpm" +fi diff --git a/.config/yadm/bootstrap##os.WSL b/.config/yadm/bootstrap##os.WSL new file mode 100755 index 0000000..4c60299 --- /dev/null +++ b/.config/yadm/bootstrap##os.WSL @@ -0,0 +1,171 @@ +#!/bin/bash + +# prompt for system password +sudo -v + +# ensure curl is installed +type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) + +# add gh cli to apt sources +echo "Adding gh cli to apt sources..." +curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null + +# update packages +sudo apt update + +# upgrade all installed packages +sudo apt upgrade -y + +# install apt packages +APT_PACKAGES=( + curl + gnupg2 + gdebi + bat + vim-gtk3 + cmake + pkg-config + libfuse2 + libfreetype6-dev + libfontconfig1-dev + libxcb-xfixes0-dev + libxkbcommon-dev + python3 + python3-dev + python3-pip + libegl1-mesa-dev + fzf + exa + fd-find + gh + tmux + zsh + pipx + shellcheck + nodejs + npm + ripgrep +) + +sudo apt install -y "${APT_PACKAGES[@]}" + +# cleanup packages that are not needed +sudo apt autoremove -y + +# install neovim +# the --classic options is required because nvim was published using classic confinement +sudo snap install --classic nvim + +# install rustup +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y +source "${HOME}/.cargo/env" +rustup override set stable +rustup update stable + +# create directory to clone manually installed applications +APPS_DIR="${HOME}/Apps" +mkdir -p "${APPS_DIR}" + +# install alacritty +ALACRITTY_DIR="${APPS_DIR}/alacritty" + +if [ -d "${ALACRITTY_DIR}" ]; then + echo "Alacritty directory exists. Updating..." + cd "${ALACRITTY_DIR}" + git pull +else + echo "Cloning Alacritty for the first time..." + git clone https://github.com/alacritty/alacritty.git "${ALACRITTY_DIR}" + cd "${ALACRITTY_DIR}" +fi + +cargo build --release + +ALACRITTY_SYMLINK="/usr/local/bin/alacritty" + +if [ -L "${ALACRITTY_SYMLINK}" ]; then + echo "Symbolic link to Alacrity already exists. Updating..." + sudo rm "${ALACRITTY_SYMLINK}" + sudo ln -s "${ALACRITTY_DIR}/target/release/alacritty" "${ALACRITTY_SYMLINK}" +else + echo "Creating a symbolic link for Alacritty..." + sudo ln -s "${ALACRITTY_DIR}/target/release/alacritty" "${ALACRITTY_SYMLINK}" +fi + +cd "${HOME}" + +# install nerd fonts +install_nerd_font() { + local font_name=$1 + local NERD_FONT_REPO="https://github.com/ryanoasis/nerd-fonts/releases/download" + local NERD_FONT_VERSION="v3.1.1" + local TMP_NERDFONT_DIR=$(mktemp -d /tmp/nerdfonts-XXXXXX) + + if fc-list | grep -qi "$font_name"; then + echo "Font $font_name is already installed. Skipping..." + else + echo "Installing Nerd Font $font_name..." + # Download and unzip the font + wget "${NERD_FONT_REPO}/${NERD_FONT_VERSION}/${font_name}.zip" -O "${TMP_NERDFONT_DIR}/${font_name}.zip" + unzip -o "${TMP_NERDFONT_DIR}/${font_name}.zip" -d ~/.fonts + + # Clean up temporary files + rm -rf "${TMP_NERDFONT_DIR}" + + # Update font cache + fc-cache -fv + fi + +} + +install_nerd_font "JetBrainsMono" + +# install python applications with pipx +install_or_update_app_with_pipx() { + for package in "$@"; do + if ! command -v "${package}" >/dev/null 2>&1; then + echo "Installing ${package} with pipx" + pipx install "${package}" + else + echo "Upgrading ${package} with pipx" + pipx upgrade "${package}" + fi + done +} + +pipx ensurepath + +install_or_update_app_with_pipx "black" \ + "codespell" \ + "flake8" \ + "isort" \ + "mypy" \ + "pycodestyle" \ + "pylint" \ + "virtualenv" \ + "pipenv" \ + "hatch" \ + "tox" + +# install go +TMP_GO_DIR=$(mktemp -d /tmp/go-XXXXXX) +GO_VERSION="1.21.5" +GO_TARBALL="go${GO_VERSION}.linux-amd64.tar.gz" + +echo "Installing Go ${GO_VERSION}..." +wget -P "${TMP_GO_DIR}" "https://go.dev/dl/${GO_TARBALL}" +sudo rm -rf /usr/local/go +sudo tar -C /usr/local -xzf "${TMP_GO_DIR}/${GO_TARBALL}" + +# install shfmt +echo "Installing shfmt..." +go install mvdan.cc/sh/v3/cmd/shfmt@latest + +# install tmux plugin manager +if [ ! -d "${HOME}/.tmux/plugins/tpm" ]; then + echo "Installing tmux plugin manager..." + mkdir -p "${HOME}/.tmux/plugins" + git clone https://github.com/tmux-plugins/tpm "${HOME}/.tmux/plugins/tpm" +fi diff --git a/.gitconfig.local##os.Linux b/.gitconfig.local##os.Linux index f610814..9d60102 100644 --- a/.gitconfig.local##os.Linux +++ b/.gitconfig.local##os.Linux @@ -1,4 +1,9 @@ +# vim: set filetype=gitconfig : [credential] helper = store UseHttpPath = true - +[user] + name = Salim Hamed + email = salimhamed@gmail.com +[core] + editor = nvim diff --git a/.gitconfig.local##os.WSL b/.gitconfig.local##os.WSL new file mode 100644 index 0000000..9d60102 --- /dev/null +++ b/.gitconfig.local##os.WSL @@ -0,0 +1,9 @@ +# vim: set filetype=gitconfig : +[credential] + helper = store + UseHttpPath = true +[user] + name = Salim Hamed + email = salimhamed@gmail.com +[core] + editor = nvim diff --git a/.ssh/config b/.ssh/config##os.Darwin similarity index 98% rename from .ssh/config rename to .ssh/config##os.Darwin index eec714b..8dd9e8d 100644 --- a/.ssh/config +++ b/.ssh/config##os.Darwin @@ -2,4 +2,3 @@ Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa - diff --git a/.ssh/config##os.Linux b/.ssh/config##os.Linux new file mode 100644 index 0000000..2305d89 --- /dev/null +++ b/.ssh/config##os.Linux @@ -0,0 +1,3 @@ +Host * + AddKeysToAgent yes + IdentityFile ~/.ssh/id_rsa diff --git a/.ssh/config##os.WSL b/.ssh/config##os.WSL new file mode 100644 index 0000000..2305d89 --- /dev/null +++ b/.ssh/config##os.WSL @@ -0,0 +1,3 @@ +Host * + AddKeysToAgent yes + IdentityFile ~/.ssh/id_rsa diff --git a/.vimrc b/.vimrc index f35785e..ad90105 100644 --- a/.vimrc +++ b/.vimrc @@ -45,7 +45,7 @@ let mapleader = "," "copy & paste set pastetoggle= "toggles paste mode using -set clipboard=unnamed "use the system clipboard +set clipboard=unnamedplus "use the system clipboard "mouse and backspace set mouse=a "on OSX press ALT and click