From ebc435ad33e27fc2088b34d1c08f18a245f76466 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 5 Apr 2018 11:25:42 +0100 Subject: [PATCH 1/3] vim: unmap Q from ex mode --- .config/vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 36294f6..00dda28 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -265,5 +265,8 @@ com! WQA wqa " Write with sudo cmap w!! w !sudo tee > /dev/null % +" Unmap ex-mode +map Q + autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et From 1bc7dd7845675330c43a1387fce943b63078c5fe Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 11 Apr 2018 16:42:01 +0100 Subject: [PATCH 2/3] zsh: move zsh into .config --- .config/zsh/.gitignore | 4 ++++ .zshrc => .config/zsh/.zshrc | 2 ++ .profile | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 .config/zsh/.gitignore rename .zshrc => .config/zsh/.zshrc (97%) diff --git a/.config/zsh/.gitignore b/.config/zsh/.gitignore new file mode 100644 index 0000000..3faf4dd --- /dev/null +++ b/.config/zsh/.gitignore @@ -0,0 +1,4 @@ +/antigen/ +/log/ +/histfile +/.zcompdump* diff --git a/.zshrc b/.config/zsh/.zshrc similarity index 97% rename from .zshrc rename to .config/zsh/.zshrc index 5d7ca21..db1b269 100644 --- a/.zshrc +++ b/.config/zsh/.zshrc @@ -54,6 +54,7 @@ antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-autosuggestions antigen bundle Tarrasch/zsh-syntax-highlighting antigen bundle zsh-users/zsh-history-substring-search +antigen bundle mafredri/zsh-async antigen apply @@ -122,3 +123,4 @@ source "$DOTFILES/aliases" # Load some manual plugins source "$ZSH_DIR/plugins/sudo.zsh" source "$ZSH_DIR/plugins/fish-theme.zsh" +[ -f '/usr/share/fzf/key-bindings.zsh' ] && source /usr/share/fzf/key-bindings.zsh diff --git a/.profile b/.profile index 1f930b0..3154887 100644 --- a/.profile +++ b/.profile @@ -20,6 +20,10 @@ export VIMINIT=":so $MYVIMRC" export EDITOR="vim" export VISUAL="vim" + +# Allow ZSH to load from ~/.config/zsh +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" + export MANPAGER="less -+N" export TERMINAL="termite" export BROWSER="chromium" From 8edd378b66f6eb083bc0f0a3a98a730d7c667c08 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 11 Apr 2018 17:42:42 +0100 Subject: [PATCH 3/3] X11/xdg: migrate to XDG_CONFIG_DIR --- .Xresources | 96 ------------------------------- .xinitrc => .config/X11/xinitrc | 4 +- .config/X11/xresources | 89 ++++++++++++++++++++++++++++ .xsession => .config/X11/xsession | 0 .profile | 25 +++++--- aliases | 22 +++---- 6 files changed, 118 insertions(+), 118 deletions(-) delete mode 100644 .Xresources rename .xinitrc => .config/X11/xinitrc (79%) create mode 100644 .config/X11/xresources rename .xsession => .config/X11/xsession (100%) diff --git a/.Xresources b/.Xresources deleted file mode 100644 index f7c5637..0000000 --- a/.Xresources +++ /dev/null @@ -1,96 +0,0 @@ -!!============================================================================= -!! RXVT-unicode setting -!!============================================================================= - - -urxvt.depth: 32 - -urxvt.internalBorder: 4 -urxvt.blurRadius: 25 -urxvt.scrollBar: false -urxvt.saveLines: 10000 -urxvt.preeditType: Root -urxvt.jumpScroll: false -urxvt.altSendsEscape: true - -xterm.metaSendsEscape: true - -!Set TERM -urxvt.termName: xterm-256color - -Xft.dpi: 96 -Xft.antialias: true -Xft.rgba: rgb -Xft.autohint: false -Xft.hinting: true -Xft.hintstyle: hintfull -urxvt*font: xft:Sauce Code Pro:style=Regular:size=9 -urxvt*imFont: xft:Sauce Code Pro:style=Regular:size=9 -urxvt*boldFont: xft:Sauce Code Pro:style=Bold:size=9 -urxvt*italicFont: xft:Sauce Code Pro:style=Italic:size=9 -urxvt*boldItalicFont: xft:Sauce Code Pro:style=Bold,Italic:size=9 - - -! clickable Url and copy paste keys - -urxvt.iso14755: false -urxvt.iso14755_52: false -urxvt.perl-ext-common: default,clipboard,vtwheel,font-size -urxvt.keysym.Shift-Control-C: perl:clipboard:copy -urxvt.keysym.Shift-Control-V: perl:clipboard:paste -urxvt.url-launcher: /usr/bin/chromium -urxvt.matcher.button: 1 - -urxvt.keysym.C-Up: font-size:increase -urxvt.keysym.C-Down: font-size:decrease -urxvt.keysym.C-S-Up: font-size:incglobal -urxvt.keysym.C-S-Down: font-size:decglobal - -Xft.lcdfilter: lcddefault - -! special -*.foreground: #ECEFF1 -*.background: #002B36 -!*.cursorColor: #ECEFF1 -*.cursorColor: #5294E2 -*.highlightColor: #5294E2 -urxvt.background: [95]#383C4A -urxvt.scrollColor: #767B87 -urxvt*dynamicColors: on -urxvt*highlightSelection: true -urxvt*colorMode: on - -! black -*.color0: #333638 - -!white -*.color15: #eceff1 - -! gray -*.color7: #8b9396 -*.color8: #475760 - -! red -*.color1: #ff3f00 -*.color9: #ef5345 - -! green -*.color2: #8bc34a -*.color10: #9ccc65 - -! yellow -*.color3: #ffc107 -*.color11: #ffa000 - -! blue -*.color4: #0266f4 -*.color12: #3f86da - -! magenta -*.color5: #cc17cc -*.color13: #a56ecC - -! cyan -*.color6: #10aeba -*.color14: #5ddae2 - diff --git a/.xinitrc b/.config/X11/xinitrc similarity index 79% rename from .xinitrc rename to .config/X11/xinitrc index a149acb..cbc8f71 100644 --- a/.xinitrc +++ b/.config/X11/xinitrc @@ -12,7 +12,7 @@ if [ -d "$xinitdir" ]; then fi source ~/.profile -source ~/.xsession -xrdb -merge ~/.Xresources +source $XDG_CONFIG_HOME/X11/xsession +xrdb -merge $XDG_CONFIG_HOME/X11/xresources exec i3 diff --git a/.config/X11/xresources b/.config/X11/xresources new file mode 100644 index 0000000..5537092 --- /dev/null +++ b/.config/X11/xresources @@ -0,0 +1,89 @@ +! Colour order: +! black +! red +! green +! yellow +! blue +! magenta +! cyan +! white/gray + +! Normal colours +*.color0: #333638 +*.color1: #f41f1c +*.color2: #8bc34a +*.color3: #ffc107 +*.color4: #0266f4 +*.color5: #cc17cc +*.color6: #10aeba +*.color7: #8b9396 + +! Bright colours +*.color8: #475760 +*.color9: #e53727 +*.color10: #9ccc65 +*.color11: #ffa000 +*.color12: #81b3f9 +*.color13: #a56ecc +*.color14: #5ddae2 +*.color15: #eceff1 + + +Xft.dpi: 96 +Xft.antialias: true +Xft.rgba: rgb +Xft.hinting: true +Xft.hintstyle: hintfull +Xft.lcdfilter: lcddefault + + + +!!======================!! +!! RXVT-unicode setting !! +!!======================!! + +urxvt.depth: 32 +urxvt.internalBorder: 6 +urxvt.blurRadius: 25 +urxvt.saveLines: 10000 +urxvt.preeditType: Root + +urxvt.scrollBar: false +urxvt.jumpScroll: false +urxvt.scrollTtyOutput: false +urxvt.scrollWithBuffer: true +urxvt.scrollTtyKeypress: true + +urxvt.altSendsEscape: true +xterm.metaSendsEscape: true + +urxvt.termName: xterm-256color + +urxvt.font: xft:SauceCodePro Nerd Font:style=regular:size=9 +urxvt.imFont: xft:SauceCodePro Nerd Font:style=regular:size=9 +urxvt.boldFont: xft:SauceCodePro Nerd Font:style=bold:size=9 +urxvt.italicFont: xft:SauceCodePro Nerd Font:style=italic:size=9 +urxvt.boldItalicFont: xft:SauceCodePro Nerd Font:style=bold,italic:size=9 + + +urxvt.iso14755: false +urxvt.iso14755_52: false +urxvt.perl-ext-common: default,vtwheel,font-size +urxvt.url-launcher: /usr/bin/chromium +urxvt.matcher.button: 1 + +urxvt.keysym.C-Up: font-size:increase +urxvt.keysym.C-Down: font-size:decrease +urxvt.keysym.C-equal: font-size:reset +urxvt.keysym.C-slash: font-size:show + +! special +*.foreground: #ECEFF1 +*.background: #002B36 +*.cursorColor: #5294E2 +*.highlightColor: #5294E2 +urxvt.background: [95]#383C4A +urxvt.scrollColor: #767B87 +urxvt.dynamicColors: on +urxvt.highlightSelection: true +urxvt.colorMode: on diff --git a/.xsession b/.config/X11/xsession similarity index 100% rename from .xsession rename to .config/X11/xsession diff --git a/.profile b/.profile index 3154887..ff54fa6 100644 --- a/.profile +++ b/.profile @@ -2,34 +2,41 @@ export LC_ALL=en_GB.UTF-8 export LANG=en_GB.UTF-8 export LC_NUMERIC=en_GB -export CONFIG_DIR="$HOME/.config" -export XDG_CONFIG_HOME="$CONFIG_DIR" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" +export XDG_LOCAL_HOME="$HOME/.local" +export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open + case "$(basename "$(readlink -f /proc/$$/exe)")" in zsh) thisfile="$(readlink -f "${(%):-%N}")";; bash) thisfile="$(readlink -f "${BASH_SOURCE[0]}")";; *) thisfile="$(find /proc/$$/fd/ | xargs readlink -f | grep .profile | head -n1)";; esac -export DOTFILES="$(dirname "${thisfile:-$CONFIG_DIR/dotfiles}")" +export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles}")" export PATH="${PATH}:$DOTFILES/scripts" -export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open # Allow Vim to load from ~/.config/vim -export VIMDIR="$CONFIG_DIR/vim" +export VIMDIR="$XDG_CONFIG_HOME/vim" export MYVIMRC="$VIMDIR/vimrc" export VIMINIT=":so $MYVIMRC" - export EDITOR="vim" export VISUAL="vim" # Allow ZSH to load from ~/.config/zsh export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +# Configure X11 config file paths +export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" +export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +export XSESSION="$XDG_CONFIG_HOME/X11/xsession" + export MANPAGER="less -+N" export TERMINAL="termite" export BROWSER="chromium" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" export QT_QPA_PLATFORMTHEME=gtk2 -export GOPATH="$HOME/.cache/go" +export GOPATH="$XDG_LOCAL_HOME/go" exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; } @@ -52,9 +59,9 @@ if exists tput; then fi # Source secret keys and values into environment -if [ -f "$CONFIG_DIR/secrets" ]; then +if [ -f "$XDG_CONFIG_HOME/secrets" ]; then set -o allexport - source $CONFIG_DIR/secrets + source $XDG_CONFIG_HOME/secrets set +o allexport fi diff --git a/aliases b/aliases index 8b73914..28a310e 100644 --- a/aliases +++ b/aliases @@ -97,8 +97,8 @@ alias -s git="git clone --recursive" # Git Aliases alias g=git alias gignore='$EDITOR .gitignore' -alias gitc='$EDITOR ~/.config/git/config' -alias ggignore='$EDITOR ~/.config/git/gitignore' +alias gitc='$EDITOR $XDG_CONFIG_HOME/git/config' +alias ggignore='$EDITOR $XDG_CONFIG_HOME/git/gitignore' alias gcl="git clone --recursive" alias gco="git checkout" alias gcom="git checkout master" @@ -254,18 +254,18 @@ alias zp=zpool # General Aliases alias ssha='eval `ssh-agent` ; ssh-add' alias aliases="$EDITOR $DOTFILES/aliases ; exec zsh" -alias vimrc="$EDITOR $MYVIMRC" -alias zshrc="$EDITOR ~/.zshrc ; exec zsh" -alias gitrc="$EDITOR ~/.config/git/config" -alias xinitrc="$EDITOR ~/.xinitrc" -alias xresources="$EDITOR ~/.Xresources ; xrdb merge ~/.Xresources" -alias xsession="$EDITOR ~/.xsession" +alias vimrc="$EDITOR $VIMRC" +alias zshrc="$EDITOR ${ZDOTDIR:-$HOME}/.zshrc ; exec zsh" +alias gitrc="$EDITOR $XDG_CONFIG_HOME/git/config" +alias xinitrc="$EDITOR $XDG_CONFIG_HOME/X11/xinitrc" +alias xresources="$EDITOR $XDG_CONFIG_HOME/X11/xresources ; xrdb merge $XDG_CONFIG_HOME/X11/Xresources" +alias xsession="$EDITOR $XDG_CONFIG_HOME/X11/xsession" alias sshc="$EDITOR ~/.ssh/config" alias dotfiles="cd $DOTFILES" -alias i3c="$EDITOR ~/.config/i3/config ; i3-msg restart" -alias i3bc="$EDITOR ~/.config/i3/blocks/config ; i3-msg restart" +alias i3c="$EDITOR $XDG_CONFIG_HOME/i3/config ; i3-msg restart" +alias i3bc="$EDITOR $XDG_CONFIG_HOME/i3/blocks/config ; i3-msg restart" i3b() { - $EDITOR ~/.config/i3/blocks/$@ + $EDITOR $XDG_CONFIG_HOME/i3/blocks/$@ } alias sf=screenfetch alias nf=neofetch