Change dotfiles structure for shell

This commit is contained in:
2026-03-13 17:57:57 +05:30
parent 4f3f274626
commit 88c308ecc4
13 changed files with 45 additions and 380 deletions

39
shell/aliases Normal file
View File

@@ -0,0 +1,39 @@
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias tmux='tmux -u'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
#---------------------------------- Alias -----------------------------------------
alias tmux='tmux -u'
alias clear="TERM=xterm /usr/bin/clear"
alias cht="cht.sh"
# alias ls="lsd"
alias ls="eza --group-directories-first --icons"
alias lt="eza --group-directories-first --icons -T -L1"
alias ll="ls -lagh"
alias bless="bat --paging=auto"
alias rename-pane="~/dotfiles/scripts/rename-pane.sh"
alias cat="bat -pf"
alias gl="git log"
alias gC="git commit"
alias gCa="git commit --amend"
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gd='git diff'
alias gc='git checkout '
alias go="git log --oneline"
alias gk='gitk --all&'
alias gn="git log -n2"
alias f="fzf --preview 'fzf-preview.sh {}'"
alias t="fzf-tmux"
alias tfn="~/scripts/nvim-fzf.sh"

23
shell/bash Normal file
View File

@@ -0,0 +1,23 @@
# Put all the commands here that should run regardless of whether
# this is an interactive or non-interactive shell.
# Example command:
umask 0027
# test if the prompt var is not set and also to prevent failures
# when `$PS1` is unset and `set -u` is used
if [ -z "${PS1:-}" ]; then
# prompt var is not set, so this is *not* an interactive shell
return
fi
# If we reach this line of code, then the prompt var is set, so
# this is an interactive shell.
# Put all the commands here that should run only if this is an
# interactive shell.
# Example command:
source ~/dotfiles/shell/common
source ~/dotfiles/shell/personal #added by 6500gitsetup
source ~/dotfiles/shell/aliases
# source /home/jsarthak/dotfiles/sh_ciena #added by 6500gitsetup

52
shell/ciena Executable file
View File

@@ -0,0 +1,52 @@
#---------------------------------- Alias -----------------------------------------
alias gsim-gui='/opt/tools/bin/gsim-gui'
alias devops-legacy='source /opt/tools/bin/6500-devops activate'
alias st="ssh 10.185.100.64"
#--------------------------------- Exports ---------------------------------------
export PATH=/opt/tools/bin/:$PATH
export PATH=/opt/tools/swtools/omeBaseTools/latest/:$PATH
export PATH=/localdisk/archive/git-cheat/:$PATH
export PATH=$HOME/toolkit/bin/:$PATH
export PATH=/home/sarjain/.cargo/bin:$PATH
export PATH=/nfs/projects/verif/ome/automain:$PATH
export PATH=/home/sarjain/scripts/:$PATH
export PATH=/home/sarjain/.local/bin/:$PATH
export PATH=/localdisk/usr/neovim/bin/:$PATH
export NTCADHOME=/opt/tools
export PATH=/usr/lab/bin:/localdisk/pne6.9/trunk/components/windml-5.3/host/x86-linux2/bin:/localdisk/pne6.9/trunk/components/webservices-1.8/host/x86-linux2/bin:/localdisk/pne6.9/trunk/components/wrll-wrsnmp/packages/wrsnmp-10.3/host/x86-linux2/bin:/localdisk/pne6.9/trunk/components/webcli-4.9/host/x86-linux2/bin:/localdisk/pne6.9/trunk/components/ip_net2-6.9/host/x86-linux2/bin:/localdisk/pne6.9/trunk/vxworks-6.9//host/x86-linux2/bin:/localdisk/pne6.9/trunk/vxworks-6.9//vxtest/src/scripts:/localdisk/pne6.9/trunk/vxworks-6.9//host/binutils/x86-linux2/bin:/localdisk/pne6.9/trunk:/localdisk/pne6.9/trunk/utilities-1.0/x86-linux2/bin:/localdisk/pne6.9/trunk/workbench-3.3/foundation/x86-linux2/bin:/localdisk/pne6.9/trunk/workbench-3.3/wrsysviewer/host/x86-linux2/bin:/localdisk/pne6.9/trunk/workbench-3.3/wrwb/platform/x86-linux2/eclipse:/localdisk/pne6.9/trunk/workbench-3.3/analysis/host/bin/x86-linux2:/localdisk/pne6.9/trunk/workbench-3.3/x86-linux2/bin:/localdisk/pne6.9/trunk/lmapi-5.0/x86-linux2/bin:/opt/tools/wh/dtd/RHE-5/wr_vxworks_gnu/4.3.3-vxworks-6.9/x86-linux2/bin:/localdisk/pne6.9/trunk/intel/20110124-vxworks-6.9/x86-linux2/bin/ia32:/opt/tools/wh/dtd/RHE-5/wr_vxworks_diab/5.9.1.0/diab/5.9.1.0/LINUX386/bin:/opt/tools/swtools/anaconda/6500/envs/linux-64/devops/bin:/opt/tools/swtools/6500/devutils/bin:/opt/tools/bin:/opt/tools/swtools/anaconda_envs/linux-64/devops/bin:/opt/tools/swtools/anaconda/pftools/condabin:/opt/vulcan/tools/equinox/latest/bin:/opt/vulcan/tools/vulcanbase/0.80/bin:/home/npawar/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/tools/swtools/omeBaseTools/latest:/opt/rational/clearcase/bin:/nfs/projects/cmtools/neu/bin:/nfs/projects/cmtools/bin:/usr/lab/bin:/nfs/projects/equinox/insight/SSIM/latest/bin:/nfs/projects/om_swdev/vkdbg/bin:/nfs/projects/verif/ome/automain:/nfs/projects/equinox/bin:/nfs/projects/aladdin/bin:/nfs/projects/pegasus/bin:/opt/mce/bin:/usr/pde/bin:/nfs/projects/equinox/fast_desktop_analysis/bin:$PATH
export PATH=/home/sarjain/usr/lab/bin/:$PATH
export PATH=/home/sarjain/.local/bin/:$PATH
export PATH=/home/sarjain/.local/neovim/bin/:$PATH
#------
# Check if the current shell is Bash
if [[ -n "$BASH_VERSION" ]]; then
source /opt/tools/swtools/git-completion/git-completion.bash #added by 6500gitsetup
source /opt/tools/bin/go-devops
#--------------------------------- Set bash prompt -------------------------------
# export PS1="\e[1;32m\h\e[0m:\e[1;34m\w\e[0m\n$ "
#
#
#--- DevOps Shell
eval "$(starship init bash)"
fi
if [[ -n "$ZSH_VERSION" ]]; then
bash -c 'source /opt/tools/bin/go-devops && env' | while IFS='=' read -r key value; do
if [[ "$key" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
export "$key=$value"
fi
done
bash -c 'source /opt/tools/swtools/git-completion/git-completion.bash && env' | while IFS='=' read -r key value; do
if [[ "$key" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
export "$key=$value"
fi
done
fi

0
shell/common Normal file
View File

65
shell/personal Normal file
View File

@@ -0,0 +1,65 @@
#
# 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
if [[ -n "$BASH_VERSION" ]]; then
shopt -s histappend
eval "$(starship init bash)"
eval "$(zoxide init bash)"
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
fi
# append to the history file, don't overwrite it
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# 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
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
#--------------------------------- Exports ---------------------------------------
export STARSHIP_CONFIG_BACKGROUND_COLOR="dark"
export EDITOR='nvim'
# export MANPAGER="sh -c 'col -bx | bat -l man -pfn --paging always'"
# export MANPAGER='nvim +Man!'
export MANROFFOPT="-c"
# Key bindings
# bind '"\C-f":"tmux-sessionizer\n"'
#
# if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then
# tmux attach-session -t 0|| tmux new-session -s 0
# fi
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# --------------------------------- Starship --------------------------------------
# colorscript -r
# neofetch

82
shell/starship.toml Normal file
View File

@@ -0,0 +1,82 @@
format = """
$username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break\
$character"""
# Wait 10 milliseconds for starship to check files under the current directory.
scan_timeout = 10
# Disable the blank line at the start of the prompt
add_newline = true
# # Define custom colors
# [palettes.foo]
# # Overwrite existing color
# blue = '21'
# # Define new color
# mustard = '#af8700'
[directory]
style = "purple"
truncation_length = 3
format = ': [$path]($style)[$read_only]($read_only_style) '
truncation_symbol = ".../"
truncate_to_repo =true
[character]
success_symbol = '[](bold green)'
# success_symbol = '[➜](bold green)'
error_symbol = '[✗](bold purple) '
vimcmd_symbol = "[](green)"
[git_branch]
symbol = '🌱 '
# truncation_length = 4
truncation_symbol = ''
format = '[$symbol$branch]($style) '
[git_status]
conflicted = '🏳'
ahead = '🏎💨'
behind = '😰'
diverged = '😵'
up_to_date = '✓'
untracked = '🤷'
stashed = '📦'
modified = '📝'
staged = '[++\($count\)](green)'
renamed = '👅'
deleted = '🗑'
[git_state]
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = '[🍒 PICKING](bold red)'
[cmd_duration]
min_time = 100
format = 'underwent [$duration](bold yellow)'
[os]
disabled = false
[username]
style_user = 'white bold'
style_root = 'black bold'
format = '[$user]($style) '
disabled = false
show_always = true
[hostname]
ssh_only = false
format = '@(bold blue) [$hostname](bold red) '
trim_at = '.ciena.com'
disabled = false
[status]
style = 'bg:blue'
symbol = '🔴 '
success_symbol = '🟢 SUCCESS'
format = '[\[$symbol$common_meaning$signal_name$maybe_int\]]($style) '
map_symbol = true
disabled = false
[conda]
format = "[$symbol$environment]($style) "

62
shell/wezterm.lua Normal file
View File

@@ -0,0 +1,62 @@
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices.
-- For example, changing the initial geometry for new windows:
config.initial_cols = 120
config.initial_rows = 28
-- or, changing the font size and color scheme.
-- You can specify some parameters to influence the font selection;
-- for example, this selects a Bold, Italic font variant.
config.font = wezterm.font('Iosevka Nerd Font Mono')
config.font_size = 12
config.color_scheme = 'iTerm2 Smoooooth'
config.window_frame = {
-- The font used in the tab bar.
-- Roboto Bold is the default; this font is bundled
-- with wezterm.
-- Whatever font is selected here, it will have the
-- main font setting appended to it to pick up any
-- fallback fonts you may have used there.
font = wezterm.font { family = 'Iosevka', weight = 'Bold' },
-- The size of the font in the tab bar.
-- Default to 10.0 on Windows but 12.0 on other systems
font_size = 14.0,
-- The overall background color of the tab bar when
-- the window is focused
active_titlebar_bg = '#333333',
-- The overall background color of the tab bar when
-- the window is not focused
inactive_titlebar_bg = '#333333',
}
config.colors = {
tab_bar = {
-- The color of the inactive tab bar edge/divider
inactive_tab_edge = '#575757',
},
}
config.window_background_opacity = .9
config.window_padding = {
left = 8,
right = 8,
top = 0,
bottom = 0,
}
-- Finally, return the configuration to wezterm:
return config

119
shell/zsh Normal file
View File

@@ -0,0 +1,119 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git starship)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Compilation flags
# export ARCHFLAGS="-arch $(uname -m)"
# Set personal aliases, overriding those provided by Oh My Zsh libs,
# plugins, and themes. Aliases can be placed here, though Oh My Zsh
# users are encouraged to define aliases within a top-level file in
# the $ZSH_CUSTOM folder, with .zsh extension. Examples:
# - $ZSH_CUSTOM/aliases.zsh
# - $ZSH_CUSTOM/macos.zsh
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH="/Users/jsarthak/flutter-sdk/flutter/bin:$PATH"
source <(fzf --zsh)
# Added by Antigravity
export PATH="/Users/jsarthak/.antigravity/antigravity/bin:$PATH"
export PATH="/Users/jsarthak/flutter-sdk/flutter/bin:$PATH"
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
source $HOME/dotfiles/shell/common
source $HOME/dotfiles/shell/personal
source $HOME/dotfiles/shell/aliases
MANPAGER="col -b | cat"
MANROFFOPT="-P-c"
eval "$(zoxide init zsh)"