Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Titusupdate #8

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[submodule "pure"]
path = pure
url = https://github.com/sindresorhus/pure.git
url = https://github.com/sindresorhus/pure
[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
82 changes: 59 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,70 @@
# 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
```
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
p10k config
```
### `pure` shell theme
- Link the `zsh.pure` file to your home folder as `.zshrc`
```
ln -s ~/zsh/zshrc.pure ~/.zsh
```

## Get Dependencies
## Get Dependancies

- 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
### 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

### Debian Dependencies
### Get this from your distribution's repository
### Debian Dependencies
```bash
sudo apt install autojump zsh
```

```bash
sudo apt install zsh-syntax-highlighting autojump zsh-autosuggestions
```
### Arch Dependencies
```bash
yay -S autojump zsh
```

### Arch Dependencies
### Recomended for `powerlevel10k`
- [`nerd-fonts`](https://github.com/ryanoasis/nerd-fonts "nerd-fonts github page") - I recomend `MesloLGS NF Regular`

```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
## 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`
* Change your user in /etc/passwd to /bin/zsh instead of /bin/bash
<details>

* Find line containing your username
* Put your username instead of `user`

From: `user:x:1000:1000::/home/user:/bin/bash`

To: `user:x:1000:1000::/home/user:/bin/zsh`
</details>

or typing `chsh $USER` and entering `/bin/zsh`
## What I used
My config is based on Chris Titus's config, `powerlevel10k` theme and `pure`
34 changes: 26 additions & 8 deletions aliasrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
##pacman-update country
update=CZ

#
# # ex - archive extractor
# # usage: ex <file>
Expand All @@ -9,7 +12,7 @@ ex ()
*.tar.gz) tar xzf $1 ;;
*.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 ;;
Expand All @@ -24,9 +27,21 @@ ex ()
fi
}

export EDITOR=vim
test ()
{
echo test;
}

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;
}

export EDITOR=nano

alias pacman-update='sudo pacman-mirrors --geoip'
alias pacman-update='sudo reflector -c $country -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist'

alias ls='ls'
alias ll='ls -l'
Expand Down Expand Up @@ -75,10 +90,11 @@ alias unexport='unset'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias vim='vim'
alias vi='vim'
alias gds-start='sudo systemctl start openvpn-client@gds'
alias gds-stop='sudo systemctl stop openvpn-client@gds'

alias wallpaper=/home/$USER/.local/bin/wallpaper

#alias vim='vim'
#alias vi='vim'
gitpush() {
git add .
git commit -m "$*"
Expand All @@ -92,5 +108,7 @@ 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"
1 change: 1 addition & 0 deletions powerlevel10k
Submodule powerlevel10k added at f2bf01
1 change: 1 addition & 0 deletions pure
Submodule pure added at c42bd3
1 change: 1 addition & 0 deletions zsh-autosuggestions
Submodule zsh-autosuggestions added at ae315d
1 change: 1 addition & 0 deletions zsh-syntax-highlighting
41 changes: 41 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

source ~/zsh/powerlevel10k/powerlevel10k.zsh-theme

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

# 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

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/autojump/autojump.zsh 2>/dev/null
alias mon2cam="deno run --unstable -A -r -q https://raw.githubusercontent.com/ShayBox/Mon2Cam/master/src/mod.ts"
16 changes: 13 additions & 3 deletions .zshrc → zshrc.pure
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ 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
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
Expand All @@ -38,13 +45,16 @@ _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 /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 $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
source ~/powerlevel10k/powerlevel10k.zsh-theme

Expand Down