2020-06-07 16:09:57 +02:00
|
|
|
# ZSH
|
|
|
|
My ZSH config
|
2020-02-13 00:40:45 +01:00
|
|
|
|
2022-01-19 22:35:27 +01:00
|
|
|
## Your own customizations
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
If you want to make any customizations to your config without deleting them,
|
|
|
|
or merging them, every time I update, here's the solution:
|
2022-01-19 22:35:27 +01:00
|
|
|
- Make a file called `custom-zshrc` in your `$HOME/zsh` directory
|
|
|
|
- Put your customizations in that file
|
2023-09-08 20:11:18 +02:00
|
|
|
The file is in `.gitignore`, so it won't interfere with the repository and you
|
|
|
|
can pull updates without resolving differences between local files and the repository.
|
|
|
|
It is also set to be sourced in the `zshrc` file, so you really don't have to
|
|
|
|
set up anything, just add the customizations.
|
2022-01-19 22:35:27 +01:00
|
|
|
|
2020-02-13 00:40:45 +01:00
|
|
|
## Setup
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- Clone the repository to your home folder
|
|
|
|
|
|
|
|
```bash
|
2022-01-09 13:02:19 +01:00
|
|
|
cd ~
|
2020-10-09 21:12:41 +02:00
|
|
|
git clone --recursive https://github.com/jiriks74/zsh
|
2022-01-09 19:52:03 +01:00
|
|
|
```
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- Link the `zsh` file to your home folder as `.zshrc`
|
|
|
|
|
|
|
|
```bash
|
2022-01-09 19:52:03 +01:00
|
|
|
ln -s ~/zsh/zshrc ~/.zshrc
|
|
|
|
```
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- Set the `powerlevel10k` theme the way you like it
|
|
|
|
|
|
|
|
```bash
|
2022-01-09 19:52:03 +01:00
|
|
|
zsh
|
|
|
|
```
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- If configuration won't start automatically, just run
|
|
|
|
|
|
|
|
```bash
|
2022-01-09 19:52:03 +01:00
|
|
|
p10k config
|
2020-10-09 21:12:41 +02:00
|
|
|
```
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- Set `zsh` as your default shell
|
|
|
|
|
|
|
|
### There are two ways
|
|
|
|
|
|
|
|
#### Running `chsh`
|
|
|
|
|
|
|
|
```bash
|
|
|
|
chsch $USER
|
|
|
|
```
|
|
|
|
|
2022-01-09 19:53:39 +01:00
|
|
|
- Input your password
|
|
|
|
- Input `/bin/zsh`
|
|
|
|
|
|
|
|
#### Modifying `/etc/passwd`
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- Change your user in `/etc/passwd` to `/bin/zsh` instead of `/bin/bash`
|
|
|
|
|
2022-01-09 19:53:39 +01:00
|
|
|
<details>
|
|
|
|
|
2023-09-08 20:11:18 +02:00
|
|
|
- Find line containing your username
|
|
|
|
- Change the end of the line
|
|
|
|
|
|
|
|
From: ...`:/bin/bash`
|
2022-01-09 19:53:39 +01:00
|
|
|
|
2023-09-08 20:11:18 +02:00
|
|
|
To: ...`:/bin/zsh`
|
2022-01-09 19:53:39 +01:00
|
|
|
</details>
|
2022-01-09 14:41:10 +01:00
|
|
|
|
|
|
|
## Updating
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
```bash
|
2022-01-09 14:41:10 +01:00
|
|
|
cd ~/zsh
|
|
|
|
git pull --recurse-submodules
|
2022-01-09 18:15:59 +01:00
|
|
|
git submodule update --init --recursive
|
2022-01-09 14:41:10 +01:00
|
|
|
```
|
|
|
|
|
2023-09-08 20:11:18 +02:00
|
|
|
### Problems with updating (this will delete any customizations you have made in `~/zsh`)
|
|
|
|
|
|
|
|
- If you get `fatal: refusing to merge unrelated histories` you have changes in
|
|
|
|
`~zsh` that are not in the repository
|
|
|
|
- If you have backed up your customizations (if you have any) this will delete
|
|
|
|
all differences between `~/zsh` and the repository
|
|
|
|
|
|
|
|
```bash
|
2022-01-09 18:31:41 +01:00
|
|
|
cd ~/zsh
|
|
|
|
git fetch
|
|
|
|
git reset --hard origin/master
|
|
|
|
```
|
|
|
|
|
2022-01-09 14:35:29 +01:00
|
|
|
## Get Dependencies
|
2020-08-31 15:44:29 +02:00
|
|
|
|
2020-10-09 20:44:19 +02:00
|
|
|
### Included in this repository
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- [`zsh-z`](https://github.com/agkozak/zsh-z) - ZSH plugin that is alternative to
|
|
|
|
`autojump`. Use `z dirname`to go to a specific directory on your system without
|
|
|
|
having to type the whole path (eg `z et` will get you to `/etc`)
|
|
|
|
- [`dirhistory`](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dirhistory) -
|
|
|
|
Plugin from oh my zsh that allows you to easily go through history of directories
|
|
|
|
(due to this not being a repository I have to update this plugin manually.
|
|
|
|
If it's out of date, please create an issue)
|
|
|
|
- [`ssh-connect`](https://github.com/gko/ssh-connect) - Plugin that logs your
|
|
|
|
`ssh` commands and provides a nice menu with your recent connections (alias: `sshc`)
|
|
|
|
- [`web-search`](https://github.com/sineto/web-search) - Allows you to DuckDuckGo,
|
|
|
|
Google, etc. directly from your zsh. just run `ddg` or `google`
|
|
|
|
- [`zsh-you-should-use`](https://github.com/MichaelAquilina/zsh-you-should-use) -
|
|
|
|
Usefull plugin that suggest existing aliases for a command you just ran
|
|
|
|
(try it out with `ls -l`)
|
|
|
|
- [`zsh-autosuggestions`](https://github.com/zsh-users/zsh-autosuggestions) -
|
|
|
|
Suggestions based on your history
|
|
|
|
- [`git`](https://github.com/davidde/git) - Usefull git aliases
|
|
|
|
- [`zsh-syntax-highlighting`](https://github.com/zsh-users/zsh-syntax-highlighting) -
|
|
|
|
Syntax highlighting for ZSH
|
|
|
|
- [`powerlevel10k`](https://github.com/romkatv/powerlevel10k) theme -
|
|
|
|
The the actual theme
|
2020-08-19 19:34:12 +02:00
|
|
|
|
2022-01-09 13:41:48 +01:00
|
|
|
### Install from your distribution's repository
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- [`thefuck`](https://github.com/nvbn/thefuck) - Corrects errors in previous
|
|
|
|
console commands (when you mess up a command, type `fuck`)
|
2022-01-09 13:41:48 +01:00
|
|
|
|
2020-10-09 21:04:56 +02:00
|
|
|
### Recomended for `powerlevel10k`
|
2023-09-08 20:11:18 +02:00
|
|
|
|
|
|
|
- [`nerd-fonts`](https://github.com/ryanoasis/nerd-fonts "nerd-fonts github page") -
|
|
|
|
I recomend `MesloLGS NF Regular`
|
|
|
|
- On Arch you can use `ttf-meslo-nerd-font-powerlevel10k` so you don't have to
|
|
|
|
donwload the whole git repository¨¨
|
2022-03-21 12:19:35 +01:00
|
|
|
|
|
|
|
## Stats
|
2023-09-08 20:11:18 +02:00
|
|
|
|
2022-03-21 12:19:35 +01:00
|
|
|
![Alt](https://repobeats.axiom.co/api/embed/0af45810ad05b4ddd92d30b2d1fa5a63be0d5bc0.svg "Repobeats analytics image")
|