summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-07-18 15:13:44 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-07-18 15:13:44 +0200
commit5f443195ff1bf6b4ed10fc2260c82deff6260d8d (patch)
tree5aa2709ac3c4086bfad30f437319b5d6a5df9d34
parentRemoved LICENSE because it's annoying in my home (diff)
downloaddotfiles-bsd-5f443195ff1bf6b4ed10fc2260c82deff6260d8d.tar.gz
dotfiles-bsd-5f443195ff1bf6b4ed10fc2260c82deff6260d8d.tar.bz2
dotfiles-bsd-5f443195ff1bf6b4ed10fc2260c82deff6260d8d.tar.xz
dotfiles-bsd-5f443195ff1bf6b4ed10fc2260c82deff6260d8d.tar.zst
dotfiles-bsd-5f443195ff1bf6b4ed10fc2260c82deff6260d8d.zip
Added .zshenv, .zshrc README.org update
-rw-r--r--.config/zsh/README.org67
-rw-r--r--.zshenv3
2 files changed, 70 insertions, 0 deletions
diff --git a/.config/zsh/README.org b/.config/zsh/README.org
index db37e46..d390af6 100644
--- a/.config/zsh/README.org
+++ b/.config/zsh/README.org
@@ -3,5 +3,72 @@
This is my ~.zshrc~ org file. Pretty straight forward.
+* Colors for the prompt
+ #+BEGIN_SRC shell
+autoload -U colors && colors
+ #+END_SRC
+
+* History
+** Basic
+ #+BEGIN_SRC shell
+HISTSIZE=5000
+SAVEHIST=5000
+HISTFILE=$XDG_CONFIG_HOME/zsh/history
+autoload -U history-search-end
+zle -N history-beginning-search-backward-end history-search-end
+zle -N history-beginning-search-forward-end history-search-end
+ #+END_SRC
+
+** Share history between multiple zsh instances
+ #+BEGIN_SRC shell
+setopt inc_append_history
+setopt share_history
+ #+END_SRC
+
+* Stuff for completions
#+BEGIN_SRC shell
+autoload -U compinit
+zstyle ':completion:*' menu select
+zstyle ':completion:*' list-colors 'di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
+zmodload zsh/complist
+compinit
+_comp_options+=(globdots)
#+END_SRC
+
+* Key bindings
+** Basic keybindings
+ These are my ~zsh~ key bindings, enabling vi mode as well
+ #+BEGIN_SRC shell
+bindkey -v
+export KEYTIMEOUT=1
+bindkey -M menuselect 'h' vi-backward-char
+bindkey -M menuselect 'j' vi-down-line-or-history
+bindkey -M menuselect 'k' vi-up-line-or-history
+bindkey -M menuselect 'l' vi-forward-char
+bindkey -v "^?" backward-delete-char
+bindkey -v "^[[A" history-beginning-search-backward
+bindkey -v "^[[B" history-beginning-search-forward
+bindkey -v "^K" history-beginning-search-backward
+bindkey -v "^J" history-beginning-search-forward
+bindkey -M vicmd "k" history-beginning-search-backward
+bindkey -M vicmd "j" history-beginning-search-forward
+ #+END_SRC
+
+** Command line edit
+ This allows me to edit the current line with ~C-e~
+ #+BEGIN_SRC shell
+autoload edit-command-line && zle -N edit-command-line
+bindkey "^e" edit-command-line
+ #+END_SRC
+
+* sourcing alias and plugins files
+ #+BEGIN_SRC shell
+[ -f "$XDG_CONFIG_HOME/zsh/alias.zsh" ] && source $ZDOTDIR/alias.zsh
+[ -f "$XDG_CONFIG_HOME/zsh/plugins.zsh" ] && source $ZDOTDIR/plugins.zsh
+ #+END_SRC
+
+* Prompt variables
+ #+BEGIN_SRC shell
+PROMPT="%B%{$fg[red]%}%M %{$fg[blue]%}%c%{$fg[red]%}%%%{$reset_color%} "
+RPROMPT="${RPROMPT}"'%{$fg_bold[red]%}%(?..%?)%{$reset_color%} $(gitprompt)'
+ #+END_SRC
diff --git a/.zshenv b/.zshenv
new file mode 100644
index 0000000..854dfb9
--- /dev/null
+++ b/.zshenv
@@ -0,0 +1,3 @@
+source $HOME/.profile
+
+export ZDOTDIR="$XDG_CONFIG_HOME/zsh"