1
0

Add xonsh configuration as a trial

This commit is contained in:
Jip J. Dekker 2022-06-27 21:30:17 +10:00
parent 7eda826079
commit c4c1b9fcf9
No known key found for this signature in database
GPG Key ID: 517DF4A00618C9C3
4 changed files with 64 additions and 2 deletions

View File

@ -9,7 +9,7 @@ font_size 16.0
confirm_os_window_close 0
shell nu
shell xonsh
# BEGIN_KITTY_THEME
include current-theme.conf

View File

@ -0,0 +1,53 @@
# --- Detect Environment ---
try:
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import darkdetect
dark_mode = darkdetect.isDark()
except ImportError:
dark_mode = False
brew_prefix = $(brew --prefix).strip()
# --- Xonsh Configuration ---
$XONSH_COLOR_STYLE = "stata-dark" if dark_mode else "stata-light"
# --- Path Variables ---
#> Use MacOS path_helper executable
source-bash $(/usr/libexec/path_helper -s)
$PATH = [
brew_prefix + "/opt/bison/bin",
brew_prefix + "/opt/flex/bin",
brew_prefix + "/opt/llvm/bin",
] + $PATH + [
$HOME + "/.local/bin",
$HOME + "/.cargo/bin",
]
# --- General Environment ---
#> Default Editor
$EDITOR = "nvim"
$VISUAL = "subl"
#> Monash Cluster
$OPTCLUSTER = "compute.optimisation-2020.cloud.edu.au"
#> CMake settings
$CMAKE_EXPORT_COMPILE_COMMANDS = "1" # output compile-commands.json for clangd
$CMAKE_GENERATOR = "Sublime Text 2 - Ninja" # use Ninja generator by default
#> FZF
$FZF_DEFAULT_COMMAND = "fd --type f"
# --- Aliases ---
aliases["brew-backup"] = ("brew", "bundle", "dump", "--global", "--no-lock", "--cask", "--mas", "--tap", "--force")
aliases["brew-cleanup"] = ("brew", "bundle", "cleanup", "--global", "--no-lock", "--force", "--zap")
aliases["brew-restore"] = ("brew", "bundle", "install", "--global", "--no-lock")
aliases["edit"] = $VISUAL
aliases["less"] = "bat"
aliases["set-dark-theme"] = ("kitty", "+kitten", "themes", "Mariana")
aliases["set-light-theme"] = ("kitty", "+kitten", "themes", "Breakers")
aliases["ssh"] = ("kitty", "+kitten", "ssh")
aliases["start"] = "open"

View File

@ -0,0 +1,8 @@
#> Homebrew integration
source-bash $(brew shellenv)
#> Kitty integration
xontrib load kitty
#> Starship: smart prompt
execx($(starship init xonsh))
#> Zoxide: smart cd
execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')

View File

@ -11,5 +11,6 @@
"MiniZinc Language",
"Package Control",
"Svelte",
"xonsh",
],
}
}