v1ral_ITS

New zshrc Aliases

Jun 13th, 2025 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.79 KB | None | 0 0
  1. # If you come from bash you might have to change your $PATH.
  2. export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
  3.  
  4. # Path to your Oh My Zsh installation.
  5. export ZSH="$HOME/.oh-my-zsh"
  6.  
  7. # Set name of the theme to load --- if set to "random", it will
  8. # load a random theme each time Oh My Zsh is loaded, in which case,
  9. # to know which specific one was loaded, run: echo $RANDOM_THEME
  10. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  11. ZSH_THEME="random"
  12.  
  13. # Set list of themes to pick from when loading at random
  14. # Setting this variable when ZSH_THEME=random will cause zsh to load
  15. # a theme from this variable instead of looking in $ZSH/themes/
  16. # If set to an empty array, this variable will have no effect.
  17. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  18.  
  19. # Uncomment the following line to use case-sensitive completion.
  20. # CASE_SENSITIVE="true"
  21.  
  22. # Uncomment the followi64728abe9ced1337317a7d8777993ef8%ng line to use hyphen-insensitive completion.
  23. # Case-sensitive completion must be off. _ and - will be interchangeable.
  24. HYPHEN_INSENSITIVE="true"
  25.  
  26. # Uncomment one of the following lines to change the auto-update behavior
  27. # zstyle ':omz:update' mode disabled  # disable automatic updates
  28. zstyle ':omz:update' mode auto      # update automatically without asking
  29. # zstyle ':omz:update' mode reminder  # just remind me to update when it's time
  30.  
  31. # Uncomment the following line to change how often to auto-update (in days).
  32. zstyle ':omz:update' frequency 7
  33.  
  34. # Uncomment the following line if pasting URLs and other text is messed up.
  35. # DISABLE_MAGIC_FUNCTIONS="true"
  36.  
  37. # Uncomment the following line to disable colors in ls.
  38. # DISABLE_LS_COLORS="true"
  39.  
  40. # Uncomment the following line to disable auto-setting terminal title.
  41. DISABLE_AUTO_TITLE="true"
  42.  
  43. # Uncomment the following line to enable command auto-correction.
  44. #ENABLE_CORRECTION="true"
  45.  
  46. # Uncomment the following line to display red dots whilst waiting for completion.
  47. # You can also set it to another string to have that shown instead of the default red dots.
  48. # Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
  49. COMPLETION_WAITING_DOTS="true"
  50. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
  51.  
  52. # Uncomment the following line if you want to disable marking untracked files
  53. # under VCS as dirty. This makes repository status check for large repositories
  54. # much, much faster.
  55. DISABLE_UNTRACKED_FILES_DIRTY="true"
  56.  
  57. # Uncomment the following line if you want to change the command execution time
  58. # stamp shown in the history command output.
  59. # You can set one of the optional three formats:
  60. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  61. # or set a custom format using the strftime function format specifications,
  62. # see 'man strftime' for details.
  63. HIST_STAMPS="%A %B %I:%Mpm"
  64.  
  65. # Would you like to use another custom folder than $ZSH/custom?
  66. # ZSH_CUSTOM=/path/to/new-custom-folder
  67.  
  68. # Which plugins would you like to load?
  69. # Standard plugins can be found in $ZSH/plugins/
  70. # Custom plugins may be added to $ZSH_CUSTOM/plugins/
  71. # Example format: plugins=(rails git textmate ruby lighthouse)
  72. # Add wisely, as too many plugins slow down shell startup.
  73. plugins=(git web-search sudo copyfile copypath )
  74.  
  75. source $ZSH/oh-my-zsh.sh
  76.  
  77. # User configuration
  78.  
  79. # export MANPATH="/usr/local/man:$MANPATH"
  80.  
  81. # You may need to manually set your language environment
  82. export LANG=en_US.UTF-8
  83.  
  84. # Preferred editor for local and remote sessions
  85.  if [[ -n $SSH_CONNECTION ]]; then
  86.     export EDITOR='nano'
  87.  else
  88.     export EDITOR='tilde'
  89.  fi
  90. #appmenu-gtk-module
  91. # Compilation flags
  92. # export ARCHFLAGS="-arch $(uname -m)"
  93.  
  94. # Set personal aliases, overriding those provided by Oh My Zsh libs,FPATH=~/.rbenv/completions:"$FPATH"
  95.  
  96.   autoload -U compinit
  97.   compinit
  98. # plugins, and themes. Aliases can be placed here, though Oh My Zsh
  99. # users are encouraged to define aliases within a top-level file in
  100. # the $ZSH_CUSTOM folder, with .zsh extension. Examples:
  101. # - $ZSH_CUSTOM/aliases.zsh
  102. # - $ZSH_CUSTOM/macos.zsh
  103. # For a full list of active aliases, run `alias`.
  104. #
  105. # Example aliases
  106. # alias zshconfig="mate ~/.zshrc"
  107. # alias ohmyzsh="mate ~/.oh-my-zsh"
  108. ########################################################################################
  109. ##  BEGIN CUSTOM                         <[email protected]>  ##
  110. ##          AREA FOR FUNCTIONS AND ALIASES         ITSolutions            ##
  111. ########################################################################################
  112.  
  113. ## START ##
  114.  
  115. cpv() {
  116.     gcp -rfLP --fix-filenames auto $
  117. }
  118. mvv() {
  119.     rsync -a --no-group --no-owner --no-perms -cvzW --inplace -h --stats --force --trust-sender --fsync --ignore-errors --delete-after --remove-source-files --recursive --progress $
  120. }
  121. alias mv=mvv
  122. alias cp='cpv'
  123. quick-dir-list-server() {
  124.     echo -e "Enter IP address from ifconfig:   "
  125.     read ADDR
  126.     python3 -m http.server --bind $ADDR
  127. }
  128. alias quicklist='quick-dir-list-server'
  129. alias torb='cd ~/.torb; ./start-tor-browser.desktop && cd $HOME; clear'
  130. servstart() {
  131.     echo -e "\n\nStart What Service:     "
  132.     read DRT
  133.     sudo service $DRT start
  134. }
  135. servstop() {
  136.     echo -e "\n\nStop What Service:     "
  137.     read DMTX
  138.     sudo service $DMTX stop
  139. }
  140. alias sss='sudo service --status-all'
  141. alias ifc='ifconfig'
  142. alias imdone='sudo killall -u $(whoami)'
  143. alias smnt='sudo mount $'
  144. alias cno='cat ~/notes'
  145. alias myweather='wget en.wttr.in/ | tr "37.7440,-77.1316 " +; cat index.html; rm index.html'
  146. alias adbin='adb install $'
  147. alias nmpf='npm fund'
  148. alias nn='\cat - >> /home/$USER/notes'
  149. alias reinstall='sudo apt-get install --reinstall $'
  150. alias carmir='cat $HOME/.mir | xsel -ib'
  151. H() {
  152.  
  153. cd $HOME
  154.  
  155. }
  156. BIN() {
  157.     cd $HOME/bin
  158. }
  159. DOWNLOADS() {
  160.     cd $HOME/Downloads
  161. }
  162. MEDIA() {
  163.     cd /media/$USER
  164. }
  165. DESKTOP() {
  166.     cd $HOME/Desktop
  167. }
  168. alias h=H
  169. alias bin=BIN
  170. alias media=MEDIA
  171. alias desktop=DESKTOP
  172. alias dls=DOWNLOADS
  173.  
  174. # Function to remove duplicate directories from the current PATH
  175. clean_current_path() {
  176.   if [ -n "$PATH" ]; then
  177.     local old_path="$PATH"
  178.     # Convert PATH to an array, remove duplicates, and reassemble
  179.     export PATH=$(echo "$PATH" | tr ':' '\n' | awk '!seen[$0]++ && NF' | paste -sd: -)
  180.     if [ "$PATH" != "$old_path" ]; then
  181.       echo "PATH has been cleaned."
  182.       echo "Old PATH: $old_path"
  183.       echo "New PATH: $PATH"
  184.       echo "To make this permanent, edit your shell rc file (e.g., ~/.zshrc or ~/.bashrc)."
  185.     else
  186.       echo "PATH is already clean (no duplicates found)."
  187.     fi
  188.   else
  189.     echo "PATH is not set."
  190.   fi
  191. }
  192.  
  193. # Function to identify duplicate alias definitions in ~/.zshrc
  194. # This helps you find aliases defined multiple times in your config file.
  195.  
  196. find_duplicate_aliases_in_zshrc() {
  197.   echo " Searching for duplicate alias definitions in ~/.zshrc..."
  198.  
  199.   local temp_alias_file
  200.   temp_alias_file=$(mktemp "${TMPDIR:-/tmp}/zshrc_aliases.XXXXXX")
  201.  
  202.   # Extract alias names
  203.   grep -E '^\salias\s+' "$HOME/.zshrc" | \
  204.     sed -E 's/\s#.//' | \
  205.     grep -E '^\salias\s+' | \
  206.     sed -E 's/^\salias\s+([^=]+)=./\1/' | \
  207.     sort > "$temp_alias_file"
  208.  
  209.   # Find duplicates
  210.   local duplicates
  211.   duplicates=$(uniq -d "$temp_alias_file")
  212.  
  213.   if [ -n "$duplicates" ]; then
  214.     echo -e "\n Found potential duplicate alias definitions in ~/.zshrc:"
  215.     echo "$duplicates" | sed 's/^/  → /'
  216.     echo -e "\n Line numbers in ~/.zshrc:\n"
  217.     while IFS= read -r alias_name; do
  218.       [ -n "$alias_name" ] && {
  219.         echo "--- Alias: '$alias_name' ---"
  220.         grep -n --color=always -E "^\salias\s+${alias_name}=" "$HOME/.zshrc"
  221.         echo ""
  222.       }
  223.     done <<< "$duplicates"
  224.   else
  225.     echo " No duplicate alias definitions found in ~/.zshrc."
  226.   fi
  227.  
  228.   rm -f "$temp_alias_file"
  229.  
  230.   echo ""
  231.   echo " Note: Zsh uses the last alias definition if multiple exist."
  232.   echo "You can check currently active ones with the 'alias' command."
  233. }
  234.  
  235. # Lines configured by zsh-newuser-install
  236. HISTFILE=~/.zsh_history
  237. HISTSIZE=1000000
  238. SAVEHIST=1000000
  239.  
  240. bindkey -e
  241.  
  242. alias cd -1='cd ..;clear;ls'
  243. alias cd -2='cd ..;cd ..;clear;ls'
  244. alias cd -3='cd ..;cd ..;cd ..;clear;ls'
  245. alias cd -4='cd ..;cd ..;cd ..;cd ..;clear;ls'
  246. alias cd -5='cd ..;cd ..;cd ..;cd ..;cd ..;clear;ls'
  247. alias 1='cd -1'
  248. alias 2='cd -2'
  249. alias 3='cd -3'
  250. alias 4='cd -4'
  251. alias 5='cd -5'
  252. alias 6='cd -6'
  253. alias 7='cd -7'
  254. alias 8='cd -8'
  255. alias 9='cd -9'
  256. reload1() {
  257.     . $HOME/.zshrc
  258.     cat $HOME/.zshrc
  259. }
  260. alias adbin='adb install '
  261. alias allpkgs='dpkg --get-selections | grep -v deinstall'
  262. alias c=clear
  263. alias x=exit
  264. alias which-command=whence
  265. alias sss='sudo service --status-all'
  266. alias smnt='sudo mount 'sdpkgi='sudo dpkg -i ""'
  267. alias nrc='\cat - >> /home/b3ar_/.zshrc; reload1'
  268. alias nn='\cat - >> /home/b3ar_/notes'
  269. alias catno='cat $HOME/notes'
  270. alias catrc='cat $HOME/.zshrc'
  271. alias _reload='reload1; echo -e "Hit [E]nter to continue:  "; read NULLl; clear;ls'
  272. alias gedrc='gedit $HOME/.zshrc'
  273. alias s='sudo $*'
  274. alias clipc='clipcopy'
  275. alias clipp='clippaste'
  276. alias chx='chmod +x $*'
  277. alias rm='trash-put $*'
  278. 2DAV() {
  279.     read FILE < <(zenity --file-selection)
  280.     curl -u b3ar_:lol -a http://127.0.0.53/webdav/ --upload $FILE
  281. }
  282. alias sdpkgi='sudo dpkg -i $*'
  283. alias ITSpeed="/bin/speedtest"
  284. alias ..='cd ..;clear;ls'
  285. alias up2dav='2DAV'
  286. alias lsblkinfo='lsblk --output NAME,SERIAL,MODEL,TYPE,SIZE,FSAVAIL,FSTYPE,MOUNTPOINT,SUBSYSTEMS,VENDOR,TRAN,HCTL,WWN,PHY-SEC,LOG-SEC,ALIGNMENT,MODE,GROUP,OWNER,STATE,SIZE,HOTPLUG,PARTFLAGS,MOUNTPOINTS,FSROOTS,PATH,KNAME'
  287. isize() {
  288.     FILE=$*
  289.     du -ah $FILE
  290. }
  291. WINE() {
  292.     cd $HOME/.wine
  293. }
  294. alias 2wine='WINE'
  295. export THEOS=~/theos
  296. alias gitc='git clone $*'
  297. alias sin=' sudo apt-get install -y $'
  298. ITS-GUI-CAT() {
  299.     FILE="$*"
  300.     cat "$FILE" | yad --title="ITS-GUI-CAT" \
  301.      --height=850  --width=1500 \
  302.       --text-info
  303. }
  304. alias cat=ITS-GUI-CAT
  305. alias open='xdg-open $*'
  306. eval "$(~/.rbenv/bin/rbenv init - --no-rehash zsh)"
  307. FPATH=~/.rbenv/completions:"$FPATH"
  308. autoload -U compinit
  309. compinit
  310.  
  311.  
Add Comment
Please, Sign In to add comment