Skip to content

Commit

Permalink
Swap out prezto for a minimal shell config
Browse files Browse the repository at this point in the history
  • Loading branch information
marier-nico committed Nov 14, 2020
1 parent d28930a commit fa7ca48
Show file tree
Hide file tree
Showing 7 changed files with 270 additions and 7 deletions.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -94,12 +94,17 @@ practice not to run random commands you find.
- [onedark](https://github.com/joshdick/onedark.vim)
- **vscode**
- [Atom One Dark Theme](https://github.com/akamud/vscode-theme-onedark)
- **zsh**
- [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) [ [arch package](https://www.archlinux.org/packages/zsh-autosuggestions) ]
- [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) [ [arch package](https://www.archlinux.org/packages/?q=zsh-syntax-highlighting) ]
- [starship](https://starship.rs/)
- **python**
- [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/)

**Shell & Term**

- [kitty](https://sw.kovidgoyal.net/kitty/)
- [zsh](https://wiki.archlinux.org/index.php/zsh)
- [prezto](https://github.com/sorin-ionescu/prezto)
- [tmux](https://github.com/tmux/tmux/wiki) [ [arch wiki](https://wiki.archlinux.org/index.php/Tmux) ]

**Social**
Expand Down
2 changes: 2 additions & 0 deletions config/zsh/aliases.zsh
@@ -0,0 +1,2 @@
alias ll="ls -l --color"
alias la="ls -la --color"
45 changes: 45 additions & 0 deletions config/zsh/ssh-agent.zsh
@@ -0,0 +1,45 @@
#
# Provides for an easier use of SSH by setting up ssh-agent.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source (adapted from):
# https://github.com/sorin-ionescu/prezto/tree/master/modules/ssh
#

# Return if requirements are not found.
if (( ! $+commands[ssh-agent] )); then
return 1
fi

# Set the path to the SSH directory.
_ssh_dir="$HOME/.ssh"

# Set the path to the environment file if not set by another module.
_ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.env}"

# Set the path to the persistent authentication socket.
_ssh_agent_sock="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock"

# Start ssh-agent if not started.
if [[ ! -S "$SSH_AUTH_SOCK" ]]; then
# Export environment variables.
source "$_ssh_agent_env" 2> /dev/null

# Start ssh-agent if not started.
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then
mkdir -p "$_ssh_agent_env:h"
eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")"
fi
fi

# Create a persistent SSH authentication socket.
if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then
mkdir -p "$_ssh_agent_sock:h"
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock"
export SSH_AUTH_SOCK="$_ssh_agent_sock"
fi

# Clean up.
unset _ssh_{dir,identities} _ssh_agent_{env,sock}
129 changes: 129 additions & 0 deletions config/zsh/starship.toml
@@ -0,0 +1,129 @@
[aws]
disabled = true

[battery]
disabled = true

[character]
success_symbol = "[⤚](bold green)"
error_symbol = "[⤚](bold red)"
vicmd_symbol = "[⤙](bold green)"

[cmake]
disabled = true

[conda]
disabled = true

[crystal]
disabled = true

[dart]
disabled = true

# [directory]

# [docker_context]

[dotnet]
disabled = true

[elixir]
disabled = true

[elm]
disabled = true

[env_var]
disabled = true

[erland]
disabled = true

[gcloud]
disabled = true

# [git_branch]

# [git_commit]

# [git_state]

# [git_status]

[golang]
disabled = true

# [hostname]

# [java]

# [jobs]

[julia]
disabled = true

# [kubernetes]

# [line_break]

[lua]
disabled = true

# [memory_usage]

# [hg_branch]

[nim]
disabled = true

[nix_shell]
disabled = true

# [nodejs]

# [package]

[ocaml]
disabled = true

[openstack]
disabled = true

[perl]
disabled = true

[php]
disabled = true

# [python]

[ruby]
disabled = true

# [rust]

# [shlvl]

[singularity]
disabled = true

[swift]
disabled = true

# [status]

# [terraform]

# [time]

# [username]

[zig]
disabled = true

[custom]
disabled = true

[purescript]
disabled = true
66 changes: 66 additions & 0 deletions config/zsh/zprofile
@@ -0,0 +1,66 @@
#
# Executes commands at login pre-zshrc.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source (adapted from):
# https://github.com/sorin-ionescu/prezto/tree/master/runcoms
#

#
# Browser
#

if [[ "$OSTYPE" == darwin* ]]; then
export BROWSER='open'
fi

#
# Editors
#

export EDITOR='nvim'
export VISUAL='nvim'
export PAGER='less'

#
# Language
#

if [[ -z "$LANG" ]]; then
export LANG='en_US.UTF-8'
fi

#
# Paths
#

# Ensure path arrays do not contain duplicates.
typeset -gU cdpath fpath mailpath path

# Set the list of directories that cd searches.
# cdpath=(
# $cdpath
# )

# Set the list of directories that Zsh searches for programs.
path=(
/usr/local/{bin,sbin}
$path
)

#
# Less
#

# Set the default Less options.
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
# Remove -X and -F (exit if the content fits on one screen) to enable it.
export LESS='-F -g -i -M -R -S -w -X -z-4'

# Set the Less input preprocessor.
# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system.
if (( $#commands[(i)lesspipe(|.sh)] )); then
export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
fi
19 changes: 19 additions & 0 deletions config/zsh/zshrc
@@ -0,0 +1,19 @@
# Source zsh-autosuggestions
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
ZSH_AUTOSUGGEST_USE_ASYNC=yes
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

# Source zsh-syntax-highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# Source aliases
source ~/.dots/config/zsh/aliases.zsh

# Source ssh-agent
source ~/.dots/config/zsh/ssh-agent.zsh

# Load virtualenvwrapper
source ~/.local/bin/virtualenvwrapper.sh

# Load starship (prompt)
eval "$(starship init zsh)"
9 changes: 3 additions & 6 deletions install.conf.yaml
Expand Up @@ -20,6 +20,7 @@
~/.config/ranger/rifle.conf: config/ranger/rifle.conf
~/.config/rofi/config.rasi: config/rofi/config.rasi
~/.config/rofi/themes/slate.rasi: config/rofi/themes/slate.rasi
~/.config/starship.toml: config/zsh/starship.toml
~/.config/spicetify/Themes: config/spicetify/Themes
~/.config/sxhkd/sxhkdrc: config/sxhkd/sxhkdrc
~/.local/bin/autorandr: bin/autorandr.sh/autorandr.sh
Expand All @@ -31,12 +32,8 @@
~/.gitmessage: gitmessage
~/.gnupg/gpg.conf: gpg.conf
~/.Xresources: Xresources
~/.zlogin: prezto/runcoms/zlogin
~/.zlogout: prezto/runcoms/zlogout
~/.zpreztorc: prezto/runcoms/zpreztorc
~/.zprofile: prezto/runcoms/zprofile
~/.zshenv: prezto/runcoms/zshenv
~/.zshrc: prezto/runcoms/zshrc
~/.zprofile: config/zsh/zprofile
~/.zshrc: config/zsh/zshrc

- shell:
- ["git submodule update --init --recursive", Installing submodules]
Expand Down

0 comments on commit fa7ca48

Please sign in to comment.