Add xonsh configuration as a trial
This commit is contained in:
parent
7eda826079
commit
c4c1b9fcf9
@ -9,7 +9,7 @@ font_size 16.0
|
|||||||
|
|
||||||
confirm_os_window_close 0
|
confirm_os_window_close 0
|
||||||
|
|
||||||
shell nu
|
shell xonsh
|
||||||
|
|
||||||
# BEGIN_KITTY_THEME
|
# BEGIN_KITTY_THEME
|
||||||
include current-theme.conf
|
include current-theme.conf
|
||||||
|
53
dot_config/xonsh/rc.d/env.xsh
Normal file
53
dot_config/xonsh/rc.d/env.xsh
Normal 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"
|
8
dot_config/xonsh/rc.d/plugins.xsh
Normal file
8
dot_config/xonsh/rc.d/plugins.xsh
Normal 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')
|
@ -11,5 +11,6 @@
|
|||||||
"MiniZinc Language",
|
"MiniZinc Language",
|
||||||
"Package Control",
|
"Package Control",
|
||||||
"Svelte",
|
"Svelte",
|
||||||
|
"xonsh",
|
||||||
],
|
],
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user