Skip to content

To share my favorites tools and plugins to optimize DX and efficiency

Notifications You must be signed in to change notification settings

FlorianBruniaux/terminal_tools_plugins_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Tech:all : [Tutoriels] Terminal : tips, tricks, resources

Extensions / Plugins

GIT tools

Delta

Lazy git

Git open

Git standup

Gitsome

TIG


Divers

Alias-tips

Annie

AG

BAT

Bottom

BYOBU

Broot

CLOC

cloc-all-repos(){
  cd /PATH/TO/YOUR/REPOSITORIES/DIRECTORY/PARENT
  for i in \*/.git; do ( echo '-----------------------------'; echo $i; cd $i/..; cloc .); done
}

Curlie

Df

Dive

Dog

Dust

Exa

Fig Autocomplete

FPP

FX

FZF

Glow

grex

Hotel

Hyperfine

itermocil

JQ

K

LNAV

Mac-cli

ncdu

  • faire du ménage dans l’espace disque, aide à trouver immédiatement les repertoires ou fichiers les plus volumineux

Oha

Ranger

Ripgrep

TTY gif

Viu

yq

Z

Zooxide


Plugins ZSH

Liste de plugin

git-extras

colorize

history

history-substring$

Jira

Vscode

zsh-autosuggestions

zsh-syntax-highlighting

zsh-syntax-highlighting-filetypes


Divers tips shell

  • sudo!! executes the last command with sudo
  • history to display command history
    • !123 to replay command 123
  • open. to open the current folder in the finder
  • CTRL + R: search in command history

Editeur pour terminal

Nano

Installation with HomeBrew, alias depending on Mac M1 or not to be placed in .zshrc, config to be put in .nanorc

brew install nano

alias nano='/opt/homebrew/bin/nano'
alias nano='/usr/local/bin/nano'

touch ~/.nanorc
nano ~/.nanorc

set tabsize 4
set linenumbers
set autoindent
set mouse
set trimblanks
set titlecolor white,red
set statuscolor yellow
set numbercolor yellow
set keycolor cyan
set functioncolor cyan
set constantshow
include /usr/local/share/nano/\*.nanorc

Aliases

git_pull_all_repos

  • To pull multiple branches (master/develop/current) from all repos in a folder
git-pull-all-repos(){
  cd /PATH/TO/REPOS
  for i in \*/.git; do ( echo '-----------------------------'; echo $i; cd $i/..; branch=$(git rev-parse --abbrev-ref HEAD); git checkout master && git pull --ff; git checkout develop && git pull --$
}

Update all local repos

git-pull-all-repos(){
  cd /PATH/TO/REPOS
  for i in \*/.git; do ( echo '-----------------------------'; echo $i; cd $i/..; branch=$(git rev-parse --abbrev-ref HEAD); git checkout master && git pull --ff; git checkout develop && git pull --ff; git checkout $branch; ); done
}

Switch all local repos to master

git-all-repos-on-master(){
  cd /PATH/TO/REPOS
  for i in \*/.git; do ( echo '-----------------------------'; echo $i; cd $i/..; git checkout master;); done
}

Update ruby projects

update-all-ruby-repos(){
  cd /PATH/TO/REPOS
  FILE=Gemfile
  cd /PATH/TO/REPOS
  for i in \*/.git; do ( echo '-----------------------------'; echo $i; cd $i/..; if \[\[ -f "$FILE" \]\]; then bundle update; rake db:migrate;  fi); done
}

Count LOC of each project

cloc-all-repos(){
  cd /PATH/TO/REPOS
  for i in \*/.git; do ( echo '-----------------------------'; echo $i; cd $i/..; cloc .); done
}

Show various information about local rests

get-all-repos-infos > ~/Desktop/git-repos-infos.txt

get-all-repos-infos(){
 cd /PATH/TO/REPOS
 for i in \*/.git; do ( echo -e '\\n////////////////////////////////////////\\n'; echo $i; echo -e '\\n////////////////////////////////////////\\n'; cd $i/..; echo -e "\\n All authors : \\n"; git authors --list; git summary; ) done
}

git_dig

  • To browse inside git logs
function git-dig {
  git log --pretty=format:'%Cred%h%Creset - %Cgreen(%ad)%Creset - %s %C(bold blue)<%an>%Creset' --abbrev-commit --date=short --grep "$1" -- $2
}

fe - fuzzy file edit

fe() {
  local file
  file=$(fzf --query="$1" --select-1 --exit-0)
  \[ -n "$file" \] && ${EDITOR:-nvim} "$file"
}

lsl

  • Display of the complete current folder pimped with exa
    • alias lsl="exa -abghHliS"

myip

  • Displaying your IP
    • alias myip='curl http://ipecho.net/plain; echo'

reload

  • allows you to update/repair your current shell (like new alias, lib, dependency or when you broke your termcaps)
    • alias reload="source ~/.zshrc && hash -r && reset"

reload_access_public_key

eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa

sub/vis

  • open a folder in the text editor
    • alias sub="open -a 'Sublime Text'"
    • alias vis="open -a 'Visual Studio Code'"

select_branch_or_tag

  • To facilitate branch/tag selection
select\_branch\_or\_tag() {
  local tags branches target

  tags=$(
    git tag | awk '{print "\\x1b\[31;1mtag\\x1b\[m\\t" $1}') || return
  branches=$(
    git branch --all | grep -v HEAD             |
    sed "s/.\* //"    | sed "s#remotes/\[^/\]\*/##" |
    sort -u          | awk '{print "\\x1b\[34;1mbranch\\x1b\[m\\t" $1}') || return
  target=$(
    (echo "$tags"; echo "$branches") |
    fzf-tmux -l30 -- --no-hscroll --ansi +m -d "\\t" -n 2 $argv) || return

  echo "$target" | awk '{print $2}'
}

show-version

  • Good old print versions of the package managers used
    • alias show-versions="echo 'RUBY : $(ruby -v)\nNODE : $(node --version) \nNPM : $(npm --version)\nYARN: $(yarn --version)'"

yarndeps

function yarndeps() {
 # preload installed dependencies, remove first and last lines
 roster="$(yarn list --depth 0 2>/dev/null | awk '{print $2}' | sed '1d;$d')"
 # match each dependency (from package.json) to the preloaded list
 while IFS= read -r dependency; do
  echo "${roster}" | GREP\_OPTIONS='' grep --color=never "^${dependency}@"
 done <<< "$(jq -r '.dependencies,.devDependencies|keys\[\]' package.json)"
}

About

To share my favorites tools and plugins to optimize DX and efficiency

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published