From 972ac5187036fdb56c350f58887fcda82b4aa706 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Sat, 7 Jul 2018 11:06:08 +0200 Subject: [PATCH] Fix coloring in less --- .bashrc | 7 ++++--- .config/bash/aliases | 36 ++++++++++++++++++------------------ .config/i3/config | 12 ++---------- bin/ranger | 0 4 files changed, 24 insertions(+), 31 deletions(-) mode change 100644 => 100755 bin/ranger diff --git a/.bashrc b/.bashrc index ea45988..0007ccc 100644 --- a/.bashrc +++ b/.bashrc @@ -48,9 +48,10 @@ export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help"; # colored GCC warnings and errors export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# syntax highlighting in less -export LESSOPEN="| /mingw64/bin/src-hilite-lesspipe.sh %s" -export LESS=' -R ' +# Enable syntax-highlighting in less. +#export LESSOPEN="| /mingw64/bin/src-hilite-lesspipe.sh %s" +export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" +export LESS=" -R " # Load aliases, functions, etc for file in ${HOME}/.config/bash/*; do diff --git a/.config/bash/aliases b/.config/bash/aliases index 7ae9a94..cc471d3 100644 --- a/.config/bash/aliases +++ b/.config/bash/aliases @@ -1,10 +1,6 @@ -alias sl=ls -alias la='ls -A' -alias ll='ls -l' -alias l1='ls -1' -alias l.='ls -d .[a-z]*' - +# ls with coloring lsflags="-hF" + # Detect which `ls` flavor is in use if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` colorflag="--color=auto" @@ -15,20 +11,19 @@ else # OS X `ls` fi alias ls="ls $colorflag $lsflags" +alias sl=ls +alias la='ls -A' +alias ll='ls -l' +alias l1='ls -1' +alias l.='ls -d .[a-z]*' -# grep and less color +# grep and less with coloring alias grep='grep --color=auto' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' -alias less='less -RX' # raw control characters, don't clear the screen after quitting - -# Shortcuts -alias info='info --vi-keys' -alias open='xdg-open &>/dev/null' -alias h='history' -alias dit='git --git-dir=$HOME/.dit --work-tree=$HOME' -alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores' -alias rg='rg --path-separator="//"' +#alias less='less -RX' # raw control characters, don't clear the screen after quitting +alias less='less -m -N -g -i -J --underline-special --SILENT -X' +alias more='less' # Secure settings alias rm='rm -i' @@ -37,16 +32,21 @@ alias mv='mv -i' alias md='mkdir -p' alias rd='rmdir' +# My shortcuts +alias h='history' +alias info='info --vi-keys' +alias open='xdg-open &>/dev/null' +alias dit='git --git-dir=$HOME/.dit --work-tree=$HOME' +alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores' +alias rg='rg --path-separator="//"' if [ ! -x "$(which tree 2>/dev/null)" ] then alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" fi - # Enable aliases to be sudo'ed alias sudo='sudo ' -alias _="sudo" # Get week number alias week='date +%V' diff --git a/.config/i3/config b/.config/i3/config index 4f51c21..e54a067 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -34,7 +34,8 @@ bindsym $mod+d kill # # Make it the same as vim command mode # bindsym $mod+semicolon exec dmenu_run -bindsym $mod+semicolon exec --no-startup-id i3-dmenu-desktop +#bindsym $mod+semicolon exec --no-startup-id i3-dmenu-desktop +bindsym $mod+semicolon exec --no-startup-id rofi -show run # change focus bindsym $mod+$left focus left @@ -144,15 +145,6 @@ bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # screenlock bindsym Control+$mod+l exec gnome-screensaver-command -l -exec --no-startup-id dbus-send \ - --session \ - --print-reply=literal \ - --dest=org.gnome.SessionManager \ - "/org/gnome/SessionManager" \ - org.gnome.SessionManager.RegisterClient \ - "string:i3" \ - "string:$DESKTOP_AUTOSTART_ID" - # custom settings exec --no-startup-id gnome-session # GNOME session exec --no-startup-id gnome-settings-daemon # GNOME desktop settings diff --git a/bin/ranger b/bin/ranger old mode 100644 new mode 100755 -- 2.43.0