diff options
Diffstat (limited to 'shell')
| -rwxr-xr-x | shell/Xresources | 21 | ||||
| -rwxr-xr-x | shell/bash_profile | 7 | ||||
| -rwxr-xr-x | shell/bashrc | 122 | ||||
| -rwxr-xr-x | shell/profile | 10 | ||||
| -rwxr-xr-x | shell/starship.toml | 190 | ||||
| -rwxr-xr-x | shell/zshrc | 81 |
6 files changed, 431 insertions, 0 deletions
diff --git a/shell/Xresources b/shell/Xresources new file mode 100755 index 0000000..0d7978d --- /dev/null +++ b/shell/Xresources @@ -0,0 +1,21 @@ + +! Xcursor.theme: windows-cursors +! Xcursor.size: 22 +*.font: xft:JetBrainsMono NF:style=Normal:size=12 +xterm*dynamicColors: true +xterm*background: black +xterm*foreground: grey +xterm*saveLines: 35000 +XTerm.vt100.backarrowKey: true +XTerm.vt100.deleteIsDEL: true +XTerm*selectToClipboard: true +! xterm*scrollBar: true +! xterm*rightScrollBar: true + +XTerm*VT100.Translations: #override \ + Ctrl Shift <Key>J: scroll-forw(5, line) \n\ + Ctrl Shift <Key>K: scroll-back(5, line) \n\ + Ctrl Shift <Key>Up: scroll-back(1, page) \n\ + Ctrl Shift <Key>Down: scroll-forw(1, page) \n\ + Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\ + Ctrl Shift <Key>C: select-end(CLIPBOARD) diff --git a/shell/bash_profile b/shell/bash_profile new file mode 100755 index 0000000..46cbf54 --- /dev/null +++ b/shell/bash_profile @@ -0,0 +1,7 @@ +# +# ~/.bash_profile +# +# Source bashrc for login shells +if [ -f ~/.bashrc ]; then + source ~/.bashrc +fi diff --git a/shell/bashrc b/shell/bashrc new file mode 100755 index 0000000..623029d --- /dev/null +++ b/shell/bashrc @@ -0,0 +1,122 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then + PROMPT_COLOR="1;31m" + ((UID)) && PROMPT_COLOR="1;37m" + if [ -n "$INSIDE_EMACS" ]; then + # Emacs term mode doesn't support xterm title escape sequence (\e]0;) + PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " + else + PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] " + fi + if test "$TERM" = "xterm"; then + PS1="\[\033]2;\h:\u:\w\007\]$PS1" + fi +fi + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +alias ls='eza --icons' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +alias cd='z' +alias cat='bat' + +set -o vi +# colored GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='eza -la' +alias la='eza -a' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +PATH=$HOME/.local/bin:/usr/local/texlive/2023/bin/x86_64-linux:$PATH + +[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh +eval "$(fzf --bash)" +eval "$(zoxide init bash)" diff --git a/shell/profile b/shell/profile new file mode 100755 index 0000000..ee55aa5 --- /dev/null +++ b/shell/profile @@ -0,0 +1,10 @@ +export XDG_DATA_DIRS="/home/skainswo/.nix-profile/share:$XDG_DATA_DIRS" + +# Nix profile path +if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then + . "$HOME/.nix-profile/etc/profile.d/nix.sh" +fi + +export XKB_DEFAULT_LAYOUT=us +export XKB_DEFAULT_OPTIONS=caps:swapescape + diff --git a/shell/starship.toml b/shell/starship.toml new file mode 100755 index 0000000..a7d9da4 --- /dev/null +++ b/shell/starship.toml @@ -0,0 +1,190 @@ +[aws] +disabled = true + +[buf] +symbol = " " + +[bun] +symbol = " " + +[c] +symbol = " " + +[cpp] +symbol = " " + +[cmake] +symbol = " " + +[conda] +symbol = " " + +[crystal] +symbol = " " + +[dart] +symbol = " " + +[deno] +symbol = " " + +[directory] +read_only = " " + +[docker_context] +symbol = " " + +[elixir] +symbol = " " + +[elm] +symbol = " " + +[fennel] +symbol = " " + +[fossil_branch] +symbol = " " + +[gcloud] +symbol = " " + +[git_branch] +symbol = " " + +[git_commit] +tag_symbol = ' ' + +[golang] +symbol = " " + +[guix_shell] +symbol = " " + +[haskell] +symbol = " " + +[haxe] +symbol = " " + +[hg_branch] +symbol = " " + +[hostname] +ssh_symbol = " " + +[java] +symbol = " " + +[julia] +symbol = " " + +[kotlin] +symbol = " " + +[lua] +symbol = " " + +[memory_usage] +symbol = " " + +[meson] +symbol = " " + +[nim] +symbol = " " + +[nix_shell] +symbol = " " + +[nodejs] +symbol = " " + +[ocaml] +symbol = " " + +[os.symbols] +Alpaquita = " " +Alpine = " " +AlmaLinux = " " +Amazon = " " +Android = " " +Arch = " " +Artix = " " +CachyOS = " " +CentOS = " " +Debian = " " +DragonFly = " " +Emscripten = " " +EndeavourOS = " " +Fedora = " " +FreeBSD = " " +Garuda = " " +Gentoo = " " +HardenedBSD = " " +Illumos = " " +Kali = " " +Linux = " " +Mabox = " " +Macos = " " +Manjaro = " " +Mariner = " " +MidnightBSD = " " +Mint = " " +NetBSD = " " +NixOS = " " +Nobara = " " +OpenBSD = " " +openSUSE = " " +OracleLinux = " " +Pop = " " +Raspbian = " " +Redhat = " " +RedHatEnterprise = " " +RockyLinux = " " +Redox = " " +Solus = " " +SUSE = " " +Ubuntu = " " +Unknown = " " +Void = " " +Windows = " " + +[package] +symbol = " " + +[perl] +symbol = " " + +[php] +symbol = " " + +[pijul_channel] +symbol = " " + +[pixi] +symbol = " " + +[python] +symbol = " " + +[rlang] +symbol = " " + +[ruby] +symbol = " " + +[rust] +symbol = " " + +[scala] +symbol = " " + +[swift] +symbol = " " + +[zig] +symbol = " " + +[gradle] +symbol = " " diff --git a/shell/zshrc b/shell/zshrc new file mode 100755 index 0000000..4bac285 --- /dev/null +++ b/shell/zshrc @@ -0,0 +1,81 @@ +# The following lines were added by compinstall + +fpath=(~/.zsh/completion/ $fpath) + +autoload -Uz compinit; compinit +source /home/anand/github/fzf-tab/fzf-tab.plugin.zsh +# For zsh completion +export PATH=/usr/bin/aws_completer:$PATH +autoload bashcompinit && bashcompinit +complete -C "$(which aws_completer)" aws + +autoload -Uz edit-command-line +zle -N edit-command-line +zstyle ':completion:*' completer _expand _complete _ignored +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' +zstyle :compinstall filename '/home/anand/.zshrc' + +autoload -Uz tetriscurses +autoload -Uz colors && colors + +alias cls="clear" +alias battery='upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage;upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time"' +alias start_venv='source ~/Documents/prog/python/.venv/bin/activate' +alias ls='[ $[$RANDOM % 1000] = 0 ] && sl || eza --icons="always"' +alias hms='home-manager switch -f ~/dots/home.nix' +alias feh='feh --info "echo %n"' +please() { + sudo $(fc -ln -1) +} +alias cat='bat' +alias ..='cd ..' +alias cp='cp -i' +alias rm='rm -i' +alias mv='mv -i' +alias df='df -h' +alias ll='eza -lF --icons="always"' +alias lla='eza -AlF --icons="always"' +alias la='eza -AF --icons="always"' + +alias feh='feh --info "echo %n"' +alias updateserver='rsync -avz --delete -e "ssh -i ~/.ssh/mailaws.pem" --rsync-path="sudo rsync" ~/Documents/prog/website/ admin@heresanandp.in:/var/www/website/' + +export EDITOR='/home/anand/.nix-profile/bin/nvim' +export VISUAL='/home/anand/.nix-profile/bin/nvim' +export HISTCONTROL=ignoreboth + +# Temporary fix +alias man='batman' + +# End of lines added by compinstall +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt notify +unsetopt nomatch autocd beep extendedglob +bindkey -v + +# Plugins +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh +fpath=(/home/anand/github/zsh-completions/src $fpath) + +# fzf +source <(fzf --zsh) +source <(jj util completion zsh) + +# Binds for history search +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down + +eval "$(zoxide init zsh)" + +## [Completion] +## Completion scripts setup. Remove the following line to uninstall +[[ -f /home/anand/.dart-cli-completion/zsh-config.zsh ]] && . /home/anand/.dart-cli-completion/zsh-config.zsh || true +## [/Completion] + +eval "$(starship init zsh)" +bindkey "^X^E" edit-command-line |
