From c427ac3370ae8be52fefb9f380a7820fbaf88528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 11 Jun 2019 06:28:58 +0200 Subject: [PATCH] Various --- config/pulse/client.conf | 1 - config/shell/commonenv | 8 ++++++++ config/shell/commonrc | 2 +- config/shell/shenv | 26 +++++++++++++++++++------- config/shell/zshrc | 2 +- config/vim/vimconfig | 15 ++++++++++++++- 6 files changed, 43 insertions(+), 11 deletions(-) diff --git a/config/pulse/client.conf b/config/pulse/client.conf index 20252aa..199bd83 100644 --- a/config/pulse/client.conf +++ b/config/pulse/client.conf @@ -1,2 +1 @@ -auth-cookie = .config/pulse/esd-auth-cookie cookie-file = .config/pulse/pulse-cookie diff --git a/config/shell/commonenv b/config/shell/commonenv index 3da0b9c..20ad15c 100644 --- a/config/shell/commonenv +++ b/config/shell/commonenv @@ -5,4 +5,12 @@ # export TIME_STYLE='+%Y-%m-%d %H:%M:%S' +export LESS=-R +export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink +export LESS_TERMCAP_md=$'\E[1;36m' # begin bold +export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink +export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video +export LESS_TERMCAP_se=$'\E[0m' # reset reverse video +export LESS_TERMCAP_us=$'\E[1;32m' # begin underline +export LESS_TERMCAP_ue=$'\E[0m' # reset underline eval $(dircolors --sh) diff --git a/config/shell/commonrc b/config/shell/commonrc index 257768d..4d5d4e9 100644 --- a/config/shell/commonrc +++ b/config/shell/commonrc @@ -14,7 +14,7 @@ HISTFILE="$HOME/.cache/shell_history" # Completion for existing commands alias cp="cp -i --reflink=auto" -alias grep="grep --color=tty" +alias grep="grep --color=auto" alias dd='dd status=progress' alias rm='rm -v --one-file-system' alias free='free -m' diff --git a/config/shell/shenv b/config/shell/shenv index 8f1fa8b..de6f648 100644 --- a/config/shell/shenv +++ b/config/shell/shenv @@ -87,21 +87,33 @@ appendpath() { *:"$1":*) ;; *) - # TODO Reverse order: I want the latest ones to supersedes the older ones export PATH="${PATH:+$PATH:}$1" ;; esac } -appendpath '/usr/lib/ccache/bin' -appendpath "${GOPATH}/bin" -appendpath "$HOME/.local/bin" -appendpath "$HOME/.config/scripts" +prependpath() { + if [ ! -d "$1" ]; then + return + fi + case ":$PATH:" in + *:"$1":*) ;; + + *) + export PATH="$1${PATH:+:$PATH}" + ;; + esac +} + +prependpath '/usr/lib/ccache/bin' +prependpath "${GOPATH}/bin" +prependpath "$HOME/.local/bin" +prependpath "$HOME/.config/scripts" # If running on termux, load those extra scripts [ -d /data/data/com.termux/ ] && ( - appendpath "$HOME/.termux/scripts" - appendpath "$HOME/.termux/bin" + prependpath "$HOME/.termux/scripts" + prependpath "$HOME/.termux/bin" ) # For superseding commands with better ones if they are present diff --git a/config/shell/zshrc b/config/shell/zshrc index bf274a5..a2cab16 100644 --- a/config/shell/zshrc +++ b/config/shell/zshrc @@ -169,7 +169,7 @@ chpwd() { print -l $PWD ${(u)dirstack} >$DIRSTACKFILE } -DIRSTACKSIZE=100 +DIRSTACKSIZE=20 setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME setopt PUSHD_IGNORE_DUPS # Remove duplicate entries diff --git a/config/vim/vimconfig b/config/vim/vimconfig index bfb4bf7..97078df 100644 --- a/config/vim/vimconfig +++ b/config/vim/vimconfig @@ -1,5 +1,7 @@ """ VIM SETTINGS """ +" From https://www.hillelwayne.com/post/intermediate-vim/ + set encoding=utf-8 set title @@ -11,6 +13,9 @@ set scrolloff=10 set ignorecase set smartcase +if has('nvim') + set inccommand=nosplit " Shows you in realtime what changes your ex command should make. +endif set incsearch @@ -27,12 +32,20 @@ set backspace=indent,eol,start set hidden set updatetime=250 +set lazyredraw " Do not redraw screen in the middle of a macro. Makes them complete faster. set cursorcolumn set splitbelow -set number relativenumber +" Turn off relativenumber only for insert mode. +if has('nvim') + augroup every + autocmd! + au InsertEnter * set norelativenumber + au InsertLeave * set relativenumber + augroup END +endif syntax enable