1
0
dotfiles/zsh/.zshrc

100 lines
2.5 KiB
Bash
Raw Normal View History

2023-10-01 13:52:05 +00:00
# attach to an existing tmux session or create a new one if none exist
2024-04-02 19:35:57 +00:00
if [ "$TMUX" = "" ] && [ -z "$TMUX"]; then
tmux attach -t $(tmux display-message -p '#S') || tmux new-session
fi
2023-10-01 13:52:05 +00:00
# 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
2024-04-02 19:35:57 +00:00
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
2023-10-01 13:52:05 +00:00
# Path to your oh-my-zsh installation.
export ZSH="/home/nigel/.oh-my-zsh"
2024-04-03 16:21:53 +00:00
bindkey -v
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
2024-04-03 16:21:53 +00:00
2023-10-01 13:52:05 +00:00
ZSH_THEME="lambda"
2024-04-02 19:35:57 +00:00
# Use case-sensitive completion.
CASE_SENSITIVE="true"
2023-10-01 13:52:05 +00:00
2024-04-02 19:35:57 +00:00
# Disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
2023-10-01 13:52:05 +00:00
2024-04-02 19:35:57 +00:00
# Enable command auto-correction.
ENABLE_CORRECTION="true"
2023-10-01 13:52:05 +00:00
2024-04-02 19:35:57 +00:00
HIST_STAMPS="dd/mm/yyyy"
2023-10-01 13:52:05 +00:00
# Which plugins would you like to load?
plugins=(git vi-mode zsh-autosuggestions zsh-syntax-highlighting tmux debian themes)
2023-10-01 13:52:05 +00:00
source $ZSH/oh-my-zsh.sh
# Add the fzf key-bindings and completions
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
2023-10-01 13:52:05 +00:00
# User configuration
source ~/.bashrc
2024-04-02 19:35:57 +00:00
# Set my language environment
export LANG=en_GB.UTF-8
2023-10-01 13:52:05 +00:00
# Preferred editor for local and remote sessions
2024-04-02 19:35:57 +00:00
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Personal aliases
alias zshconfig="nvim ~/.zshrc"
alias ohmyzsh="nvim ~/.oh-my-zsh"
2024-04-02 19:35:57 +00:00
alias dev="cd /home/nigel/Hacking/Development"
alias dotfiles="cd /home/nigel/.dotfiles"
2024-04-02 19:35:57 +00:00
# Set Environment Variables
DOTNET_ROOT=$HOME/dotnet
PATH=$PATH:$HOME/dotnet
export PATH=$PATH:/home/nigel/Hacking/Development/depot_tools
2023-10-01 13:52:05 +00:00
2024-04-03 16:21:53 +00:00
# Personal Aliases
alias zshconfig="mate ~/.zshrc"
alias ohmyzsh="mate ~/.oh-my-zsh"
2024-04-02 19:35:57 +00:00
# Add Clang-Tools
export PATH=$PATH:$HOME/llvm/build/bin
2023-10-01 13:52:05 +00:00
2024-04-02 19:35:57 +00:00
# Add nvim
export PATH=$PATH:/usr/local/bin/nvim/bin:
export PATH=$PATH:/opt/gradle/gradle-8.7/bin
2023-10-01 13:52:05 +00:00
# Add GoLang
export PATH=$PATH:/usr/local/go/bin
2023-10-01 13:52:05 +00:00
2024-04-02 19:35:57 +00:00
# Add Autocompletion tools
2023-10-01 13:52:05 +00:00
_dotnet_zsh_complete()
{
local completions=("$(dotnet complete "$word")")
reply=( "${(ps:\n:)completions}")
}
2024-04-02 19:35:57 +00:00
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
2023-10-01 13:52:05 +00:00
2024-04-02 19:35:57 +00:00
# zsh paramater for dotnet cli tab completion
2023-10-01 13:52:05 +00:00
compctl -K _dotnet_zsh_complete dotnet
eval "$(fzf --zsh)"
2023-10-01 13:52:05 +00:00
eval "$(starship init zsh)"
2024-04-03 16:21:53 +00:00