zsh: Switch to znap & remove direct oh-my-zsh install

This commit is contained in:
saibotk 2022-02-23 00:23:40 +01:00
parent 28b87e7706
commit faed4caf8f
Signed by: saibotk
GPG key ID: 67585F0065E261D5
4 changed files with 16 additions and 56 deletions

View file

@ -6,17 +6,8 @@ To install run this command:
``` ```
git clone https://github.com/saibotk/.dotfiles ~/; cd ~/.dotfiles; ./install git clone https://github.com/saibotk/.dotfiles ~/; cd ~/.dotfiles; ./install
``` ```
This should install all dependecies and create symlinks to all needed files. The only thing that you have to setup on your own is `nvim`. This should install all dependencies and create symlinks to all needed files.
## Customization ## Customization
It is possible to load your own zsh-plugins and other commands you want to execute in the `.zshrc`. To add zsh-plugins add a `plugins` file to `~/.dotfiles/shell/`. An example is provided in `~/.dotfiles/shell/plugins.example`. The same thing applies to commands you want to execute in on shell startup, just add a `localcommands` file with your commands in `~/.dotfiles/shell/`. It is possible to load your own commands you want to execute in the `.zshrc`. To add commands you want to execute on shell startup, just add a `localcommands` file with your commands in `~/.dotfiles/shell/`.
## Atom packages
If you plan on using you own atom package list, you can modify the "atom/packages.list".
The install script will try to find that file and automatically install all packages.
You can export the package list with:
```
apm list --installed --bare > ~/.dotfiles/.atom/packages.list
```

View file

@ -7,6 +7,9 @@
- clean: ['~', '.config/'] - clean: ['~', '.config/']
- link: - link:
~/.zshrc:
force: true
path: shell/zshrc
~/.tmux.conf: ~/.tmux.conf:
path: shell/tmux.conf path: shell/tmux.conf
~/.config/nvim: ~/.config/nvim:
@ -15,12 +18,11 @@
path: kitty path: kitty
- shell: - shell:
# install ohmyzsh # install znap (zsh plugin manager)
- - command: 'if [ ! -d ~/.znap ]; then sh -c "$(git clone --depth 1 -- https://github.com/marlonrichert/zsh-snap.git ~/.znap)"; fi'
command: 'if [ ! -d ~/.oh-my-zsh ]; then sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; fi'
stdin: false stdin: false
stdout: true stdout: true
description: "Install ohmyzsh:" description: "Installing znap (zsh-snap):"
quiet: false quiet: false
# install vim plug for nvim # install vim plug for nvim
@ -32,9 +34,3 @@
stdout: true stdout: true
description: "Install nvim plugins! Hit enter once if stuck:" description: "Install nvim plugins! Hit enter once if stuck:"
quiet: false quiet: false
# do this last to override generated .zshrc
- link:
~/.zshrc:
force: true
path: shell/zshrc

View file

@ -1,9 +0,0 @@
# plugins
plugins=(
git
pip
screen
artisan
fzf
z
)

View file

@ -1,27 +1,6 @@
# Path to your oh-my-zsh installation. # Load zsh-snap (znap) plugin manager
export ZSH="$HOME/.oh-my-zsh" zstyle ':znap:*' repos-dir ~/.znap
source ~/.znap/znap.zsh
# plugins
if [ -f ~/.dotfiles/shell/plugins ]
then
source ~/.dotfiles/shell/plugins
else
plugins=(
git
pip
screen
laravel
dirhistory
per-directory-history
z
)
fi
source $ZSH/oh-my-zsh.sh
# User configuration
# Helper Functions # Helper Functions
# Returns whether the given command is executable or aliased. # Returns whether the given command is executable or aliased.
@ -29,8 +8,11 @@ _has() {
return $( whence $1 >/dev/null ) return $( whence $1 >/dev/null )
} }
# Set vim as default editor # Plugins
export EDITOR='vim' znap source ohmyzsh/ohmyzsh lib/{git,theme-and-appearance}
znap source ohmyzsh/ohmyzsh plugins/{per-directory-history,git}
# ZSH Theme
znap prompt ohmyzsh/ohmyzsh robbyrussell
# aliases # aliases
alias ll='ls -l' alias ll='ls -l'