From 927cdeccb64bdba1f3062a5a42eafd6c6d9df5d2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 27 Feb 2018 01:38:51 +0000 Subject: [PATCH 01/37] profile: add LESS/man output colours --- .profile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index b4ed5f4..9483fad 100644 --- a/.profile +++ b/.profile @@ -15,14 +15,28 @@ export VIMINIT=":so $MYVIMRC" export EDITOR="vim" export VISUAL="vim" -export LESS="-RNI" -export PAGER="less $LESS" 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 LESS="-RNI" +export PAGER="less $LESS" +export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green +export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan +export LESS_TERMCAP_me=$(tput sgr0) +export LESS_TERMCAP_so=$(tput bold; tput setaf 4) # blue +export LESS_TERMCAP_se=$(tput rmso; tput sgr0) +export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white +export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) +export LESS_TERMCAP_mr=$(tput rev) +export LESS_TERMCAP_mh=$(tput dim) +export LESS_TERMCAP_ZN=$(tput ssubm) +export LESS_TERMCAP_ZV=$(tput rsubm) +export LESS_TERMCAP_ZO=$(tput ssupm) +export LESS_TERMCAP_ZW=$(tput rsupm) + # Source secret keys and values into environment if [ -f "$CONFIG_DIR/secrets" ]; then set -o allexport From da3ff094356d69c46e7163db3d3f98b1c757a02d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 27 Feb 2018 01:39:49 +0000 Subject: [PATCH 02/37] aliases: add gitc alias for editing git config --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index c97eea2..e84ed96 100644 --- a/aliases +++ b/aliases @@ -93,6 +93,7 @@ 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 gcl="git clone --recursive" alias gco="git checkout" From 7c9ed10a00d0c379869943f6ed82cc01edaf4ea2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 14 Mar 2018 02:07:57 +0000 Subject: [PATCH 03/37] compton: don't shadow slop/maim --- .config/compton.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/compton.conf b/.config/compton.conf index 8cd53bb..bc85628 100644 --- a/.config/compton.conf +++ b/.config/compton.conf @@ -11,7 +11,7 @@ shadow-opacity = 0.65; # The translucency for shadows. (default .75) # shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0) # shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0) # shadow-blue = 0.0; # Blue color value of shadow. (0.0 - 1.0, defaults to 0) -#shadow-exclude = [ "n:e:Notification" ]; # Exclude conditions for shadows. +shadow-exclude = [ "class_g = 'slop'" ]; # Exclude conditions for shadows. shadow-ignore-shaped = false; # Avoid drawing shadow on all shaped windows # (see also: --detect-rounded-corners) @@ -50,10 +50,10 @@ backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typical # much faster but depends on a sane driver. mark-wmwin-focused = true; # Try to detect WM windows and mark them as active. mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus). -use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused +use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused # instead of using FocusIn/Out events. Usually more reliable but # depends on a EWMH-compliant WM. -detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. +detect-rounded-corners = true; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. detect-client-opacity = true; # Detect _NET_WM_OPACITY on client windows, useful for window # managers not passing _NET_WM_OPACITY of client windows to frame windows. refresh-rate = 0; # For --sw-opti: Specify refresh rate of the screen. 0 for auto. From 7b006d65ca3a24f1878af0503875189dc15ab337 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 14 Mar 2018 02:08:51 +0000 Subject: [PATCH 04/37] vim: remap completion to --- .config/vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 8174964..9347f62 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -98,6 +98,10 @@ set mouse=nicr nnoremap nnoremap +" Remap completion +inoremap +inoremap + let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] From c11c48422c26dc4f37acfe1ee320649108c62421 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 14 Mar 2018 02:09:24 +0000 Subject: [PATCH 05/37] aliases: add lsz for sorting by size --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index e84ed96..e6a18c9 100644 --- a/aliases +++ b/aliases @@ -14,6 +14,7 @@ alias l=ll alias ll="ls -lFh --group-directories-first" alias la="ls -lAFh --group-directories-first" alias lt='ls -lAFh --sort=time' +alias lsz='ls -lAFh --sort=size' alias al=la # No, I don't need the Mono Assembly Linker alias md="mkdir -p" From a56610b939354546951fb0d07e2ef0de3d8b21b2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 14 Mar 2018 02:15:49 +0000 Subject: [PATCH 06/37] aliases: add gcmst for committing with autostash --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index e6a18c9..b71bf1d 100644 --- a/aliases +++ b/aliases @@ -105,6 +105,7 @@ alias gaa="ga -A" alias grm="git rm" alias gc="git commit" alias gcm="gc -m" +gcmst() { git stash -u -k && git commit -m "$1" && git stash pop; } alias gca="git commit --amend" alias gcan="git commit --amend --no-edit" alias gcam="git commit --amend -m" From 9c3b1aa3b01316b099299d5c444b62dfa0928d0c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 14 Mar 2018 02:16:24 +0000 Subject: [PATCH 07/37] rofi-emoji: add skin-tone modifiers --- scripts/rofi-emoji | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/rofi-emoji b/scripts/rofi-emoji index 3618201..90e695b 100755 --- a/scripts/rofi-emoji +++ b/scripts/rofi-emoji @@ -34,6 +34,7 @@ URLS=( 'https://emojipedia.org/objects/' 'https://emojipedia.org/symbols/' 'https://emojipedia.org/flags/' + 'https://emojipedia.org/modifiers/' ) From fafe922fff0f8d2773f2e577036f1c4fb7b911d6 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 15 Mar 2018 16:48:18 +0000 Subject: [PATCH 08/37] Relocate acme.sh configuration/logs to .config --- aliases | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aliases b/aliases index b71bf1d..b9b2fca 100644 --- a/aliases +++ b/aliases @@ -58,6 +58,8 @@ alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" alias grip='grip --user=frebib --pass=$GRIP_API_KEY' +alias acme.sh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' +alias acmesh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' which gopass &>/dev/null && alias pass='gopass' alias abuild='docker run -ti --rm \ -e USER \ From 3c875bc0c8d9ec212e3ae3b421390d8bbd0e2f1c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Mar 2018 12:55:56 +0000 Subject: [PATCH 09/37] aliases: add NO global alias for muting stdout --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index b9b2fca..cc98c05 100644 --- a/aliases +++ b/aliases @@ -31,6 +31,7 @@ alias -g C="| wc -l" alias -g S="| sort" alias -g U="| uniq" alias -g count="| wc -l" +alias -g NO="1> /dev/null" alias -g NE="2> /dev/null" alias -g NUL="&> /dev/null" alias -g BG="&;disown" From 151c74bb3f025a44f2d33f624d668b0597031609 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 26 Mar 2018 18:35:23 +0100 Subject: [PATCH 10/37] Use POSIX standard for nullifying stdout/stderr --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index cc98c05..c06c6e0 100644 --- a/aliases +++ b/aliases @@ -61,7 +61,7 @@ alias ssh="ssh -tt" alias grip='grip --user=frebib --pass=$GRIP_API_KEY' alias acme.sh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' alias acmesh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' -which gopass &>/dev/null && alias pass='gopass' +which gopass 1>/dev/null 2>/dev/null && alias pass='gopass' alias abuild='docker run -ti --rm \ -e USER \ -e PWD \ From 4d623f711912b5de4aafc5b41f9187949a4c09a6 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 26 Mar 2018 18:35:46 +0100 Subject: [PATCH 11/37] aliases: update abuild alias --- aliases | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aliases b/aliases index c06c6e0..4685f6d 100644 --- a/aliases +++ b/aliases @@ -65,11 +65,10 @@ which gopass 1>/dev/null 2>/dev/null && alias pass='gopass' alias abuild='docker run -ti --rm \ -e USER \ -e PWD \ + -e HOME \ -w $PWD \ -v $PWD:$PWD \ - -v ~/.abuild:/home/$USER/.abuild \ - -v ~/.config/git:/home/$USER/.config/git:ro \ - -v ~/.gnupg:/home/$USER/.gnupg \ + -v ~/.abuild:$HOME/.abuild \ frebib/alpine-sdk:edge abuild' # System aliases From ce1b6bdffc1504eff80dd9c0177784ad4d7ecd90 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 10:15:16 +0100 Subject: [PATCH 12/37] git/config: update email & cleanup --- .config/git/config | 50 ++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/.config/git/config b/.config/git/config index 52e1148..d4ee07a 100644 --- a/.config/git/config +++ b/.config/git/config @@ -1,32 +1,38 @@ [user] name = Joe Groocock - email = frebib@gmail.com + email = me@frebib.net signingkey = CFBB6A86 -[commit] - gpgsign = true -[color] - ui = auto -[alias] - verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr - pushall = !git remote | xargs -L1 git push -[rebase] - autoStash = true -[push] - default = upstream -[advice] - statusHints = false - pushUpdateRejected = false -[pull] - rebase = true [core] autocrlf = input excludesfile = /home/frebib/.config/git/gitignore +[commit] + gpgsign = true +[push] + default = upstream +[pull] + rebase = true +[rebase] + autoStash = true +[color] + ui = auto +[log] + date = relative +[format] + pretty = format:%h %Cblue%ad%Creset %ae %Cgreen%s%Creset +[alias] + verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr + pushall = !git remote | xargs -L1 git push + count = !echo $(pwd) && git rev-list HEAD --count + unpushed = !git log --oneline @{u}..HEAD +[advice] + statusHints = false + pushUpdateRejected = false [diff] algorithm = patience [sendemail] - from = Joe Groocock - smtpserver = smtp.gmail.com - smtpuser = frebib@gmail.com - smtpencryption = tls - smtpserverport = 587 + from = Joe Groocock + smtpserver = smtp.zoho.com + smtpuser = me@frebib.net + smtpencryption = ssl + smtpserverport = 465 suppresscc = self From 0623fdb4eacdfb95ee274fe7d7dcb412a978ddec Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:09:44 +0100 Subject: [PATCH 13/37] profile: dynamically calculate DOTFILES directory --- .profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.profile b/.profile index 9483fad..7c657f5 100644 --- a/.profile +++ b/.profile @@ -4,7 +4,7 @@ export LC_NUMERIC=en_GB export CONFIG_DIR="$HOME/.config" export XDG_CONFIG_HOME="$CONFIG_DIR" -export DOTFILES="$CONFIG_DIR/dotfiles" +export DOTFILES="$(dirname "$(readlink -m "$0")")" export PATH="${PATH}:$DOTFILES/scripts" export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open From 5a6795c8e30845cd86a611c132ebab5e89438aa7 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:10:36 +0100 Subject: [PATCH 14/37] profile: add GOPATH --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index 7c657f5..006a8a8 100644 --- a/.profile +++ b/.profile @@ -20,6 +20,7 @@ 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 LESS="-RNI" export PAGER="less $LESS" From c2dc82c1ccf1bea7fa8c4b65c2015359f3530a55 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:15:56 +0100 Subject: [PATCH 15/37] profile: add progexists function, deduplicating which --- .profile | 36 ++++++++++++++++++++---------------- .zshrc | 9 +++++---- aliases | 2 +- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.profile b/.profile index 006a8a8..b767732 100644 --- a/.profile +++ b/.profile @@ -22,21 +22,25 @@ export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.su export QT_QPA_PLATFORMTHEME=gtk2 export GOPATH="$HOME/.cache/go" +exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; } + export LESS="-RNI" export PAGER="less $LESS" -export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green -export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan -export LESS_TERMCAP_me=$(tput sgr0) -export LESS_TERMCAP_so=$(tput bold; tput setaf 4) # blue -export LESS_TERMCAP_se=$(tput rmso; tput sgr0) -export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white -export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) -export LESS_TERMCAP_mr=$(tput rev) -export LESS_TERMCAP_mh=$(tput dim) -export LESS_TERMCAP_ZN=$(tput ssubm) -export LESS_TERMCAP_ZV=$(tput rsubm) -export LESS_TERMCAP_ZO=$(tput ssupm) -export LESS_TERMCAP_ZW=$(tput rsupm) +if exists tput; then + export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green + export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan + export LESS_TERMCAP_me=$(tput sgr0) + export LESS_TERMCAP_so=$(tput bold; tput setaf 4) # blue + export LESS_TERMCAP_se=$(tput rmso; tput sgr0) + export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white + export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) + export LESS_TERMCAP_mr=$(tput rev) + export LESS_TERMCAP_mh=$(tput dim) + export LESS_TERMCAP_ZN=$(tput ssubm) + export LESS_TERMCAP_ZV=$(tput rsubm) + export LESS_TERMCAP_ZO=$(tput ssupm) + export LESS_TERMCAP_ZW=$(tput rsupm) +fi # Source secret keys and values into environment if [ -f "$CONFIG_DIR/secrets" ]; then @@ -46,17 +50,17 @@ if [ -f "$CONFIG_DIR/secrets" ]; then fi # Merge system clipboards -if [ -n "$DISPLAY" ] && which autocutsel >/dev/null 2>&1; then +if [ -n "$DISPLAY" ] && exists autocutsel; then autocutsel -fork autocutsel -selection PRIMARY -fork fi -if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && which dbus-launch >/dev/null 2>&1; then +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && exists dbus-launch; then eval $(dbus-launch --sh-syntax --exit-with-session) dbus-update-activation-environment --systemd DISPLAY fi # Start the gnome-keyring if it's installed -if which gnome-keyring-daemon >/dev/null 2>&1; then +if exists gnome-keyring-daemon; then export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) fi diff --git a/.zshrc b/.zshrc index 8cad46c..4849327 100644 --- a/.zshrc +++ b/.zshrc @@ -13,8 +13,10 @@ HISTFILE="$ZSH_DIR/histfile" HISTSIZE=999999 SAVEHIST=999999 +exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; } + # Only set tty if running interactively -if tty -s; then +if exists tty && tty -s; then # Resolve at shell runtime export GPG_TTY="$(tty)" fi @@ -23,13 +25,12 @@ fi setopt sharehistory histignorealldups histignorespace histreduceblanks setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak - # Completion initialisation autoload -U compinit ; compinit autoload -U bashcompinit ; bashcompinit # gopass completion -if gopass --help &>/dev/null; then +if exists gopass; then source <(gopass completion bash) fi @@ -44,7 +45,7 @@ zstyle ':compinstall' filename "$HOME/.zshrc" # Load antigen & plugins antigen_src="$ZSH_DIR/antigen.zsh" if [ ! -f "$antigen_src" ]; then - if which curl &>/dev/null; then + if exists curl; then getcmd='curl -L' else getcmd='wget -qO-' diff --git a/aliases b/aliases index 4685f6d..945ad46 100644 --- a/aliases +++ b/aliases @@ -61,7 +61,7 @@ alias ssh="ssh -tt" alias grip='grip --user=frebib --pass=$GRIP_API_KEY' alias acme.sh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' alias acmesh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' -which gopass 1>/dev/null 2>/dev/null && alias pass='gopass' +exists gopass && alias pass='gopass' alias abuild='docker run -ti --rm \ -e USER \ -e PWD \ From 91cb7ea620007b410e445ed371a8d5f31b5c7f6b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:17:28 +0100 Subject: [PATCH 16/37] vimrc: enable spell-checking for Tex --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 9347f62..632140f 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -200,3 +200,4 @@ cmap w!! w !sudo tee > /dev/null % autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et autocmd FileType tex silent VimtexCompile +autocmd FileType tex setlocal spell From 209ce198f33f08ec2c3bca380d3b3567f4aa872e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:17:58 +0100 Subject: [PATCH 17/37] powermenu: add hibernate option --- .config/i3/powermenu.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/i3/powermenu.sh b/.config/i3/powermenu.sh index 015327c..3672c5d 100755 --- a/.config/i3/powermenu.sh +++ b/.config/i3/powermenu.sh @@ -1,17 +1,18 @@ #!/bin/bash -option=$(echo " lock| logout| sleep| power off| reboot| windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 6 -location 3 -tokenize false -matching normal | xargs) +option=$(echo " lock| logout| sleep| hibernate| power off| reboot| windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 6 -location 3 -tokenize false -matching normal | xargs) case $option in lock) ./lock.sh;; logout) i3-msg exit;; sleep) systemctl suspend;; + hibernate) systemctl hibernate;; power\ off) systemctl poweroff;; reboot) systemctl reboot;; windows) windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4` sudo efibootmgr -n $windows - systemctl reboot;; + sudo hibereboot;; esac exit 0 From 70fd8c5d742ed6d1bafd7497e237c7aaeee45ff4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:18:48 +0100 Subject: [PATCH 18/37] i3/config: start shell after mod+# decryption --- .config/i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index 3d347e0..afdbdf6 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -168,7 +168,7 @@ bindsym $mod+Shift+e exec rofi-emoji bindsym --release Print exec imgur-screenshot bindsym --release $mod+Print exec imgur-screenshot -f bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks -bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ &&\ read'" +bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ \;\ $SHELL'" bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"$LINK\\"" # Media player controls From 173b41ea4dd759a8583f6d0fc1e6235df8716f25 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:19:08 +0100 Subject: [PATCH 19/37] i3/config: add mod+r password-generator --- .config/i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/i3/config b/.config/i3/config index afdbdf6..4679bf5 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -169,6 +169,7 @@ bindsym --release Print exec imgur-screenshot bindsym --release $mod+Print exec imgur-screenshot -f bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ \;\ $SHELL'" +bindsym $mod+r exec "bash -c 'pwgen -nc 32 1 | tee >(xargs notify-send Generated\ password\:) | xclip -i'" bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"$LINK\\"" # Media player controls From 5f4f9cc0f5489c12b4ad4a0901c699914d489da2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:22:23 +0100 Subject: [PATCH 20/37] i3b/updates: add trizen to package manager list --- .config/i3/blocks/updates | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/i3/blocks/updates b/.config/i3/blocks/updates index 9da2fb7..e9a8cc0 100755 --- a/.config/i3/blocks/updates +++ b/.config/i3/blocks/updates @@ -1,7 +1,7 @@ #!/bin/bash set -e -for p in pacaur yaourt pacman; do +for p in trizen pacaur yaourt pacman; do if $p --version &>/dev/null; then PAC="$p" break; @@ -13,7 +13,7 @@ if [ -z "$PAC" ]; then fi if [ "$BLOCK_BUTTON" == 1 ]; then - nohup i3-sensible-terminal -r i3blocks-update-term -e "sh -c '$PAC -Syu; pkill -RTMIN+5 i3blocks'" &>/dev/null & + nohup i3-sensible-terminal -r i3blocks-update-term -e "sh -c '$PAC -Syu || exec zsh; pkill -RTMIN+5 i3blocks'" &>/dev/null & disown fi From c2b74ccefdc74c8bb5cceea64296d39f00276c3b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:36:43 +0100 Subject: [PATCH 21/37] aliases: assume acme.sh in XDG_CONFIG_HOME --- aliases | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases b/aliases index 945ad46..7ad80ee 100644 --- a/aliases +++ b/aliases @@ -59,8 +59,8 @@ alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" alias grip='grip --user=frebib --pass=$GRIP_API_KEY' -alias acme.sh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' -alias acmesh='acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' +alias acme.sh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' +alias acmesh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' exists gopass && alias pass='gopass' alias abuild='docker run -ti --rm \ -e USER \ From 8123d9499c876c95e0ef5bf779f5e889d8471f1c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:46:24 +0100 Subject: [PATCH 22/37] vim: ignore more viminf* tmp files --- .config/vim/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/.gitignore b/.config/vim/.gitignore index 1a49755..3bd6b88 100644 --- a/.config/vim/.gitignore +++ b/.config/vim/.gitignore @@ -2,5 +2,6 @@ /spell/ /swapfiles/ /viminfo +/viminf*.tmp /vim-latex /.netrwhist From 96919ff7605b8dac24a20cb811b89250e2c0dc0b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:49:21 +0100 Subject: [PATCH 23/37] termite: clean-up colour configuration --- .config/termite/config | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/.config/termite/config b/.config/termite/config index 9bdf2f1..d4257ed 100644 --- a/.config/termite/config +++ b/.config/termite/config @@ -10,30 +10,34 @@ foreground = #ECEFF1 background = rgba(56, 60, 74, 0.95) highlight = #5294E2 -# black +# Colour order: +# black +# red +# green +# yellow +# blue +# magenta +# cyan +# white/gray + +# Normal colours 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 = #81b3f9 -# magenta color5 = #cc17cc -color13 = #a56ecc -# cyan color6 = #10aeba +color7 = #8b9396 + +# Bright colours +color8 = #475760 +color9 = #ef5345 +color10 = #9ccc65 +color11 = #ffa000 +color12 = #81b3f9 +color13 = #a56ecc color14 = #5ddae2 +color15 = #eceff1 # vim: ft=dosini cms=#%s From c8eb0184f0274150f6bb008047ff85c5b9523151 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:49:48 +0100 Subject: [PATCH 24/37] termite: increase scrollback amount by 10x --- .config/termite/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/termite/config b/.config/termite/config index d4257ed..24de1ed 100644 --- a/.config/termite/config +++ b/.config/termite/config @@ -1,6 +1,6 @@ [options] font = SauceCodePro 9 -scrollback_lines = 100000 +scrollback_lines = 1000000 cursor_blink = off size_hints = true From 29d4bbae7b6f9f01508f568b4e294fe21fb9f12e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:53:27 +0100 Subject: [PATCH 25/37] i3b/iface: add clipboard insertion of IPs on click --- .config/i3/blocks/iface | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/i3/blocks/iface b/.config/i3/blocks/iface index 4b49830..f597580 100755 --- a/.config/i3/blocks/iface +++ b/.config/i3/blocks/iface @@ -51,6 +51,10 @@ LOCIP=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$ #------------------------------------------------------------------------ case $BLOCK_BUTTON in - 1) curl -s https://api.ipify.org;; - *) echo "$LOCIP";; + 1) curl -s https://api.ipify.org; + break;; + 2) curl -s https://api.ipify.org | tee >(xclip -i); + break;; + *) echo "$LOCIP" | tee >(xclip -i); + break;; esac From 61ca5b014bc41a348df60fc7d9d31033778a5717 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:54:40 +0100 Subject: [PATCH 26/37] vim: use darker grey for whitespace --- .config/vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 632140f..762b7cb 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -49,7 +49,7 @@ set guioptions= " Whitespace highlight settings set list set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< -highlight SpecialKey ctermfg=7 +highlight SpecialKey ctermfg=8 " set the runtime path to include Vundle and initialize From 5c8faae56d142c19681170cd0bd608ff21f9ff6d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 12:15:20 +0100 Subject: [PATCH 27/37] vim: only autosave for existing files --- .config/vim/vimrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 762b7cb..bd418bb 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -34,8 +34,13 @@ set scrolloff=6 set nojoinspaces " Autosave settings +function SaveIfExist() + if @% != "" && filereadable(@%) + write + endif +endfunction set autowrite -autocmd InsertLeave * save +autocmd InsertLeave * call SaveIfExist() " Search options set hlsearch From 0f019287774ea9c00ca7834fb311df08b6699b51 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 12:16:30 +0100 Subject: [PATCH 28/37] vim: add column at 80 chars for C-like filetypes --- .config/vim/vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index bd418bb..97236e9 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -56,6 +56,12 @@ set list set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< highlight SpecialKey ctermfg=8 +if exists('+colorcolumn') + highlight ColorColumn ctermbg=8 + autocmd filetype c,h,cpp,hpp set colorcolumn=81 + autocmd filetype c,h,cpp,hpp match ErrorMsg '\%>80v.\+' +endif + " set the runtime path to include Vundle and initialize set rtp+=~/.config/vim/bundle/Vundle.vim From f2883972312227cc62279c244b807f69ba74d214 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 14:00:57 +0100 Subject: [PATCH 29/37] profile: intelligently determine .profile abs path --- .profile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.profile b/.profile index b767732..1b57803 100644 --- a/.profile +++ b/.profile @@ -4,7 +4,12 @@ export LC_NUMERIC=en_GB export CONFIG_DIR="$HOME/.config" export XDG_CONFIG_HOME="$CONFIG_DIR" -export DOTFILES="$(dirname "$(readlink -m "$0")")" +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 PATH="${PATH}:$DOTFILES/scripts" export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open From 593f39fff3a822f1ab268791e4ef4a47bc714438 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 15:57:51 +0100 Subject: [PATCH 30/37] git/config: improve git-diff colours with diff-so-fancy --- .config/git/config | 29 ++++++++++++++++++++++++----- .config/termite/config | 4 ++-- .profile | 2 +- aliases | 12 +++++------- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.config/git/config b/.config/git/config index d4ee07a..94bf786 100644 --- a/.config/git/config +++ b/.config/git/config @@ -4,7 +4,8 @@ signingkey = CFBB6A86 [core] autocrlf = input - excludesfile = /home/frebib/.config/git/gitignore + excludesfile = $HOME/.config/git/gitignore + pager = diff-so-fancy | less [commit] gpgsign = true [push] @@ -13,8 +14,6 @@ rebase = true [rebase] autoStash = true -[color] - ui = auto [log] date = relative [format] @@ -27,8 +26,6 @@ [advice] statusHints = false pushUpdateRejected = false -[diff] - algorithm = patience [sendemail] from = Joe Groocock smtpserver = smtp.zoho.com @@ -36,3 +33,25 @@ smtpencryption = ssl smtpserverport = 465 suppresscc = self +[diff] + algorithm = patience +[interactive] + diffFilter = diff-so-fancy --patch-mode +[color] + ui = true +[color "diff"] + meta = cyan + frag = magenta + commit = yellow + old = red + new = green + whitespace = red 88 reverse +[color "diff-highlight"] + oldNormal = red + oldHighlight = red 88 + newNormal = green + newHighlight = green 22 +[diff-so-fancy] + changeHunkIndicators = false + +# vim: noet diff --git a/.config/termite/config b/.config/termite/config index 24de1ed..19f2e23 100644 --- a/.config/termite/config +++ b/.config/termite/config @@ -22,7 +22,7 @@ highlight = #5294E2 # Normal colours color0 = #333638 -color1 = #ff3f00 +color1 = #f41f1c color2 = #8bc34a color3 = #ffc107 color4 = #0266f4 @@ -32,7 +32,7 @@ color7 = #8b9396 # Bright colours color8 = #475760 -color9 = #ef5345 +color9 = #e53727 color10 = #9ccc65 color11 = #ffa000 color12 = #81b3f9 diff --git a/.profile b/.profile index 1b57803..437713a 100644 --- a/.profile +++ b/.profile @@ -29,7 +29,7 @@ export GOPATH="$HOME/.cache/go" exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; } -export LESS="-RNI" +export LESS="-RI" export PAGER="less $LESS" if exists tput; then export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green diff --git a/aliases b/aliases index 7ad80ee..cfbd5d8 100644 --- a/aliases +++ b/aliases @@ -92,7 +92,6 @@ alias -s gz="tar tf" alias -s jar="java -jar" alias -s git="git clone --recursive" - # Git Aliases alias g=git alias gignore='$EDITOR .gitignore' @@ -102,7 +101,7 @@ alias gcl="git clone --recursive" alias gco="git checkout" alias gcom="git checkout master" alias ga="git add" -alias gap="git -c interactive.diffFilter=\"git diff --color-words\" add -p" +alias gap="git add -p" alias gaa="ga -A" alias grm="git rm" alias gc="git commit" @@ -130,14 +129,13 @@ alias glp="gl && gp" gd() { local commit=$1 if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then - git diff --color-words $@ - return + git diff $@ else - git diff --color-words "@~${commit:1}^!" + git diff "@~${commit:1}^!" fi } -alias gds="git diff --staged --color-words" -alias gsh="git show --color-words" +alias gds="git diff --staged" +alias gsh="git show" alias glg="git log --stat --color" alias glog="git log --oneline --decorate --color --graph" From dfda38ffab405ec929397f7bdf17b7226626eafe Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 16:09:57 +0100 Subject: [PATCH 31/37] compton: fix stacked transparent windows in i3 --- .config/compton.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/compton.conf b/.config/compton.conf index bc85628..793452d 100644 --- a/.config/compton.conf +++ b/.config/compton.conf @@ -22,6 +22,9 @@ active-opacity = 1.0; # Default opacity for active windows. (0.0 - 1.0) frame-opacity = 1.0; # Opacity of window titlebars and borders. (0.1 - 1.0) inactive-opacity-override = true; # Let inactive opacity set by 'inactive-opacity' overrides # value of _NET_WM_OPACITY. Bad choice. +opacity-rule = [ + "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" +]; alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasing # it may result in less X resource usage, # Yet f ading may look bad. From 761c84863e8172a580fc12ab7ecea3c85f754844 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 15:59:41 +0100 Subject: [PATCH 32/37] i3b/iface: fix repeated xclip invocation --- .config/i3/blocks/iface | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/i3/blocks/iface b/.config/i3/blocks/iface index f597580..c3219fa 100755 --- a/.config/i3/blocks/iface +++ b/.config/i3/blocks/iface @@ -55,6 +55,8 @@ case $BLOCK_BUTTON in break;; 2) curl -s https://api.ipify.org | tee >(xclip -i); break;; - *) echo "$LOCIP" | tee >(xclip -i); + 0|3) echo "$LOCIP" | tee >(xclip -i); + break;; + *) echo "$LOCIP" break;; esac From e294810914ff49898c5935201d0e0d41824e710f Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 16:00:15 +0100 Subject: [PATCH 33/37] vim: add tagbar, nerdtree & various latex configuration --- .config/vim/vimrc | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 97236e9..58dc008 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -71,14 +71,17 @@ call vundle#rc('~/.config/vim/bundle') Plugin 'VundleVim/Vundle.vim' Plugin 'Valloric/YouCompleteMe' Plugin 'scrooloose/syntastic' +Plugin 'scrooloose/nerdtree' Plugin 'tpope/vim-sensible' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-rhubarb' Plugin 'tpope/vim-abolish' +Plugin 'majutsushi/tagbar' Plugin 'airblade/vim-gitgutter' Plugin 'ryanoasis/vim-devicons' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' +Plugin 'chr4/nginx.vim' Plugin 'PotatoesMaster/i3-vim-syntax' Plugin 'lervag/vimtex' Plugin 'JamshedVesuna/vim-markdown-preview' @@ -90,6 +93,15 @@ let g:use_dvorak = 1 " YouCompleteMe config let g:ycm_confirm_extra_conf = 0 +if !exists('g:ycm_semantic_triggers') + let g:ycm_semantic_triggers = {} +endif +let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme +"let g:vimtex_view_method='zathura' +let g:tex_flavor='latex' +autocmd FileType tex silent VimtexCompile +autocmd FileType tex setlocal spell +autocmd FileType tex TagbarOpen " Vim-Airline config let g:Powerline_symbols = 'fancy' @@ -103,6 +115,20 @@ let vim_markdown_preview_browser='Chromium' let vim_markdown_preview_use_xdg_open=1 let vim_markdown_preview_github=1 +" Syntastic configuration +let g:syntastic_enable_highlighting = 1 +let g:syntastic_enable_signs=1 +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 + +" Tagbar configuration +let g:tagbar_width = 50 +let g:tagbar_compact = 1 +let g:tagbar_show_linenumbers = 1 +let g:tagbar_singleclick = 1 +let g:tagbar_autopreview = 1 " Disable mouse set mouse=nicr @@ -121,6 +147,10 @@ for prefix in ['n', 'v'] endfor endfor +" Source: https://github.com/ChrisLane/dotfiles/blob/1f5efd44e1b78224568645eaec2e6e243959c0a9/.vimrc#L66 +" Remove whitespace at end of lines with F5 +:nnoremap :let _s=@/ :%s/\s\+$//e :let @/=_s :nohl :unlet _s + " Dvorak Hackery " Source: https://github.com/sporkbox/vimrc/blob/master/vimrc if (exists("g:use_dvorak") && g:use_dvorak == 1) @@ -210,5 +240,3 @@ cmap w!! w !sudo tee > /dev/null % autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et -autocmd FileType tex silent VimtexCompile -autocmd FileType tex setlocal spell From 423c9a7d013a638c5f2fa24247067adb66d2b41b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 30 Mar 2018 10:49:33 +0100 Subject: [PATCH 34/37] profile: only start autocutsel if it's not running --- .profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.profile b/.profile index 437713a..1f930b0 100644 --- a/.profile +++ b/.profile @@ -55,7 +55,7 @@ if [ -f "$CONFIG_DIR/secrets" ]; then fi # Merge system clipboards -if [ -n "$DISPLAY" ] && exists autocutsel; then +if [ -n "$DISPLAY" ] && exists autocutsel && ! pidof autocutsel 1>/dev/null; then autocutsel -fork autocutsel -selection PRIMARY -fork fi From 6129bb679475eb691fdafb9e23277cc535341b2e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 30 Mar 2018 10:52:23 +0100 Subject: [PATCH 35/37] vim: add vim-surround and vim-repeat --- .config/vim/vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 58dc008..bd2ccc8 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -76,6 +76,8 @@ Plugin 'tpope/vim-sensible' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-rhubarb' Plugin 'tpope/vim-abolish' +Plugin 'tpope/vim-surround' +Plugin 'tpope/vim-repeat' Plugin 'majutsushi/tagbar' Plugin 'airblade/vim-gitgutter' Plugin 'ryanoasis/vim-devicons' From 9a37bbb4c1c3c3078910ff00d52ef794a7d38b01 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 30 Mar 2018 14:44:32 +0100 Subject: [PATCH 36/37] vim: improve autosave events, fix re-sourcing --- .config/vim/vimrc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index bd2ccc8..2781b31 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -32,15 +32,16 @@ set autoread set showmatch set scrolloff=6 set nojoinspaces +set updatetime=500 " reduce delay from 4s default " Autosave settings -function SaveIfExist() - if @% != "" && filereadable(@%) +function! SaveIfExist() + if @% != "" && filereadable(@%) && !&readonly write endif endfunction set autowrite -autocmd InsertLeave * call SaveIfExist() +autocmd CursorHold,CursorHoldI,InsertLeave,FocusLost * call SaveIfExist() " Search options set hlsearch @@ -233,10 +234,10 @@ endif " Save aliases. noremap q :wq -com W w -com Q q -com Wq wq -com WQ wq +com! W w +com! Q q +com! Wq wq +com! WQ wq " Write with sudo cmap w!! w !sudo tee > /dev/null % From eb161668733f318942b27c698d9c63031d24a19a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 30 Mar 2018 14:44:49 +0100 Subject: [PATCH 37/37] vim: add vim-commentary for easy comments --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 2781b31..4e016a3 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -79,6 +79,7 @@ Plugin 'tpope/vim-rhubarb' Plugin 'tpope/vim-abolish' Plugin 'tpope/vim-surround' Plugin 'tpope/vim-repeat' +Plugin 'tpope/vim-commentary' Plugin 'majutsushi/tagbar' Plugin 'airblade/vim-gitgutter' Plugin 'ryanoasis/vim-devicons'