Skip to content

dot Files: ZSH setup and productivity tools for development

License

Notifications You must be signed in to change notification settings

deinsoftware/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Languages: [🇪🇸] Español - [🇺🇸] English

ZSH setup and productivity tools for development

Repo

1. Clone

Clone this repo on ~/.dotfiles path:

git clone https://github.com/deinsoftware/dotfiles.git ~/.dotfiles

2. Setup

On .zshrc file add.

# Default branches
export MAIN="main"
export DEV="dev"

# Helpers
export WINHOME=$(wslpath "$(wslvar USERPROFILE)")
export OPEN="wslview" #wsl2
export BROWSER="${OPEN}" #wsl2

export PATH="$HOME/.dotfiles/helpers/android/:$PATH"
export PATH="$HOME/.dotfiles/helpers/b64/:$PATH"
export PATH="$HOME/.dotfiles/helpers/code/:$PATH"
export PATH="$HOME/.dotfiles/helpers/md/:$PATH"
export PATH="$HOME/.dotfiles/helpers/open/:$PATH"
export PATH="$HOME/.dotfiles/helpers/search/:$PATH"
export PATH="$HOME/.dotfiles/helpers/terminal/:$PATH"
chmod +x ~/.dotfiles/helpers/**/* ~/.dotfiles/helpers/**/.[!.]*

# Custom
[ -f ~/.dotfiles/.aliases ] && . ~/.dotfiles/.aliases
[ -f ~/.dotfiles/.colors ] && . ~/.dotfiles/.colors
[ -f ~/.dotfiles/.hooks ] && . ~/.dotfiles/.hooks

OPEN and BROWSE constants need to be configured according yor OS. Windows (WSL2) and macOS use the same command to open the file explorer or the default web browser, on Ubuntu (Linux) need to be specified each one.

SO OPEN BROWSER
Windows (GitBash) "explorer.exe" "${OPEN}"
Windows (WSL2) "wslview" "${OPEN}"
macOS "open" "${OPEN}"
Ubuntu "xdg-open", "gnome-open", "nautilus" ... "googlechrome", "firefox" ...

On WSL require to install wslu

3. Permissions

Now add execution permission:

chmod +x ~/.dotfiles/helpers/**/* ~/.dotfiles/helpers/**/.[!.]*

4. Update

Once finish, save .zshrc file, close and reopen all terminals or update his source running source ~/.zshrc command.

That's all folks! It's ready to use.

Folder Structure

~
└── .zshrc
└── .dotfiles
    ├── helpers
    │   ├── android
    │   ├── b64
    │   ├── code
    │   ├── md
    │   ├── open
    │   ├── search
    │   └── terminal
    ├── .aliases
    ├── .colors
    └── .hooks
Name Description
.zshrc ZSH source file
helpers Folder with custom helper functions to use as terminal commands
── android Helper commands for Android tools
── b64 Helper commands for file conversions to/from base64
── code Helper commands to open VSCode
── open Helper commands to open file/folder on the File Explorer or open files/url on the Browser
── search Helper commands to search text inside files
── terminal Helper commands to talk with the OS
.aliases File for aliases definitions
.colors File with terminal colors to use in other scripts
.hooks ZSH hooks file with custom functions to run as validation before and after run commands

Plugins

Oh My zsh! have a lot of plugins to use. It's recommended to explore the options and use what is good for your needs.

If you are using NVM take care of following this configuration to avoid slowing the zsh start-up and this configuration to speed up the compinit

Official

Extras

git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ohmyzsh-full-autoupdate

Edit the ~/.zshrc file and add it inside the plugins property (don't use commas as separators).

+ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor root line)
+ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red')

plugins=(
    ...
+   zsh-autosuggestions
+   zsh-syntax-highlighting
+   ohmyzsh-full-autoupdate
)

Article Series


About

Built With

  • VS Code - Code editing redefined.
  • Widows Terminal - A modern terminal application for users of command-line tools and shells.

Versioning

We use SemVer for versioning. For the versions available, see the ZSH Dev Toolkit on GitHub.

Authors

See also the list of contributors who participated in this project.

Sponsors

If this project helps you, consider buying me a cup of coffee.

GitHub Sponsors paypal

License

This project is licensed under the MIT License - see the LICENSE file for details.