Compare commits

...

30 Commits

Author SHA1 Message Date
github-actions[bot]
5aaa177756 chore: update pre-commit hooks (#86)
Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>
2025-03-03 08:32:57 +02:00
31a6ea351d Update linters.yml 2025-03-02 12:41:30 +02:00
333995c7f4 fix(config): vim config
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-28 17:08:06 +02:00
d6b24c27a1 chore(config): add LM Studio to path
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-27 16:20:16 +02:00
89ae4003f9 chore(config): ignore config/git/local.d/*
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-27 15:39:19 +02:00
7a008c3ae8 chore(config): update brewfile
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-27 15:34:36 +02:00
a6f89e80bd chore(config): tmux: tms keybindings, update docs
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-27 15:34:11 +02:00
3d987e491e chore(config): fish: add cargo bin, pyenv init
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-27 15:33:24 +02:00
e1729fd925 chore(config): aerospace, add Microsoft RDC
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-27 15:32:32 +02:00
4e5dae4161 fix(ci): update-submodules fetch-depth to 2 2025-02-27 14:58:22 +02:00
6b30ebfddb fix(config): vim plugged config 2025-02-27 14:58:03 +02:00
github-actions[bot]
0aafae5d97 chore: update pre-commit hooks (#85)
Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>
2025-02-27 07:37:20 +02:00
32cc561d20 chore(ci): update-submodules fetch depth to 1 2025-02-26 18:00:55 +02:00
784fddea64 fix(repo): remove tools/dotbot-asdf submodule 2025-02-26 00:41:03 +02:00
0a058aaf22 chore(config): fish_add_path "$CARGO_HOME/bin" 2025-02-25 23:39:46 +02:00
ff6876a56d chore(bin): remove markdown-to-telegram.py 2025-02-25 20:32:29 +02:00
ccbd29fc40 chore(dotbot): remove dotbot-asdf 2025-02-25 20:31:57 +02:00
9251225d3e chore(bin): update x-env-list with skipping 2025-02-25 20:26:32 +02:00
241eed66f5 chore(config): update zed config 2025-02-25 20:25:24 +02:00
6de8e92968 chore(scripts): update install-cargo-packages.sh 2025-02-25 20:25:01 +02:00
2cdda605ef chore(config): tweak tmux.conf 2025-02-25 20:23:41 +02:00
87a4ec8ecf chore(config): clean up fish/exports.fish 2025-02-25 20:23:06 +02:00
87613d10ec chore(config): remove ehfive/fish-bash2env 2025-02-25 20:22:36 +02:00
f6dc193f6a feat(config): add vim config (#61)
* feat: vim config
* fix: nvim was getting vimrc config
* chore: cleanup, cr fix
* feat(config): add config/fish/alias.fish
2025-02-25 20:20:31 +02:00
4adbbdb47a chore(config): tmux tweaks 2025-02-25 10:46:01 +02:00
bdbe10f612 chore(config): aerospace sessions app
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-25 10:41:54 +02:00
531488001f chore(config): shared.sh tweak
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-25 10:41:39 +02:00
4f2b47d5c3 feat(asdf): removal of asdf
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-25 10:41:20 +02:00
github-actions[bot]
dfbdb89aca chore: update pre-commit hooks (#83) 2025-02-24 08:30:19 +02:00
ivuorinen
c9489ae50f chore(git): Update submodules (automated) 2025-02-24 05:03:01 +01:00
37 changed files with 3726 additions and 671 deletions

View File

@@ -5,6 +5,8 @@ jobs:
linters: linters:
name: Linters name: Linters
runs-on: self-hosted runs-on: self-hosted
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: GitHub Actions - name: GitHub Actions

View File

@@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 2
token: ${{secrets.GITHUB_TOKEN}} token: ${{secrets.GITHUB_TOKEN}}
- name: Config Git User - name: Config Git User
run: | run: |
@@ -33,7 +33,7 @@ jobs:
echo "$name updated to $tag" echo "$name updated to $tag"
fi fi
' '
if git diff --quiet; then if git diff --quiet; then
echo "No updates for submodules." echo "No updates for submodules."
else else

6
.gitignore vendored
View File

@@ -22,6 +22,10 @@ config/npm/npmrc
config/nvim/lazy-lock.json config/nvim/lazy-lock.json
config/nvim/spell/* config/nvim/spell/*
!config/nvim/spell/.gitkeep !config/nvim/spell/.gitkeep
config/git/local.d/*
!config/git/local.d/.gitkeep
config/vim/fzf
config/vim/plugged/*
config/zed/* config/zed/*
!config/zed/settings.json !config/zed/settings.json
config/zsh/.zcompdump config/zsh/.zcompdump
@@ -36,3 +40,5 @@ ssh/local.d/*
config/fish/fish_variables config/fish/fish_variables
**/exports-secret.fish **/exports-secret.fish
config/fish/completions/asdf.fish config/fish/completions/asdf.fish
config/vim/.netrwhist
*.swp

9
.gitmodules vendored
View File

@@ -74,18 +74,9 @@
url = https://github.com/erikw/tmux-dark-notify.git url = https://github.com/erikw/tmux-dark-notify.git
ignore = dirty ignore = dirty
[submodule "asdf"]
path = local/asdf
url = https://github.com/asdf-vm/asdf.git
ignore = dirty
[submodule "antidote"] [submodule "antidote"]
path = tools/antidote path = tools/antidote
url = https://github.com/mattmc3/antidote.git url = https://github.com/mattmc3/antidote.git
shallow = true shallow = true
ignore = dirty ignore = dirty
[submodule "dotbot-asdf"]
path = tools/dotbot-asdf
url = https://github.com/sobolevn/dotbot-asdf
ignore = dirty

View File

@@ -49,7 +49,7 @@ repos:
- id: actionlint - id: actionlint
- repo: https://github.com/renovatebot/pre-commit-hooks - repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.174.3 rev: 39.185.0
hooks: hooks:
- id: renovate-config-validator - id: renovate-config-validator

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
git submodule sync --recursive
# dotbot and plugins # dotbot and plugins
git submodule add --name dotbot \ git submodule add --name dotbot \
-f https://github.com/anishathalye/dotbot.git tools/dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot
@@ -9,16 +11,12 @@ git submodule add --name dotbot-include \
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
git submodule add --name dotbot-pip \ git submodule add --name dotbot-pip \
-f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip -f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip
git submodule add --name dotbot-asdf \
-f https://github.com/sobolevn/dotbot-asdf tools/dotbot-asdf
# other repos # other repos
git submodule add --name cheat-community \ git submodule add --name cheat-community \
-f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
git submodule add --name cheat-tldr \ git submodule add --name cheat-tldr \
-f https://github.com/ivuorinen/cheatsheet-tldr.git config/cheat/cheatsheets/tldr -f https://github.com/ivuorinen/cheatsheet-tldr.git config/cheat/cheatsheets/tldr
git submodule add --name asdf \
-f https://github.com/asdf-vm/asdf.git local/asdf
git submodule add --name antidote \ git submodule add --name antidote \
--depth 1 \ --depth 1 \
-f https://github.com/mattmc3/antidote.git tools/antidote -f https://github.com/mattmc3/antidote.git tools/antidote
@@ -54,18 +52,20 @@ git config -f .gitmodules submodule.antidote.shallow true
# remove old submodules # remove old submodules
folders=( folders=(
"config/tmux/plugins/tpm" "config/tmux/plugins/tpm"
"config/tmux/plugins/tmux" "config/tmux/plugins/tmux"
"config/tmux/plugins/tmux-menus" "config/tmux/plugins/tmux-menus"
"config/tmux/plugins/tmux-resurrect" "config/tmux/plugins/tmux-resurrect"
"tools/dotbot-crontab" "tools/dotbot-crontab"
"tools/dotbot-snap" "tools/dotbot-snap"
"config/nvim-kickstart" "config/nvim-kickstart"
"local/bin/asdf" "local/bin/asdf"
"local/asdf"
"tools/dotbot-asdf"
) )
for folder in "${folders[@]}"; do for folder in "${folders[@]}"; do
[ -d "$folder" ] && \ [ -d "$folder" ] \
rm -rf "$folder" && \ && rm -rf "$folder" \
msgr run_done "Removed old submodule $folder" && msgr run_done "Removed old submodule $folder"
done done

View File

@@ -25,3 +25,6 @@ x-have antidot && {
PROMPT_DIRTRIM=3 PROMPT_DIRTRIM=3
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)' PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'
PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] ' PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] '
# Added by LM Studio CLI (lms)
export PATH="$PATH:$HOME/.lmstudio/bin"

View File

@@ -1,2 +1 @@
use node use node
use asdf

View File

@@ -1,19 +0,0 @@
golang 1.23.4
rust 1.83.0
direnv 2.35.0
fd 10.2.0
1password-cli 2.30.3
age 1.2.1
dotenv-linter 3.3.0
editorconfig-checker 2.8.0
github-cli 2.64.0
hadolint 2.12.0
kubectl 1.32.0
pre-commit 4.0.1
ripgrep 14.1.1
shellcheck 0.10.0
shfmt 3.10.0
terragrunt 0.71.1
tf-summarize 0.3.14
yamllint 1.35.1
yq 4.44.6

View File

@@ -12,7 +12,6 @@ export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$LOCAL_SHARE/nvim/mason/bin:$L
export SHARED_SCRIPTS_SOURCED=0 export SHARED_SCRIPTS_SOURCED=0
source "$DOTFILES/config/shared.sh" source "$DOTFILES/config/shared.sh"
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
# zsh completions directory # zsh completions directory
[ -z "$ZSH_COMPLETIONS" ] && export ZSH_COMPLETIONS="$XDG_CONFIG_HOME/zsh/completion" [ -z "$ZSH_COMPLETIONS" ] && export ZSH_COMPLETIONS="$XDG_CONFIG_HOME/zsh/completion"
@@ -23,7 +22,6 @@ FPATH="$ZSH_COMPLETIONS:$FPATH"
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}" ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
source "$DOTFILES/config/zsh/antidote.zsh" source "$DOTFILES/config/zsh/antidote.zsh"
# source "$DOTFILES/config/zsh/prompt.zsh"
# Function to source FZF configuration # Function to source FZF configuration
source_fzf_config() source_fzf_config()
@@ -51,10 +49,6 @@ setup_tmux_window_name_plugin()
fi fi
} }
if [[ -n $GHOSTTY_RESOURCES_DIR ]]; then
source "$GHOSTTY_RESOURCES_DIR"/shell-integration/zsh/ghostty-integration
fi
source_fzf_config source_fzf_config
setup_tmux_window_name_plugin setup_tmux_window_name_plugin
x-have antidot && eval "$(antidot init)" x-have antidot && eval "$(antidot init)"
@@ -66,3 +60,6 @@ bashcompinit
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
export P10K_CONFIG="$DOTFILES/config/zsh/p10k.zsh" export P10K_CONFIG="$DOTFILES/config/zsh/p10k.zsh"
[[ ! -f "$P10K_CONFIG" ]] || source "$P10K_CONFIG" [[ ! -f "$P10K_CONFIG" ]] || source "$P10K_CONFIG"
# Added by LM Studio CLI (lms)
export PATH="$PATH:$HOME/.lmstudio/bin"

View File

@@ -115,6 +115,13 @@ run = ['layout floating']
if.app-id = 'com.apple.backup.launcher' # TimeMachine if.app-id = 'com.apple.backup.launcher' # TimeMachine
run = ['layout floating'] run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.philipyoungg.session-setapp' # Session app (Setapp)
run = ['layout floating']
[[on-window-detected]]
if.app-id = 'com.microsoft.rdc.macos' # Remote Desktop
run = ['layout floating']
# Possible values: (qwerty|dvorak) # Possible values: (qwerty|dvorak)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping # See https://nikitabobko.github.io/AeroSpace/guide#key-mapping

View File

@@ -7,6 +7,8 @@ x-have eza && {
alias ls="eza -h -s=type --git --icons --group-directories-first" alias ls="eza -h -s=type --git --icons --group-directories-first"
} }
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
# Easier navigation: .., ..., .... # Easier navigation: .., ..., ....
alias ..="cd .." alias ..="cd .."
alias ...="cd ../.." alias ...="cd ../.."

View File

@@ -1,3 +0,0 @@
### Do not edit. This was autogenerated by 'asdf direnv setup' ###
export ASDF_DIRENV_BIN="$(asdf where direnv)/bin/direnv"
eval "$($ASDF_DIRENV_BIN hook zsh)"

View File

@@ -291,35 +291,6 @@ hash shopt 2> /dev/null && shopt -s checkwinsize
# shellcheck disable=SC2155 # shellcheck disable=SC2155
export SHORT_HOST=$(hostname -s) export SHORT_HOST=$(hostname -s)
# asdf
# https://github.com/asdf-vm/asdf
msg "Setting up asdf configuration"
export ASDF_DIR="${HOME}/.local/asdf"
[[ -d $ASDF_DIR ]] && {
# [[ -d $ASDF_DIR/completions ]] && FPATH="$ASDF_DIR/completions:$FPATH"
# [[ -d $ASDF_DIR/plugins ]] && FPATH="$ASDF_DIR/plugins:$FPATH"
export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME}/asdf/asdfrc"
export ASDF_DATA_DIR="${ASDF_DIR}"
export ASDF_PLUGIN_MANAGER_PLUGIN_VERSIONS_FILENAME="${XDG_CONFIG_HOME}/asdf/plugin-versions"
export ASDF_LOG_FILE="${XDG_CACHE_HOME}/asdf/asdf.log"
export ASDF_FORCE_PREPEND=yes
## Default package files
export ASDF_CRATE_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/cargo-packages"
export ASDF_GEM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/gem-packages"
export ASDF_GOLANG_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/golang-packages"
export ASDF_NPM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/npm-packages"
export ASDF_PYTHON_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/python-packages"
## Plugin configuration
export ASDF_DIRENV_IGNORE_MISSING_PLUGINS=1
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
## Add asdf to path
export PATH="${ASDF_DIR}/bin:${PATH}"
source "$ASDF_DIR/asdf.sh"
}
# Antidote configuration # Antidote configuration
# https://getantidote.github.io/ # https://getantidote.github.io/
msg "Setting up Antidote configuration" msg "Setting up Antidote configuration"

4
config/fish/alias.fish Normal file
View File

@@ -0,0 +1,4 @@
# Set aliases for fish shell
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'

View File

@@ -2,6 +2,9 @@
# │ fish/config.fish │ # │ fish/config.fish │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
test -e "$HOME/.config/fish/alias.fish" &&
source "$HOME/.config/fish/alias.fish"
test -e "$HOME/.config/fish/exports.fish" && test -e "$HOME/.config/fish/exports.fish" &&
source "$HOME/.config/fish/exports.fish" source "$HOME/.config/fish/exports.fish"
@@ -11,3 +14,6 @@ if status is-interactive
# Start tmux if not already running and not in SSH # Start tmux if not already running and not in SSH
open-tmux # defined in functions/open-tmux.fish open-tmux # defined in functions/open-tmux.fish
end end
# Added by LM Studio CLI (lms)
set -gx PATH $PATH $HOME/.lmstudio/bin

View File

@@ -1,69 +1,39 @@
#!/usr/bin/env fish #!/usr/bin/env fish
# Set XDG environment variables # XDG Base Directory Specification
test -z "$XDG_CONFIG_HOME" && set -x XDG_CONFIG_HOME "$HOME/.config" set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME "$HOME/.config"
test -z "$XDG_DATA_HOME" && set -x XDG_DATA_HOME "$HOME/.local/share" set -q XDG_DATA_HOME; or set -x XDG_DATA_HOME "$HOME/.local/share"
test -z "$XDG_CACHE_HOME" && set -x XDG_CACHE_HOME "$HOME/.cache" set -q XDG_CACHE_HOME; or set -x XDG_CACHE_HOME "$HOME/.cache"
test -z "$XDG_STATE_HOME" && set -x XDG_STATE_HOME "$HOME/.local/state" set -q XDG_STATE_HOME; or set -x XDG_STATE_HOME "$HOME/.local/state"
test -z "$XDG_BIN_HOME" && set -x XDG_BIN_HOME "$HOME/.local/bin" set -q XDG_BIN_HOME; or set -x XDG_BIN_HOME "$HOME/.local/bin"
test -z "$XDG_RUNTIME_DIR" && set -x XDG_RUNTIME_DIR "$HOME/.local/run" set -q XDG_RUNTIME_DIR; or set -x XDG_RUNTIME_DIR "$HOME/.local/run"
# Set dotfiles directory # Dotfiles directory
test -z "$DOTFILES" && set -x DOTFILES "$HOME/.dotfiles" set -q DOTFILES; or set -x DOTFILES "$HOME/.dotfiles"
# Set other environment variables # Editor settings
test -z "$EDITOR" && set -x EDITOR "nvim" set -q EDITOR; or set -x EDITOR "nvim"
test -z "$VISUAL" && set -x VISUAL "code" set -q VISUAL; or set -x VISUAL "code"
test -z "$HOSTNAME" && set -x HOSTNAME (hostname -s) set -q HOSTNAME; or set -x HOSTNAME (hostname -s)
# Add local bin to path # Add local bin to path
fish_add_path "$XDG_BIN_HOME" fish_add_path "$XDG_BIN_HOME"
# Set npm environment variables # Add cargo bin to path
test -z "$NPM_CONFIG_PREFIX" && set -x NPM_CONFIG_PREFIX "$XDG_DATA_HOME/npm" fish_add_path "$XDG_SHARE_HOME/cargo/bin"
# NPM configuration
set -q NPM_CONFIG_PREFIX; or set -x NPM_CONFIG_PREFIX "$XDG_DATA_HOME/npm"
fish_add_path "$NPM_CONFIG_PREFIX/bin" fish_add_path "$NPM_CONFIG_PREFIX/bin"
# Set yarn environment variables # Yarn configuration
test -z "$YARN_GLOBAL_FOLDER" && set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn" set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
fish_add_path "$YARN_GLOBAL_FOLDER/bin" fish_add_path "$YARN_GLOBAL_FOLDER/bin"
# Set mason environment variables # Mason configuration
test -z "$MASON_HOME" && set -x MASON_HOME "$XDG_DATA_HOME/nvim/mason" set -q MASON_HOME; or set -x MASON_HOME "$XDG_DATA_HOME/nvim/mason"
fish_add_path "$MASON_HOME/bin" fish_add_path "$MASON_HOME/bin"
# Set ASDF environment variables
test -z "$ASDF_DATA_DIR" && set -x ASDF_DATA_DIR "$XDG_DATA_HOME/asdf"
test -z "$ASDF_LOG_PATH" && set -x ASDF_LOG_PATH "$XDG_STATE_HOME/asdf/log"
test -z "$ASDF_CONFIG_DIR" && set -x ASDF_CONFIG_DIR "$XDG_CONFIG_HOME/asdf"
test -z "$ASDF_CONFIG_FILE" && set -x ASDF_CONFIG_FILE "$ASDF_CONFIG_DIR/asdfrc"
## Default package files
test -z "$ASDF_CRATE_DEFAULT_PACKAGES_FILE" && set -x ASDF_CRATE_DEFAULT_PACKAGES_FILE "$ASDF_CONFIG_DIR/cargo-packages"
test -z "$ASDF_GEM_DEFAULT_PACKAGES_FILE" && set -x ASDF_GEM_DEFAULT_PACKAGES_FILE "$ASDF_CONFIG_DIR/gem-packages"
test -z "$ASDF_GOLANG_DEFAULT_PACKAGES_FILE" && set -x ASDF_GOLANG_DEFAULT_PACKAGES_FILE "$ASDF_CONFIG_DIR/golang-packages"
test -z "$ASDF_NPM_DEFAULT_PACKAGES_FILE" && set -x ASDF_NPM_DEFAULT_PACKAGES_FILE "$ASDF_CONFIG_DIR/npm-packages"
test -z "$ASDF_PYTHON_DEFAULT_PACKAGES_FILE" && set -x ASDF_PYTHON_DEFAULT_PACKAGES_FILE "$ASDF_CONFIG_DIR/python-packages"
## Plugin configuration
set -x ASDF_DIRENV_IGNORE_MISSING_PLUGINS "1"
set -x ASDF_GOLANG_MOD_VERSION_ENABLED "true"
set -x ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY "latest_available"
test -z "$ASDF_GOLANG_MOD_VERSION_ENABLED" && set -x ASDF_GOLANG_MOD_VERSION_ENABLED "true"
## Load ASDF, if it exists
test -f "$HOME/.local/asdf/asdf.fish" &&
source "$HOME/.local/asdf/asdf.fish" &&
asdf reshim &&
fish_add_path "$ASDF_DIR/shims"
## If $HOME/.local/asdf/asdf.fish does not exist, show error message
test -e "$HOME/.local/asdf/asdf.fish" || echo "ASDF not found"
# Load ASDF completions
test -d "$XDG_CONFIG_HOME/fish/completions" ||
mkdir -p "$XDG_CONFIG_HOME/fish/completions";
test -e "$XDG_CONFIG_HOME/fish/completions/asdf.fish" ||
and ln -s "$ASDF_DIR/completions/asdf.fish" "$XDG_CONFIG_HOME/fish/completions/asdf.fish"
# Set Neovim environment variables # Set Neovim environment variables
test -z "$NVIM_STATE" && set -x NVIM_STATE "$XDG_STATE_HOME/nvim" test -z "$NVIM_STATE" && set -x NVIM_STATE "$XDG_STATE_HOME/nvim"
test -z "$NVIM_CONFIG_HOME" && set -x NVIM_CONFIG_HOME "$XDG_CONFIG_HOME/nvim" test -z "$NVIM_CONFIG_HOME" && set -x NVIM_CONFIG_HOME "$XDG_CONFIG_HOME/nvim"
@@ -75,136 +45,133 @@ test -z "$NVIM_SHADA_PATH" && set -x NVIM_SHADA_PATH "$NVIM_STATE/shada"
test -z "$NVIM_UNDO_PATH" && set -x NVIM_UNDO_PATH "$NVIM_STATE/undo" test -z "$NVIM_UNDO_PATH" && set -x NVIM_UNDO_PATH "$NVIM_STATE/undo"
# Ansible configuration # Ansible configuration
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html set -q ANSIBLE_HOME; or set -x ANSIBLE_HOME "$XDG_CONFIG_HOME/ansible"
test -z "$ANSIBLE_HOME" && set -x ANSIBLE_HOME "$XDG_CONFIG_HOME/ansible" set -q ANSIBLE_CONFIG; or set -x ANSIBLE_CONFIG "$ANSIBLE_HOME/ansible.cfg"
test -z "$ANSIBLE_CONFIG" && set -x ANSIBLE_CONFIG "$ANSIBLE_HOME/ansible.cfg" set -q ANSIBLE_GALAXY_CACHE_DIR; or set -x ANSIBLE_GALAXY_CACHE_DIR "$XDG_CACHE_HOME/ansible/galaxy_cache"
test -z "$ANSIBLE_GALAXY_CACHE_DIR" && set -x ANSIBLE_GALAXY_CACHE_DIR "$XDG_CACHE_HOME/ansible/galaxy_cache"
x-dc "$ANSIBLE_HOME" x-dc "$ANSIBLE_HOME"
x-dc "$ANSIBLE_GALAXY_CACHE_DIR" x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
# AWS configuration # AWS configuration
test -z "$AWS_CONFIG_FILE" && set -x AWS_CONFIG_FILE "$XDG_STATE_HOME/aws/config" set -q AWS_CONFIG_FILE; or set -x AWS_CONFIG_FILE "$XDG_STATE_HOME/aws/config"
test -z "$AWS_SHARED_CREDENTIALS_FILE" && set -x AWS_SHARED_CREDENTIALS_FILE "$XDG_STATE_HOME/aws/credentials" set -q AWS_SHARED_CREDENTIALS_FILE; or set -x AWS_SHARED_CREDENTIALS_FILE "$XDG_STATE_HOME/aws/credentials"
test -z "$AWS_SESSION_TOKEN" && set -x AWS_SESSION_TOKEN "$XDG_STATE_HOME/aws/session_token" set -q AWS_SESSION_TOKEN; or set -x AWS_SESSION_TOKEN "$XDG_STATE_HOME/aws/session_token"
test -z "$AWS_DATA_PATH" && set -x AWS_DATA_PATH "$XDG_DATA_HOME/aws" set -q AWS_DATA_PATH; or set -x AWS_DATA_PATH "$XDG_DATA_HOME/aws"
test -z "$AWS_DEFAULT_OUTPUT" && set -x AWS_DEFAULT_OUTPUT "table" set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT "table"
test -z "$AWS_CONFIGURE_KEYS" && set -x AWS_CONFIGURE_KEYS "true" set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS "true"
test -z "$AWS_CONFIGURE_SESSION" && set -x AWS_CONFIGURE_SESSION "true" set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION "true"
test -z "$AWS_CONFIGURE_SESSION_DURATION" && set -x AWS_CONFIGURE_SESSION_DURATION "7200" set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION "7200"
test -z "$AWS_CONFIGURE_SESSION_MFA" && set -x AWS_CONFIGURE_SESSION_MFA "true" set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA "true"
test -z "$AWS_CONFIGURE_PROFILE" && set -x AWS_CONFIGURE_PROFILE "true" set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE "true"
test -z "$AWS_CONFIGURE_PROMPT" && set -x AWS_CONFIGURE_PROMPT "true" set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT "true"
test -z "$AWS_CONFIGURE_PROMPT_DEFAULT" && set -x AWS_CONFIGURE_PROMPT_DEFAULT "true" set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT "true"
# Brew configuration # Brew configuration
test -z "$HOMEBREW_NO_ANALYTICS" && set -x HOMEBREW_NO_ANALYTICS "true" set -q HOMEBREW_NO_ANALYTICS; or set -x HOMEBREW_NO_ANALYTICS "true"
test -z "$HOMEBREW_NO_ENV_HINTS" && set -x HOMEBREW_NO_ENV_HINTS "true" set -q HOMEBREW_NO_ENV_HINTS; or set -x HOMEBREW_NO_ENV_HINTS "true"
test -z "$HOMEBREW_BUNDLE_MAS_SKIP" && set -x HOMEBREW_BUNDLE_MAS_SKIP "true" set -q HOMEBREW_BUNDLE_MAS_SKIP; or set -x HOMEBREW_BUNDLE_MAS_SKIP "true"
test -z "$HOMEBREW_BUNDLE_FILE" && set -x HOMEBREW_BUNDLE_FILE "$XDG_CONFIG_HOME/homebrew/Brewfile" set -q HOMEBREW_BUNDLE_FILE; or set -x HOMEBREW_BUNDLE_FILE "$XDG_CONFIG_HOME/homebrew/Brewfile"
# Set composer environment variables # Composer configuration
test -z "$COMPOSER_HOME" && set -x COMPOSER_HOME "$XDG_STATE_HOME/composer" set -q COMPOSER_HOME; or set -x COMPOSER_HOME "$XDG_STATE_HOME/composer"
test -z "$COMPOSER_BIN" && set -x COMPOSER_BIN "$COMPOSER_HOME/vendor/bin" set -q COMPOSER_BIN; or set -x COMPOSER_BIN "$COMPOSER_HOME/vendor/bin"
fish_add_path "$COMPOSER_BIN" fish_add_path "$COMPOSER_BIN"
# direnv, https://direnv.net/ # direnv configuration
# https://direnv.net/docs/hook.html set -q DIRENV_LOG_FORMAT; or set -x DIRENV_LOG_FORMAT ''
# Set the hook to show the direnv message in a different color
# export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
test -z "$DIRENV_LOG_FORMAT" && set -x DIRENV_LOG_FORMAT ''
# docker, https://docs.docker.com/engine/reference/commandline/cli/ # Docker configuration
test -z "$DOCKER_CONFIG" && set -x DOCKER_CONFIG "$XDG_CONFIG_HOME/docker" set -q DOCKER_CONFIG; or set -x DOCKER_CONFIG "$XDG_CONFIG_HOME/docker"
x-dc "$DOCKER_CONFIG" x-dc "$DOCKER_CONFIG"
test -z "$DOCKER_HIDE_LEGACY_COMMANDS" && set -x DOCKER_HIDE_LEGACY_COMMANDS "true" set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS "true"
# Docke: Disable snyk ad set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST "false"
test -z "$DOCKER_SCAN_SUGGEST" && set -x DOCKER_SCAN_SUGGEST "false"
# fzf # fzf configuration
test -z "$FZF_BASE" && set -x FZF_BASE "$XDG_CONFIG_HOME/fzf" set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
test -z "$FZF_DEFAULT_OPTS" && set -x FZF_DEFAULT_OPTS '--height 40% --tmux bottom,40% --layout reverse --border top' set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS '--height 40% --tmux bottom,40% --layout reverse --border top'
# GnuPG # GnuPG configuration
# https://gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html set -q GNUPGHOME; or set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
test -z "$GNUPGHOME" && set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
# Go # Go configuration
test -z "$GOPATH" && set -x GOPATH "$XDG_DATA_HOME/go" set -q GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go"
test -z "$GOBIN" && set -x GOBIN "$XDG_BIN_HOME" set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME"
fish_add_path "$GOBIN" fish_add_path "$GOBIN"
# NPM: Add npm packages to path # NPM: Add npm packages to path
if x-have node; if x-have node;
set -x NVM_NODE_BIN_DIR $(dirname $(which node)) set -x NVM_NODE_BIN_DIR (dirname (which node))
fish_add_path "$NVM_NODE_BIN_DIR" fish_add_path "$NVM_NODE_BIN_DIR"
end end
# 1Password # 1Password configuration
test -z "$OP_CACHE" && set -x OP_CACHE "$XDG_STATE_HOME/1password" set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
# Python # Python configuration
test -z "$WORKON_HOME" && set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs" set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
test -z "$PYENV_ROOT" && set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv" set -q PYENV_ROOT; or set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv"
fish_add_path "$PYENV_ROOT/bin" fish_add_path "$PYENV_ROOT/bin"
if x-have pyenv; and not functions -q pyenv
status --is-interactive; and source (pyenv init - | psub)
end
## Set poetry environment variables # Poetry configuration
test -z "$POETRY_HOME" && set -x POETRY_HOME "$XDG_DATA_HOME/poetry" set -q POETRY_HOME; or set -x POETRY_HOME "$XDG_DATA_HOME/poetry"
fish_add_path "$POETRY_HOME/bin" fish_add_path "$POETRY_HOME/bin"
# Rust / cargo # Rust / cargo configuration
test -z "$CARGO_HOME" && set -x CARGO_HOME "$XDG_DATA_HOME/cargo" set -q CARGO_HOME; or set -x CARGO_HOME "$XDG_DATA_HOME/cargo"
test -z "$CARGO_BIN_HOME" && set -x CARGO_BIN_HOME "$XDG_BIN_HOME" set -q CARGO_BIN_HOME; or set -x CARGO_BIN_HOME "$XDG_BIN_HOME"
test -z "$RUSTUP_HOME" && set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup" set -q RUSTUP_HOME; or set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup"
set -x RUST_WITHOUT "clippy,docs,rls" set -x RUST_WITHOUT "clippy,docs,rls"
fish_add_path "$CARGO_BIN_HOME" fish_add_path "$CARGO_BIN_HOME"
fish_add_path "$CARGO_HOME/bin"
fish_add_path "$XDG_SHARE_HOME/bob/nvim-bin" fish_add_path "$XDG_SHARE_HOME/bob/nvim-bin"
# screen # screen configuration
# https://www.gnu.org/software/screen/manual/screen.html set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"
test -z "$SCREENRC" && set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"
# Sonarlint # Sonarlint configuration
test -z "$SONARLINT_HOME" && set -x SONARLINT_HOME "$XDG_DATA_HOME/sonarlint" set -q SONARLINT_HOME; or set -x SONARLINT_HOME "$XDG_DATA_HOME/sonarlint"
test -z "$SONARLINT_BIN" && set -x SONARLINT_BIN "$XDG_BIN_HOME" set -q SONARLINT_BIN; or set -x SONARLINT_BIN "$XDG_BIN_HOME"
test -z "$SONARLINT_USER_HOME" && set -x SONARLINT_USER_HOME "$XDG_DATA_HOME/sonarlint" set -q SONARLINT_USER_HOME; or set -x SONARLINT_USER_HOME "$XDG_DATA_HOME/sonarlint"
# Terraform # Terraform configuration
test -z "$TF_DATA_DIR" && set -x TF_DATA_DIR "$XDG_STATE_HOME/terraform" set -q TF_DATA_DIR; or set -x TF_DATA_DIR "$XDG_STATE_HOME/terraform"
test -z "$TF_CLI_CONFIG_FILE" && set -x TF_CLI_CONFIG_FILE "$XDG_CONFIG_HOME/terraform/terraformrc" set -q TF_CLI_CONFIG_FILE; or set -x TF_CLI_CONFIG_FILE "$XDG_CONFIG_HOME/terraform/terraformrc"
test -z "$TF_PLUGIN_CACHE_DIR" && set -x TF_PLUGIN_CACHE_DIR "$XDG_CACHE_HOME/terraform/plugin-cache" set -q TF_PLUGIN_CACHE_DIR; or set -x TF_PLUGIN_CACHE_DIR "$XDG_CACHE_HOME/terraform/plugin-cache"
# tmux # tmux configuration
# https://tmux.github.io/ set -q TMUX_TMPDIR; or set -x TMUX_TMPDIR "$XDG_STATE_HOME/tmux"
test -z "$TMUX_TMPDIR" && set -x TMUX_TMPDIR "$XDG_STATE_HOME/tmux" set -q TMUX_CONF_DIR; or set -x TMUX_CONF_DIR "$XDG_CONFIG_HOME/tmux"
test -z "$TMUX_CONF_DIR" && set -x TMUX_CONF_DIR "$XDG_CONFIG_HOME/tmux" set -q TMUX_PLUGINS; or set -x TMUX_PLUGINS "$TMUX_CONF_DIR/plugins"
test -z "$TMUX_PLUGINS" && set -x TMUX_PLUGINS "$TMUX_CONF_DIR/plugins" set -q TMUX_CONF; or set -x TMUX_CONF "$TMUX_CONF_DIR/tmux.conf"
test -z "$TMUX_CONF" && set -x TMUX_CONF "$TMUX_CONF_DIR/tmux.conf" set -q TMUX_PLUGIN_MANAGER_PATH; or set -x TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGINS"
test -z "$TMUX_PLUGIN_MANAGER_PATH" && set -x TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGINS"
# tms # Source tmux theme activation script for Fish shell
# https://github.com/jrmoulton/tmux-sessionizer if test -f "$DOTFILES/config/tmux/theme-activate.fish"
test -z "$TMS_CONFIG_FILE" && set -x TMS_CONFIG_FILE "$XDG_CONFIG_HOME/tms/config.toml" source "$DOTFILES/config/tmux/theme-activate.fish"
end
# wakatime # tms configuration
# https://github.com/wakatime/wakatime-cli set -q TMS_CONFIG_FILE; or set -x TMS_CONFIG_FILE "$XDG_CONFIG_HOME/tms/config.toml"
test -z "$WAKATIME_HOME" && set -x WAKATIME_HOME "$XDG_STATE_HOME/wakatime"
# wakatime configuration
set -q WAKATIME_HOME; or set -x WAKATIME_HOME "$XDG_STATE_HOME/wakatime"
x-dc "$WAKATIME_HOME" x-dc "$WAKATIME_HOME"
# misc # Miscellaneous configuration
test -z "$CHEAT_USE_FZF" && set -x CHEAT_USE_FZF "true" set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF "true"
test -z "$SQLITE_HISTORY" && set -x SQLITE_HISTORY "$XDG_CACHE_HOME/sqlite/sqlite_history" set -q SQLITE_HISTORY; or set -x SQLITE_HISTORY "$XDG_CACHE_HOME/sqlite/sqlite_history"
# Source exports-secret.fish if it exists # Source additional configuration files if they exist
if test -f "$DOTFILES/config/fish/exports-secret.fish" if test -f "$DOTFILES/config/fish/exports-secret.fish"
source "$DOTFILES/config/fish/exports-secret.fish" source "$DOTFILES/config/fish/exports-secret.fish"
end end
# Source $DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish if it exists
if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish" if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish" source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
end end
# Source $DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish if it exists
if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish" if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish" source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
end end

View File

@@ -3,7 +3,6 @@ jorgebucaran/nvm.fish
ilancosman/tide@v6 ilancosman/tide@v6
jethrokuan/z jethrokuan/z
halostatue/fish-macos@v7 halostatue/fish-macos@v7
ehfive/fish-bash2env
jgusta/paths jgusta/paths
danhper/fish-ssh-agent danhper/fish-ssh-agent
halostatue/fish-brew@v3 halostatue/fish-brew@v3

View File

@@ -1,56 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2022 Huang-Huang Bao
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# shellcheck disable=SC2076
set -e
disallowd_vars_arr=(
_
fish_kill_signal
fish_killring
fish_pid
history
hostname
PWD
pipestatus
SHLVL
status
status_generation
version
)
disallowd_vars=" ${disallowd_vars_arr[*]} "
fish_escape() {
value="${1//\\/\\\\}"
value="${value//\'/\\\'}"
echo "'${value}'"
}
flag_impure="$__FISH_BASH2ENV_IMPURE"
unset __FISH_BASH2ENV_IMPURE
if [[ -z "$flag_impure" ]]; then
old_env=" $(env -0 | tr '\0' ' ') "
fi
eval_status=
eval "$*" 1>&2 || eval_status=$?
env -0 | while IFS= read -rs -d $'\0' line; do
if [[ -z "$flag_impure" && "${old_env}" =~ " ${line} " ]]; then
continue
fi
name="${line%%=*}"
if [[ "${disallowd_vars}" =~ " ${name} " ]]; then
continue
fi
value="$(fish_escape "${line#*=}")"
echo "set -gx ${name} ${value}"
done
exit $eval_status

View File

@@ -1,39 +0,0 @@
# Copyright (c) 2022 Huang-Huang Bao
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
function bash2env -d "Import environment variables modified by given bash command"
argparse --stop-nonopt h/help i/impure -- $argv
or set argv
function _print_usage
echo 'Usage:' \
(set_color $fish_color_command)'bash2env' \
(set_color $fish_color_normal)'[-i/--impure]' \
(set_color $fish_color_param)"<bash command>"
end
if test -n "$_flag_help"
_print_usage
return
end
if test (count $argv) -eq 0
_print_usage
return 22
end
if test -n "$_flag_impure"
set _flag_impure 1
end
set -l DIR (dirname (status -f))
__FISH_BASH2ENV_IMPURE=$_flag_impure command \
bash $DIR/__bash2env.sh $argv | source
for code in $pipestatus
if test $code != 0
return $code
end
end
end

View File

View File

@@ -217,8 +217,6 @@ brew "nss"
brew "openldap" brew "openldap"
# ISO-C API and CLI for generating UUIDs # ISO-C API and CLI for generating UUIDs
brew "ossp-uuid" brew "ossp-uuid"
# General-purpose scripting language
brew "php@8.2"
# Execute binaries from Python packages in isolated environments # Execute binaries from Python packages in isolated environments
brew "pipx" brew "pipx"
# Python version management # Python version management
@@ -235,6 +233,8 @@ brew "ruby-build"
brew "rbenv" brew "rbenv"
# Generate C-based recognizers from regular expressions # Generate C-based recognizers from regular expressions
brew "re2c" brew "re2c"
# Rust toolchain installer
brew "rustup"
# Static analysis and lint tool, for (ba)sh scripts # Static analysis and lint tool, for (ba)sh scripts
brew "shellcheck" brew "shellcheck"
# Send macOS User Notifications from the command-line # Send macOS User Notifications from the command-line
@@ -288,9 +288,11 @@ brew "shivammathur/extensions/uuid@8.3"
# Yaml PHP extension # Yaml PHP extension
brew "shivammathur/extensions/yaml@8.3" brew "shivammathur/extensions/yaml@8.3"
# General-purpose scripting language # General-purpose scripting language
brew "shivammathur/php/php"
# General-purpose scripting language
brew "shivammathur/php/php-debug" brew "shivammathur/php/php-debug"
# General-purpose scripting language
brew "shivammathur/php/php@8.2", link: true
# General-purpose scripting language
brew "shivammathur/php/php@8.2-debug"
# Command-line interface for 1Password # Command-line interface for 1Password
cask "1password-cli" cask "1password-cli"
# AeroSpace is an i3-like tiling window manager for macOS # AeroSpace is an i3-like tiling window manager for macOS

View File

@@ -6,7 +6,8 @@
# Defaults # Defaults
[ -z "$DOTFILES" ] && export DOTFILES="$HOME/.dotfiles" [ -z "$DOTFILES" ] && export DOTFILES="$HOME/.dotfiles"
export DOTFILES_CURRENT_SHELL=$(basename "$SHELL") DOTFILES_CURRENT_SHELL=$(basename "$SHELL")
export DOTFILES_CURRENT_SHELL
# Enable verbosity with VERBOSE=1 # Enable verbosity with VERBOSE=1
VERBOSE="${VERBOSE:-0}" VERBOSE="${VERBOSE:-0}"

View File

@@ -3,7 +3,7 @@
# Contains configuration from the following sources: # Contains configuration from the following sources:
# - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html # - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html
# - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf # - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf
#
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Settings │ # │ Settings │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
@@ -16,13 +16,13 @@
# -u : Unset the specified option. # -u : Unset the specified option.
set -g default-terminal "tmux-256color" # Set default terminal to 256 colors set -g default-terminal "tmux-256color" # Set default terminal to 256 colors
set -g detach-on-destroy off # don't detach tmux when killing a session set -g detach-on-destroy off # don't detach tmux when killing a session
set -g display-time 0 # Hide clock set -g display-time 0 # Hide clock
set -g focus-events on # Focus events enabled for terminals that support them set -g focus-events on # Focus events enabled for terminals that support them
set -g mouse on # Mouse support set -g mouse on # Mouse support
set -g set-titles on # Allow tmux to set the terminal title set -g set-titles on # Allow tmux to set the terminal title
set -g status on # Setting status on set -g status on # Setting status on
set -g status-keys vi # vi keys to move between panes set -g status-keys vi # vi keys to move between panes
# Activity Monitoring (for when something happens in another pain) # Activity Monitoring (for when something happens in another pain)
set -g monitor-activity on set -g monitor-activity on
@@ -43,7 +43,6 @@ set -g renumber-windows on
# Activate with `DEBUG=1 tmux -vv` # Activate with `DEBUG=1 tmux -vv`
if-shell '[ "$DEBUG" = "1" ]' 'set -g debug-file ~/.cache/tmux-debug.log' if-shell '[ "$DEBUG" = "1" ]' 'set -g debug-file ~/.cache/tmux-debug.log'
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Theme │ # │ Theme │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
@@ -63,6 +62,7 @@ set -g window-status-format ' #I:#W '
# │ Bindings │ # │ Bindings │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
# bind flags # bind flags
# -N = Note / description of the command
# -r = repeatable, only needs prefix once # -r = repeatable, only needs prefix once
# -n = doesn't need prefix # -n = doesn't need prefix
# -t = binds to a certain key-table (root, copy-mode, prefix, etc.) # -t = binds to a certain key-table (root, copy-mode, prefix, etc.)
@@ -73,10 +73,10 @@ set -g prefix C-Space
bind C-Space send-prefix bind C-Space send-prefix
# Use Alt-arrow keys without prefix key to switch panes # Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L bind -n M-Left select-pane -L
bind -n M-Right select-pane -R bind -n M-Right select-pane -R
bind -n M-Up select-pane -U bind -n M-Up select-pane -U
bind -n M-Down select-pane -D bind -n M-Down select-pane -D
# Easier switching between window # Easier switching between window
bind C-n next-window bind C-n next-window
@@ -96,10 +96,10 @@ unbind p
bind p paste-buffer bind p paste-buffer
# tms bindings # tms bindings
bind C-f display-popup -E "tms" bind -N "tms" t display-popup -E "tms"
bind C-w display-popup -E "tms windows" bind -N "tms windows" C-w display-popup -E "tms windows"
bind C-s display-popup -E "tms switch" bind -N "tms switch" C-s display-popup -E "tms switch"
bind C-r display-popup -E "tms refresh" bind -N "tms refresh" C-r display-popup -E "tms refresh"
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Plugins │ # │ Plugins │
@@ -125,7 +125,7 @@ set -g @tmux_window_name_use_tilde "True"
# https://github.com/erikw/tmux-dark-notify # https://github.com/erikw/tmux-dark-notify
set -g @dark-notify-theme-path-light "$HOME/.dotfiles/config/tmux/theme-light.conf" set -g @dark-notify-theme-path-light "$HOME/.dotfiles/config/tmux/theme-light.conf"
set -g @dark-notify-theme-path-dark "$HOME/.dotfiles/config/tmux/theme-dark.conf" set -g @dark-notify-theme-path-dark "$HOME/.dotfiles/config/tmux/theme-dark.conf"
## https://github.com/MunifTanjim/tmux-mode-indicator ## https://github.com/MunifTanjim/tmux-mode-indicator
set -g @mode_indicator_copy_mode_style 'bg=default,fg=yellow' set -g @mode_indicator_copy_mode_style 'bg=default,fg=yellow'
@@ -145,7 +145,7 @@ run-shell "$HOME/.dotfiles/config/tmux/rename-session.sh"
# Load theme based on tmux-dark-notify state. # Load theme based on tmux-dark-notify state.
# This script helps states where dark-notify is not available, # This script helps states where dark-notify is not available,
# and we want to have light or dark state constantly available. # and we want to have light or dark state constantly available.
run-shell "$HOME/.dotfiles/config/tmux/theme-activate.sh" # run-shell "$HOME/.dotfiles/config/tmux/theme-activate.sh"
# ── Sourcing the plugins ────────────────────────────────────────────── # ── Sourcing the plugins ──────────────────────────────────────────────
@@ -159,4 +159,4 @@ run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-yank/yank.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-current-pane-hostname/current_pane_hostname.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-current-pane-hostname/current_pane_hostname.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-dark-notify/main.tmux" # run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-dark-notify/main.tmux"

1
config/vim/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
plugged

2887
config/vim/autoload/plug.vim Normal file

File diff suppressed because it is too large Load Diff

569
config/vim/vimrc Normal file
View File

@@ -0,0 +1,569 @@
" This is my vimrc
"
"
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************
let vimplug_exists=expand('$HOME/.config/autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
endif
let g:vim_bootstrap_langs = "go,html,javascript,lua,php,python,typescript"
let g:vim_bootstrap_editor = "vim" " nvim or vim
let g:vim_bootstrap_theme = "minimalist"
let g:vim_bootstrap_frams = "vuejs"
if !filereadable(vimplug_exists)
if !executable(curl_exists)
echoerr "You have to install curl or first install vim-plug yourself!"
execute "q!"
endif
echo "Installing Vim-Plug..."
echo ""
silent exec "!"curl_exists" -fLo " . shellescape(vimplug_exists) . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
let g:not_finish_vimplug = "yes"
autocmd VimEnter * PlugInstall
endif
" Required:
call plug#begin(expand('$HOME/.config/vim/plugged'))
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'vim-scripts/grep.vim'
Plug 'vim-scripts/CSApprox'
Plug 'Raimondi/delimitMate'
Plug 'majutsushi/tagbar'
Plug 'dense-analysis/ale'
Plug 'Yggdroot/indentLine'
Plug 'editor-bootstrap/vim-bootstrap-updater'
Plug 'tpope/vim-rhubarb' " required by fugitive to :GBrowse
Plug 'dikiaap/minimalist'
Plug 'liuchengxu/vim-which-key'
if isdirectory('~/.config/vim/extra/fzf')
Plug '~/.local/bin/fzf' | Plug 'junegunn/fzf.vim'
else
Plug 'junegunn/fzf', { 'dir': '~/.config/vim/fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
endif
let g:make = 'gmake'
if exists('make')
let g:make = 'make'
endif
Plug 'Shougo/vimproc.vim', {'do': g:make}
"" Vim-Session
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
" go
"" Go Lang Bundle
Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'}
" html
"" HTML Bundle
Plug 'hail2u/vim-css3-syntax'
Plug 'gko/vim-coloresque'
Plug 'tpope/vim-haml'
Plug 'mattn/emmet-vim'
" javascript
"" Javascript Bundle
Plug 'jelera/vim-javascript-syntax'
" lua
"" Lua Bundle
Plug 'xolox/vim-lua-ftplugin'
Plug 'xolox/vim-lua-inspect'
" php
"" PHP Bundle
Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install --no-dev -o'}
Plug 'stephpy/vim-php-cs-fixer'
" python
"" Python Bundle
Plug 'davidhalter/jedi-vim'
Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
" typescript
Plug 'leafgarland/typescript-vim'
Plug 'HerringtonDarkholme/yats.vim'
" vuejs
Plug 'posva/vim-vue'
Plug 'leafOfTree/vim-vue-plugin'
"*****************************************************************************
"*****************************************************************************
set nocompatible " disable compatibility mode with vi
filetype off " disable filetype detection (but re-enable later, see below)
set encoding=utf-8 " UTF-8
set number " Show line numbers
set relativenumber " Show relative line numbers
set laststatus=2 " Always show statusline (even with only single window)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
set backspace=indent,eol,start " Backspace behaviour
set cindent " Use 'C' style program indenting
set cursorline " Highlight current line
set expandtab " Use spaces instead of tabs
set fileformats=unix,dos,mac
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set linespace=3
set modeline
set modelines=3
set mouse=a
set mousemodel=popup
set ruler " Show row and column ruler information
set scrolloff=5
set shiftwidth=4 " Number of auto-indent spaces
set smartcase " Enable smart-case search
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set termguicolors
set undolevels=1000 " Number of undo levels
set wildmenu
call plug#end()
" Required:
filetype plugin indent on
"" Map leader to <space>
let mapleader=' '
"" Enable hidden buffers
set hidden
if exists('$SHELL')
set shell=$SHELL
else
set shell=/bin/sh
endif
" session management
let g:session_directory = "~/.local/state/vim/session"
let g:session_autoload = "yes"
let g:session_autosave = "yes"
let g:session_command_aliases = 1
syntax on
set mousemodel=popup
set t_Co=256
set guioptions=egmrti
if has("gui_running")
if has("gui_mac") || has("gui_macvim")
set macligatures
set guifont=JetBrains\ Mono:h14
set transparency=7
endif
else
let g:CSApprox_loaded = 1
" IndentLine
let g:indentLine_enabled = 1
let g:indentLine_concealcursor = ''
let g:indentLine_char = '┆'
let g:indentLine_faster = 1
if $COLORTERM == 'gnome-terminal'
set term=gnome-256color
else
if $TERM == 'xterm'
set term=xterm-256color
endif
endif
endif
if &term =~ '256color'
set t_ut=
endif
set title
set titleold="Terminal"
set titlestring=%F
set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L)|
" Search mappings: These will make it so that going to the next one in a
" search will center on the line it's found in.
nnoremap n nzzzv
nnoremap N Nzzzv
if exists("*fugitive#statusline")
set statusline+=%{fugitive#statusline()}
endif
" vim-airline
let g:airline#extensions#ale#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_skip_empty_sections = 1
let g:airline_theme = 'minimalist'
"*****************************************************************************
"" Abbreviations
"*****************************************************************************
"" no one is really happy until you have this shortcuts
cnoreabbrev W! w!
cnoreabbrev Q! q!
cnoreabbrev Qall! qall!
cnoreabbrev Wq wq
cnoreabbrev Wa wa
cnoreabbrev wQ wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall
"" NERDTree configuration
let g:NERDTreeChDirMode=2
let g:NERDTreeIgnore=['node_modules', 'vendor', '\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowBookmarks=1
let g:nerdtree_tabs_focus_on_files=1
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
let g:NERDTreeWinSize = 50
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite,*node_modules/,*vendor/
nnoremap <silent> <F2> :NERDTreeFind<CR>
nnoremap <silent> <leader>q :NERDTreeToggle<CR>
" grep.vim
nnoremap <silent> <leader>f :Rgrep<CR>
let Grep_Default_Options = '-IR'
let Grep_Skip_Files = '*.log *.db .DS_Store'
let Grep_Skip_Dirs = '.git node_modules vendor plugged'
" terminal emulation
nnoremap <silent> <leader>sh :terminal<CR>
" vim-which-key config
nnoremap <silent> <leader> :WhichKey '<Space>'<CR>
set timeoutlen=500 " By default timeoutlen=1000 (ms)
"*****************************************************************************
"" Commands
"*****************************************************************************
" remove trailing whitespaces
command! FixWhitespace :%s/\s\+$//e
"*****************************************************************************
"" Functions
"*****************************************************************************
if !exists('*s:setupWrapping')
function s:setupWrapping()
set wrap
set wm=2
set textwidth=79
endfunction
endif
"*****************************************************************************
"" Autocmd Rules
"*****************************************************************************
"" The PC is fast enough, do syntax highlight syncing from start unless 200 lines
augroup vimrc-sync-fromstart
autocmd!
autocmd BufEnter * :syntax sync maxlines=200
augroup END
"" Remember cursor position
augroup vimrc-remember-cursor-position
autocmd!
" autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
augroup END
"" txt
augroup vimrc-wrapping
autocmd!
autocmd BufRead,BufNewFile *.txt call s:setupWrapping()
augroup END
"" make/cmake
augroup vimrc-make-cmake
autocmd!
autocmd FileType make setlocal noexpandtab
autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake
augroup END
set autoread
"*****************************************************************************
"" Mappings
"*****************************************************************************
"" Split
noremap <Leader>h :<C-u>split<CR>
noremap <Leader>v :<C-u>vsplit<CR>
"" Git
noremap <Leader>ga :Gwrite<CR>
noremap <Leader>gc :Git commit --verbose<CR>
noremap <Leader>gsh :Git push<CR>
noremap <Leader>gll :Git pull<CR>
noremap <Leader>gs :Git<CR>
noremap <Leader>gb :Git blame<CR>
noremap <Leader>gd :Gvdiffsplit<CR>
noremap <Leader>gr :GRemove<CR>
" session management
nnoremap <leader>so :OpenSession<Space>
nnoremap <leader>ss :SaveSession<Space>
nnoremap <leader>sd :DeleteSession<CR>
nnoremap <leader>sc :CloseSession<CR>
"" Tabs
nnoremap <Tab> gt
nnoremap <S-Tab> gT
nnoremap <silent> <S-t> :tabnew<CR>
"" Set working directory
nnoremap <leader>. :lcd %:p:h<CR>
"" Opens an edit command with the path of the currently edited file filled in
noremap <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
"" Opens a tab edit command with the path of the currently edited file filled
noremap <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
"" fzf.vim
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__,vendor
let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'vendor/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null"
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
cnoremap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
nnoremap <silent> <leader>b :Buffers<CR>
nnoremap <silent> <leader>e :FZF -m<CR>
"Recovery commands from history through FZF
nmap <leader>y :History:<CR>
" ale
let g:ale_linters = {}
" Tagbar
nmap <silent> <F4> :TagbarToggle<CR>
let g:tagbar_autofocus = 1
" Disable visualbell
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
"" Copy/Paste/Cut
if has('unnamedplus')
set clipboard=unnamed,unnamedplus
endif
noremap YY "+y<CR>
noremap <leader>p "+gP<CR>
noremap XX "+x<CR>
if has('macunix')
" pbcopy for OSX copy/paste
vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR>
vmap <C-v> :!pbpaste<CR>
endif
"" Buffer nav
noremap <leader>z :bp<CR>
noremap <leader>q :bp<CR>
noremap <leader>x :bn<CR>
noremap <leader>w :bn<CR>
"" Close buffer
noremap <leader>c :bd<CR>
"" Clean search (highlight)
nnoremap <silent> <leader><space> :noh<cr>
"" Switching windows
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
noremap <C-h> <C-w>h
"" Vmap for maintain Visual Mode after shifting > and <
vmap < <gv
vmap > >gv
"" Move visual block
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
"" Open current line on GitHub
nnoremap <Leader>o :.GBrowse<CR>
"*****************************************************************************
"" Custom configs
"*****************************************************************************
" go
" vim-go
" run :GoBuild or :GoTestCompile based on the go file
function! s:build_go_files()
let l:file = expand('%')
if l:file =~# '^\f\+_test\.go$'
call go#test#Test(0, 1)
elseif l:file =~# '^\f\+\.go$'
call go#cmd#Build(0)
endif
endfunction
let g:go_list_type = "quickfix"
let g:go_fmt_command = "goimports"
let g:go_fmt_fail_silently = 1
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_structs = 1
let g:go_highlight_generate_tags = 1
let g:go_highlight_space_tab_error = 0
let g:go_highlight_array_whitespace_error = 0
let g:go_highlight_trailing_whitespace_error = 0
let g:go_highlight_extra_types = 1
autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4
augroup completion_preview_close
autocmd!
if v:version > 703 || v:version == 703 && has('patch598')
autocmd CompleteDone * if !&previewwindow && &completeopt =~ 'preview' | silent! pclose | endif
endif
augroup END
augroup go
au!
au Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
au Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
au Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
au Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
au FileType go nmap <Leader>dd <Plug>(go-def-vertical)
au FileType go nmap <Leader>dv <Plug>(go-doc-vertical)
au FileType go nmap <Leader>db <Plug>(go-doc-browser)
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>t <Plug>(go-test)
au FileType go nmap <Leader>gt <Plug>(go-coverage-toggle)
au FileType go nmap <Leader>i <Plug>(go-info)
au FileType go nmap <silent> <Leader>l <Plug>(go-metalinter)
au FileType go nmap <C-g> :GoDecls<cr>
au FileType go nmap <leader>dr :GoDeclsDir<cr>
au FileType go imap <C-g> <esc>:<C-u>GoDecls<cr>
au FileType go imap <leader>dr <esc>:<C-u>GoDeclsDir<cr>
au FileType go nmap <leader>rb :<C-u>call <SID>build_go_files()<CR>
augroup END
" ale
:call extend(g:ale_linters, {"go": [ 'golint', 'go vet' ]})
" html
" for html files, 2 spaces
autocmd Filetype html setlocal ts=2 sw=2 expandtab
" javascript
let g:javascript_enable_domhtmlcss = 1
" vim-javascript
augroup vimrc-javascript
autocmd!
autocmd FileType javascript setl tabstop=4|setl shiftwidth=4|setl expandtab softtabstop=4
augroup END
" php
" Phpactor plugin
" Include use statement
nmap <Leader>u :call phpactor#UseAdd()<CR>
" Invoke the context menu
nmap <Leader>mm :call phpactor#ContextMenu()<CR>
" Invoke the navigation menu
nmap <Leader>nn :call phpactor#Navigate()<CR>
" Goto definition of class or class member under the cursor
nmap <Leader>oo :call phpactor#GotoDefinition()<CR>
nmap <Leader>oh :call phpactor#GotoDefinition('hsplit')<CR>
nmap <Leader>ov :call phpactor#GotoDefinition('vsplit')<CR>
nmap <Leader>ot :call phpactor#GotoDefinition('tabnew')<CR>
" Show brief information about the symbol under the cursor
nmap <Leader>K :call phpactor#Hover()<CR>
" Transform the classes in the current file
nmap <Leader>tt :call phpactor#Transform()<CR>
" Generate a new class (replacing the current file)
nmap <Leader>cc :call phpactor#ClassNew()<CR>
" Extract expression (normal mode)
nmap <silent><Leader>ee :call phpactor#ExtractExpression(v:false)<CR>
" Extract expression from selection
vmap <silent><Leader>ee :<C-U>call phpactor#ExtractExpression(v:true)<CR>
" Extract method from selection
vmap <silent><Leader>em :<C-U>call phpactor#ExtractMethod()<CR>
" python
" vim-python
augroup vimrc-python
autocmd!
autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=8 colorcolumn=79 formatoptions+=croq softtabstop=4 cinwords=if,elif,else,for,while,try,except,finally,def,class,with
augroup END
" jedi-vim
let g:jedi#popup_on_dot = 0
let g:jedi#goto_assignments_command = "<leader>g"
let g:jedi#goto_definitions_command = "<leader>d"
let g:jedi#documentation_command = "K"
let g:jedi#usages_command = "<leader>n"
let g:jedi#rename_command = "<leader>r"
let g:jedi#show_call_signatures = "0"
let g:jedi#completions_command = "<C-Space>"
let g:jedi#smart_auto_mappings = 0
" ale
:call extend(g:ale_linters, { 'python': [ 'flake8' ] })
" Syntax highlight
let python_highlight_all = 1
" typescript
let g:yats_host_keyword = 1
" vuejs
" vim vue
let g:vue_disable_pre_processors=1
" vim vue plugin
let g:vim_vue_plugin_load_full_syntax = 1

View File

@@ -11,7 +11,7 @@
}, },
"formatter": { "formatter": {
"external": { "external": {
"command": "node_modules/.bin/prettier", "command": "prettier",
"arguments": [ "arguments": [
"--stdin-filepath", "--stdin-filepath",
"{buffer_path}" "{buffer_path}"
@@ -69,7 +69,7 @@
"buffer_font_fallbacks": [ "buffer_font_fallbacks": [
"JetBrainsMono Nerd Font" "JetBrainsMono Nerd Font"
], ],
"inline_completions": { "edit_predictions": {
"disabled_globs": [ "disabled_globs": [
".env" ".env"
] ]

View File

@@ -3,10 +3,16 @@
Leader: `<ctrl><space>` Leader: `<ctrl><space>`
```txt ```txt
Space Select next layout
! Break pane to a new window
" Split window vertically
# List all paste buffers
$ Rename current session $ Rename current session
% Split window horizontally % Split window horizontally
& Kill current window & Kill current window
' Prompt for window index to select ' Prompt for window index to select
( Switch to previous client
) Switch to next client
, Rename current window , Rename current window
- Delete the most recent paste buffer - Delete the most recent paste buffer
. Move the current window . Move the current window
@@ -25,6 +31,7 @@ Leader: `<ctrl><space>`
; Move to the previously active pane ; Move to the previously active pane
= Choose a paste buffer from a list = Choose a paste buffer from a list
? List key bindings ? List key bindings
D Choose and detach a client from a list
E Spread panes out evenly E Spread panes out evenly
L Switch to the last client L Switch to the last client
M Clear the marked pane M Clear the marked pane
@@ -33,11 +40,13 @@ Leader: `<ctrl><space>`
d Detach the current client d Detach the current client
f Search for a pane f Search for a pane
i Display window information i Display window information
l Select the previously current window
m Toggle the marked pane m Toggle the marked pane
n Select the next window
o Select the next pane o Select the next pane
q Display pane numbers q Display pane numbers
s Choose a session from a list s Choose a session from a list
t Show a clock t tms
w Choose a window from a list w Choose a window from a list
x Kill the active pane x Kill the active pane
z Zoom the active pane z Zoom the active pane
@@ -65,6 +74,9 @@ Leader: `<ctrl><space>`
M-Left Resize the pane left by 5 M-Left Resize the pane left by 5
M-Right Resize the pane right by 5 M-Right Resize the pane right by 5
C-o Rotate through the panes C-o Rotate through the panes
C-r tms refresh
C-s tms switch
C-w tms windows
C-z Suspend the current client C-z Suspend the current client
C-Up Resize the pane up C-Up Resize the pane up
C-Down Resize the pane down C-Down Resize the pane down
@@ -75,3 +87,4 @@ Leader: `<ctrl><space>`
S-Left Move the visible part of the window left S-Left Move the visible part of the window left
S-Right Move the visible part of the window right S-Right Move the visible part of the window right
``` ```

View File

@@ -40,9 +40,6 @@
relink: true relink: true
path: config/* path: config/*
exclude: [config/nvm, config/fzf] exclude: [config/nvm, config/fzf]
~/.local/asdf:
glob: true
path: local/asdf/*
~/.local/bin: ~/.local/bin:
glob: true glob: true
path: local/bin/* path: local/bin/*
@@ -65,46 +62,6 @@
- bash add-submodules.sh || true - bash add-submodules.sh || true
- git submodule update --init --recursive --force - git submodule update --init --recursive --force
- asdf:
- plugin: 1password-cli
url: https://github.com/NeoHsu/asdf-1password-cli.git
- plugin: age
url: https://github.com/threkk/asdf-age.git
- plugin: direnv
url: https://github.com/asdf-community/asdf-direnv.git
- plugin: dotenv-linter
url: https://github.com/wesleimp/asdf-dotenv-linter.git
- plugin: editorconfig-checker
url: https://github.com/gabitchov/asdf-editorconfig-checker.git
- plugin: fd
url: https://gitlab.com/wt0f/asdf-fd.git
- plugin: github-cli
url: https://github.com/bartlomiejdanek/asdf-github-cli.git
- plugin: golang
url: https://github.com/asdf-community/asdf-golang.git
- plugin: hadolint
url: https://github.com/devlincashman/asdf-hadolint.git
- plugin: kubectl
url: https://github.com/asdf-community/asdf-kubectl.git
- plugin: pre-commit
url: https://github.com/jonathanmorley/asdf-pre-commit.git
- plugin: ripgrep
url: https://gitlab.com/wt0f/asdf-ripgrep.git
- plugin: rust
url: https://github.com/code-lever/asdf-rust.git
- plugin: shellcheck
url: https://github.com/luizm/asdf-shellcheck.git
- plugin: shfmt
url: https://github.com/luizm/asdf-shfmt.git
- plugin: terragrunt
url: https://github.com/ohmer/asdf-terragrunt.git
- plugin: tf-summarize
url: https://github.com/adamcrews/asdf-tf-summarize.git
- plugin: yamllint
url: https://github.com/ericcornelissen/asdf-yamllint.git
- plugin: yq
url: https://github.com/sudermanjr/asdf-yq.git
- shell: - shell:
- bash local/bin/dfm install all - bash local/bin/dfm install all

Submodule local/asdf deleted from 31e8c93004

View File

@@ -43,7 +43,6 @@ section_install()
MENU=( MENU=(
"all:Installs everything in the correct order" "all:Installs everything in the correct order"
"asdf:Install asdf plugins"
"cargo:Install rust/cargo packages" "cargo:Install rust/cargo packages"
"cheat-databases:Install cheat external cheatsheet databases" "cheat-databases:Install cheat external cheatsheet databases"
"composer:Install composer" "composer:Install composer"
@@ -65,7 +64,6 @@ section_install()
$0 install macos $0 install macos
$0 install fonts $0 install fonts
$0 brew install $0 brew install
$0 install asdf
$0 install composer $0 install composer
$0 install fzf $0 install fzf
$0 install cheat-databases $0 install cheat-databases
@@ -77,12 +75,6 @@ section_install()
msgr yay "All done!" msgr yay "All done!"
;; ;;
asdf)
msgr run "Installing asdf..."
$0 asdf plugins-install \
&& msgr yay "asdf plugins installed!"
;;
cargo) cargo)
msgr run "Installing cargo packages..." msgr run "Installing cargo packages..."
bash "$DOTFILES/scripts/install-cargo-packages.sh" \ bash "$DOTFILES/scripts/install-cargo-packages.sh" \
@@ -270,164 +262,6 @@ section_brew()
! x-have brew && menu_builder "$USAGE_PREFIX" "brew not available on this system" ! x-have brew && menu_builder "$USAGE_PREFIX" "brew not available on this system"
} }
section_asdf()
{
USAGE_PREFIX="$SCRIPT asdf <command>"
MENU=(
"current:Show asdf current versions"
"global:Show asdf global versions"
"installed:Show asdf installed versions"
"plugins-update:Update all asdf plugins"
"plugins-install:Install plugins from configuration"
"plugins-remove:Remove installed plugins"
"reset:Reset asdf plugins"
"fix-tool-versions:Remove uninstalled plugins from .tool-versions"
"versions:Show asdf versions"
"where:Show asdf where"
"which:Show asdf which"
)
case "$1" in
plugins-update)
msgr run "Updating all asdf plugins"
asdf plugin update --all
msgr run_done "Updated all plugins"
;;
plugins-install)
msgr run "Installing plugins from configuration"
# First install direnv if it's not installed
if ! asdf plugin list | grep -q "^direnv$"; then
msgr nested "Installing direnv plugin"
asdf plugin add direnv https://github.com/asdf-community/asdf-direnv.git
# Install latest direnv
local latest_direnv
latest_direnv=$(asdf latest direnv)
asdf install direnv "$latest_direnv"
asdf global direnv "$latest_direnv"
fi
# Check that all plugins are installed
local installed_plugins
installed_plugins=$(asdf plugin list)
while IFS= read -r line; do
# Skip empty lines and comments
[[ -z $line || $line =~ ^# ]] && continue
local plugin
plugin=$(echo "$line" | awk '{print $1}')
# Skip direnv, it's already installed
[[ $plugin == "direnv" ]] && continue
if ! echo "$installed_plugins" | grep -q "^${plugin}$"; then
msgr nested "Installing $plugin plugin"
asdf plugin add "$plugin"
fi
done < "$DOTFILES/base/tool-versions"
msgr run_done "All plugins installed"
;;
plugins-remove)
msgr run "Remove installed plugins"
local installed_plugins
installed_plugins=$(asdf plugin list | grep -v "^direnv$")
for plugin in $installed_plugins; do
msgr nested "Removing $plugin"
asdf plugin remove "$plugin"
done
msgr run_done "Remove plugins done!"
;;
reset)
msgr run "Resetting asdf environment"
$0 asdf plugins-remove
$0 asdf plugins-install
asdf reshim
msgr yay "Reset asdf plugins done!"
;;
fix-tool-versions)
local tool_versions_file="$DOTFILES/base/tool-versions"
local temp_file
temp_file=$(mktemp)
msgr run "Fixing tool-versions file"
# Check that .tool-versions file exists
if [[ ! -f $tool_versions_file ]]; then
msgr error "tool-versions file not found: $tool_versions_file"
rm -f "$temp_file"
return 1
fi
# Check that asdf can be found in the path
if ! command -v asdf > /dev/null; then
msgr error "asdf not found"
rm -f "$temp_file"
return 1
fi
# Read installed plugins
msgr nested "Reading installed plugins"
local installed_plugins
installed_plugins=$(asdf plugin list | sort)
# Compare .tool-versions and installed plugins,
# remove unknown plugins from .tool-versions
msgr nested "Updating tool-versions file"
while IFS= read -r line; do
# Keep comments and empty lines
if [[ -z $line || $line =~ ^[[:space:]]*# ]]; then
echo "$line" >> "$temp_file"
continue
fi
local plugin
plugin=$(echo "$line" | awk '{print $1}')
if echo "$installed_plugins" | grep -q "^${plugin}$"; then
echo "$line" >> "$temp_file"
else
msgr nested "Removing $plugin - not installed"
fi
done < "$tool_versions_file"
# Check that the temp file is valid
if [[ ! -s $temp_file ]] || ! grep -v '^[[:space:]]*#' "$temp_file" | grep -q .; then
msgr error "Generated file is empty or contains only comments, keeping original"
rm -f "$temp_file"
return 1
fi
# Backup the original .tool-versions
cp "$tool_versions_file" "${tool_versions_file}.bak"
# Overwrite .tool-versions with the generated file
mv "$temp_file" "$tool_versions_file"
msgr run_done "Updated $tool_versions_file"
msgr nested "Backup saved as ${tool_versions_file}.bak"
return 0
;;
current) asdf current ;;
global) asdf global ;;
installed) asdf list ;;
versions) asdf list all ;;
where) asdf where ;;
which) asdf which ;;
*) menu_builder "$USAGE_PREFIX" "${MENU[@]}" ;;
esac
}
section_helpers() section_helpers()
{ {
USAGE_PREFIX="$SCRIPT helpers <command>" USAGE_PREFIX="$SCRIPT helpers <command>"
@@ -647,7 +481,7 @@ section_dotfiles()
fd --full-path "$DOTFILES" -tx \ fd --full-path "$DOTFILES" -tx \
--hidden \ --hidden \
-E '*.pl' -E '*.php' -E '*.py' -E '*.zsh' -E 'plugins' -E 'fzf' -E 'dotbot' \ -E '*.pl' -E '*.php' -E '*.py' -E '*.zsh' -E 'plugins' -E 'fzf' -E 'dotbot' \
-E 'test' -E '**/bin/asdf/**' -E '**/tldr/*' \ -E 'test' -E '**/tldr/*' \
-x shfmt \ -x shfmt \
--language-dialect bash \ --language-dialect bash \
--func-next-line --list --write \ --func-next-line --list --write \
@@ -778,8 +612,6 @@ usage()
echo "" echo ""
section_apt section_apt
echo "" echo ""
section_asdf
echo ""
section_brew section_brew
echo "" echo ""
section_check section_check
@@ -801,7 +633,6 @@ main()
case "$SECTION" in case "$SECTION" in
install) section_install "$@" ;; install) section_install "$@" ;;
apt) section_apt "$@" ;; apt) section_apt "$@" ;;
asdf) section_asdf "$@" ;;
brew) section_brew "$@" ;; brew) section_brew "$@" ;;
check) section_check "$@" ;; check) section_check "$@" ;;
dotfiles) section_dotfiles "$@" ;; dotfiles) section_dotfiles "$@" ;;

View File

@@ -1,100 +0,0 @@
#!/usr/bin/env python3
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Convert Markdown to Telegram Format
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🔄
# @raycast.packageName Conversions
# @raycast.description Convert Markdown formatting to Telegram format, excluding processing inside code blocks or quotes
# Documentation:
# @raycast.author Maxim Borzov
# @raycast.authorURL https://github.com/borzov
import re
import subprocess
# Set environment variables and encoding
env_vars = {'LANG': 'en_US.UTF-8'}
encoding = 'utf-8'
def paste():
"""Read text from the clipboard."""
return subprocess.check_output('pbpaste', env=env_vars).decode(encoding)
def copy(text):
"""Write text to the clipboard."""
process = subprocess.Popen('pbcopy', env=env_vars, stdin=subprocess.PIPE)
process.communicate(text.encode(encoding))
def convert_markdown(text):
"""Convert Markdown formatting to Telegram format."""
lines = text.split('\n')
converted_lines = []
in_code_block = False
for line in lines:
# Check if the line is a code block delimiter
if line.startswith('```'):
in_code_block = not in_code_block
converted_lines.append(line)
continue
# Skip quotes and only format if not in a code block
if not in_code_block and not line.startswith('>'):
# Format headers with emojis and bold text
if line.startswith('# '):
line = f"⚫️ **{line[2:].strip()}**\n"
elif line.startswith('## '):
line = f"◾️ **{line[3:].strip()}**\n"
elif line.startswith('### '):
line = f"▪️ **{line[4:].strip()}**\n"
elif line.startswith('#### '):
line = f"🔹 **{line[5:].strip()}**\n"
elif line.startswith('##### '):
line = f"📌 **{line[6:].strip()}**\n"
elif line.startswith('###### '):
line = f"🔰 **{line[7:].strip()}**\n"
else:
# Format bold text
line = re.sub(r'(?<!\\)\*{2}(.*?)\*{2}', r'**\1**', line)
line = re.sub(r'(?<!\\)_{2}(.*?)_{2}', r'**\1**', line)
# Format italic text
line = re.sub(r'(?<!\\|\*)\*(?!\*)(.+?)(?<!\*)\*(?![\*_])', r'__\1__', line)
line = re.sub(r'(?<!\\|_)_(?!_)(.+?)(?<!_)_(?![\*_])', r'__\1__', line)
# Format strikethrough text
line = re.sub(r'(?<!\\)~{2}(.*?)~{2}', r'~~\1~~', line)
# Format spoilers
line = re.sub(r'(?<!\\)\|\|(.*?)\|\|', r'||\1||', line)
# Format underline text
line = re.sub(r'(?<!\\)-{2}(.*?)-{2}', r'--\1--', line)
# Format links
line = re.sub(r'(?<!\\)\[(.*?)\]\((.*?)\)', r'[\1](\2)', line)
# Format inline code
line = re.sub(r'(?<!\\)`(.*?)`', r'`\1`', line)
converted_lines.append(line)
# Add empty lines between paragraphs
result = []
for i in range(len(converted_lines)):
result.append(converted_lines[i])
if i < len(converted_lines) - 1:
cur = converted_lines[i].strip()
next = converted_lines[i+1].strip()
if cur and next and not cur.startswith(('*', '-', '```', '|', '>')) and not next.startswith(('*', '-', '```', '|', '>')):
result.append('')
return '\n'.join(result)
if __name__ == "__main__":
try:
markdown_text = paste()
converted_text = convert_markdown(markdown_text)
copy(converted_text)
print("✅ Markdown converted and copied to clipboard")
except Exception as e:
print(f"❌ Error during conversion: {str(e)}")

View File

@@ -14,7 +14,7 @@
# Define protected keywords. Values of these keys are displayed as [protected value]. # Define protected keywords. Values of these keys are displayed as [protected value].
# The keys are case-insensitive and are matched as substrings. # The keys are case-insensitive and are matched as substrings.
PROTECTED_KEYS=("*TOKEN*" "*SECRET*" "DIRENV_DIFF" "DIRENV_WATCHES" "PATH" "FPATH") PROTECTED_KEYS=("*TOKEN*" "*SECRET*" "DIRENV_DIFF" "DIRENV_WATCHES")
# Default grouping is based on the first part before underscore, but can be overridden # Default grouping is based on the first part before underscore, but can be overridden
# either by custom grouping file or by the get_custom_group function. # either by custom grouping file or by the get_custom_group function.
@@ -49,17 +49,50 @@ DEFINED_GROUPS=(
"PYENV_ROOT=PYTHON" "PYENV_ROOT=PYTHON"
"PYENV_SHELL=PYTHON" "PYENV_SHELL=PYTHON"
"PYTHONPATH=PYTHON" "PYTHONPATH=PYTHON"
"POETRY_HOME=PYTHON"
"RUSTUP_HOME=RUST" "RUSTUP_HOME=RUST"
"RUST_WITHOUT=RUST" "RUST_WITHOUT=RUST"
"SHELL=SHELL" "SHELL=SHELL"
"TMPDIR=SHELL" "TMPDIR=SHELL"
"USER=SHELL" "USER=SHELL"
"SECURITYSESSIONID=SHELL"
"SHLVL=SHELL"
"WORKON_HOME=PYTHON" "WORKON_HOME=PYTHON"
"ZSH=ZSH" "ZSH=ZSH"
"LANG=SHELL"
"EDITOR=SHELL"
"VISUAL=SHELL"
"COMMAND_MODE=SHELL"
"COLORTERM=SHELL"
"CARGO_BIN_HOME=RUST"
"CARGO_HOME=RUST"
"LaunchInstanceID=SHELL"
"SECURITYSESSIONID=SHELL"
"TERM=SHELL"
"TERM_PROGRAM=SHELL"
"TERM_PROGRAM_VERSION=SHELL"
"XPC_FLAGS=SHELL"
"XPC_SERVICE_NAME=SHELL"
"NPM_CONFIG_PREFIX=NODE"
"YARN_GLOBAL_FOLDER=NODE"
"MASON_HOME=NVIM"
"asdf_data_dir=ASDF"
"nvm_current_version=NODE"
"NVM_NODE_BIN_DIR=NODE"
"_=SHELL" "_=SHELL"
"npm_config_cache=NPM" "npm_config_cache=NPM"
) )
SKIPPED_KEYS=(
"_tide*"
"__FISH_*"
"___paths_plugin_colors"
"__CFBundleIdentifier"
"__CF_USER_TEXT_ENCODING"
"PATH"
"FPATH"
)
CONFIG_FILE="$X_ENV_GROUPING" CONFIG_FILE="$X_ENV_GROUPING"
# If we have configuration file, run extra checks so we can process it. # If we have configuration file, run extra checks so we can process it.
@@ -93,6 +126,12 @@ if [[ -f "$CONFIG_FILE" ]]; then
PROTECTED_KEYS+=("$key") PROTECTED_KEYS+=("$key")
done <<< "$CUSTOM_KEYS" done <<< "$CUSTOM_KEYS"
SKIPPED+=("$(yq '.skipped_keys[]' "$CONFIG_FILE")")
while IFS= read -r key; do
# Add to default_skipped_keys
SKIPPED_KEYS+=("$key")
done <<< "$SKIPPED"
CUSTOM_GROUPS=$(yq '.custom_grouping[]' "$CONFIG_FILE") CUSTOM_GROUPS=$(yq '.custom_grouping[]' "$CONFIG_FILE")
while IFS= read -r group; do while IFS= read -r group; do
group_name=$(echo "$group" | yq 'keys[0]') group_name=$(echo "$group" | yq 'keys[0]')
@@ -150,6 +189,22 @@ get_custom_group()
return 1 return 1
} }
is_skipped()
{
local key=$1
for skipped_key in "${SKIPPED_KEYS[@]}"; do
# Direct match
if [[ "$key" == "$skipped_key" ]]; then
return 0
fi
# Wildcard match (skipped_key contains '*')
if [[ "$skipped_key" == *"*"* ]] && [[ "$key" == $skipped_key ]]; then
return 0
fi
done
return 1
}
# Create arrays to store all groups, group data and max lengths for each group # Create arrays to store all groups, group data and max lengths for each group
all_groups=() all_groups=()
group_data=() group_data=()
@@ -157,6 +212,15 @@ group_max_lengths=()
# Get environment variables and group them # Get environment variables and group them
while IFS='=' read -r key value; do while IFS='=' read -r key value; do
# Skip keys that are in the skipped list
if is_skipped "$key"; then
continue
fi
if is_skipped "$value"; then
continue
fi
# Check for custom group # Check for custom group
group=$(get_custom_group "$key") group=$(get_custom_group "$key")

View File

@@ -1,13 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# @description Install cargo/rust packages. # @description Install cargo/rust packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/config/shared.sh"
msgr run "Starting to install rust/cargo packages" msgr run "Starting to install rust/cargo packages"
source "$CARGO_HOME/env"
# If we have cargo install-update, use it first # If we have cargo install-update, use it first
if command -v cargo-install-update &> /dev/null; then if command -v cargo-install-update &> /dev/null; then
msgr run "Updating cargo packages with cargo install-update" msgr run "Updating cargo packages with cargo install-update"
@@ -15,8 +10,8 @@ if command -v cargo-install-update &> /dev/null; then
msgr run_done "Done with cargo install-update" msgr run_done "Done with cargo install-update"
fi fi
[[ -z "$ASDF_CRATE_DEFAULT_PACKAGES_FILE" ]] && \ [[ -z "$ASDF_CRATE_DEFAULT_PACKAGES_FILE" ]] \
ASDF_CRATE_DEFAULT_PACKAGES_FILE="$DOTFILES/config/asdf/cargo-packages" && ASDF_CRATE_DEFAULT_PACKAGES_FILE="$DOTFILES/config/asdf/cargo-packages"
# Packages are defined in $DOTFILES/config/asdf/cargo-packages, one per line # Packages are defined in $DOTFILES/config/asdf/cargo-packages, one per line
# Skip comments and empty lines # Skip comments and empty lines
@@ -31,7 +26,7 @@ while IFS= read -r line; do
done < "$ASDF_CRATE_DEFAULT_PACKAGES_FILE" done < "$ASDF_CRATE_DEFAULT_PACKAGES_FILE"
# Number of jobs to run in parallel, this helps to keep the system responsive # Number of jobs to run in parallel, this helps to keep the system responsive
BUILD_JOBS=$(nproc --ignore=2) BUILD_JOBS=$(nproc --ignore=2 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 1)
# Function to install cargo packages # Function to install cargo packages
install_packages() install_packages()
@@ -61,13 +56,13 @@ post_install_steps()
msgr run "Removing cargo cache" msgr run "Removing cargo cache"
cargo cache --autoclean cargo cache --autoclean
msg_done "Done removing cargo cache" msgr done "Done removing cargo cache"
} }
main() main()
{ {
install_packages install_packages
msg_done "Installed cargo packages!" msgr done "Installed cargo packages!"
post_install_steps post_install_steps
} }