From ab2739ede266d01bf0fe13876fde348335932676 Mon Sep 17 00:00:00 2001 From: "chawley (derry)" Date: Sun, 18 Aug 2019 08:48:18 -0400 Subject: [PATCH 1/4] Removed unused plugins from .zshrc --- .zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 06af746..cd334bc 100644 --- a/.zshrc +++ b/.zshrc @@ -53,7 +53,8 @@ COMPLETION_WAITING_DOTS="true" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git zsh-autosuggestions zsh-completions vi-mode) +#plugins=(git zsh-autosuggestions zsh-completions vi-mode) +plugins=(git) # User configuration From d95443a470560a54e158089e0581ce674846051a Mon Sep 17 00:00:00 2001 From: "chawley (overlook)" Date: Sun, 18 Aug 2019 08:52:50 -0400 Subject: [PATCH 2/4] Added keybindings to handle cluster keys to .zshrc --- .zshrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.zshrc b/.zshrc index cd334bc..fed69ea 100644 --- a/.zshrc +++ b/.zshrc @@ -102,6 +102,21 @@ bindkey '^h' backward-delete-char bindkey '^w' backward-kill-word bindkey '^r' history-incremental-search-backward +bindkey "\e[1~" beginning-of-line +bindkey "\e[4~" end-of-line +bindkey "\e[5~" beginning-of-history +bindkey "\e[6~" end-of-history +bindkey "\e[3~" delete-char +bindkey "\e[2~" quoted-insert +bindkey "\e[5C" forward-word +bindkey "\eOc" emacs-forward-word +bindkey "\e[5D" backward-word +bindkey "\eOd" emacs-backward-word +bindkey "\ee[C" forward-word +bindkey "\ee[D" backward-word + +bindkey "^H" backward-delete-word + export KEYTIMEOUT=1 From b33b694116d11723a25f6541f9bf87081d8daf10 Mon Sep 17 00:00:00 2001 From: "chawley (derry)" Date: Wed, 28 Aug 2019 13:11:27 -0400 Subject: [PATCH 3/4] Removed separate setup file (migrated to ansible playbook) and updated REEADME.md --- .zshrc | 1 - README.md | 8 +-- setup.sh | 167 ------------------------------------------------------ 3 files changed, 2 insertions(+), 174 deletions(-) delete mode 100755 setup.sh diff --git a/.zshrc b/.zshrc index fed69ea..00e836e 100644 --- a/.zshrc +++ b/.zshrc @@ -53,7 +53,6 @@ COMPLETION_WAITING_DOTS="true" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -#plugins=(git zsh-autosuggestions zsh-completions vi-mode) plugins=(git) diff --git a/README.md b/README.md index f49ca80..0ef0ca5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # dotfiles-zsh -A dotfile repo for zsh-specific dotfiles. I've not yet put zsh on all my machines and I want to start segregating bash -and zsh configs so I can switch back and forth if need be. +A dotfile repo for zsh-specific dotfiles. Includes setting for [oh-my-zsh ](https://github.com/robbyrussell/oh-my-zsh) +(required) -The setup script will check for the presence of the `~/.oh-my-zsh/` directory and if not found will install oh-my-zsh -from the [ohmyz.sh](http://ohmyz.sh/) website. - -If oh-my-zsh needs to be installed the script will end after the installation. Re-run it to then link the dotfiles. diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 21434b7..0000000 --- a/setup.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env bash -#=============================================================================== -# -# FILE: setup.sh -# USAGE: ./setup.sh -# DESCRIPTION: after pulling/cloning dotfiles repo, this script will check/create -# symlinks for for dotfiles. It checks for the presence of installed -# software (i.e. won't symlink a dotfile for applications that aren't -# installed) and will remove links for applications that are no longer -# installed. Safe to run after every git pull -# OPTIONS: -# REQUIREMENTS: This script replies on the 'command' command. Basically, it will run -# `command -v ` and if there is no output, it assumes the app -# isn't installed. So this won't work for apps that aren't in your $PATH -# reference: http://www.cyberciti.biz/faq/unix-linux-shell-find-out-posixcommand-exists-or-not/ -# NOTES: -# AUTHOR: C Hawley -# CREATED: 2015-10 -# REVISION: Mon 09 Oct 2017 04:14:39 PM EDT -# -#=============================================================================== - -set -o nounset # Treat unset variables as an error - -# specify where your dotfiles live -dotfiledir="$HOME/dotfiles-zsh" - -# function to handle checking for existings links/files and updating -link() { - echo "symlinking ${1}" - # check for existing symlinks - if [ -h "${HOME}"/"${1}" ]; then - echo " - There's already a symlink named ${1}. Diff'ing." - # If there's an existing sylink, check if it's different than the dotfile - if [[ $(diff --brief "${HOME}"/"${1}" "${dotfiledir}"/"${1}") ]]; then - # If the links are different, ask if it should be replaced - echo " - Old link and new link are different:" - echo -n " - Replace existing symlink "${1}"? [Y/N] " - read replace - if [ "${replace}" = "Y" ] || [ "${replace}" = "y" ]; then - # If yes, unlink the old file and link the new one and exit - echo " - Unlinking old file and linking new file" - unlink "${HOME}"/"${1}" - ln -s "${dotfiledir}"/"${1}" "${HOME}"/"${1}" - fi - else - # If the link is the same, just exit function - echo " - Old link and new link are the same." - fi - # check for existing file/directory - elif [ -f "${HOME}"/"${1}" ] || [ -d "${HOME}"/"${1}" ]; then - echo " - There's already a file or directory named ${1}. Diff'ing." - if [[ $(diff --brief "${HOME}"/"${1}" "${dotfiledir}"/"${1}") ]]; then - echo " - Old file/dir and new link are different:" - echo -n " - Rename "${1}" and create new link? [Y/N] " - read replace - if [ "${replace}" = "Y" ] || [ "${replace}" = "y" ]; then - echo " - Renaming old file/dir and linking new file" - mv "${HOME}"/"${1}" "${HOME}"/"${1}"_original - ln -s "${dotfiledir}"/"${1}" "${HOME}"/"${1}" - fi - fi - else - # If there is no existing file, create one and exit - echo " - Creating link for ${1}" - ln -s "${dotfiledir}"/"${1}" "${HOME}"/"${1}" - fi -} - -# function to handle checking for existings links/files and updating -copy() { - echo "copying ${1}" - # check for existing symlinks - if [ -h "${HOME}"/"${1}" ]; then - echo " - There's already a symlink named ${1}. Diff'ing." - # If there's an existing sylink, check if it's different than the dotfile - if [[ $(diff --brief "${HOME}"/"${1}" "${dotfiledir}"/"${1}") ]]; then - # If the links are different, ask if it should be replaced - echo " - Old link and new link are different:" - echo -n " - Replace existing symlink "${1}"? [Y/N] " - read replace - if [ "${replace}" = "Y" ] || [ "${replace}" = "y" ]; then - # If yes, unlink the old file and link the new one and exit - echo " - Unlinking old file and copying new file" - unlink "${HOME}"/"${1}" - cp -rv "${dotfiledir}"/"${1}" "${HOME}"/"${1}" - fi - else - # If the link is the same, just exit function - echo " - Old link and new link are the same." - fi - # check for existing file/directory - elif [ -f "${HOME}"/"${1}" ] || [ -d "${HOME}"/"${1}" ]; then - echo " - There's already a file or directory named ${1}. Diff'ing." - if [[ $(diff --brief "${HOME}"/"${1}" "${dotfiledir}"/"${1}") ]]; then - echo " - Old file/dir and new link are different:" - echo -n " - Rename "${1}" and copy newer? [Y/N] " - read replace - if [ "${replace}" = "Y" ] || [ "${replace}" = "y" ]; then - echo " - Renaming old file/dir and copying new file" - mv "${HOME}"/"${1}" "${HOME}"/"${1}"_original - cp -rv "${dotfiledir}"/"${1}" "${HOME}"/"${1}" - fi - fi - else - # If there is no existing file, create one and exit - echo " - Copying ${1}" - cp -rv "${dotfiledir}"/"${1}" "${HOME}"/"${1}" - fi -} -clear - -echo "------------------------------------------" -echo " dotfiles repo setup script " -echo "------------------------------------------" -echo " Setting up symlinks " -echo "------------------------------------------" -echo "" - - -# Check/Install Oh-My-ZSH! -#------------------------------------------------------------------------------- -if [ ! -d $HOME/.oh-my-zsh ]; then - echo "OH NO! You don't have Oh-my-ZSH installed! I'll do it now!" - echo "" - echo "" - echo "When install is finished, re-run this setup script to symlink your dotfiles" - echo "" - echo "Press a key when ready" - read anykey - sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - exit 0 -else - echo "... nevermind - oh-my-zsh already installed!" -fi - -# link .zshrc -#------------------------------------------------------------------------------- -link .zshrc - -# link .zsh_aliases -#------------------------------------------------------------------------------- -link .zsh_aliases - -# link .zsh_functions -#------------------------------------------------------------------------------- -link .zsh_functions - - - -# Report on backed up files -#------------------------------------------------------------------------------- -echo "These original files were backed up as '*_original'" -ofiles=$(find "${HOME}" -maxdepth 1 -regex ".*_original$" | wc -l) -if [ "${ofiles}" -gt 0 ]; then - find "${HOME}" -maxdepth 1 -regex ".*_original$" -else - echo "" -fi - -echo "" -echo "------------------------------------------" -echo "Done. " -echo "source ${HOME}/.zshrc " -echo "or " -echo "logout and login to enable .zshrc changes " -echo "------------------------------------------" From 98b8c3ce06cfc5efb6ca4c181c28f233eb742eea Mon Sep 17 00:00:00 2001 From: "chawley (chawley)" Date: Fri, 11 Oct 2019 10:09:32 -0400 Subject: [PATCH 4/4] Added powerline10k to .zshrc and vfz alias to open vim files with fzf --- .zsh_aliases | 4 ++-- .zshrc | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.zsh_aliases b/.zsh_aliases index 145fe7c..802d0e1 100644 --- a/.zsh_aliases +++ b/.zsh_aliases @@ -71,6 +71,6 @@ alias git-st='git status' alias git-lg='git log --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit' alias git-remotes='git remote -v update' -# Makes work easier -alias rdp='/opt/freerdp-nightly/bin/xfreerdp /u:chawley2 /size:90% ' +# Edit files with vim/fzf +alias vfz='vim "`fzf`"' diff --git a/.zshrc b/.zshrc index 00e836e..696bcd1 100644 --- a/.zshrc +++ b/.zshrc @@ -9,7 +9,8 @@ export ZSH=$HOME/.oh-my-zsh # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes # ZSH_THEME="robbyrussell" # ZSH_THEME="avit" -ZSH_THEME="bureau" +# ZSH_THEME="bureau" +ZSH_THEME=powerlevel10k/powerlevel10k # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" @@ -130,3 +131,6 @@ export FZF_DEFAULT_COMMAND='find .' # --------------------------------------------------------------------------------------------------------------------- # ==> set PATH so it includes user's private ~/bin if it exists PATH="$HOME/.local/bin:$HOME/bin:$PATH" + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh