aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-02-28 19:49:47 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-02-28 19:49:47 +0000
commita54125ec2d5a43a6f3e578681f0862114c3b8745 (patch)
tree75d4a3ec8e426d6ca4779384f1f08c538a7c3aa5
parentd0943595971d8d03583fbe760f118846637a2de4 (diff)
downloaddotfiles-a54125ec2d5a43a6f3e578681f0862114c3b8745.tar.gz
dotfiles-a54125ec2d5a43a6f3e578681f0862114c3b8745.zip
Adding tmux, zsh and X config
-rw-r--r--X/.Xmodmap4
-rw-r--r--X/.Xresources363
-rw-r--r--X/.xinitrc51
-rw-r--r--tmux/.tmux.conf45
-rw-r--r--zsh/.zsh/export.zsh7
-rw-r--r--zsh/.zsh/function.zsh14
-rw-r--r--zsh/.zsh/fzf_completion.zsh199
-rw-r--r--zsh/.zsh/fzf_key_bindings.zsh78
-rw-r--r--zsh/.zsh/minimal.zsh181
-rw-r--r--zsh/.zsh/startup.zsh3
-rw-r--r--zsh/.zshrc27
11 files changed, 972 insertions, 0 deletions
diff --git a/X/.Xmodmap b/X/.Xmodmap
new file mode 100644
index 0000000..0553230
--- /dev/null
+++ b/X/.Xmodmap
@@ -0,0 +1,4 @@
+clear lock
+clear control
+keycode 66 = Control_L
+add control = Control_L Control_R
diff --git a/X/.Xresources b/X/.Xresources
new file mode 100644
index 0000000..789a451
--- /dev/null
+++ b/X/.Xresources
@@ -0,0 +1,363 @@
+Xft.antialias: true
+
+
+! ----------------------------------------------------------------------------
+! Updated: Sat Jul 27 01:25:39 2013
+!
+! ----------------------------------------------------------------------------
+
+
+
+
+! urxvt {{{
+! ================================================================================================================================================================
+! urxvt --help 2>&1| sed -n '/: /s/^ */! URxvt*/gp' >> ~/.Xresources
+! TERM=dump command man -Pcat urxvt | sed -n '/depth: b/,/^BACKGROUND/p'|sed '$d'| sed 's/@/%-.-%/g; s/\^/%-+-%/g' | sed '/^ [a-z]/s/^ */^/g' | tr -s "\n" \|
+! sed -e :a -e 'N;s/\n/@@/g;ta;P;D' | sed 's,\^\([^@]\+\)@*[\t ]*\([^\^]\+\),! \2\n! URxvt*\1\n\n,g' | sed 's,@@ ,\n ,g' | sed 's,@*$,,g' |sed '/^[^!]/d'
+
+! Specifies the terminal type name to be set in the TERM environment variable
+URxvt*termName: rxvt-unicode-256color
+
+! Create the window with the specified X window geometry [default 80x24]
+URxvt*geometry: 100x25
+
+! True: start as a login shell by prepending a - to argv[0] of the shell; option -ls. False: start as a normal sub-shell [default];
+URxvt*loginShell: true
+
+! Use the specified colour for the scrollbar [default #B2B2B2]
+URxvt*scrollColor: #777777
+
+! Set scrollbar style to rxvt, plain, next or xterm. plain is the authors favourite.
+URxvt*scrollstyle: plain
+
+! True: scroll to bottom when a non-special key pressed. Special keys are those which are intercepted by rxvt for special handling andnt passed onto the shell; False: dont scroll to bottom
+URxvt*scrollTtyKeypress: true
+
+! True: scroll to bottom when tty receives output; False: do not scroll to bottom when tty receives output
+URxvt*scrollTtyOutput: false
+
+! True: scroll with scrollback buffer when tty recieves new lines (and scrollTtyOutput is False); False: do not scroll with scrollback buffer when tty recieves new lines
+URxvt*scrollWithBuffer: false
+
+! Turn on/off secondary screen (default enabled)
+URxvt*secondaryScreen: true
+
+! (default enabled). If this option is enabled, scrolls on the secondary screen will change the scrollback buffer and, when secondaryScreen is off, switching to/from the secondary screen will instead scroll the screen up.
+URxvt*secondaryScroll: true
+
+! When receiving lots of lines, urxvt will only scroll once a whole screen height of lines has been read, resulting in fewer updates while still displaying every received line
+! False: specify that smooth scrolling should be used. urxvt will force a screen refresh on each new line it received
+URxvt*jumpScroll: true
+
+! (true) When receiving lots of lines, urxvt will only scroll once in a while (around 60x/sec), resulting in fewer updates. This can result in urxvt not ever displaying some of the lines it receives
+URxvt*skipScroll: false
+
+! True: enable the scrollbar [default]; option -sb. False: disable the scrollbar
+URxvt*scrollBar: false
+
+! place the scrollbar on the right of the window
+URxvt*scrollBar_right: false
+
+! di5play an rxvt scrollbar with/without a trough
+URxvt*scrollBar_floating: false
+
+! Align the top, bottom or centre [default] of the scrollbar thumb with the pointer on middle button press/drag
+! URxvt*scrollBar_align: mode
+
+! Set the scrollbar width in pixels.
+! URxvt*thickness: number
+
+! Turn on/off pseudo-transparency by using the root pixmap as background
+URxvt*transparent: false
+
+! Tint the transparent background with the given colour. Note that a black tint yields a completely black image while a white tint yields the image unchanged.
+! URxvt*tintColor: white
+
+! Darken (0 .. 99) or lighten (101 .. 200) the transparent background. A value of 100 means no shading
+! URxvt*shading: 100
+
+! Apply gaussian blur with the specified radius to the transparent background. If a single number is specified, the vertical and horizontal radii are considered to be the same.
+! Setting one of the radii to 1 and the other to a large number creates interesting effects on some backgrounds. The maximum radius value is 128. An horizontal or vertical radius of 0 disables blur
+!URxvt*blurRadius: 3
+
+! Fade the text by the given percentage when focus is lost
+!URxvt*fading: 20
+
+! Fade to this colour, when fading is used (see fading:). The default colour is black
+! URxvt*fadeColor: Green
+
+! True: inhibit writing record into the system log file utmp; False: write record into the system log file utmp [default]
+URxvt*utmpInhibit: false
+
+! True: set the urgency hint for the wm on receipt of a bell character. False: do not set the urgency hint [default] urxvt resets the urgency hint on every focus change.
+URxvt*urgentOnBell: false
+
+! True: use visual bell on receipt of a bell character; option -vb. False: no visual bell [default]
+URxvt*visualBell: false
+
+! True: de-iconify (map) on receipt of a bell character. False: no de-iconify (map) on receipt of a bell character [default].
+URxvt*mapAlert: false
+
+! True: the mouse wheel scrolls a page full. False: the mouse wheel scrolls five lines [default]
+URxvt*mouseWheelScrollPage: false
+
+! Change the meaning of triple-click selection with the left mouse button. Instead of selecting a full line it will extend the selection to the end of the logical line only
+! URxvt*tripleclickwords: boolean
+
+! Enables "insecure" mode. Rxvt-unicode offers some escape sequences that echo arbitrary strings like the icon name or the locale. This could be abused if somebody gets 8-bit-clean access to your disp1ay
+! URxvt*insecure: boolean
+
+! Use the specified colour as the windows background colour [default White]
+ URxvt*background: [70]#2c2c2c
+!urxvt*background: rgba:2c00/2c00/2c00/c800
+
+! Use the specified colour as the windows foreground colour [default Black]
+URxvt*foreground: #eaeaea
+
+! Use the specified colour to disp1ay bold characters when the foreground colour is the default.
+! URxvt*colorBD: color
+
+! Use the specified colour to disp1ay italic characters when the foreground colour is the default
+! URxvt*colorIT: color
+
+! Use the specified colour to disp1ay underlined characters when the foreground colour is the default.
+URxvt*colorUL: yellow
+
+! Use the specified colour as the background for reverse video characters.
+! URxvt*colorRV: color
+
+! If set, use the specified colour as the colour for the underline itself. If unset, use the foreground colour
+URxvt*underlineColor: yellow
+
+! Use the specified colour for the scrollbar [default #B2B2B2]
+! URxvt*scrollColor: color
+
+! Use the specified colour for the scrollbars trough area [default #969696]. Only relevant for rxvt (non XTerm/NeXT) scrollbar
+! URxvt*troughColor: color
+
+! If set, use the specified colour as the background for highlighted characters. If unset, use reverse video
+URxvt*highlightColor: #373b41
+
+! If set and highlightColor is set, use the specified colour as the foreground for highlighted characters
+URxvt*highlightTextColor: White
+
+! True: Make the cursor underlined. False: Make the cursor a box [default]
+!URxvt*cursorUnderline: false
+
+! True: blink the cursor. False: do not blink the cursor [default];
+!URxvt*cursorBlink: true
+
+! Use the specified colour for the cursor. The default is to use the foreground colour
+URxvt*cursorColor: #cc99cc
+
+! Use the specified colour for the colour of the cursor text. For this to take effect, cursorColor must also be specified. The default is to use the background colour
+!URxvt*cursorColor2: White
+
+! True: blank the pointer when a key is pressed or after a set number of seconds of inactivity. False: the pointer is always visible [default]
+!URxvt*pointerBlank: true
+
+! Specifies number of seconds before blanking the pointer [default 2]. Use a large number (e.g. 987654321) to effectively disable the timeout
+!URxvt*pointerBlankDelay: 4
+
+! Mouse pointer foreground colour
+!URxvt*pointerColor: green
+
+! Mouse pointer background colour
+!URxvt*pointerColor2: blue
+
+! Set the name used to label the window's icon or displayed in an icon manager window, it also sets the window's title unless it is explicitly set
+! URxvt*iconName: string
+
+! Set the application icon pixmap; option -icon.
+! URxvt*iconFile: file
+
+! Set window title string, the default title is the command-line specified after the -e option, if any, otherwise the application name
+! URxvt*title: string
+
+
+
+
+
+! Select the fonts to be used. This is a comma separated list of font names that are checked in order when trying to find glyphs for characters
+URxvt*font: xft:Inconsolata for Powerline:pixelsize:12
+
+! When font styles are not enabled, or this option is enabled (True default), bold/blink font styles imply high intensity foreground/background colours
+URxvt*intensityStyles: false
+
+! Save number lines in the scrollback buffer [default 64]. This resource is limited on most machines to 65535
+URxvt*saveLines: 16384
+
+! Double-buffering for xft (default enabled). On some card/driver combination enabling it slightly decreases performance, on most it greatly helps it. The slowdown is small, so it should normally be enabled
+URxvt*buffered: true
+
+! Attempt to find a visual with the given bit depth
+URxvt*depth: 32
+
+! visual id to request
+! URxvt*visual: number
+
+! Sets the WM_TRANSIENT_FOR property to the given window id.
+! URxvt*transient-for: windowid
+
+! Sets override-redirect for the terminal window, making it almost invisible to window managers
+! URxvt*override-redirect: boolean
+
+! Turn on/off hold window after exit support. If enabled, urxvt will not immediately destroy its window when the program executed within it exits. Instead, it will wait till it is being killed or closed by the user.
+URxvt*hold: false
+
+! External border of number pixels. This resource is limited to 100
+! URxvt*externalBorder: number
+
+! Internal border of number pixels. This resource is limited to 100
+! URxvt*internalBorder:
+
+! The colour of the border around the text area and between the scrollbar and the text.
+! URxvt*borderColor: color
+
+! Set MWM hints to request a borderless window, i.e. if honoured by the WM, the rxvt-unicode window will not have window decorations
+! URxvt*borderLess: true
+
+! Specifies number of lines (pixel height) to insert between each row of the disp1ay [default 0]
+! URxvt*lineSpace: number
+
+! Letter spacing adjustment
+! URxvt*letterSpace: number
+
+! Disable the usage of the built-in block graphics/line drawing characters and just rely on what the specified fonts provide. Use this if you have a good font and want to use its block graphic glyphs
+! URxvt*skipBuiltinGlyphs: boolean
+
+! The string to send when the backspace key is pressed. If set to DEC or unset it will send Delete (code 127) or, with control, Backspace (code 8)
+! URxvt*backspacekey: string
+
+! The string to send when the delete key (not the keypad delete key) is pressed. If unset it will send the sequence traditionally associated with the Execute key.
+! URxvt*deletekey: string
+
+! Specify a command pipe for vt100 printer [default lpr(1)]. Use Print to initiate a screen dump to the printer and Ctrl-Print or Shift-Print to include the scrollback
+URxvt*print-pipe: cat > $HOME/$(echo urxvt.dump.$(date +'%Y%M%d%H%m%S'))
+
+! Set the key to be interpreted as the Meta key to: alt, meta, hyper, super, mod1, mod2, mod3, mod4, mod5
+URxvt*modifier: alt
+
+! The characters used as delimiters for double-click word selection (whitespace delimiting is added automatically if resource is given)
+! URxvt*cutchars: string
+
+! Specify the reply rxvt-unicode sends to the shell when an ENQ (control-E) character is passed through. It may contain escape values as described in the entry on keysym following.
+! URxvt*answerbackString: string
+
+! Colon-separated list of additional directories that hold extension scripts. When looking for perl extensions, urxvt will first look in these directories
+!URxvt*perl-lib: /usr/lib64/urxvt/perl/
+
+! Perl code to be evaluated when all extensions have been registered
+! URxvt*perl-eval: perl-eval
+
+! Comma-separated list(s) of perl extension scripts (default: "default") to use in this terminal instance, blank disables
+URxvt*perl-ext-common: fullscreen
+URxvt*perl-ext:
+
+! Specifies the program to be started with a URL argument. Used by the "selection-popup" and "matcher" perl extensions
+! URxvt*url-launcher: string
+
+! name of inputMethod to use
+! URxvt*inputMethod: name
+
+! OverTheSpot, OffTheSpot, Root
+! URxvt*preeditType: style
+
+! The locale to use for opening the IM. You can use an "LC_CTYPE" of e.g. "de_DE.UTF-8" for normal text processing
+! URxvt*imLocale: string
+
+! Specify the font-set used for XIM styles "OverTheSpot" or "OffTheSpot". It must be a standard X font set (XLFD patterns separated by commas)
+! URxvt*imFont: fontname
+
+! Sets the working directory for the shell (or the command specified via -e). The path must be an absolute path and it must exist for urxvt to start. If it isnt specified then the current working directory
+! URxvt*chdir: string
+
+! True: simulate reverse video by foreground and background colours; option -rv. False: regular screen colours [default]
+! URxvt*reverseVideo: boolean
+
+! True: handle Meta (Alt) + keypress to set the 8th bit. False: handle Meta (Alt) + keypress as an escape prefix [default]
+! URxvt*meta8: boolean
+
+! True: store tabs as wide characters. False: interpret tabs as cursor movement only
+! URxvt*pastableTabs: boolean
+
+! Turn on/off ISO 14755 (default enabled)
+!URxvt*iso14755: False
+
+! Turn on/off ISO 14755 5.2 mode (default enabled)
+! URxvt*iso14755_52: boolean
+
+! Sets the hotkey that starts the incremental scrollback buffer search (default: "M-s")
+! URxvt*searchable-scrollback: string
+
+! Additional selection patterns, see the urxvtperl(3) manpage for details.
+! URxvt*selection.pattern-0: string
+
+! Selection auto-transform patterns, see the urxvtperl(3) manpage for details
+! URxvt*selection-autotransform.*: string
+
+! Associate string with keysym sym. The intervening resource name keysym. cannot be omitted.
+! URxvt*keysym.sym: keysym
+
+! Turning on cp/paste
+!URxvt.keysym.SHIFT-CONTROL-V: perl:clipboard:paste
+
+! URxvt*selection-pastebin.cmd: string
+! URxvt*selection-pastebin.url: string
+
+! URxvt*tab-bg: colour
+! URxvt*tab-fg: colour
+! URxvt*tabbar-bg: colour
+! URxvt*tabbar-fg: colour
+
+
+! URxvt*xrm: string
+! URxvt*background.border: boolean
+! URxvt*background.expr: string
+! URxvt*background.interval: seconds
+
+! URxvt*bell-command: string
+
+! URxvt*matcher.button: string
+! URxvt*matcher.launcher: string
+! URxvt*matcher.launcher.*: string
+! URxvt*matcher.pattern.*: string
+! URxvt*matcher.rend.*: string
+
+! URxvt*remote-clipboard.fetch: string
+! URxvt*remote-clipboard.store: string
+
+
+*color0: #2c2c2c
+*color8: #1f1f1f
+
+!! red dark/light
+*color1: #dc322f
+*color9: #cb4b16
+
+!! green dark/light
+*color2: #859900
+*color10: #586e75
+
+!! yellow dark/light
+*color3: #b58900
+*color11: #657b83
+
+!! blue dark/light
+*color4: #268bd2
+*color12: #839496
+
+!! magenta dark/light
+*color5: #d33682
+*color13: #6c71c4
+
+!! cyan dark/light
+*color6: #2aa198
+*color14: #93a1a1
+
+!! white dark/light
+*color7: #eee8d5
+*color15: #fdf6e3
+
+!! Key bindings
+URxvt.keysym.F11: perl:fullscreen:switch
diff --git a/X/.xinitrc b/X/.xinitrc
new file mode 100644
index 0000000..4287a7a
--- /dev/null
+++ b/X/.xinitrc
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+userresources=$HOME/.Xresources
+usermodmap=$HOME/.Xmodmap
+sysresources=/etc/X11/xinit/.Xresources
+sysmodmap=/etc/X11/xinit/.Xmodmap
+
+# merge in defaults and keymaps
+
+if [ -f $sysresources ]; then
+
+
+
+
+
+
+
+ xrdb -merge $sysresources
+
+fi
+
+if [ -f $sysmodmap ]; then
+ xmodmap $sysmodmap
+fi
+
+if [ -f "$userresources" ]; then
+
+
+
+
+
+
+
+ xrdb -merge "$userresources"
+
+fi
+
+if [ -f "$usermodmap" ]; then
+ xmodmap "$usermodmap"
+fi
+
+# start some nice programs
+
+if [ -d /etc/X11/xinit/xinitrc.d ] ; then
+ for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
+ [ -x "$f" ] && . "$f"
+ done
+ unset f
+fi
+
+exec i3
diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf
new file mode 100644
index 0000000..9ae45c1
--- /dev/null
+++ b/tmux/.tmux.conf
@@ -0,0 +1,45 @@
+set -g assume-paste-time 1
+set -g base-index 0
+set -g bell-action any
+set -g bell-on-alert off
+set -g default-command ""
+set -g default-shell "/usr/bin/zsh"
+set -g default-terminal "screen-256color"
+set -g destroy-unattached off
+set -g detach-on-destroy on
+set -g display-panes-active-colour red
+set -g display-panes-colour blue
+set -g display-panes-time 1000
+set -g display-time 750
+set -g history-limit 2000
+set -g key-table "root"
+set -g lock-after-time 0
+set -g lock-command "lock -np"
+set -g message-command-style fg=yellow,bg=black
+set -g message-style fg=black,bg=yellow
+set -g mouse off
+set -g prefix C-b
+set -g prefix2 None
+set -g renumber-windows off
+set -g repeat-time 500
+set -g set-remain-on-exit off
+set -g set-titles off
+set -g set-titles-string "#S:#I:#W - "#T" #{session_alerts}"
+set -g status on
+set -g status-interval 15
+set -g status-justify left
+set -g status-keys vi
+set -g status-left "[#S] "
+set -g status-left-length 10
+set -g status-left-style default
+set -g status-position bottom
+set -g status-right " "#{=21:pane_title}" %H:%M %d-%b-%y"
+set -g status-right-length 40
+set -g status-right-style default
+set -g status-style fg=black,bg=green
+set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
+set -g visual-activity off
+set -g visual-bell off
+set -g visual-silence off
+set -g word-separators " -_@"
+set -g mouse on
diff --git a/zsh/.zsh/export.zsh b/zsh/.zsh/export.zsh
new file mode 100644
index 0000000..07e1b56
--- /dev/null
+++ b/zsh/.zsh/export.zsh
@@ -0,0 +1,7 @@
+export GITHUB_HOME=$HOME/Github
+export ALTERNATE_EDITOR=""
+export EDITOR="nvim"
+export VISUAL="nvim"
+
+export PATH="{$PATH}:${HOME}/.gem/ruby/2.5.0/bin:/usr/local/bin"
+export PATH="{$PATH}:${HOME}/.local/bin"
diff --git a/zsh/.zsh/function.zsh b/zsh/.zsh/function.zsh
new file mode 100644
index 0000000..30e24aa
--- /dev/null
+++ b/zsh/.zsh/function.zsh
@@ -0,0 +1,14 @@
+alias fdisk='fdisk --color=always'
+alias grep='grep --color=always'
+alias ls='ls --color=always'
+alias l='ls -la --color=always'
+alias vim='nvim'
+# alias lspasscp='lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\\]//g')'
+
+# fd - cd to selected directory
+fd() {
+ local dir
+ dir=$(find ${1:-.} -path '*/\.*' -prune \
+ -o -type d -print 2> /dev/null | fzf +m) &&
+ cd "$dir"
+}
diff --git a/zsh/.zsh/fzf_completion.zsh b/zsh/.zsh/fzf_completion.zsh
new file mode 100644
index 0000000..d3e64d8
--- /dev/null
+++ b/zsh/.zsh/fzf_completion.zsh
@@ -0,0 +1,199 @@
+#!/bin/zsh
+# ____ ____
+# / __/___ / __/
+# / /_/_ / / /_
+# / __/ / /_/ __/
+# /_/ /___/_/-completion.zsh
+#
+# - $FZF_TMUX (default: 0)
+# - $FZF_TMUX_HEIGHT (default: '40%')
+# - $FZF_COMPLETION_TRIGGER (default: '**')
+# - $FZF_COMPLETION_OPTS (default: empty)
+
+# To use custom commands instead of find, override _fzf_compgen_{path,dir}
+if ! declare -f _fzf_compgen_path > /dev/null; then
+ _fzf_compgen_path() {
+ echo "$1"
+ command find -L "$1" \
+ -name .git -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
+ -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
+ }
+fi
+
+if ! declare -f _fzf_compgen_dir > /dev/null; then
+ _fzf_compgen_dir() {
+ command find -L "$1" \
+ -name .git -prune -o -name .svn -prune -o -type d \
+ -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
+ }
+fi
+
+###########################################################
+
+__fzfcmd_complete() {
+ [ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] &&
+ echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
+}
+
+__fzf_generic_path_completion() {
+ local base lbuf compgen fzf_opts suffix tail fzf dir leftover matches
+ # (Q) flag removes a quoting level: "foo\ bar" => "foo bar"
+ base=${(Q)1}
+ lbuf=$2
+ compgen=$3
+ fzf_opts=$4
+ suffix=$5
+ tail=$6
+ fzf="$(__fzfcmd_complete)"
+
+ setopt localoptions nonomatch
+ dir="$base"
+ while [ 1 ]; do
+ if [[ -z "$dir" || -d ${~dir} ]]; then
+ leftover=${base/#"$dir"}
+ leftover=${leftover/#\/}
+ [ -z "$dir" ] && dir='.'
+ [ "$dir" != "/" ] && dir="${dir/%\//}"
+ dir=${~dir}
+ matches=$(eval "$compgen $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" ${=fzf} ${=fzf_opts} -q "$leftover" | while read item; do
+ echo -n "${(q)item}$suffix "
+ done)
+ matches=${matches% }
+ if [ -n "$matches" ]; then
+ LBUFFER="$lbuf$matches$tail"
+ fi
+ zle redisplay
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+ break
+ fi
+ dir=$(dirname "$dir")
+ dir=${dir%/}/
+ done
+}
+
+_fzf_path_completion() {
+ __fzf_generic_path_completion "$1" "$2" _fzf_compgen_path \
+ "-m" "" " "
+}
+
+_fzf_dir_completion() {
+ __fzf_generic_path_completion "$1" "$2" _fzf_compgen_dir \
+ "" "/" ""
+}
+
+_fzf_feed_fifo() (
+ command rm -f "$1"
+ mkfifo "$1"
+ cat <&0 > "$1" &
+)
+
+_fzf_complete() {
+ local fifo fzf_opts lbuf fzf matches post
+ fifo="${TMPDIR:-/tmp}/fzf-complete-fifo-$$"
+ fzf_opts=$1
+ lbuf=$2
+ post="${funcstack[2]}_post"
+ type $post > /dev/null 2>&1 || post=cat
+
+ fzf="$(__fzfcmd_complete)"
+
+ _fzf_feed_fifo "$fifo"
+ matches=$(cat "$fifo" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" ${=fzf} ${=fzf_opts} -q "${(Q)prefix}" | $post | tr '\n' ' ')
+ if [ -n "$matches" ]; then
+ LBUFFER="$lbuf$matches"
+ fi
+ zle redisplay
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+ command rm -f "$fifo"
+}
+
+_fzf_complete_telnet() {
+ _fzf_complete '+m' "$@" < <(
+ command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0' |
+ awk '{if (length($2) > 0) {print $2}}' | sort -u
+ )
+}
+
+_fzf_complete_ssh() {
+ _fzf_complete '+m' "$@" < <(
+ command cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}') \
+ <(command grep -oE '^[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \
+ <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |
+ awk '{if (length($2) > 0) {print $2}}' | sort -u
+ )
+}
+
+_fzf_complete_export() {
+ _fzf_complete '-m' "$@" < <(
+ declare -xp | sed 's/=.*//' | sed 's/.* //'
+ )
+}
+
+_fzf_complete_unset() {
+ _fzf_complete '-m' "$@" < <(
+ declare -xp | sed 's/=.*//' | sed 's/.* //'
+ )
+}
+
+_fzf_complete_unalias() {
+ _fzf_complete '+m' "$@" < <(
+ alias | sed 's/=.*//'
+ )
+}
+
+fzf-completion() {
+ local tokens cmd prefix trigger tail fzf matches lbuf d_cmds
+ setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
+
+ # http://zsh.sourceforge.net/FAQ/zshfaq03.html
+ # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
+ tokens=(${(z)LBUFFER})
+ if [ ${#tokens} -lt 1 ]; then
+ zle ${fzf_default_completion:-expand-or-complete}
+ return
+ fi
+
+ cmd=${tokens[1]}
+
+ # Explicitly allow for empty trigger.
+ trigger=${FZF_COMPLETION_TRIGGER-'**'}
+ [ -z "$trigger" -a ${LBUFFER[-1]} = ' ' ] && tokens+=("")
+
+ tail=${LBUFFER:$(( ${#LBUFFER} - ${#trigger} ))}
+ # Kill completion (do not require trigger sequence)
+ if [ $cmd = kill -a ${LBUFFER[-1]} = ' ' ]; then
+ fzf="$(__fzfcmd_complete)"
+ matches=$(ps -ef | sed 1d | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" ${=fzf} -m | awk '{print $2}' | tr '\n' ' ')
+ if [ -n "$matches" ]; then
+ LBUFFER="$LBUFFER$matches"
+ fi
+ zle redisplay
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+ # Trigger sequence given
+ elif [ ${#tokens} -gt 1 -a "$tail" = "$trigger" ]; then
+ d_cmds=(${=FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir})
+
+ [ -z "$trigger" ] && prefix=${tokens[-1]} || prefix=${tokens[-1]:0:-${#trigger}}
+ [ -z "${tokens[-1]}" ] && lbuf=$LBUFFER || lbuf=${LBUFFER:0:-${#tokens[-1]}}
+
+ if eval "type _fzf_complete_${cmd} > /dev/null"; then
+ eval "prefix=\"$prefix\" _fzf_complete_${cmd} \"$lbuf\""
+ elif [ ${d_cmds[(i)$cmd]} -le ${#d_cmds} ]; then
+ _fzf_dir_completion "$prefix" "$lbuf"
+ else
+ _fzf_path_completion "$prefix" "$lbuf"
+ fi
+ # Fall back to default completion
+ else
+ zle ${fzf_default_completion:-expand-or-complete}
+ fi
+}
+
+[ -z "$fzf_default_completion" ] && {
+ binding=$(bindkey '^I')
+ [[ $binding =~ 'undefined-key' ]] || fzf_default_completion=$binding[(s: :w)2]
+ unset binding
+}
+
+zle -N fzf-completion
+bindkey '^I' fzf-completion
diff --git a/zsh/.zsh/fzf_key_bindings.zsh b/zsh/.zsh/fzf_key_bindings.zsh
new file mode 100644
index 0000000..7064611
--- /dev/null
+++ b/zsh/.zsh/fzf_key_bindings.zsh
@@ -0,0 +1,78 @@
+# Key bindings
+# ------------
+if [[ $- == *i* ]]; then
+
+# CTRL-T - Paste the selected file path(s) into the command line
+__fsel() {
+ local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
+ -o -type f -print \
+ -o -type d -print \
+ -o -type l -print 2> /dev/null | cut -b3-"}"
+ setopt localoptions pipefail 2> /dev/null
+ eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read item; do
+ echo -n "${(q)item} "
+ done
+ local ret=$?
+ echo
+ return $ret
+}
+
+__fzf_use_tmux__() {
+ [ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ]
+}
+
+__fzfcmd() {
+ __fzf_use_tmux__ &&
+ echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
+}
+
+fzf-file-widget() {
+ LBUFFER="${LBUFFER}$(__fsel)"
+ local ret=$?
+ zle redisplay
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+ return $ret
+}
+zle -N fzf-file-widget
+bindkey '^T' fzf-file-widget
+
+# ALT-C - cd into the selected directory
+fzf-cd-widget() {
+ local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
+ -o -type d -print 2> /dev/null | cut -b3-"}"
+ setopt localoptions pipefail 2> /dev/null
+ local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)"
+ if [[ -z "$dir" ]]; then
+ zle redisplay
+ return 0
+ fi
+ cd "$dir"
+ local ret=$?
+ zle reset-prompt
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+ return $ret
+}
+zle -N fzf-cd-widget
+bindkey '\ec' fzf-cd-widget
+
+# CTRL-R - Paste the selected command from history into the command line
+fzf-history-widget() {
+ local selected num
+ setopt localoptions noglobsubst noposixbuiltins pipefail 2> /dev/null
+ selected=( $(fc -l 1 |
+ FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) )
+ local ret=$?
+ if [ -n "$selected" ]; then
+ num=$selected[1]
+ if [ -n "$num" ]; then
+ zle vi-fetch-history -n $num
+ fi
+ fi
+ zle redisplay
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+ return $ret
+}
+zle -N fzf-history-widget
+bindkey '^R' fzf-history-widget
+
+fi
diff --git a/zsh/.zsh/minimal.zsh b/zsh/.zsh/minimal.zsh
new file mode 100644
index 0000000..cb814bc
--- /dev/null
+++ b/zsh/.zsh/minimal.zsh
@@ -0,0 +1,181 @@
+# Switches
+MINIMAL_PROMPT="${MINIMAL_PROMPT:-yes}"
+MINIMAL_RPROMPT="${MINIMAL_RPROMPT:-yes}"
+MINIMAL_MAGIC_ENTER="${MINIMAL_MAGIC_ENTER:-yes}"
+
+# Parameters
+MINIMAL_OK_COLOR="${MINIMAL_OK_COLOR:-2}"
+MINIMAL_USER_CHAR="${MINIMAL_USER_CHAR:-λ}"
+MINIMAL_INSERT_CHAR="${MINIMAL_INSERT_CHAR:-›}"
+MINIMAL_NORMAL_CHAR="${MINIMAL_NORMAL_CHAR:-·}"
+MINIMAL_PWD_LEN="${MINIMAL_PWD_LEN:-2}"
+MINIMAL_PWD_CHAR_LEN="${MINIMAL_PWD_CHAR_LEN:-10}"
+MINIMAL_MAGIC_ENTER_MARGIN="${MINIMAL_MAGIC_ENTER_MARGIN:- | }"
+
+# check if function exists
+function _isfn {
+ type -w "$1" | grep -wq function
+}
+
+# Extensions
+if ! _isfn minimal_magic_output; then
+ function minimal_magic_output {
+ minimal_magic_output_base
+ }
+fi
+
+if ! _isfn minimal_vcs; then
+ function minimal_vcs {
+ # git
+ local statc="%{\e[0;3${MINIMAL_OK_COLOR}m%}" # assumes is clean
+ local bname="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)"
+
+ if [ -n "$bname" ]; then
+ [ -n "$(git status --porcelain 2> /dev/null)" ] &&\
+ statc="%{\e[0;31m%}"
+ echo -n " $statc$bname%{\e[0m%}"
+ fi
+ }
+fi
+
+if ! _isfn minimal_env; then
+ function minimal_env {
+ # python virtual env
+ if [ -n "$VIRTUAL_ENV" ]; then
+ _venv="$(basename $VIRTUAL_ENV)"
+ echo -n "${_venv%%.*} "
+ fi
+ }
+fi
+
+# Setup
+autoload -U colors && colors
+setopt prompt_subst
+
+_grey="\e[38;5;244m"
+_greyp="%{$_grey%}"
+
+# Left Prompt
+function minimal_lprompt {
+ local user_status="%{\e[%(1j.4.0);3%(0?.$MINIMAL_OK_COLOR.1)m%}\
+%(!.#.$MINIMAL_USER_CHAR)"
+ local kmstatus="$MINIMAL_INSERT_CHAR"
+ [ "$KEYMAP" = 'vicmd' ] && kmstatus="$MINIMAL_NORMAL_CHAR"
+
+ echo -n "$user_status%{\e[0m%} $kmstatus"
+}
+
+function minimal_ps2 {
+ local kmstatus="$MINIMAL_INSERT_CHAR"
+ local offset="$((${#_venv} + 2))"
+ [ "$KEYMAP" = 'vicmd' ] && kmstatus="$MINIMAL_NORMAL_CHAR"
+
+ printf " %.0s" {1..$offset}
+ echo -n "$kmstatus"
+}
+
+# Right Prompt
+function minimal_path {
+ local w="%{\e[0m%}"
+ local cwd="%${MINIMAL_PWD_LEN}~"
+ local pi=""
+ local len="$MINIMAL_PWD_CHAR_LEN"
+ [ "$len" -lt 4 ] && len=4
+ local hlen=$((len / 2 - 1))
+ cwd="${(%)cwd}"
+ cwd=("${(@s:/:)cwd}")
+
+ for i in {1..${#cwd}}; do
+ pi="$cwd[$i]"
+ [ "${#pi}" -gt "$len" ] && cwd[$i]="${pi:0:$hlen}$w..$_greyp${pi: -$hlen}"
+ done
+
+ echo -n "$_greyp${(j:/:)cwd//\//$w/$_greyp}$w"
+}
+
+# Magic Enter
+function minimal_infoline {
+ local last_err="$1"
+ local w="\e[0m"
+ local rn="\e[0;31m"
+ local rb="\e[1;31m"
+
+ local user_host_pwd="$_grey%n$w@$_grey%m$w:$_grey%~$w"
+ user_host_pwd="${${(%)user_host_pwd}//\//$w/$_grey}"
+
+ local v_files="$(ls -1 | sed -n '$=')"
+ local h_files="$(ls -1A | sed -n '$=')"
+
+ local job_n="$(jobs | sed -n '$=')"
+
+ local iline="[$user_host_pwd] [$_grey${v_files:-0}$w ($_grey${h_files:-0}$w)]"
+ [ "$job_n" -gt 0 ] && iline="$iline [$_grey$job_n$w&]"
+
+ if [ "$last_err" != "0" ]; then
+ iline="$iline \e[1;31m[\e[0;31m$last_err\e[1;31m]$w"
+ fi
+
+ echo "$iline"
+}
+
+function minimal_magic_output_base {
+ local margin="${#MINIMAL_MAGIC_ENTER_MARGIN}"
+
+ if [ "$(dirs -p | wc -l)" -gt 1 ]; then
+ local stack="$(dirs)"
+ echo "[${_grey}dirs\e[0m - ${_grey}${stack//\//\e[0m/$_grey}\e[0m]"
+ fi
+
+ if [ "$(uname)" = "Darwin" ] && ! ls --version &> /dev/null; then
+ COLUMNS=$((COLUMNS - margin)) CLICOLOR_FORCE=1 ls -C -G
+ else
+ ls -C --color="always" -w $((COLUMNS - margin))
+ fi
+
+ git -c color.status=always status -sb 2> /dev/null
+}
+
+function minimal_wrap_output {
+ local output="$1"
+ local output_len="$(echo "$output" | sed -n '$=')"
+ if [ -n "$output" ]; then
+ if [ "$output_len" -gt "$((LINES - 2))" -a -n "$PAGER" ]; then
+ printf "$output\n" | "$PAGER" -R
+ else
+ printf "$output\n" | sed "s/^/$MINIMAL_MAGIC_ENTER_MARGIN/"
+ fi
+ fi
+}
+
+function minimal_magic_enter {
+ local last_err="$?" # I need to capture this ASAP
+
+ if [ -z "$BUFFER" ]; then
+ minimal_infoline $last_err
+ minimal_wrap_output "$(minimal_magic_output)"
+ zle redisplay
+ else
+ zle accept-line
+ fi
+}
+
+# Apply Switches
+if [ "$MINIMAL_PROMPT" = "yes" ]; then
+ # prompt redraw on vimode change
+ function reset_prompt {
+ zle reset-prompt
+ }
+
+ zle -N zle-line-init reset_prompt
+ zle -N zle-keymap-select reset_prompt
+
+ PROMPT='$(minimal_env)$(minimal_lprompt) '
+ PS2='$(minimal_ps2) '
+ [ "$MINIMAL_RPROMPT" = "yes" ] && RPROMPT='$(minimal_path)$(minimal_vcs)'
+fi
+
+if [ "$MINIMAL_MAGIC_ENTER" = "yes" ]; then
+ zle -N minimal-magic-enter minimal_magic_enter
+ bindkey -M main "^M" minimal-magic-enter
+ bindkey -M vicmd "^M" minimal-magic-enter
+fi
diff --git a/zsh/.zsh/startup.zsh b/zsh/.zsh/startup.zsh
new file mode 100644
index 0000000..f09fbfd
--- /dev/null
+++ b/zsh/.zsh/startup.zsh
@@ -0,0 +1,3 @@
+# Startup archey3
+archey3
+cd
diff --git a/zsh/.zshrc b/zsh/.zshrc
new file mode 100644
index 0000000..5cd69b5
--- /dev/null
+++ b/zsh/.zshrc
@@ -0,0 +1,27 @@
+# Lines configured by zsh-newuser-install
+HISTFILE=~/.histfile
+HISTSIZE=100000
+SAVEHIST=1000000
+setopt appendhistory notify
+bindkey -e
+# End of lines configured by zsh-newuser-install
+# The following lines were added by compinstall
+
+zstyle ':completion:*' completer _expand _complete _ignored _approximate
+zstyle ':completion:*' list-colors ''
+zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+zstyle ':completion:*' max-errors 10
+zstyle ':completion:*' prompt ' '
+zstyle :compinstall filename '/home/yannherklotz/.zshrc'
+
+autoload -Uz compinit
+compinit
+# End of lines added by compinstall
+
+# Sourcing everything
+source /usr/share/fzf/key-bindings.zsh
+source /usr/share/fzf/completion.zsh
+source $HOME/.zsh/export.zsh
+source $HOME/.zsh/minimal.zsh
+source $HOME/.zsh/function.zsh
+source $HOME/.zsh/startup.zsh