diff --git a/.gitmodules b/.gitmodules index 199a376..77971d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,3 @@ [submodule "pure"] path = pure url = https://github.com/sindresorhus/pure.git -[submodule "zsh-autosuggestions"] - path = zsh-autosuggestions - url = https://github.com/zsh-users/zsh-autosuggestions -[submodule "zsh-syntax-highlighting"] - path = zsh-syntax-highlighting - url = https://github.com/zsh-users/zsh-syntax-highlighting.git -[submodule "powerlevel10k"] - path = powerlevel10k - url = https://github.com/romkatv/powerlevel10k.git diff --git a/zshrc b/.zshrc similarity index 51% rename from zshrc rename to .zshrc index af8573c..cd0ce4d 100644 --- a/zshrc +++ b/.zshrc @@ -5,15 +5,29 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -source ~/zsh/powerlevel10k/powerlevel10k.zsh-theme +# Dependancies You Need for this Config +# zsh-syntax-highlighting - syntax highlighting for ZSH in standard repos +# autojump - jump to directories with j or jc for child or jo to open in file manager +# zsh-autosuggestions - Suggestions based on your history -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# Initial Setup +# touch "$HOME/.cache/zshhistory +# Setup Alias in $HOME/zsh/aliasrc +# git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k +# echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc + +# Enable colors and change prompt: +autoload -U colors && colors +PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " + +# Custom Variables +EDITOR=vim # History in cache directory: HISTSIZE=10000 SAVEHIST=10000 HISTFILE=~/.cache/zshhistory +setopt appendhistory # Basic auto/tab complete: autoload -U compinit @@ -24,18 +38,15 @@ _comp_options+=(globdots) # Include hidden files. # Custom ZSH Binds bindkey '^ ' autosuggest-accept -bindkey "^[[H" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[[3~" delete-char - -export PATH=$PATH:/home/jirka/.local/bin -export DOTNET_CLI_TELEMETRY_OPTOUT=1 # Load aliases and shortcuts if existent. [ -f "$HOME/zsh/aliasrc" ] && source "$HOME/zsh/aliasrc" # Load ; should be last. -source $HOME/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null -source $HOME/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null source /usr/share/autojump/autojump.zsh 2>/dev/null -alias mon2cam="deno run --unstable -A -r -q https://raw.githubusercontent.com/ShayBox/Mon2Cam/master/src/mod.ts" +source ~/powerlevel10k/powerlevel10k.zsh-theme + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh diff --git a/README.md b/README.md index ab1086c..1e340d8 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,34 @@ -# ZSH -My ZSH config +# zsh + +My ZSH Config ## Setup - - Clone the repository to your home folder -``` -git clone --recursive https://github.com/jiriks74/zsh -``` -### `powerlevel10k` theme - - Link the `zsh` file to your home folder as `.zshrc` -``` -ln -s ~/zsh/zshrc ~/.zshrc -``` - - Set the `powerlevel10k` theme the way you like it -``` -zsh -``` - - If configuration won't start automatically, just run -``` -p10k config -``` -### `pure` shell theme - - Link the `zsh.pure` file to your home folder as `.zshrc` -``` -ln -s ~/zsh/zshrc.pure ~/.zsh -``` -## Get Dependancies -### Included in this repository - - `zsh-syntax-highlighting` - syntax highlighting for ZSH - - `zsh-autosuggestions` - Suggestions based on your history - - `powerlevel10k` theme - The the actual theme - - `pure` - Pure shell look for zsh -### Get this from your distribution's repository - - Consider security here - autojump is ok on local machine, but I wouldn't recommend deploying it on public server due to some security concerns - `autojump` - Jump to directories with j or jc for child or jo to open in file manager - - `zsh` - the shell itself -### Recomended for `powerlevel10k` - - [`nerd-fonts`](https://github.com/ryanoasis/nerd-fonts "nerd-fonts github page") - I recomend `MesloLGS NF Regular` +``` +touch "$HOME/.cache/zshhistory" +#-- Setup Alias in $HOME/zsh/aliasrc +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k +echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc +``` -## Set as default -To set zsh as default shell for your user, edit `/etc/passwd` (from `/bin/bash` to `/bin/zsh`) -### There are two ways: -#### Running this command: -```chsch $USER``` -#### Modifying `/etc/passwd` - * Find line containing your username - * Put your username instead of `user` +## Get Dependencies -From: `user:x:1000:1000::/home/user:/bin/bash` +- zsh-syntax-highlighting - syntax highlighting for ZSH in standard repos +- autojump - jump to directories with j or jc for child or jo to open in file manager +- zsh-autosuggestions - Suggestions based on your history -To: `user:x:1000:1000::/home/user:/bin/zsh` +### Debian Dependencies -## What I used -My config is based on Chris Titus's config, `powerlevel10k` theme and `pure` +```bash +sudo apt install zsh-syntax-highlighting autojump zsh-autosuggestions +``` + +### Arch Dependencies + +```bash +yay -S zsh-syntax-highlighting autojump zsh-autosuggestions +``` + +Finish the conversion by changing your user in /etc/passwd to /bin/zsh instead of /bin/bash + +or typing `chsh $USER` and entering `/bin/zsh` diff --git a/aliasrc b/aliasrc index 6035ea4..96c166c 100644 --- a/aliasrc +++ b/aliasrc @@ -1,6 +1,3 @@ -##pacman-update country -update=CZ - # # # ex - archive extractor # # usage: ex @@ -10,9 +7,9 @@ ex () case $1 in *.tar.bz2) tar xjf $1 ;; *.tar.gz) tar xzf $1 ;; - *.tar.xz) tar -xf ;; + *.tar.xz) tar xJf $1 ;; *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; + *.rar) unrar x $1 ;; *.gz) gunzip $1 ;; *.tar) tar xf $1 ;; *.tbz2) tar xjf $1 ;; @@ -27,34 +24,22 @@ ex () fi } -test () -{ -echo test; -} +export EDITOR=vim -pacmanupdate () -{ - echo "Enter your country (like 'US' or 'CZ')"; - read update; - sudo reflector -c $update -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist; -} +alias pacman-update='sudo pacman-mirrors --geoip' -export EDITOR=nano - -alias pacman-update='sudo reflector -c $country -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist' - -alias ls='ls --color=auto' +alias ls='ls' alias ll='ls -l' # ls, the common ones I use a lot shortened for rapid fire usage -alias l='ls -lFh --color=auto' #size,show type,human readable -alias la='ls -lAFh --color=auto' #long list,show almost all,show type,human readable -alias lr='ls -tRFh --color=auto' #sorted by date,recursive,show type,human readable -alias lt='ls -ltFh --color=auto' #long list,sorted by date,show type,human readable -alias ll='ls -l --color=auto' #long list -alias ldot='ls -ld .* --color=auto' -alias lS='ls -1FSsh --color=auto' -alias lart='ls -1Fcart --color=auto' -alias lrt='ls -1Fcrt --color=auto' +alias l='ls -lFh' #size,show type,human readable +alias la='ls -lAFh' #long list,show almost all,show type,human readable +alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable +alias lt='ls -ltFh' #long list,sorted by date,show type,human readable +alias ll='ls -l' #long list +alias ldot='ls -ld .*' +alias lS='ls -1FSsh' +alias lart='ls -1Fcart' +alias lrt='ls -1Fcrt' alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file @@ -90,9 +75,10 @@ alias unexport='unset' alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' - -alias wallpaper=/home/jirka/.local/bin/wallpaper - +alias vim='vim' +alias vi='vim' +alias gds-start='sudo systemctl start openvpn-client@gds' +alias gds-stop='sudo systemctl stop openvpn-client@gds' gitpush() { git add . git commit -m "$*" @@ -106,6 +92,5 @@ gitupdate() { } alias gp=gitpush alias gu=gitupdate +alias lbrynet='/opt/LBRY/resources/static/daemon/lbrynet' alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg' -#alias firefox='GTK_USE_PORTAL=1 firefox' -alias cls="clear" diff --git a/powerlevel10k b/powerlevel10k deleted file mode 160000 index f2bf019..0000000 --- a/powerlevel10k +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f2bf0197581abb8bde529e6b492710948549ba7f diff --git a/pure b/pure deleted file mode 160000 index c42bd35..0000000 --- a/pure +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c42bd354943ba4cf2da3ecf493fca4fef0b2722c diff --git a/zsh-autosuggestions b/zsh-autosuggestions deleted file mode 160000 index ae315de..0000000 --- a/zsh-autosuggestions +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d diff --git a/zsh-syntax-highlighting b/zsh-syntax-highlighting deleted file mode 160000 index 6fd92e1..0000000 --- a/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6fd92e1bbd927119e8fbb2d8f50d4cd9a6bcb6d9 diff --git a/zshrc.pure b/zshrc.pure deleted file mode 100644 index 6397135..0000000 --- a/zshrc.pure +++ /dev/null @@ -1,49 +0,0 @@ -# Dependancies You Need for this Config -# zsh-syntax-highlighting - syntax highlighting for ZSH in standard repos -# autojump - jump to directories with j or jc for child or jo to open in file manager -# zsh-autosuggestions - Suggestions based on your history - -# Initial Setup -# mkdir -p "$HOME/zsh/.zsh" -# git submodule add https://github.com/sindresorhus/pure.git "$HOME/zsh/pure" -# Setup Alias in $HOME/zsh/aliasrc - -# Enable colors and change prompt: -autoload -U colors && colors -PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " - -# Custom Variables -EDITOR=nano - -# Pure Prompt -fpath+=$HOME/zsh/pure -autoload -U promptinit; promptinit -prompt pure -PURE_PROMPT_SYMBOL=\$ -PURE_PROMPT_VICMD_SYMBOL=\< - -# History in cache directory: -HISTSIZE=10000 -SAVEHIST=10000 -HISTFILE=~/.cache/zshhistory - -# Basic auto/tab complete: -autoload -U compinit -zstyle ':completion:*' menu select -zmodload zsh/complist -compinit -_comp_options+=(globdots) # Include hidden files. - -# Custom ZSH Binds -bindkey '^ ' autosuggest-accept -bindkey "^[[H" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[[3~" delete-char - -# Load aliases and shortcuts if existent. -[ -f "$HOME/zsh/aliasrc" ] && source "$HOME/zsh/aliasrc" - -# Load ; should be last. -source $HOME/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null -source $HOME/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null -source /usr/share/autojump/autojump.zsh 2>/dev/null