diff --git a/.config/ghostty/config b/.config/ghostty/config index bc8355a..6e32c08 100644 --- a/.config/ghostty/config +++ b/.config/ghostty/config @@ -1,18 +1,9 @@ +# Font +font-family = JetBrainsMono Nerd Font Mono +font-size = 16 + # Theme theme = GruvboxDarkHard background = 1d2021 - -# 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 +window-theme = ghostty +window-decoration = false diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index df882e7..be96bd2 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,16 +16,10 @@ 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 fd61445..518d0b1 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', - version = "*", + build = 'cargo build --release', opts = { keymap = { preset = 'default', diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 066291b..5940247 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -181,8 +181,7 @@ return { markdown = { "mdformat" }, rust = { "rustfmt" }, go = { "gofmt" }, - json = { "jq" }, - bash = { "shfmt" } + json = { "jq" } } }) end, diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua index 3115bc5..4e09576 100644 --- a/.config/nvim/lua/plugins/misc.lua +++ b/.config/nvim/lua/plugins/misc.lua @@ -47,12 +47,5 @@ return { require("blame").setup() end }, - "tpope/vim-fugitive", - -- { - -- "nvzone/typr", - -- dependencies = { - -- "nvzone/volt" - -- }, - -- opts = {} - -- } + "tpope/vim-fugitive" } diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index d60abea..eb8a371 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -84,17 +84,13 @@ 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 2577479..4ab8df1 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 60% -h 40% "~/.local/bin/tms" +bind-key 's' display-popup -E -w 90% -h 90% "~/.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 469b8b8..4366349 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -44,6 +44,5 @@ 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 39a1a71..45c1ca2 100755 --- a/.local/bin/change-theme.sh +++ b/.local/bin/change-theme.sh @@ -81,16 +81,14 @@ case $1 in tmux_bar_focused_fg="#1d2021" - 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 + 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 #Change kitty theme kitten themes --reload-in=all Gruvbox Dark @@ -108,16 +106,14 @@ case $1 in tmux_bar_focused_fg="#f2e5bc" - 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 + 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 #Change kitty theme kitten themes --reload-in=all Gruvbox Light diff --git a/.local/bin/tms b/.local/bin/tms index 7af9e19..182cdc2 100755 --- a/.local/bin/tms +++ b/.local/bin/tms @@ -1,56 +1,33 @@ #!/usr/bin/env bash if [[ $# -eq 1 ]]; then - selected_path=$1 + selected=$1 else - # 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}') + 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) fi -# Exit if no selection was made -if [[ -z $selected_path ]]; then +if [[ -z $selected ]]; then exit 0 fi -# Prepare tmux session name -selected_name=$(basename "$selected_path" | tr . _) +selected_name=$(basename "$selected" | tr . _) selected_name=${selected_name^^} tmux_running=$(pgrep tmux) if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then - tmux new-session -s $selected_name -c "$selected_path" + tmux new-session -s $selected_name -c $selected exit 0 fi if ! tmux has-session -t=$selected_name 2> /dev/null; then - tmux new-session -ds $selected_name -c "$selected_path" + tmux new-session -ds $selected_name -c $selected fi tmux switch-client -t $selected_name