diff --git a/.config/ghostty/config b/.config/ghostty/config index 6e32c08..bc8355a 100644 --- a/.config/ghostty/config +++ b/.config/ghostty/config @@ -1,9 +1,18 @@ -# Font -font-family = JetBrainsMono Nerd Font Mono -font-size = 16 - # Theme theme = GruvboxDarkHard background = 1d2021 -window-theme = ghostty -window-decoration = false + +# Font +font-family = JetBrainsMono Nerd Font Mono +font-style = Medium +font-size = 16 +font-feature = -calt +font-feature = -liga +font-feature = -dlig + +window-padding-color = background +macos-titlebar-style = hidden + +term = "xterm-256color" + +auto-update = download diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index be96bd2..df882e7 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -8,7 +8,7 @@ vim.keymap.set("n", "", "cnextzz") vim.keymap.set("n", "", "bp") vim.keymap.set("n", "", "bn") --jk as escape -vim.keymap.set("i", "jk","") +vim.keymap.set("i", "jk", "") -- Copy to system clipboard vim.keymap.set({ 'n', 'x' }, 'gy', '"+y', { desc = 'Copy to system clipboard' }) -- Paste from system clipboard in normal mode @@ -16,10 +16,16 @@ vim.keymap.set('n', 'gp', '"+p', { desc = 'Paste from system clipboard' }) -- Paste from system clipboard in visual mode without overwriting the clipboard vim.keymap.set('x', 'gp', '"+P', { desc = 'Paste from system clipboard' }) --Center screen after some motions -vim.keymap.set("n", "", "zz", {desc = "Center cursor after moving down half-page"}) -vim.keymap.set("n", "", "zz", {desc = "Center cursor after moving down half-page"}) -vim.keymap.set("n", "G", "Gzz", {desc = "Center cursor after moving down half-page"}) +vim.keymap.set("n", "", "zz", { desc = "Center cursor after moving down half-page" }) +vim.keymap.set("n", "", "zz", { desc = "Center cursor after moving down half-page" }) +vim.keymap.set("n", "G", "Gzz", { desc = "Center cursor after moving down half-page" }) --Run lua stuff (ty teej) vim.keymap.set("n", "x", "source %") vim.keymap.set("n", "x", ":.lua") vim.keymap.set("v", "x", ":lua") +--Merge lines in visual mode +vim.keymap.set("v", "J", function() + for _ = 1, vim.fn.getpos("'>")[2] - vim.fn.getpos("'<")[2] - 1 do + vim.api.nvim_command("normal! J") + end +end) diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 518d0b1..fd61445 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -3,7 +3,7 @@ return { 'saghen/blink.cmp', lazy = false, dependencies = 'rafamadriz/friendly-snippets', - build = 'cargo build --release', + version = "*", opts = { keymap = { preset = 'default', diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 5940247..066291b 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -181,7 +181,8 @@ return { markdown = { "mdformat" }, rust = { "rustfmt" }, go = { "gofmt" }, - json = { "jq" } + json = { "jq" }, + bash = { "shfmt" } } }) end, diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua index 4e09576..3115bc5 100644 --- a/.config/nvim/lua/plugins/misc.lua +++ b/.config/nvim/lua/plugins/misc.lua @@ -47,5 +47,12 @@ return { require("blame").setup() end }, - "tpope/vim-fugitive" + "tpope/vim-fugitive", + -- { + -- "nvzone/typr", + -- dependencies = { + -- "nvzone/volt" + -- }, + -- opts = {} + -- } } diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index eb8a371..d60abea 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -84,13 +84,17 @@ return { table.insert(newVirtText, { suffix, 'MoreMsg' }) return newVirtText end - - -- global handler - -- `handler` is the 2nd parameter of `setFoldVirtTextHandler`, - -- check out `./lua/ufo.lua` and search `setFoldVirtTextHandler` for detail. require('ufo').setup({ fold_virt_text_handler = handler }) end + }, + { + "OXY2DEV/markview.nvim", + ft = "markdown", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons" + } } } diff --git a/.config/tmux/tmux_binds.conf b/.config/tmux/tmux_binds.conf index 4ab8df1..2577479 100644 --- a/.config/tmux/tmux_binds.conf +++ b/.config/tmux/tmux_binds.conf @@ -25,7 +25,7 @@ bind-key 'o' if-shell "$is_vim" 'send-keys F8' 'select-pane -R' # Tmus sessionizer unbind s -bind-key 's' display-popup -E -w 90% -h 90% "~/.local/bin/tms" +bind-key 's' display-popup -E -w 60% -h 40% "~/.local/bin/tms" unbind g bind-key 'g' display-popup -d '#{pane_current_path}' -E -w 100% -h 100% "lazygit" diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index 4366349..469b8b8 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -44,5 +44,6 @@ export XDG_CONFIG_HOME="${HOME}/.config" export XDG_CACHE_HOME="${HOME}/.cache" export XDG_DATA_HOME="${HOME}/.local/share" export XDG_STATE_HOME="${HOME}/.local/state" +export XDG_RUNTIME_DIR=/tmp . "$HOME/.cargo/env" diff --git a/.local/bin/change-theme.sh b/.local/bin/change-theme.sh index 45c1ca2..39a1a71 100755 --- a/.local/bin/change-theme.sh +++ b/.local/bin/change-theme.sh @@ -81,14 +81,16 @@ case $1 in tmux_bar_focused_fg="#1d2021" - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' || true - echo "vim.g.gruvbox_material_better_performance = 1" > ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_background = "hard"' || true - echo "vim.g.gruvbox_material_background = 'hard'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_foreground = "original"' || true - echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.opt.background = "dark"' || true - echo "vim.opt.background = 'dark'" >> ~/.config/nvim/lua/core/theme.lua + for addr in $XDG_RUNTIME_DIR/nvim.*; do + nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' || true + echo "vim.g.gruvbox_material_better_performance = 1" > ~/.config/nvim/lua/core/theme.lua + nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_background = "hard"' || true + echo "vim.g.gruvbox_material_background = 'hard'" >> ~/.config/nvim/lua/core/theme.lua + nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_foreground = "original"' || true + echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua + nvim --server $addr --remote-send ':lua vim.opt.background = "dark"' || true + echo "vim.opt.background = 'dark'" >> ~/.config/nvim/lua/core/theme.lua + done #Change kitty theme kitten themes --reload-in=all Gruvbox Dark @@ -106,14 +108,16 @@ case $1 in tmux_bar_focused_fg="#f2e5bc" - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' || true - echo "vim.g.gruvbox_material_better_performance = 1" > ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_background = "soft"' || true - echo "vim.g.gruvbox_material_background = 'soft'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_foreground = "original"' || true - echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.opt.background = "light"' || true - echo "vim.opt.background = 'light'" >> ~/.config/nvim/lua/core/theme.lua + for addr in $XDG_RUNTIME_DIR/nvim.*; do + nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' || true + echo "vim.g.gruvbox_material_better_performance = 1" > ~/.config/nvim/lua/core/theme.lua + nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_background = "soft"' || true + echo "vim.g.gruvbox_material_background = 'soft'" >> ~/.config/nvim/lua/core/theme.lua + nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_foreground = "original"' || true + echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua + nvim --server $addr --remote-send ':lua vim.opt.background = "light"' || true + echo "vim.opt.background = 'light'" >> ~/.config/nvim/lua/core/theme.lua + done #Change kitty theme kitten themes --reload-in=all Gruvbox Light diff --git a/.local/bin/tms b/.local/bin/tms index 182cdc2..7af9e19 100755 --- a/.local/bin/tms +++ b/.local/bin/tms @@ -1,33 +1,56 @@ #!/usr/bin/env bash if [[ $# -eq 1 ]]; then - selected=$1 + selected_path=$1 else - uni_projects=$(find ~/projects/University -mindepth 3 -maxdepth 3 -type d) - personal_projects=$(find ~/projects/Personal -mindepth 1 -maxdepth 1 -type d) - work_projects=$(find ~/projects/Work -mindepth 1 -maxdepth 1 -type d) - vaults=$(find ~/vaults -mindepth 2 -maxdepth 2 -type d) - gits=$(find ~/gits -mindepth 1 -maxdepth 1 -type d) - dotfiles=$(find ~/.config -mindepth 1 -maxdepth 1 -type d) - #Merge the two lists - selected=$(echo -e "$uni_projects\n$personal_projects\n$work_projects\n$dotfiles\n$gits\n$vaults" | fzf) + # Define commands dynamically with display names + + declare -A commands=( + ["University"]="fd . ~/projects/University --exact-depth 3 --type d 2> /dev/null" + ["Personal"]="fd . ~/projects/Personal --exact-depth 1 --type d 2> /dev/null" + ["Work"]="fd . ~/projects/Work --exact-depth 1 --type d 2> /dev/null" + ["Vaults"]="fd . ~/vaults --exact-depth 2 --type d 2> /dev/null" + ["Git Repositories"]="fd . ~/gits --exact-depth 1 --type d 2> /dev/null" + ["Dotfiles"]="fd . ~/.config --exact-depth 1 --type d 2> /dev/null" + ) + + + # Initialize combined list + combined_list="" + + for display_name in "${!commands[@]}"; do + command="${commands[$display_name]}" + result=$(eval $command | while read -r path; do + last_segment=$(basename "$path") + echo -e "$display_name > $last_segment\t$path" + done) + [[ -n "$result" ]] && combined_list+="$result\n" + done + + selected=$(echo -e "$combined_list" | fzf --with-nth=1 --delimiter='\t' --prompt="Select a project: " \ + --preview "eza --tree --level=2 --icons --color=always {2}" \ + --preview-window=right:50%:wrap) + + selected_path=$(echo "$selected" | awk -F'\t' '{print $2}') fi -if [[ -z $selected ]]; then +# Exit if no selection was made +if [[ -z $selected_path ]]; then exit 0 fi -selected_name=$(basename "$selected" | tr . _) +# Prepare tmux session name +selected_name=$(basename "$selected_path" | tr . _) selected_name=${selected_name^^} tmux_running=$(pgrep tmux) if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then - tmux new-session -s $selected_name -c $selected + tmux new-session -s $selected_name -c "$selected_path" exit 0 fi if ! tmux has-session -t=$selected_name 2> /dev/null; then - tmux new-session -ds $selected_name -c $selected + tmux new-session -ds $selected_name -c "$selected_path" fi tmux switch-client -t $selected_name