Compare commits
5 commits
f2ea356808
...
8226abf839
Author | SHA1 | Date | |
---|---|---|---|
8226abf839 | |||
f2da0e6ee5 | |||
685ca0b086 | |||
b3c8e565b6 | |||
d709f1b3cc |
10 changed files with 102 additions and 47 deletions
|
@ -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
|
||||
|
|
|
@ -8,7 +8,7 @@ vim.keymap.set("n", "<C-n>", "<cmd>cnext<CR>zz")
|
|||
vim.keymap.set("n", "<A-h>", "<cmd>bp<CR>")
|
||||
vim.keymap.set("n", "<A-l>", "<cmd>bn<CR>")
|
||||
--jk as escape
|
||||
vim.keymap.set("i", "jk","<esc>")
|
||||
vim.keymap.set("i", "jk", "<esc>")
|
||||
-- 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", "<C-d>", "<C-d>zz", {desc = "Center cursor after moving down half-page"})
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>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", "<C-d>", "<C-d>zz", { desc = "Center cursor after moving down half-page" })
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>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", "<space><space>x", "<cmd>source %<CR>")
|
||||
vim.keymap.set("n", "<space>x", ":.lua<CR>")
|
||||
vim.keymap.set("v", "<space>x", ":lua<CR>")
|
||||
--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)
|
||||
|
|
|
@ -3,7 +3,7 @@ return {
|
|||
'saghen/blink.cmp',
|
||||
lazy = false,
|
||||
dependencies = 'rafamadriz/friendly-snippets',
|
||||
build = 'cargo build --release',
|
||||
version = "*",
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = 'default',
|
||||
|
|
|
@ -181,7 +181,8 @@ return {
|
|||
markdown = { "mdformat" },
|
||||
rust = { "rustfmt" },
|
||||
go = { "gofmt" },
|
||||
json = { "jq" }
|
||||
json = { "jq" },
|
||||
bash = { "shfmt" }
|
||||
}
|
||||
})
|
||||
end,
|
||||
|
|
|
@ -47,5 +47,12 @@ return {
|
|||
require("blame").setup()
|
||||
end
|
||||
},
|
||||
"tpope/vim-fugitive"
|
||||
"tpope/vim-fugitive",
|
||||
-- {
|
||||
-- "nvzone/typr",
|
||||
-- dependencies = {
|
||||
-- "nvzone/volt"
|
||||
-- },
|
||||
-- opts = {}
|
||||
-- }
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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<CR>' || 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"<CR>' || 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"<CR>' || 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"<CR>' || 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<CR>' || 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"<CR>' || 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"<CR>' || true
|
||||
echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua
|
||||
nvim --server $addr --remote-send ':lua vim.opt.background = "dark"<CR>' || 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<CR>' || 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"<CR>' || 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"<CR>' || 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"<CR>' || 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<CR>' || 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"<CR>' || 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"<CR>' || true
|
||||
echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua
|
||||
nvim --server $addr --remote-send ':lua vim.opt.background = "light"<CR>' || true
|
||||
echo "vim.opt.background = 'light'" >> ~/.config/nvim/lua/core/theme.lua
|
||||
done
|
||||
|
||||
#Change kitty theme
|
||||
kitten themes --reload-in=all Gruvbox Light
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue