diff options
Diffstat (limited to 'mac')
| -rw-r--r-- | mac/.config/lf/lfrc | 4 | ||||
| -rw-r--r-- | mac/.config/shell/aliasrc | 2 | ||||
| -rw-r--r-- | mac/.config/shell/bm-files | 6 | ||||
| -rw-r--r-- | mac/.config/shell/profile | 29 | ||||
| -rw-r--r-- | mac/.config/vim/vimrc | 3 | ||||
| -rw-r--r-- | mac/.config/zsh/.zshrc | 2 | ||||
| -rw-r--r-- | mac/.config/zsh/keymaps.zsh | 8 | ||||
| -rwxr-xr-x | mac/.local/bin/bmshortcuts | 20 | ||||
| -rwxr-xr-x | mac/.local/bin/lastfiles (renamed from mac/.local/bin/lastnvim) | 0 |
9 files changed, 42 insertions, 32 deletions
diff --git a/mac/.config/lf/lfrc b/mac/.config/lf/lfrc index f7cb423..c9b2d36 100644 --- a/mac/.config/lf/lfrc +++ b/mac/.config/lf/lfrc @@ -432,7 +432,7 @@ cmd zi ${{ cmd follow_link %{{ lf -remote "send ${id} select '$(readlink $f)'" }} -cmd lastnvim ${{ +cmd lastfiles ${{ list=$(nvim -u NONE --headless +'lua io.write(table.concat(vim.v.oldfiles, "\n") .. "\n")' +qa) file=$(printf "%s" "$list" | while read -r file; do [ -f "$file" ] && printf "%s\n" "$file" @@ -516,7 +516,7 @@ map <delete> delete; clear; save-select map <enter> $$EDITOR "$f" map <c-v> push :!nvim<space> map vlf edit-config -map vll lastnvim +map vll lastfiles map vln $$EDITOR "$(nvim -u NONE --headless +'lua io.write(vim.v.oldfiles[1] .. "\n")' +qa)" # Extract diff --git a/mac/.config/shell/aliasrc b/mac/.config/shell/aliasrc index 2163e68..6dcdf7d 100644 --- a/mac/.config/shell/aliasrc +++ b/mac/.config/shell/aliasrc @@ -292,7 +292,7 @@ alias nlu='NVIM_APPNAME=LunarVim nvim' alias nlv='NVIM_APPNAME=LazyVim nvim' alias nnc='NVIM_APPNAME=NvChad nvim' alias snv='sudo nvim' -alias vll='lastnvim -l' +alias vll='lastfiles -l' alias vln='$EDITOR -c '\''execute "edit " . v:oldfiles[0] | normal ''0'\' # nxsiv diff --git a/mac/.config/shell/bm-files b/mac/.config/shell/bm-files index 17aefce..aabc278 100644 --- a/mac/.config/shell/bm-files +++ b/mac/.config/shell/bm-files @@ -25,10 +25,12 @@ vnp ${XDG_CONFIG_HOME:-${HOME}/.config}/ncmpcpp/config vns ${XDG_CONFIG_HOME:-${HOME}/.config}/newsboat/config # Newsboat config (RSS reader) vnu ${XDG_CONFIG_HOME:-${HOME}/.config}/newsboat/urls # Newsboat url (RSS reader) vqt $HOME/.qutebrowser/config.py # Qutebrowser config +vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells) vse ${XDG_CONFIG_HOME:-${HOME}/.config}/sesh/sesh.toml # Sesh config vsh $HOME/.ssh/config # SSH config vsk ${XDG_CONFIG_HOME:-${HOME}/.config}/sketchybar/sketchybarrc # Sketchybar config -vsp ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets +vsn ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets +vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system vss ${XDG_CONFIG_HOME:-${HOME}/.config}/starship/starship.toml # Starship vsx ${XDG_CONFIG_HOME:-${HOME}/.config}/nsxiv/exec/key-handler # Nsxiv (image viewer) key/script handler vtc ${XDG_CONFIG_HOME:-${HOME}/.config}/task/taskrc # Task config @@ -43,8 +45,6 @@ vvw ${XDG_DATA_HOME:-${HOME}/.local/share}/vimwiki/index.md vyc ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/yazi.toml # Yazi config vyi ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/init.lua # Yazi init for plugins vyk ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap-default.toml # Yazi key config -vza ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by zsh (and potentially other shells) vzc ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/.zshrc # Zsh config vzk ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/keymaps.zsh # Zsh keymaps -vzp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Zsh profile used for system vzs ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh # Zsh scripts diff --git a/mac/.config/shell/profile b/mac/.config/shell/profile index 0b676be..da5b702 100644 --- a/mac/.config/shell/profile +++ b/mac/.config/shell/profile @@ -1,19 +1,9 @@ ################################################### -### --- ENV PATH --- ### +### --- LANG --- ### ################################################### export LANG=ko_KR.UTF-8 export LC_CTYPE=ko_KR.UTF-8 -# Add all directories in each subdirectory to $PATH -export PATH="$PATH:$(find ~/.local/bin -path '*/.git*' -prune -o \( -type f -o -type l \) -perm -u=x -exec dirname {} \; | sort -u | paste -sd ':' -)" -export PATH="$PATH:$(find ~/.local/share/.password-store -type d -name '.extensions' | paste -sd ':' -)" -export PATH="$PATH:/opt/homebrew/bin" -export PATH="$PATH:$(find -L /opt/homebrew/Caskroom \( -name bin -o -name MacOS \) -type d -print 2>/dev/null | sort -u | paste -s -d ':' -)" -export PATH="$PATH:$(find -L /opt/homebrew/Cellar -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -)" -export PATH="$PATH:$(find -L /opt/homebrew/opt -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -)" - -unsetopt PROMPT_SP 2>/dev/null - ################################################### ### --- DEFAULT PROGRAMS --- ### ################################################### @@ -64,7 +54,6 @@ export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" ### --- ASDF --- ### export ASDF_CONFIG_FILE="$XDG_CONFIG_HOME/asdf/asdfrc" export ASDF_DATA_DIR="$XDG_DATA_HOME/asdf" -export PATH="$ASDF_DATA_DIR/shims:$PATH" ### --- BAT --- ### export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config" @@ -236,5 +225,21 @@ export STARDICT_DATA_DIR="$XDG_DATA_HOME/dic" export STARDICT_HISTFILE="$XDG_DATA_HOME/history/dic" export SDCV_PAGER='less --quit-if-one-screen -RX' +################################################### +### --- ENV PATH --- ### +################################################### +# Add all directories in each subdirectory to $PATH +export PATH="$(find ~/.local/bin -path '*/.git*' -prune -o \( -type f -o -type l \) -perm -u=x -exec dirname {} \; | sort -u | paste -sd ':' -):$PATH" +export PATH="$(find ~/.local/share/.password-store -type d -name '.extensions' | paste -sd ':' -):$PATH" +export PATH="$ASDF_DATA_DIR/shims:$PATH" +export PATH="/opt/homebrew/bin:$PATH" +export PATH="$(find -L /opt/homebrew/Caskroom \( -name bin -o -name MacOS \) -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" +export PATH="$(find -L /opt/homebrew/Cellar -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" +export PATH="$(find -L /opt/homebrew/opt -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" + +unsetopt PROMPT_SP 2>/dev/null + +################################################### ### --- SHORTCUTS --- ### +################################################### [ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && nohup bmshortcuts >/dev/null 2>&1 & diff --git a/mac/.config/vim/vimrc b/mac/.config/vim/vimrc index 0535aec..0a76953 100644 --- a/mac/.config/vim/vimrc +++ b/mac/.config/vim/vimrc @@ -367,9 +367,6 @@ set title set timeoutlen=300 " Time (in milliseconds) to wait for a mapping set ttimeoutlen=10 " Time (in milliseconds) to wait for terminal key codes -" Esc -set noesckeys - " Set the commands to save in history default number is 20. set history=1000 diff --git a/mac/.config/zsh/.zshrc b/mac/.config/zsh/.zshrc index a90fe52..145ee4a 100644 --- a/mac/.config/zsh/.zshrc +++ b/mac/.config/zsh/.zshrc @@ -124,3 +124,5 @@ export AVANTE_OPENAI_API_KEY="$(pass show api/chatGPT/nvim | head -n1)" ### --- OPENAI --- ### export OPENAI_API_KEY="$(pass show api/chatGPT/nvim | head -n1)" + +. "$(brew --prefix asdf)/libexec/asdf.sh" diff --git a/mac/.config/zsh/keymaps.zsh b/mac/.config/zsh/keymaps.zsh index 6653e44..583b8e4 100644 --- a/mac/.config/zsh/keymaps.zsh +++ b/mac/.config/zsh/keymaps.zsh @@ -164,7 +164,7 @@ if [[ -f "${ZPLUGINDIR:-${HOME}/.local/bin/zsh}/zsh-vi-mode/zsh-vi-mode.plugin.z bindkey -s '^D' '^ucdi\n' bindkey -s '^F' '^ufzffiles\n' bindkey -s '^G' '^uyazi\n' - bindkey -s '^N' '^ulastnvim\n' + bindkey -s '^N' '^ulastfiles\n' bindkey -s '^O' '^utmo\n' bindkey -s '^P' '^ufzfpass\n' bindkey -s '^Q' '^uhtop\n' @@ -180,7 +180,7 @@ if [[ -f "${ZPLUGINDIR:-${HOME}/.local/bin/zsh}/zsh-vi-mode/zsh-vi-mode.plugin.z zvm_bind_script viins '^X^F' 'gitfiles' zvm_bind_script viins '^X^G' 'rgafiles ' zvm_bind_script viins '^X^L' 'gloac' - zvm_bind_script viins '^X^N' 'lastnvim -l' + zvm_bind_script viins '^X^N' 'lastfiles -l' # zvm_bind_script viins '^X^O' '^u\n' zvm_bind_script viins '^X^Q' 'fpkill' zvm_bind_script viins '^X^R' 'fgst' @@ -310,7 +310,7 @@ else bindkey -s '^D' '^ucdi\n' bindkey -s '^F' '^ufzffiles\n' bindkey -s '^G' '^uyazi\n' - bindkey -s '^N' '^ulastnvim\n' + bindkey -s '^N' '^ulastfiles\n' bindkey -s '^O' '^utmo\n' bindkey -s '^P' '^ufzfpass\n' bindkey -s '^Q' '^uhtop\n' @@ -324,7 +324,7 @@ else bindkey -s '^X^F' '^ugitfiles\n' bindkey -s '^X^G' '^urgafiles ' bindkey -s '^X^L' '^ugloac\n' - bindkey -s '^X^N' '^ulastnvim -l\n' + bindkey -s '^X^N' '^ulastfiles -l\n' # bindkey -s '^X^O' '^u\n' bindkey -s '^X^Q' '^ufpkill\n' bindkey -s '^X^R' '^ufgst\n' diff --git a/mac/.local/bin/bmshortcuts b/mac/.local/bin/bmshortcuts index 2a8d3fa..af4ad58 100755 --- a/mac/.local/bin/bmshortcuts +++ b/mac/.local/bin/bmshortcuts @@ -10,7 +10,13 @@ zsh_named_dirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" command -v lf && lf_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/lf/shortcutrc" || lf_shortcuts="/dev/null" command -v vim && vim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vim/shortcuts.vim" || vim_shortcuts="/dev/null" command -v nvim && nvim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/shortcuts.lua" || nvim_shortcuts="/dev/null" -command -v yazi && yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml" || yazi_shortcuts="/dev/null" +if command -v yazi; then + yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml" + yazi_shortcuts_tmp="$yazi_shortcuts.tmp" +else + yazi_shortcuts="/dev/null" + yazi_shortcuts_tmp="/dev/null" +fi command -v ranger && ranger_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/ranger/shortcuts.conf" || ranger_shortcuts="/dev/null" command -v qutebrowser && qute_shortcuts="$HOME/.qutebrowser/shortcuts.py" || qute_shortcuts="/dev/null" command -v fish && fish_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/fish/shortcuts.fish" || fish_shortcuts="/dev/null" @@ -22,7 +28,7 @@ printf "# vim: filetype=sh\\n" >"$fish_shortcuts" printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts" printf "# vim: filetype=sh\\n" >"$shell_env_shortcuts" printf "\" vim: filetype=vim\\n" >"$vifm_shortcuts" -cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts" +[ -f "$HOME/.config/yazi/keymap-default.toml" ] && cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. eval "echo \"$(cat "$bmdirs")\"" | @@ -43,7 +49,7 @@ eval "echo \"$(cat "$bmdirs")\"" | printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path); key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" } - printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts.tmp\"}" + printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts_tmp\"}" # Format the `files` file in the correct syntax and sent it to both configs. eval "echo \"$(cat "$bmfiles")\"" | @@ -66,10 +72,10 @@ eval "echo \"$(cat "$bmfiles")\"" | printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path); key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" } - printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts.tmp\" }" + printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts_tmp\" }" # Merge bookmarks into keymap-default.toml -if [ -f "$yazi_shortcuts.tmp" ]; then +if [ -f "$yazi_shortcuts_tmp" ]; then # Find the line with the closing bracket in the [mgr] section line_num=$(grep -n "^]" "$yazi_shortcuts" | head -1 | cut -d: -f1) @@ -77,11 +83,11 @@ if [ -f "$yazi_shortcuts.tmp" ]; then head -n $((line_num - 1)) "$yazi_shortcuts" >"$yazi_shortcuts.new" echo "" >>"$yazi_shortcuts.new" echo " # Custom bookmarks" >>"$yazi_shortcuts.new" - cat "$yazi_shortcuts.tmp" >>"$yazi_shortcuts.new" + cat "$yazi_shortcuts_tmp" >>"$yazi_shortcuts.new" echo "]" >>"$yazi_shortcuts.new" tail -n +$((line_num + 1)) "$yazi_shortcuts" >>"$yazi_shortcuts.new" # Replace the original file mv "$yazi_shortcuts.new" "$yazi_shortcuts" - rm -f "$yazi_shortcuts.tmp" + rm -f "$yazi_shortcuts_tmp" fi diff --git a/mac/.local/bin/lastnvim b/mac/.local/bin/lastfiles index b1ab6c9..b1ab6c9 100755 --- a/mac/.local/bin/lastnvim +++ b/mac/.local/bin/lastfiles |
