diff --git a/common/starship.toml b/common/starship.toml index ab4962c..9f07121 100644 --- a/common/starship.toml +++ b/common/starship.toml @@ -343,7 +343,7 @@ format = '[ $symbol ($version) ]($style)' style = "bg:#06969A" format = '[ $indicator ]($style)' fish_indicator = "󰈺 " -bash_indicator = '$ ' +bash_indicator = '\$ ' zsh_indicator = "% " powershell_indicator = "PS" cmd_indicator = "cm" diff --git a/tools/bash/bash_aliases b/tools/bash/bash_aliases new file mode 100644 index 0000000..e236c4a --- /dev/null +++ b/tools/bash/bash_aliases @@ -0,0 +1,134 @@ + +if command -v zoxide > /dev/null ; then + eval "$(zoxide init bash)" +# Relative navigation # + alias ..="z .." + alias ...="z ../.." + alias ....="z ../../.." + alias .....="z ../../../.." + alias ......="z ../../../../.." +# Use `-` to jump to the previous directory +# Oh-My-Zsh defines a similar one + -(){ + z - + } + zls(){ + cd $1 && ls + } +else + alias ..="cd .." + alias ...="cd ../.." + alias ....="cd ../../.." + alias .....="cd ../../../.." + alias ......="cd ../../../../.." + -() { + cd - + } +fi + + +alias ni=touch +alias cls=clear +alias ii=open + +# Editors # +alias v=nvim +alias c=code +# Use neovide as gVim +alias gvi="neovide" +alias sv="sudo vim -u ~/.dotfiles/common/vim.noxdg.vimrc" +alias sn="sudo nvim -u ~/.config/nvim/init.lua" + +# Dev # +alias gpp='g++ -std=c++2b' # Set the default C++ standard to C++20 +alias gcc='gcc -std=c99' # Set the default C standard to C99 +alias cl='clang -std=c99' +alias clpp='clang++ -std=c++2b' +alias python=python3 # Set the default Python version to Python 3 +alias py=python +alias ipy=ipython + +alias g=lazygit + + +# lsd - modern ls +if command -v lsd > /dev/null; then + alias ls='lsd' + alias l='lsd -lah' + alias ll='lsd -l' + alias la='lsd -A' + alias l.='lsd -d .*' + alias tree='lsd --tree -A' +else + alias l='ls -lah' + alias ll='ls -l' +fi + + +# Functions # +mkcd() { + mkdir -p $1 && cd $1 +} +cdls(){ + cd $1 && ls +} +tc(){ + touch $1 && code $1 +} +tv(){ + touch $1 && nvim $1 +} +mt(){ + mkdir -p $(dirname $1) && touch $1 +} +mtv(){ + mkdir -p $(dirname $1) && touch $1 && nvim $1 +} + + +alias update="source $DOTFILES/scripts/update.zsh" + +if command -v pacman > /dev/null; then + alias pac="sudo pacman" + alias paci="sudo pacman -S" + alias pacr="sudo pacman -R" + alias pacu="sudo pacman -Syu" + alias pacl="pacman -Q" + if command -v paru > /dev/null; then + alias pacs="paru -Ss" + elif command -v yay > /dev/null; then + alias pacs="yay -Ss" + else + alias pacs="pacman -Ss" + fi +fi + +if command -v apt > /dev/null; then + alias apt="sudo apt" + alias apti="sudo apt install" + alias aptr="sudo apt remove" + alias aptu="sudo apt update && sudo apt upgrade" + alias apts="apt search" + alias aptl="apt list --installed" +fi + +if command -v brew > /dev/null; then + alias brewi="brew install" + alias brewr="brew uninstall" + alias brewu="brew update && brew upgrade" + alias brews="brew search" + alias brewl="brew list" +fi + + + +# TODO: Does not work +if [ "$TERM" = "xterm-ghostty" ] || [ "$TERM" = "xterm-kitty" ]; then + alias icat="kitten icat" +elif [ "$TERM_PROGRAM" = "WezTerm" ]; then + if [ -n "$WSL_DISTRO_NAME" ]; then + alias icat="wezterm.exe imgcat" + else + alias icat="wezterm imgcat" + fi +fi diff --git a/tools/bash/bashrc b/tools/bash/bashrc index e69de29..ed9b861 100644 --- a/tools/bash/bashrc +++ b/tools/bash/bashrc @@ -0,0 +1,30 @@ +# If no admin rights, just +# ln -sf $DOTFILES/tools/bash/bashrc ~/.bashrc + +export DOTFILES=$HOME/.dotfiles + +if [ -n "$WAYLAND_DISPLAY" ]; then + alias clip="wl-copy" + alias paste="wl-paste" +elif [ -n "$DISPLAY" ]; then + alias clip="xclip" +elif [ -n "$WSL_DISTRO_NAME" ]; then + alias clip="clip.exe" + alias paste="pwsh.exe -NoProfile -Command 'Get-Clipboard'" +fi + + + +source $DOTFILES/tools/bash/bash_aliases # For compatibility + +export IPYTHONDIR="$XDG_CONFIG_HOME"/ipython + +if command -v fzf > /dev/null; then + eval "$(fzf --bash)" +fi + +if command -v starship > /dev/null; then + eval "$(starship init bash)" +fi +# + # bind 'set show-mode-in-prompt off' diff --git a/tools/bash/global.bashrc b/tools/bash/global.bashrc new file mode 100644 index 0000000..b5e8dc1 --- /dev/null +++ b/tools/bash/global.bashrc @@ -0,0 +1,2 @@ +test -f $HOME/.config/bash/bashrc && source $HOME/.config/bash/bashrc +test -f $HOME/.bashrc && source $HOME/.bashrc diff --git a/tools/bash/profile b/tools/bash/profile index e0513d6..4c91ee2 100644 --- a/tools/bash/profile +++ b/tools/bash/profile @@ -1,3 +1,10 @@ +# Put this file in $XDG_CONFIG_HOME/bash/profile +# This file is sourced by /etc/profile.d/xdg-compat.sh +# and will source user's XDG-compliant Bash Run Commands + +# If no admin rights, just +# ln -sf $DOTFILES/tools/bash/profile ~/.bash_profile + # Before antidots if [ -n "$BASH_VERSION" ] && [ -f "$HOME/.bash_profile" ]; then . "$HOME/.bash_profile" @@ -49,7 +56,7 @@ fi # macOS Specific # This syntax is POSIX standard, for portability if [ "$(uname)" = "Darwin" ]; then - + : # Do nothing fi # Linux Specific @@ -125,13 +132,11 @@ fi # Ruby Gem # Ruby Gem if command -v gem > /dev/null; then - setopt nullglob for dir in "$HOME/.local/share/gem/ruby/"*/bin; do if [ -d "$dir" ]; then export PATH="$dir:$PATH" fi done - unsetopt nullglob fi # Spacemacs if command -v emacs > /dev/null; then diff --git a/tools/nvim/lua/plugins/appearance.lua b/tools/nvim/lua/plugins/appearance.lua index ded26c6..46063a9 100644 --- a/tools/nvim/lua/plugins/appearance.lua +++ b/tools/nvim/lua/plugins/appearance.lua @@ -13,6 +13,9 @@ return { styles = { -- keywords = { "underline" }, }, + integrations = { + "lualine", + }, }) end, }, diff --git a/tools/zed/keymap.json b/tools/zed/keymap.json index d90f0d7..2791e19 100755 --- a/tools/zed/keymap.json +++ b/tools/zed/keymap.json @@ -59,7 +59,8 @@ "space space": "file_finder::Toggle", "space ;": "command_palette::Toggle", "space f c": "zed::OpenSettings", - "space f e c": "zed::OpenSettings" + "space f e c": "zed::OpenSettings", + "space f t": "project_panel::ToggleFocus" } }, {