Compare commits

..

2 commits

Author SHA1 Message Date
Lazare Olivry
32c6947516 add ip color, alias cantine, kubernetes completion 2019-04-11 10:29:31 +02:00
Lazare Olivry
e7aad58047 various : no ssh forward, git prune local branches, ssh agent 2019-04-11 10:29:31 +02:00
89 changed files with 715 additions and 7678 deletions

12
.gitignore vendored
View file

@ -1,13 +1,3 @@
git_user
vim/.netrwhist
vim/bundle/*
vim/cache/*
config/kitty/.local.conf
config/mpv/watch_later
config/nvim/.netrwhist
src/*
!src/Makefile
!src/*.*
git_user

6
.gitmodules vendored
View file

@ -1,9 +1,3 @@
[submodule "fast-syntax-highlighting"]
path = fast-syntax-highlighting
url = https://github.com/zdharma/fast-syntax-highlighting
[submodule "themes/base16-kitty"]
path = themes/base16-kitty
url = https://github.com/kdrag0n/base16-kitty
[submodule "zsh-autosuggestions"]
path = zsh-autosuggestions
url = https://github.com/zsh-users/zsh-autosuggestions

71
aliases
View file

@ -2,53 +2,28 @@
# Aliases #
###########
# Detect if we have GNU coreutils or BSD
if date --version > /dev/null 2>&1 ;then
alias ls='ls --classify --tabsize=0 --literal --color=auto --show-control-chars -h'
alias lh='ls -trhgGN --color=always | cut -d" " -f3-' # List files in chronological order
alias diff='diff --color'
alias less='less --quiet'
alias grep="grep --color"
alias rm='rm -I'
alias ip='ip --color'
alias ipa='ip route && echo && ip --brief address'
alias ipr='ip --brief address && echo && ip route'
alias cal='cal -m -3'
else
alias ls='ls -FGh'
alias ipa='ip address'
alias ipa='ip route'
fi
if which sl > /dev/null 2>&1; then
alias l='sl'
alias lll='sl'
fi
if which nvim > /dev/null 2>&1; then
alias vim='nvim'
fi
if [ -f "$HOME/howto/how_to" ]; then
alias howto="vim $HOME/howto/how_to"
fi
case $(uname -s) in
Arch)
alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm'
alias upgrade='sudo pacman -Syu';;
Debian|Ubuntu)
alias upgrade='sudo apt-get update && sudo apt-get -dy dist-upgrade && sudo apt-get dist-upgrade';;
VoidLinux)
alias upgrade='sudo xbps-install -Su';;
Darwin)
if which mvim > /dev/null 2>&1; then
alias vim='mvim -v'
fi;;
esac
alias acs='apt-cache search'
alias ls='ls --classify --tabsize=0 --literal --color=auto --show-control-chars -h'
alias ll='ls -lha'
alias df='df -h'
alias diff='diff -u'
alias du='du -h'
alias feh="feh -. --auto-rotate --action1 'dragon -x %F'"
alias l='sl'
alias lll='sl'
alias less='less --quiet'
alias df='df --human-readable'
alias du='du --human-readable'
alias diff='diff -u --color'
# alias mutt='mutt -y'
alias upgrade='sudo apt-get update && sudo apt-get -dy dist-upgrade && sudo apt-get dist-upgrade'
alias feh='feh --auto-rotate'
# alias -g GP='|grep '
alias grep="grep --color"
alias ssh='ssh -A'
# alias -s txt=cat
alias rm='rm -I'
alias ip='ip --color'
alias ipa='ip route && echo && ip --brief address'
alias ipr='ip --brief address && echo && ip route'
alias which='which -a'
# The infamous cd ...etc
# Le fameux cd ...etc
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
@ -57,13 +32,15 @@ alias -g .......='../../../../../..'
alias -g ........='../../../../../../..'
# Hackish tweaks
alias steam-wine="WINEDEBUG=-all wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite -no-cef-sandbox &"
alias minecraft='prismlauncher'
alias pacaur='AURDEST=$HOME/aur pacaur'
alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm'
alias minecraft='java -jar $HOME/.minecraft/launcher.jar'
alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
alias shuffle='mpv --shuffle --display-tags= --no-audio-display'
alias steam="LD_PRELOAD='/usr/\$LIB/libstdc++.so.6 /usr/\$LIB/libgcc_s.so.1 /usr/\$LIB/libxcb.so.1 /usr/\$LIB/libgpg-error.so' /usr/bin/steam"
alias surftor='http_proxy=socks5://127.0.0.1:9050/ surf'
alias ytmp3='youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s" "$(xsel -ob)"'
# Fix for archlinux
# Fix pour archlinux
alias zbarcam='LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam'
# vim: ft=zsh

View file

@ -1,103 +0,0 @@
#!/bin/sh
# Load helper functions
source "$(dirname "$(rreadlink "$0")")/../lib/utils.sh"
# TODO: detect term or set it globally
TERM_EMU="kitty"
if ! check_exists wl-paste && [ ! -z "$WAYLAND_DISPLAY" ]; then
die "Wayland detected and wl-paste not found"
elif ! check_exists xsel && [ -z "$WAYLAND_DISPLAY" ]; then
die "xsel not found"
fi
# TODO check for xsel/wl-clipboard presence ?
if [ -z "$WAYLAND_DISPLAY" ]; then
clip="$(xsel -b -o)"
else
clip="$(wl-paste)"
fi
urls="$(echo $clip | grep -o 'https\?://[a-zA-Z0-9~#%&_+=,.?@/-]\+')"
# Check the requirements for every option
opts="fav|rot13"
check_exists "$TERM_EMU" "mpv" "yt-dlp" &&
opts="audio-search|$opts"
check_exists "dragon" &&
opts="drag-n-drop|$opts"
# Enable additional features when the clipboard contains an URL
if [ -n "$urls" ] && check_exists "yt-dlp"; then
if echo "$urls" | grep -qF "scribblehub.com"; then
check_exists "lncrawl" && opts="crawl|$opts"
else
check_exists "mpv" && opts="play|low-play|$opts"
check_exists "mpc" && opts="queue|$opts"
opts="download|$opts"
fi
fi
# Load default choice last
check_exists "qrencode" "feh" &&
opts="qr|$opts"
# Split into multiple lines for dmenu
opts="$(printf "%s" "$opts" | sed 's/|/\n/g')"
choice="$(printf "%s" "$opts" | dmenu -p "$(printf "%s" "$clip" | cut -c 1-48)")"
case "$choice" in
"qr")
printf "%s" "$clip" | qrencode -o - | feh -. -Z --force-aliasing --geometry 400x400 -
;;
# Download supports optional folder target
"download"*)
path="$HOME/mus/$(printf "%s" "$choice" | cut -d " " -f 2-)"
mp3dl -d "$path" "$urls"
;;
"crawl")
path="$HOME/books/"
[ -d "$path" ] || mkdir -p "$path"
cd "$path" || exit
out="$(lncrawl --single --all --format epub --filename-only --suppress -s "$urls" | grep -vFe "Input is suppressed" -e "Namespace(")"
errors="$(printf "%s" "$out" | grep -Fe " ❗ ")"
if [ -n "$errors" ]; then
printf "%s" "$errors" | notify_err
else
printf "%s" "$out" | sed -ne '/^NOVEL: /s/NOVEL: \(.*\)/Successfully crawled "\1"/p' | xargs -0 -n1 notify-send
fi
;;
"drag-n-drop")
dragon -x "$clip"
;;
"play")
playvideo "$clip"
;;
"low-play")
playvideo -l "$clip"
;;
"queue")
out="$(mpdurlqueue "$urls" 2>&1)" && notify-send "cliplumber" "stream queued"
printf "%s" "$out" | grep "ERROR:" | notify_err
;;
"audio-search")
"$TERM_EMU" --single-instance mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip"
;;
"rot13")
if [ -z "$WAYLAND_DISPLAY" ]; then
xsel -b -o | tr 'A-Za-z' 'N-ZA-Mn-za-m' | xsel -b -i
else
wl-copy -n "$(wl-paste | tr 'A-Za-z' 'N-ZA-Mn-za-m')"
fi
;;
# Optional argument to set a description for the fav
"f"*)
desc="$(printf "%s" "$choice" | cut -d " " -s -f 2-)"
if [ -n "$desc" ]; then
printf "# %s\n" "$desc" >> "$HOME/favs"
fi
printf "%s\n" "$urls" >> "$HOME/favs"
;;
*)
printf 'Nope\n'
;;
esac

Binary file not shown.

View file

@ -1,11 +0,0 @@
#!/bin/sh
# We use a script instead of an alias because we want this utility in our path,
# usable from dmenu
# Load helper functions
source "$(dirname "$(rreadlink "$0")")/../lib/utils.sh"
assert_exists dragon-drag-and-drop
dragon-drag-and-drop "$@"

View file

@ -1,19 +0,0 @@
#!/bin/sh
# Inspired from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
# usage: import-gsettings
config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
gnome_schema="org.gnome.desktop.interface"
gtk_theme="$(sed -nE '/^gtk-theme-name/s/^gtk-theme-name\s*=\s*//p' "$config")"
icon_theme="$(sed -nE '/^gtk-icon-theme-name/s/^gtk-icon-theme-name\s*=\s*//p' "$config")"
cursor_theme="$(sed -nE '/^gtk-cursor-theme-name/s/^gtk-cursor-theme-name\s*=\s*//p' "$config")"
font_theme="$(sed -nE '/^gtk-font-name/s/^gtk-font-name\s*=\s*//p' "$config")"
gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
gsettings set "$gnome_schema" icon-theme "$icon_theme"
gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
gsettings set "$gnome_schema" font-name "$font_name"

View file

@ -1,24 +0,0 @@
#!/bin/sh
if [ -z "$2" ]; then
>&2 echo "Usage: $0 <source maildir> <archive maildir>"
exit 1
fi
src="$1"
arch="$2"
begin="2010"
if ! [ -d "$arch/cur" ]; then
>&2 echo "Folder $arch does not appear to be a maildir"
exit 1
fi
umask 700
for y in $(seq "$begin" "$(date '+%Y')" | sort -r); do
mkdir -p "$arch/$y/cur" "$arch/$y/new" "$arch/$y/tmp"
mails=$(mlist "$src" | mpick -t "date <= \"$y-12-31\" && date >= \"$y-01-01\" && date < \"-180d\"" 2> /dev/null)
>&2 printf 'The year is %s. %s emails to sort\n' "$y" "$(echo "$mails" | wc -l)"
echo "$mails" | mrefile "$arch/$y"
done

View file

@ -1,37 +0,0 @@
#!/bin/sh
die () {
2>&1 echo "$*"
exit 1
}
maildir=~/mail
mailboxes=$(find "$maildir" -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch -printf '%f\n')
LOCKFILE="/tmp/.mailsync.$USER.lock"
# https://stackoverflow.com/questions/185451/quick-and-dirty-way-to-ensure-only-one-instance-of-a-shell-script-is-running-at
# /!\ locking method is susceptible to race condition
# Should be fine for cron job
if [ -e "$LOCKFILE" ] && kill -0 "$(cat "$LOCKFILE")"; then
echo "mailsync is already running"
exit 1
fi
# make sure the lockfile is removed when we exit and then claim it
trap "rm -f '$LOCKFILE'; exit" INT TERM EXIT
echo $$ > "$LOCKFILE"
# Try a single short sync to test password availability
mbsync "$(echo "$mailboxes" | head -n 1)" || die "Please unlock password database"
for m in $(echo "$mailboxes" | tail -n+2); do
mbsync "$m" &
sleep 1
done
wait
fdm fetch
notmuch new
rm -f "$LOCKFILE"

View file

@ -1,45 +0,0 @@
#!/bin/sh
set -eu
# Load helper functions
source "$(dirname "$(rreadlink "$0")")/../lib/utils.sh"
usage() {
>&2 echo "Usage: $0 [-d folder_dest] <video url>"
exit 1
}
dest="$HOME/mus/download/"
url=""
while [ $# -gt 0 ]; do
arg="$1"
case $arg in
-h|--help)
usage
;;
-d)
dest="$2"
shift 2
;;
*)
url="$1"
shift
;;
esac
done
if [ -z "$url" ]; then
usage
fi
check_exists yt-dlp || die "yt-dlp not found"
[ -d "$dest" ] || mkdir -p "$dest"
notify-send -t 3000 "mp3dl" "Downloading $url..."
yt-dlp -x --audio-format mp3 --no-playlist --add-metadata -o "$dest/%(title)s.%(ext)s" "$url" 2>&1 \
| grep 'ERROR:' \
| notify_err

View file

@ -1,61 +0,0 @@
#!/usr/bin/env python3
"""
A simple script to pipe URIs through yt-dlp and mpd
Credit: https://gist.github.com/phaer/86bdcc3fb59cd3fcd9534bfe84d9fe5f
"""
import sys
import mpd
import yt_dlp
mpd_host = ('localhost', 6600)
ydl_opts = {
'format': 'bestaudio/audio',
'quiet': True,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
print("usage: {} <url>".format(sys.argv[0]), file=sys.stderr)
sys.exit(1)
source_url = sys.argv[1]
client = mpd.MPDClient()
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
try:
info = ydl.extract_info(source_url, process=False, download=False)
except yt_dlp.utils.DownloadError:
# Don't print anything, yt-dlp is already on it
sys.exit(1)
if info.get("_type") is not None and info.get("_type") == "playlist":
print("Queuing playlists not supported yet.", file=sys.stderr)
sys.exit(1)
info = ydl.process_ie_result(info, download=False)
url = info.get('url')
title = info.get('title')
source = info.get('extractor_key')
# This info is only available for songs
# that have been tagged as such on youtube
artist = info.get('artist')
if not (url and title and source):
print("youtube-dl error.", file=sys.stderr)
sys.exit(1)
client.connect(*mpd_host)
# Get current playing song index and then append the stream just after
# This is analogous to `mpc insert <song>`
pos = int(client.status()["song"])
song_id = client.addid(url, pos + 1)
client.addtagid(song_id, 'title', title)
client.addtagid(song_id, 'album', source)
if artist is not None:
client.addtagid(song_id, 'artist', artist)
client.disconnect()

View file

@ -1,114 +0,0 @@
#!/bin/sh
# @(#) mutt_bgrun $Revision: 1.4 $
# mutt_bgrun - run an attachment viewer from mutt in the background
# Copyright (C) 1999-2002 Gary A. Johnson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# SYNOPSIS
# mutt_bgrun viewer [viewer options] file
#
# DESCRIPTION
# Mutt invokes external attachment viewers by writing the
# attachment to a temporary file, executing the pipeline specified
# for that attachment type in the mailcap file, waiting for the
# pipeline to terminate, writing nulls over the temporary file,
# then deleting it. This causes problems when using graphical
# viewers such as qvpview and acroread to view attachments.
#
# If qvpview, for example, is executed in the foreground, the mutt
# user interface is hung until qvpview exits, so the user can't do
# anything else with mutt until he or she finishes reading the
# attachment and exits qvpview. This is especially annoying when
# a message contains several MS Office attachments--one would like
# to have them all open at once.
#
# If qvpview is executed in the background, it must be given
# enough time to completely read the file before returning control
# to mutt, since mutt will then obliterate the file. Qvpview is
# so slow that this time can exceed 20 seconds, and the bound is
# unknown. So this is again annoying.
#
# The solution provided here is to invoke the specified viewer
# from this script after first copying mutt's temporary file to
# another temporary file. This script can then quickly return
# control to mutt while the viewer can take as much time as it
# needs to read and render the attachment.
#
# EXAMPLE
# To use qvpview to view MS Office attachments from mutt, add the
# following lines to mutt's mailcap file.
#
# application/msword; mutt_bgrun qvpview %s
# application/vnd.ms-excel; mutt_bgrun qvpview %s
# application/vnd.ms-powerpoint; mutt_bgrun qvpview %s
#
# AUTHOR
# Gary A. Johnson
# <garyjohn@spk.agilent.com>
#
# ACKNOWLEDGEMENTS
# My thanks to the people who have commented on this script and
# offered solutions to shortcomings and bugs, especially Edmund
# GRIMLEY EVANS <edmundo@rano.org> and Andreas Somogyi
# <aso@somogyi.nu>.
prog=${0##*/}
# Check the arguments first.
if [ "$#" -lt "2" ]
then
echo "usage: $prog viewer [viewer options] file" >&2
exit 1
fi
# Separate the arguments. Assume the first is the viewer, the last is
# the file, and all in between are options to the viewer.
viewer="$1"
shift
while [ "$#" -gt "1" ]
do
options="$options $1"
shift
done
file=$1
# Create a temporary directory for our copy of the temporary file.
#
# This is more secure than creating a temporary file in an existing
# directory.
tmpdir=/tmp/$LOGNAME$$
umask 077
mkdir "$tmpdir" || exit 1
tmpfile="$tmpdir/${file##*/}"
# Copy mutt's temporary file to our temporary directory so that we can
# let mutt overwrite and delete it when we exit.
cp "$file" "$tmpfile"
# Run the viewer in the background and delete the temporary files when done.
(
"$viewer" $options "$tmpfile"
rm -f "$tmpfile"
rmdir "$tmpdir"
) &

View file

@ -1,136 +0,0 @@
# Copyright (C) 2009 www.stani.be
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/
# Follows PEP8
APP_NAME = 'notify.py'
from sys import stderr
# Notify (linux)
try:
# import Notify
# import gobject
# gobject.threads_init()
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
except (ImportError, ValueError):
Notify = None
# Growl (Mac Os X)
if Notify:
Growl = None
else:
try:
import Growl
except ImportError:
Growl = None
# Toasterbox (Windows)
if Notify or Growl:
TB = None
else:
try:
import wx
import other.pyWx.toasterbox as TB
except ImportError:
TB = None
def register(app_name):
global APP_NAME
APP_NAME = app_name
def init(app_name, icon=None):
print("Warning: couldn't find any notification API", file=stderr)
register(app_name)
if Notify:
def init(app_name, icon=None):
register(app_name)
Notify.init(app_name)
def send(title, message, icon='gtk-dialog-info', wxicon=None,
urgent=False, timeout=None):
n = Notify.Notification.new(title, message, icon)
if urgent:
n.set_urgency(2)
if timeout:
n.set_timeout(timeout)
n.show()
elif Growl:
def init(app_name, icon=None):
"""Create a growl notifier with appropriate icon if specified.
The notification classes default to [APP_NAME]. The user can
enable/disable notifications based on this class name."""
global growl
register(app_name)
if icon is None:
icon = {}
else:
icon = {'applicationIcon': Growl.Image.imageFromPath(icon)}
growl = Growl.GrowlNotifier(APP_NAME, [APP_NAME], **icon)
def send(title, message, icon='gtk-dialog-info', wxicon=None,
urgent=False, timeout=None):
global growl
growl.notify(APP_NAME, title, message)
elif TB:
def send(title, message, icon='gtk-dialog-info',
wxicon=None, urgent=False, timeout=None):
if wxicon == None:
wxicon = wx.ArtProvider_GetBitmap(wx.ART_INFORMATION,
wx.ART_OTHER, (48, 48))
tb = TB.ToasterBox(wx.GetApp().GetTopWindow(),
TB.TB_COMPLEX, TB.DEFAULT_TB_STYLE, TB.TB_ONTIME)
tb.SetPopupSize((300, 80))
tb.SetPopupPauseTime(5000)
tb.SetPopupScrollSpeed(8)
tb.SetPopupPositionByInt(3)
#wx controls
tbpanel = tb.GetToasterBoxWindow()
panel = wx.Panel(tbpanel, -1)
panel.SetBackgroundColour(wx.WHITE)
wxicon = wx.StaticBitmap(panel, -1, wxicon)
title = wx.StaticText(panel, -1, title)
message = wx.StaticText(panel, -1, message)
# wx layout controls
ver_sizer = wx.BoxSizer(wx.VERTICAL)
ver_sizer.Add(title, 0, wx.ALL, 4)
ver_sizer.Add(message, 0, wx.ALL, 4)
hor_sizer = wx.BoxSizer(wx.HORIZONTAL)
hor_sizer.Add(wxicon, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL \
| wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 4)
hor_sizer.Add(ver_sizer, 1, wx.EXPAND)
hor_sizer.Layout()
panel.SetSizer(hor_sizer)
tb.AddPanel(panel)
tb.Play()
else:
def send(*args, **keyw):
pass

View file

@ -1,20 +0,0 @@
#!/bin/sh
# Load helper functions
source "$(dirname "$(rreadlink "$0")")/../lib/utils.sh"
if [ "$1" = "-h" ] || [ "$#" -lt "1" ]; then
>&2 echo "Usage: $0 [-l] <video url>"
exit 1
fi
quality=720
if [ "$1" = "-l" ]; then
shift
quality=360
fi
# https://github.com/mpv-player/mpv/issues/4241
#mpv --ytdl-format="bestvideo[height<=?$quality]+bestaudio/best" "$@" 2>&1 | grep 'ERROR:' | notify_err
mpv --ytdl-format="bestvideo[height<=?$quality][fps<=?30][vcodec!=?vp9]+bestaudio/best[height<=?$quality]" "$@" 2>&1 | grep 'ERROR:' | notify_err

View file

@ -1,3 +0,0 @@
#!/bin/sh
zbarcam --raw --oneshot -q | tee /dev/fd/2 | xsel -bi

View file

@ -1,55 +0,0 @@
#!/bin/sh
# Function by mklement0
# https://stackoverflow.com/a/29835459/5309963
# The following, POSIX-compliant shell function implements what
# GNU's readlink -e does and is a reasonably robust solution
# that only fails in two rare edge cases:
# - paths with embedded newlines (very rare)
# - filenames containing literal string -> (also rare)
( # Execute the function in a *subshell* to localize variables and the effect of `cd`.
target=$1 fname= targetDir= CDPATH=
# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`
# itself is not redefined as an alias or shell function.
# (Note that command is too inconsistent across shells, so we don't use it.)
# `command` is a *builtin* in bash, dash, ksh, zsh, and some platforms do not even have
# an external utility version of it (e.g, Ubuntu).
# `command` bypasses aliases and shell functions and also finds builtins
# in bash, dash, and ksh. In zsh, option POSIX_BUILTINS must be turned on for that
# to happen.
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.
while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
fname=$(command basename -- "$target") # Extract filename.
[ "$fname" = '/' ] && fname='' # !! curiously, `basename /` returns '/'
if [ -L "$fname" ]; then
# Extract [next] target path, which may be defined
# *relative* to the symlink's own directory.
# Note: We parse `ls -l` output to find the symlink target
# which is the only POSIX-compliant, albeit somewhat fragile, way.
target=$(command ls -l "$fname")
target=${target#* -> }
continue # Resolve [next] symlink target.
fi
break # Ultimate target reached.
done
targetDir=$(command pwd -P) # Get canonical dir. path
# Output the ultimate target's canonical path.
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
if [ "$fname" = '.' ]; then
command printf '%s\n' "${targetDir%/}"
elif [ "$fname" = '..' ]; then
# Caveat: something like /var/.. will resolve to /private (assuming /var@ -> /private/var), i.e. the '..' is applied
# AFTER canonicalization.
command printf '%s\n' "$(command dirname -- "${targetDir}")"
else
command printf '%s\n' "${targetDir%/}/$fname"
fi
)

View file

@ -1,26 +0,0 @@
#!/bin/sh
# Load helper functions
bin_path="$(dirname "$(rreadlink "$0")")"
source "$bin_path/../lib/utils.sh"
if [ -z "$1" ]; then
NAME="shot_$(date '+%Y%m%d%H%M%S').png"
else
NAME="$1"
fi
SCREEN_DIR="$HOME/img/screenshots"
mkdir -p "$SCREEN_DIR"
# Let's try to detect Wayland running
if [ -z "$WAYLAND_DISPLAY" ]; then
assert_exists "maim"
maim --hidecursor --select "$SCREEN_DIR/$NAME"
# Fail silently if xsel isn't installed, the clipboard feature isn't critical
echo "$SCREEN_DIR/$NAME" | xsel --clipboard --input > /dev/null 2>&1
else
assert_exists "grim" "slop"
slop | awk -F '[x+]' '{printf "%s,%s %sx%s",$3,$4,$1,$2}' | grim -g - "$SCREEN_DIR/$NAME"
# Same as xsel
wl-copy -n "$SCREEN_DIR/$NAME" > /dev/null 2>&1
fi

View file

@ -1,167 +0,0 @@
#!/bin/sh
# finds the active sink for pulse audio and increments the volume. useful when you have multiple audio outputs and have a key bound to vol-up and down
# Taken from http://customlinux.blogspot.fr/2013/02/pavolumesh-control-active-sink-volume.html
# and slightly adapted by lhark to work with notify-send
notify='dunst' # no/yes/dunst
notiftime='400'
notifid='42'
inc='2'
capvol='yes'
maxvol='200'
autosync='no'
icon_up='audio-volume-high-symbolic'
icon_down='audio-volume-low-symbolic'
icon_mute='audio-volume-muted-symbolic'
main_sink=$(pacmd list-sinks |awk '/* index:/{print $3}')
active_sinks=$(pacmd list-sinks |awk '/index:/{print $NF}' | tr '\n' ' ' | sed 's/ $/\n/g')
limit=$((100 - inc))
maxlimit=$((maxvol - inc))
updateSinks () {
active_sinks=$(pacmd list-sinks |awk '/index:/{print $NF}' | tr '\n' ' ' | sed 's/ $/\n/g')
}
volUp () {
updateSinks
getCurVol
for sink in ${active_sinks}; do
if [ ${capvol} = 'yes' ]; then
if [ "${curVol}" -le 100 ] && [ "${curVol}" -ge ${limit} ]; then
pactl set-sink-volume "${sink}" 100%
elif [ "${curVol}" -lt ${limit} ]; then
pactl set-sink-volume "${sink}" +${inc}%
fi
elif [ "${curVol}" -le ${maxvol} ] && [ "${curVol}" -ge ${maxlimit} ]; then
pactl set-sink-volume "${sink}" ${maxvol}%
elif [ "${curVol}" -lt ${maxlimit} ]; then
pactl set-sink-volume "${sink}" +${inc}%
fi
done
getCurVol
if [ ${notify} = 'yes' ]; then
notify-send "Volume : ${curVol}%" -t ${notiftime}
elif [ "$notify" = 'dunst' ]; then
dunstify -r "$notifid" -t "$notiftime" -i "$icon_up" "Volume: $curVol%"
fi
if [ ${autosync} = 'yes' ]; then
volSync
fi
}
volDown () {
updateSinks
for sink in ${active_sinks}; do
pactl set-sink-volume "${sink}" -${inc}%
done
getCurVol
if [ ${notify} = 'yes' ]; then
notify-send "Volume : ${curVol}%" -t ${notiftime}
elif [ "$notify" = 'dunst' ]; then
dunstify -r "$notifid" -t "$notiftime" -i "$icon_down" "Volume: $curVol%"
fi
if [ ${autosync} = 'yes' ]; then
volSync
fi
}
volSync () {
updateSinks
getCurVol
for each in ${active_sinks}; do
pactl set-sink-volume "${each}" "${curVol}"%
done
}
getCurVol () {
curVol=$(pacmd list-sinks |grep -A 15 'index: '"${main_sink}"'' |grep 'volume:' |egrep -v 'base volume:' |awk -F : '{print $3}' |grep -o -P '.{0,3}%'|sed s/.$// | tr -d ' ')
}
volMute () {
case "$1" in
mute)
for sink in ${active_sinks}; do
pactl set-sink-mute "${sink}" 1
done
curVol=0
status=1
;;
unmute)
for sink in ${active_sinks}; do
pactl set-sink-mute "${sink}" 0
done
getCurVol
status=0
;;
esac
if [ ${notify} = 'yes' ]; then
notify-send "$([ "${status}" = 1 ] && echo "Sound muted" || echo "Sound unmuted")" -t ${notiftime}
elif [ "$notify" = 'dunst' ]; then
[ "$status" = 1 ] && icon="$icon_mute" || icon="$icon_up"
dunstify -r "$notifid" -t "$notiftime" -i "$icon" "$([ "${status}" = 1 ] && echo "Sound muted" || echo "Sound unmuted")"
fi
}
volMuteStatus () {
curStatus=$(pacmd list-sinks |grep -A 15 'index: '"${main_sink}"'' |awk '/muted/{ print $2}')
if [ "${curStatus}" = 'yes' ]; then
volMute unmute
else
volMute mute
fi
}
volHelp () {
echo "Finds the active sink for pulse audio and manages the volume."
echo "Options :"
echo ""
echo " --down"
echo " --help"
echo " --mute"
echo " --sync Sync all sinks volumes"
echo " --toggle"
echo " --unmute"
echo " --up"
}
case "$1" in
--up)
volUp
;;
--down)
volDown
;;
--toggle)
volMuteStatus
;;
--help)
volHelp
;;
--mute)
volMute mute
;;
--unmute)
volMute unmute
;;
--sync)
volSync
;;
esac

296
bin/work
View file

@ -1,296 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import notify
from signal import signal, SIGINT
import sys
from time import sleep
from os.path import expanduser, join
from datetime import datetime, timedelta
TIME_FILE = join(expanduser("~"), "timekeeping.csv")
TODAY_FILE = join(expanduser("~"), ".timekeeping")
is_on_break = False
today_fields = []
start_time = datetime.now()
def die(*args):
print("Error: {}".format(*args), file=sys.stderr)
sys.exit(1)
def log(*args):
print(*args, file=sys.stderr)
def signal_handler(signal, frame):
global today_fields
now = datetime.now()
hour = now.strftime("%H:%M")
if not is_on_break:
sys.exit(0)
else:
break_time = now - start_time
log("\nBreak ended at {} and lasted {}".format(
hour, td_format(break_time)))
today_fields.append(start_time.strftime("%H:%M"))
today_fields.append(hour)
with open(TODAY_FILE, "w") as f:
f.write(",".join(today_fields))
sys.exit(0)
def td_format(td):
prefix = ""
if td < timedelta(0):
td = -td
prefix = "-"
hours, remainder = divmod(td.total_seconds(), 3600)
minutes, seconds = divmod(remainder, 60)
return '{}{:d}:{:02d}'.format(prefix, int(hours), int(minutes))
def get_today_fields():
try:
with open(TODAY_FILE, "r") as f:
line_count = 0
for line in f:
line_count += 1
if line_count > 1:
log("Warning: incomplete day leftover in {}".format(TODAY_FILE))
if line.startswith(start_time.strftime("%Y-%m-%d")):
return line.strip().split(",")
except FileNotFoundError:
return []
return []
def work(args):
total_delta = timedelta()
month_delta = timedelta()
count = 0
month_count = 0
with open(TIME_FILE, "r") as f:
for line in f:
fields = line.strip().split(",", 5)
date = datetime.strptime(fields[0], "%Y-%m-%d")
t = datetime.strptime(fields[4], "%H:%M")
delta = timedelta(hours=t.hour, minutes=t.minute)
if date.month == start_time.month:
month_delta += delta
month_count += 1
total_delta += delta
count += 1
eight_h = timedelta(hours=8) * count
mean_time = total_delta / count if count > 0 else total_delta
minutes = total_delta - eight_h
month_mean_time = month_delta / month_count if month_count > 0 else month_delta
month_min = month_delta - timedelta(hours=(8 * month_count))
print("stats: {}, {}".format(
td_format(mean_time),
td_format(minutes)))
print("month stats: {}, {}".format(
td_format(month_mean_time),
td_format(month_min)))
# Try to calculate remaining time
fields = get_today_fields()
hour = start_time.strftime("%H:%M")
if not fields:
print("No work ongoing")
return
fields.append(hour)
# Test for even number of timestamp (but fields[0] is the date)
if len(fields) < 3:
die("not enough fields in {}".format(TODAY_FILE))
elif len(fields) % 2 == 0:
# Break in progress
log("Break in progress")
return
begin_time = None
worked_time = timedelta()
for field in fields[1:]:
try:
if begin_time is None:
begin_time = datetime.strptime(field, "%H:%M")
else:
end_time = datetime.strptime(field, "%H:%M")
worked_time += end_time - begin_time
begin_time = None
except ValueError:
die("couldn't parse field '{}' in {}".format(
field, TODAY_FILE))
day_start = datetime.strptime(fields[1], "%H:%M")
day_end = datetime.strptime(fields[-1], "%H:%M")
total_time = day_end - day_start
break_time = total_time - worked_time
day_end_estimation = day_start + timedelta(hours=8) + break_time
print("Worked {} already today. Estimated leave at {}".format(
td_format(worked_time),
day_end_estimation.strftime("%H:%M")))
def work_start(args):
fields = get_today_fields()
try:
hour = datetime.strptime(args.time, "%H:%M")
except ValueError:
die("Error: {} is not a valid time".format(args.time))
if fields:
die("You already started working")
with open(TODAY_FILE, "a") as f:
f.write("{},{}".format(
start_time.strftime("%Y-%m-%d"),
hour.strftime("%H:%M")))
log("Started working at {}".format(hour.strftime("%H:%M")))
def work_pause(args):
global is_on_break
global today_fields
is_on_break = True
today_fields = get_today_fields()
hour = start_time.strftime("%H:%M")
if not today_fields:
die("no work to take a break from")
log("Taking a break at {}".format(hour))
notify.init("work")
# Wait to be stopped by a Ctrl-C
reminder_interval = 5 # In minutes
count = 0
while True:
sleep(reminder_interval * 60)
count += 1
notify.send("Pause reminder",
"It has now been {} minutes".format(count * reminder_interval))
def work_end(args):
fields = get_today_fields()
hour = start_time.strftime("%H:%M")
if not fields:
die("Why try to leave when you haven't even started")
fields.append(hour)
if len(fields) < 3:
die("not enough fields in {}".format(TODAY_FILE))
# Test for even number of timestamp (but fields[0] is the date)
elif len(fields) % 2 == 0:
die("odd number of timestamps in {}".format(TODAY_FILE))
begin_time = None
worked_time = timedelta()
for field in fields[1:]:
try:
if begin_time is None:
begin_time = datetime.strptime(field, "%H:%M")
else:
end_time = datetime.strptime(field, "%H:%M")
worked_time += end_time - begin_time
begin_time = None
except ValueError:
die("couldn't parse field '{}' in {}".format(
field, TODAY_FILE))
day_start = datetime.strptime(fields[1], "%H:%M")
day_end = datetime.strptime(fields[-1], "%H:%M")
total_time = day_end - day_start
break_time = total_time - worked_time
with open(TIME_FILE, "a") as f:
f.write('{},{},{},{},{},"{}"\n'.format(
fields[0],
day_start.strftime("%H:%M"),
start_time.strftime("%H:%M"),
td_format(break_time),
td_format(worked_time),
args.description))
# Erase TODAY_FILE
with open(TODAY_FILE, "w") as f:
f.write("")
f.flush()
log("Finished working at {} after working {}".format(
hour, td_format(worked_time)))
def work_export(args):
print("export")
def work_parse(args):
new_lines = []
try:
with open(args.file, "r") as f:
for line in f:
fields = line.strip().split(",")
if len(fields) < 6:
log("Record: '{}' hasn't got enough fields ({})".format(line, len(fields)))
continue
times = []
for field in fields[1:]:
try:
time = datetime.strptime(field, "%H:%M")
times.append(time)
except ValueError:
break
if len(times) % 2 != 0:
die("Error: uneven number of timestamps ({}) in line '{}'".format(len(times), line))
desc = ','.join(fields[len(times)+1:]).strip()
worked_time = timedelta()
for i in range(int(len(times) / 2)):
worked_time += times[i * 2 + 1] - times[i * 2]
morning = times[0]
evening = times[-1]
full_day = evening - morning
break_time = full_day - worked_time
new_lines.append('{},{},{},{},{},{}'.format(
fields[0],
morning.strftime("%H:%M"),
evening.strftime("%H:%M"),
td_format(break_time),
td_format(worked_time),
desc))
except FileNotFoundError:
die("file not found: {}".format(args.file))
# TODO do sanity checking, like if a day already exists
with open(TIME_FILE, "a") as f:
for line in new_lines:
f.write("{}\n".format(line))
log("Written {} new entries to {}".format(len(new_lines), TIME_FILE))
if __name__ == "__main__":
# Handle Ctrl-C
signal(SIGINT, signal_handler)
parser = argparse.ArgumentParser()
parser.set_defaults(func=work)
commands = parser.add_subparsers(dest="command")
start_parser = commands.add_parser("start")
pause_parser = commands.add_parser("pause")
end_parser = commands.add_parser("end")
export_parser = commands.add_parser("export")
parse_parser = commands.add_parser("parse")
start_parser.set_defaults(func=work_start)
start_parser.add_argument("time", nargs="?", default=datetime.now().strftime("%H:%M"))
pause_parser.set_defaults(func=work_pause)
end_parser.set_defaults(func=work_end)
end_parser.add_argument("description")
export_parser.set_defaults(func=work_export)
parse_parser.set_defaults(func=work_parse)
parse_parser.add_argument("file")
args = parser.parse_args()
args.func(args)
#now = datetime.now()
#with open(TIME_FILE, "r") as f:
# for line in f:
# print(line.strip())

View file

@ -1,71 +0,0 @@
#!/bin/sh
TIMEFILE="$HOME/timekeeping.csv"
usage () {
>&2 printf "usage:\n\t%s <start|pause|end>" "$(basename "$0")"
exit 0
}
die () {
>&2 echo "Error: $*"
exit 1
}
from_ts () {
if ! date --version >/dev/null 2>&1; then # BSD
date -r "$1" '+%H:%M'
else # GNU
date -d "@$1" '+%H:%M'
fi
}
pause_end () {
if [ "$ACTION" = "pause" ]; then
now="$(date '+%s')"
printf "%s," "$((now - START))" >> "$TIMEFILE"
>&2 printf "\nYou took a %d minutes pause\n" "$(( (now - START) / 60))"
fi
}
trap pause_end INT
test -z "$1" && usage
test -e "$TIMEFILE" || touch "$TIMEFILE"
TODAY="$(date '+%Y-%m-%d')"
START="$(date '+%s')"
ACTION="$1"
case "$1" in
start)
grep -qE "^$TODAY" "$TIMEFILE" && die "you already started your day"
printf "%s,%s," "$TODAY" "$(date '+%s')" >> "$TIMEFILE"
>&2 printf "Started work at %s\n" "$(date '+%H:%M')";;
pause)
grep -qE "^$TODAY" "$TIMEFILE" || die "You haven't even started your day!"
awk -F, "/^$TODAY/"'{if (NF > 4) exit 1}' "$TIMEFILE" || die "You're already done for the day"
awk -F, "/^$TODAY/"'{if (NF > 2) exit 1}' "$TIMEFILE" || die "You've already expanded your daily break allowance"
>&2 echo "Taking a break..."
sleep 9999999;;
end)
test -z "$2" && die "Tell me what you did today"
grep -qE "^$TODAY" "$TIMEFILE" || die "You haven't even started your day!"
start_hour="$(from_ts "$(tail -n1 "$TIMEFILE" | cut -f 2 -d ,)")"
end_hour="$(date '+%H:%M')"
shift 1
msg="$(printf "%s" "$*" | sed 's/"/""/g')"
line="$(awk -F ',' -v now="$START" -v start="$start_hour" -v end="$end_hour" -v msg="$msg" \
"/^$TODAY/"'{
total=now-$2-$3;
h=int(total/3600);
m=int(total/60%60);
ph=int($3/3600);
pm=int($3/60%60);
printf "%s,%s,%s,%s:%s,%s:%s,\"%s\"",$1,start,end,ph,pm,h,m,msg;
}' \
"$TIMEFILE")"
printf "\$d\nw\n\q" | ed "$TIMEFILE" > /dev/null 2>&1
printf "%s\n" "$line" >> "$TIMEFILE";;
esac

View file

@ -1,348 +0,0 @@
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "400x5-40+60"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 20
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
# Base16 theme : gruvbox-dark-pale
frame_color = "#dab997"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# Transient notifications ignore this setting.
idle_threshold = 120
### Text ###
font = Hack 12
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to ellipsize long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Merge multiple notifications with the same content
stack_duplicates = true
# Hide the count of merged notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 64
# Paths to default icons.
icon_path = /usr/share/icons/gruvbox-dark-icons-gtk/symbolic/status/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#222222"
foreground = "#888888"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#285577"
foreground = "#ffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#900000"
foreground = "#ffffff"
frame_color = "#ff0000"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Base16 theme : gruvbox-dark-pale
# https://github.com/khamer/base16-dunst/blob/master/themes/base16-gruvbox-dark-pale.dunstrc
[base16_low]
msg_urgency = low
background = "#3a3a3a"
foreground = "#8a8a8a"
[base16_normal]
msg_urgency = normal
background = "#4e4e4e"
foreground = "#dab997"
[base16_critical]
msg_urgency = critical
background = "#d75f5f"
foreground = "#d5c4a1"
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
[dino]
appname = "Dino"
timeout = 10
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg

View file

@ -1,24 +0,0 @@
if status --is-login
# Do login stuff
end
set --export EDITOR /usr/bin/vim
# # Vi mode, fixing ctrl-c to cancel the line instead of exiting insert mode
# function fish_vi_key_bindings_local
# fish_vi_key_bindings
# bind -e -M insert \cc
# bind -M insert -m insert \cc 'commandline ""'
# end
# set -g fish_key_bindings fish_vi_key_bindings_local
function hybrid_bindings --description "Vi-style bindings that inherit emacs-style bindings in all modes"
for mode in default insert visual
fish_default_key_bindings -M $mode
end
fish_vi_key_bindings --no-erase
bind -e -M insert \cc
bind -M insert -m insert \cc 'commandline ""'
end
set -g fish_key_bindings hybrid_bindings

View file

@ -1,34 +0,0 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR --export MOZ_ENABLE_WAYLAND:1
SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d
SETUVAR __fish_init_3_x:\x1d
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:green
SETUVAR fish_color_comment:990000
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:009900
SETUVAR fish_color_error:ff0000
SETUVAR fish_color_escape:00a6b2
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:00afff
SETUVAR fish_color_quote:999900
SETUVAR fish_color_redirection:00afff
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:\x1d
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan

View file

@ -1,91 +0,0 @@
set -g fish_color_git_normal blue
set -g fish_color_git_ahead green
set -g fish_color_git_behind red
set -g fish_color_git_diverged magenta
set -g fish_color_git_staged green
set -g fish_color_git_unstaged yellow
set -g fish_color_git_untracked red
set -g fish_color_git_unmerged red
set -g fish_prompt_git_status_ahead '▲'
set -g fish_prompt_git_status_behind '▼'
set -g fish_prompt_git_status_diverged '⯁'
set -g fish_prompt_git_status_staged '●'
set -g fish_prompt_git_status_unstaged '●'
set -g fish_prompt_git_status_untracked '●'
set -g fish_prompt_git_status_unmerged 'M'
set -g fish_prompt_git_status_stashed 'S'
set -g fish_prompt_git_status_order ahead behind diverged staged unstaged untracked unmerged stashed
# Useful chars
# '✓'
# '⚡'
# '✚'
# '●'
# '▾'
# '✖'
# '➜'
# '⇒'
# '➤'
function __plaid_git_prompt --description 'Write out the git prompt'
# If git isn't installed, there's nothing we can do
# Return 1 so the calling prompt can deal with it
if not command -sq git
return 1
end
set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null)
if test -z $branch
return
end
set -l index (git status --porcelain -b 2>/dev/null)
set -l rst (set_color normal)
if test -z "$index"
printf '%s[%s]%s' (set_color $fish_color_git_normal) $branch $rst
return
end
set -l gs
printf '%s[%s ' (set_color $fish_color_git_normal) $branch
for i in $index
if echo $i | grep '^[AMRCD]' >/dev/null
set -a gs staged
end
if echo $i | grep '^.\{1\}[AMRCD]' >/dev/null
set -a gs unstaged
end
if echo $i | grep '^??' >/dev/null
set -a gs untracked
end
if echo $i | grep '^[ADU*][ADU*]' >/dev/null
set -a gs unmerged
end
if echo $i | grep '^## .*ahead' >/dev/null
set -a gs ahead
end
if echo $i | grep '^## .*behind' >/dev/null
set -a gs behind
end
if echo $i | grep '^## .*diverged' >/dev/null
set -a gs diverged
end
if git rev-parse --verify refs/stash >/dev/null 2>&1
set -a gs stashed
end
end
for i in $fish_prompt_git_status_order
if contains $i in $gs
set -l color_name fish_color_git_$i
set -l status_name fish_prompt_git_status_$i
printf '%s%s' (set_color $$color_name) $$status_name
end
end
printf '%s]%s' (set_color $fish_color_git_normal) $rst
end

View file

@ -1,47 +0,0 @@
set -g fish_color_user cyan
set -g fish_color_host green
set -g fish_color_cwd yellow
set -g fish_prompt_pwd_dir_length 0
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
set -l rst (set_color normal)
# User
set -l user (set_color --bold $fish_color_user)(whoami)$rst
# Host
set -l host (set_color --bold $fish_color_host)(prompt_hostname)$rst
# PWD
set -l ppwd (set_color $fish_color_cwd)(prompt_pwd)$rst
# Git
set -l pgit (__plaid_git_prompt)
# __fish_hg_prompt
printf '%s@%s:%s %s\n' $user $host $ppwd $pgit
switch $fish_bind_mode
case default
set_color --bold --background red black
echo -n '<N>'
case insert
set_color --bold green
echo -n '<I>'
case replace_one
set_color --bold --background yellow black
echo -n '<R>'
case visual
set_color --bold --background magenta black
echo -n '<V>'
end
set_color normal
if not test $last_status -eq 0
set_color $fish_color_error
end
printf ' '
set_color normal
end

View file

@ -1,3 +0,0 @@
function ll --description 'List contents of directory using long format'
ls -lha $argv
end

View file

@ -1,19 +0,0 @@
## Base16 Gruvbox dark, pale
# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
set $base00 #262626
set $base01 #3a3a3a
set $base02 #4e4e4e
set $base03 #8a8a8a
set $base04 #949494
set $base05 #dab997
set $base06 #d5c4a1
set $base07 #ebdbb2
set $base08 #d75f5f
set $base09 #ff8700
set $base0A #ffaf00
set $base0B #afaf00
set $base0C #85ad85
set $base0D #83adad
set $base0E #d485ad
set $base0F #d65d0e

View file

@ -1 +0,0 @@
base16-gruvbox-dark-pale

View file

@ -1,264 +0,0 @@
#########################
# i3/sway common config #
#########################
### Variables
#
# Logo key. Use Mod1 for Alt, Mod4 for Super
set $mod Mod1
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# keycodes for number keys
set $key1 10
set $key2 11
set $key3 12
set $key4 13
set $key5 14
set $key6 15
set $key7 16
set $key8 17
set $key9 18
set $key0 19
# Workspaces names. Format: "index:name"
set $ws1 "1:mail"
set $ws2 "2:web"
set $ws3 "3:3"
set $ws4 "4:4"
set $ws5 "5:5"
set $ws6 "6:6"
set $ws7 "7:7"
set $ws8 "8:8"
set $ws9 "9:9"
set $ws10 "10:10"
# Your preferred terminal emulator
set $term kitty --single-instance --instance-group i3
# Other utilities
set $backlightinc light -A 5
set $backlightdec light -U 5
set $volinc volcont --up
set $voldec volcont --down
set $voltog volcont --toggle
set $cliplumber cliplumber
set $mpdtoggle mpc toggle
set $mpdnext mpc next
set $mpdprev mpc prev
# Font for window titles and bar
font pango:Hack 8
# Remove borders
hide_edge_borders smart
# Remove window title
default_border pixel 1
# Default to vertical split (vim :sp)
# Base16 color config
include ./colorscheme
# Property Name Border BG Text Indicator Child Border
client.focused $base05 $base0D $base00 $base0D $base0D
client.focused_inactive $base01 $base01 $base05 $base03 $base01
client.unfocused $base01 $base00 $base05 $base01 $base01
client.urgent $base08 $base08 $base00 $base08 $base08
client.placeholder $base00 $base00 $base05 $base00 $base00
client.background $base07
### Key bindings
#
# Basics:
# exit i3/sway
bindsym $mod+Shift+q exec $exit
# lock session
bindsym Mod4+l exec $lock
# application launcher
bindsym $mod+r exec $menu
# start a terminal
bindsym $mod+Return exec $term
# call clipboard plumber
bindsym $mod+v exec $cliplumber
# volume control
bindsym XF86AudioRaiseVolume exec $volinc
bindsym XF86AudioLowerVolume exec $voldec
bindsym XF86AudioMute exec $voltog
# MPD control
bindsym $mod+greater exec $mpdnext
bindsym $mod+less exec $mpdprev
bindsym $mod+p exec $mpdtoggle
bindsym XF86AudioNext exec $mpdnext
bindsym XF86AudioPrev exec $mpdprev
bindsym XF86AudioPlay exec $mpdtoggle
# brightness control (using Super because MSI weirdness)
bindsym Mod4+Up exec $backlightinc
bindsym Mod4+Down exec $backlightdec
# reload the configuration file
bindsym $mod+Shift+r reload
# restart i3/sway inplace (preserves your layout/session)
bindsym $mod+Shift+x restart
# kill focused window
bindsym $mod+Shift+c kill
# mouse button for dragging.
floating_modifier $mod normal
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# _move_ the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# switch to workspace
bindcode $mod+$key1 workspace $ws1
bindcode $mod+$key2 workspace $ws2
bindcode $mod+$key3 workspace $ws3
bindcode $mod+$key4 workspace $ws4
bindcode $mod+$key5 workspace $ws5
bindcode $mod+$key6 workspace $ws6
bindcode $mod+$key7 workspace $ws7
bindcode $mod+$key8 workspace $ws8
bindcode $mod+$key9 workspace $ws9
bindcode $mod+$key0 workspace $ws10
# move focused container to workspace
bindcode $mod+Shift+$key1 move container to workspace $ws1
bindcode $mod+Shift+$key2 move container to workspace $ws2
bindcode $mod+Shift+$key3 move container to workspace $ws3
bindcode $mod+Shift+$key4 move container to workspace $ws4
bindcode $mod+Shift+$key5 move container to workspace $ws5
bindcode $mod+Shift+$key6 move container to workspace $ws6
bindcode $mod+Shift+$key7 move container to workspace $ws7
bindcode $mod+Shift+$key8 move container to workspace $ws8
bindcode $mod+Shift+$key9 move container to workspace $ws9
bindcode $mod+Shift+$key0 move container to workspace $ws10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
#bindsym $mod+b splith
#bindsym $mod+v splitv
bindsym $mod+shift+v splith
bindsym $mod+ctrl+shift+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
#bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
#bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Mnemonic: Dimension
bindsym $mod+d mode "resize"
# Fast resize
bindsym $mod+Ctrl+$left resize shrink width 5 px or 5 ppt
bindsym $mod+Ctrl+$down resize grow height 5 px or 5 ppt
bindsym $mod+Ctrl+$up resize shrink height 5 px or 5 ppt
bindsym $mod+Ctrl+$right resize grow width 5 px or 5 ppt
# App specific settings
for_window [class="mpv"] floating enable
### Status Bar
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
#status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
status_command i3status
# Base16 colors for the statusbar
colors {
background $base00
separator $base04
statusline $base05
# State Border BG Text
focused_workspace $base0D $base0D $base00
active_workspace $base03 $base03 $base00
inactive_workspace $base01 $base01 $base05
urgent_workspace $base0F $base0F $base00
binding_mode $base0A $base0A $base00
}
separator_symbol " | "
strip_workspace_numbers yes
}

View file

@ -1,279 +0,0 @@
#########################
# i3/sway common config #
#########################
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# keycodes for number keys
set $key1 10
set $key2 11
set $key3 12
set $key4 13
set $key5 14
set $key6 15
set $key7 16
set $key8 17
set $key9 18
set $key0 19
# Workspaces names. Format: "index:name"
set $ws1 "1:mail"
set $ws2 "2:web"
set $ws3 "3:3"
set $ws4 "4:4"
set $ws5 "5:5"
set $ws6 "6:6"
set $ws7 "7:7"
set $ws8 "8:8"
set $ws9 "9:9"
set $ws10 "10:10"
# Your preferred terminal emulator
set $term kitty --single-instance
# Font for window titles and bar
font pango:Hack 8
# Remove borders
hide_edge_borders smart
# Remove window title
default_border pixel 1
# Default to vertical split (vim :sp)
## Base16 Gruvbox dark, pale
# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
set $base00 #262626
set $base01 #3a3a3a
set $base02 #4e4e4e
set $base03 #8a8a8a
set $base04 #949494
set $base05 #dab997
set $base06 #d5c4a1
set $base07 #ebdbb2
set $base08 #d75f5f
set $base09 #ff8700
set $base0A #ffaf00
set $base0B #afaf00
set $base0C #85ad85
set $base0D #83adad
set $base0E #d485ad
set $base0F #d65d0e
# Property Name Border BG Text Indicator Child Border
client.focused $base05 $base0D $base00 $base0D $base0D
client.focused_inactive $base01 $base01 $base05 $base03 $base01
client.unfocused $base01 $base00 $base05 $base01 $base01
client.urgent $base08 $base08 $base00 $base08 $base08
client.placeholder $base00 $base00 $base05 $base00 $base00
client.background $base07
### Key bindings
#
# Basics:
# exit i3/sway
bindsym $mod+Shift+e exec $exit
# lock session
bindsym Ctrl+Mod1+l exec $lock
# application launcher
bindsym $mod+r exec $menu
# start a terminal
bindsym $mod+Return exec $term
# call clipboard plumber
bindsym $mod+v exec cliplumber
# volume control
bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 1%- unmute
bindsym XF86AudioMute exec amixer -q set Master toggle
# music control
bindsym $mod+p exec mpc toggle
bindsym $mod+less exec mpc prev
bindsym $mod+Shift+less exec mpc next
# reload the configuration file
bindsym $mod+Shift+r reload
# restart i3/sway inplace (preserves your layout/session)
bindsym $mod+Shift+x restart
# kill focused window
bindsym $mod+Shift+c kill
# mouse button for dragging.
floating_modifier $mod
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# _move_ the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# switch to workspace
bindcode $mod+$key1 workspace $ws1
bindcode $mod+$key2 workspace $ws2
bindcode $mod+$key3 workspace $ws3
bindcode $mod+$key4 workspace $ws4
bindcode $mod+$key5 workspace $ws5
bindcode $mod+$key6 workspace $ws6
bindcode $mod+$key7 workspace $ws7
bindcode $mod+$key8 workspace $ws8
bindcode $mod+$key9 workspace $ws9
bindcode $mod+$key0 workspace $ws10
# move focused container to workspace
bindcode $mod+Shift+$key1 move container to workspace $ws1
bindcode $mod+Shift+$key2 move container to workspace $ws2
bindcode $mod+Shift+$key3 move container to workspace $ws3
bindcode $mod+Shift+$key4 move container to workspace $ws4
bindcode $mod+Shift+$key5 move container to workspace $ws5
bindcode $mod+Shift+$key6 move container to workspace $ws6
bindcode $mod+Shift+$key7 move container to workspace $ws7
bindcode $mod+Shift+$key8 move container to workspace $ws8
bindcode $mod+Shift+$key9 move container to workspace $ws9
bindcode $mod+Shift+$key0 move container to workspace $ws10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
#bindsym $mod+b splith
#bindsym $mod+v splitv
bindsym $mod+shift+v splith
bindsym $mod+ctrl+shift+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
#bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
#bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Mnemonic: Dimension
bindsym $mod+d mode "resize"
# Fast resize
bindsym $mod+Ctrl+$left resize shrink width 5 px or 5 ppt
bindsym $mod+Ctrl+$down resize grow height 5 px or 5 ppt
bindsym $mod+Ctrl+$up resize shrink height 5 px or 5 ppt
bindsym $mod+Ctrl+$right resize grow width 5 px or 5 ppt
### Status Bar
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
#status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
status_command i3status
# Base16 colors for the statusbar
colors {
background $base00
separator $base04
statusline $base05
# State Border BG Text
focused_workspace $base0D $base0D $base00
active_workspace $base03 $base03 $base00
inactive_workspace $base01 $base01 $base05
urgent_workspace $base0F $base0F $base00
binding_mode $base0A $base0A $base00
}
separator_symbol " | "
strip_workspace_numbers yes
}
#
###############################################
# i3 config file (v4) #
# Manual https://i3wm.org/docs/userguide.html #
###############################################
# Quick and dirty hack because i3 doesn't have includes
# exit i3 (logs you out of your X session)
set $exit i3-msg exit
#set $exit "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# Screen locker
set $lock i3lock -c 000000
# Application launcher
set $menu dmenu_run
# App specific settings
for_window [class="mpv"] floating enable

View file

@ -1,65 +0,0 @@
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
interval = 5
# Base16 gruvbox-dark-pale
color_good = "#afaf00"
color_degraded = "#ffaf00"
color_bad = "#d65d0e"
}
order += "ipv6"
order += "wireless _first_"
order += "ethernet _first_"
order += "battery all"
order += "disk /"
order += "load"
order += "memory"
order += "tztime local"
ipv6 {
format_down = ""
}
wireless _first_ {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}
ethernet _first_ {
format_up = "E: %ip (%speed)"
format_down = "E: down"
}
battery all {
format = "%status %percentage %remaining"
format_down = ""
}
disk "/" {
format = "%avail"
low_threshold = "5"
threshold_type = "percentage_free"
}
load {
format = "%1min"
}
memory {
format = "%used:%available"
threshold_degraded = "1G"
format_degraded = "MEMORY < %available"
}
tztime local {
format = "%Y-%m-%d %H:%M"
}

View file

@ -1 +0,0 @@
../../themes/base16-kitty/colors

View file

@ -1,70 +0,0 @@
font_family hack
bold_font auto
italic_font auto
bold_italic_font auto
font_size 14
background_opacity 0.85
include colors/base16-gruvbox-dark-pale-256.conf
enable_audio_bell no
include .local.conf
##################################
# Nice alternative base16 themes #
##################################
#include colors/base16-3024-256.conf
#include colors/base16-gruvbox-dark-hard-256.conf
#include colors/base16-atelier-dune-256.conf
#include colors/base16-atelier-forest-256.conf
#include colors/base16-bespin-256.conf
#include colors/base16-brewer-256.conf
#include colors/base16-bright-256.conf
#include colors/base16-hopscotch-256.conf
#include colors/base16-irblack-256.conf
#include colors/base16-isotope-256.conf
#include colors/base16-macintosh-256.conf
#include colors/base16-materia-256.conf
#include colors/base16-monokai-256.conf
#include colors/base16-spacemacs-256.conf
#include colors/base16-woodland-256.conf
#########################
# Old kitty conf backup #
#########################
# background #002b36
# foreground #839496
# background_opacity 0.85
# cursor #93a1a1
# cursor_text_color #586e75
# selection_foreground #93a1a1
# selection_background #586e75
#
# color0 #073642
# color1 #dc322f
# color2 #859900
# color3 #b58900
# color4 #268bd2
# color5 #d33682
# color6 #2aa198
# color7 #eee8d5
# color9 #cb4b16
# color8 #002b36
# color10 #586e75
# color11 #657b83
# color12 #839496
# color13 #6c71c4
# color14 #93a1a1
# color15 #fdf6e3
#
# enable_audio_bell no
#
# map ctrl+shift+equal change_font_size all +1.0
# map ctrl+shift+minus change_font_size all -1.0
#
# font_size 10.0
# font_family Hack

View file

@ -1,3 +0,0 @@
# Download current video as mp3 using youtube-dl
g-d run mp3dl ${path}
#y-y run yank url

View file

@ -1 +0,0 @@
screenshot-directory=~/img/screenshots/mpv/

View file

@ -1,2 +0,0 @@
*.mail
*.pw.gpg

View file

@ -1,15 +0,0 @@
set my_account = "accountname"
set realname = "Rey"
set from = "rey@millenium.falcon"
alternates "^rey.*@millenium\\.falcon$"
set hostname = "millenium.falcon"
source 'account.rc'
set crypt_autosign
set crypt_opportunistic_encrypt
set pgp_default_key = D1D400EBE283A278E72A6ED40FDA27891A60E157
color status blue default
# vim: syntax=neomuttrc

View file

@ -1,11 +0,0 @@
set sendmail = "/usr/bin/msmtp $my_msmtp_conf -a $my_account"
set spoolfile = "+$my_account/Inbox"
set record = "+$my_account/Sent"
set postponed = "+$my_account/Draft"
set trash = "+$my_account/Trash"
macro index,pager gs "<shell-escape>mbsync $my_mbsync_conf $my_account<enter>" "IMAP sync account"
macro index,pager gi "<shell-escape>mbsync $my_mbsync_conf $my_account:INBOX<enter>" "IMAP sync Inbox"
macro index,pager gf "<shell-escape>fdm fetch -a $my_account<enter>" "fdm filter mailbox"
# vim: syntax=neomuttrc

View file

@ -1,92 +0,0 @@
# color OBJECT FOREGROUND BACKGROUND
#########
# INDEX #
#########
color index brightcyan default ~N
color index brightyellow default ~F
color index black green ~T
color index brightred default ~D
mono index bold ~N
mono index bold ~F
mono index bold ~T
mono index bold ~D
##############
# HIGHLIGHTS #
##############
color body brightgreen default "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
color body brightgreen default "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
color body brightgreen default "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
mono body bold "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
mono body bold "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
###########
# HEADERS #
###########
color header green default "^from:"
color header green default "^to:"
color header green default "^cc:"
color header green default "^date:"
color header yellow default "^newsgroups:"
color header yellow default "^reply-to:"
color header brightcyan default "^subject:"
color header red default "^x-spam-rule:"
color header yellow default "^message-id:"
color header yellow default "^Organization:"
color header yellow default "^Organisation:"
color header yellow default "^User-Agent:"
color header yellow default "^x-mailer:"
color header yellow default "^message-id: .*pine"
color header yellow default "^X-Fnord:"
color header yellow default "^X-WebTV-Stationery:"
color header yellow default "^X-Message-Flag:"
color header yellow default "^X-Spam-Status:"
color header yellow default "^X-SpamProbe:"
color header red default "^X-SpamProbe: SPAM"
##########
# QUOTES #
##########
color quoted cyan default
color quoted1 yellow default
color quoted2 red default
color quoted3 green default
color quoted4 cyan default
color quoted5 yellow default
color quoted6 red default
color quoted7 green default
###########
# SIDEBAR #
###########
color sidebar_highlight black green # Highlighted, not open
color sidebar_divider default default # divider bar
color sidebar_flagged red default # mailboxes containing flagged mail
color sidebar_new green default # mailboxes containing new mail
color sidebar_ordinary color245 default # normal mailboxes
# Default color definitions
#color hdrdefault white green
color signature brightmagenta default
color indicator black cyan
color attachment black green
color error red default
color message white default
color search brightwhite magenta
color status brightyellow blue
color tree brightblue default
color normal white default
color tilde green default
color bold brightyellow default
#color underline magenta default
color markers brightcyan default
# Colour definitions when on a mono screen
mono bold bold
mono underline underline
mono indicator reverse
# vim: syntax=neomuttrc

View file

@ -1,93 +0,0 @@
set copy # See also $record
unmailboxes *
source "~/.config/neomutt/mailboxes.sh $folder|"
# Load external configs
source sidebar.rc
source colors.rc
source gpg.rc
source keys.rc
# Accounts
source "~/.config/neomutt/folder-hooks.sh $folder|"
# Basic options
unset wait_key # Only wait if command exited != 0
set delete # delete messages for real
unset confirmappend # don't ask when adding to a mailbox
set quit #default; <quit> exits neomutt
unset move #default; don't move read messages
unset mark_old # don't mark unread mail as old when exiting mailbox
set beep_new # Hope your term bell is set to something sensible :P
unset pipe_decode # decode and weed headers before <pipe-message>, urlscan seems to require it unset
set thorough_search #default; decode mail before searching ~b and ~h
set sleep_time = 0 # Speed up folder opening
set change_folder_next # Default to next folder in list
set mail_check = 5 #default; look for new mail every 'n' seconds
set mail_check_stats # Allow mail stats gathering
set mail_check_stats_interval = 10 # Mail stats calc interval
# Status bar
set status_chars = " *%A" # mailbox unchanged/changed/RO/attach-msg mode
set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"
#########
# Index #
#########
set date_format = "%d/%m/%y %H:%M"
set index_format = "[%Z] %D - %-20.20F %s"
set sort = threads
set sort_aux = last-date-received
set uncollapse_jump # Jump to unread when unfolding
set sort_re #default; useful for mailbox sort in sidebar
unset narrow_tree #default; compact thread tree arrows
#########
# Pager #
#########
set pager_index_lines = 10 # lines aboves the pager
set pager_context = 3 # lines of context around selected msg in index
set pager_stop # don't jump to next msg when scrolling past the end
set menu_scroll # don't skip to next page when reaching bottom
set tilde # pad blank lines with '~'
unset markers # remove '+' on wrapped lines
set smart_wrap #default; wrap at word boundaries
set quote_regex = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
# Prefer plaintext and process html through mailcap
alternative_order text/plain text/enriched text/html
auto_view text/html
# Prune headers
ignore *
unignore From To Reply-To Cc Bcc Subject Date
unignore Organization X-Label X-Mailer User-Agent
###########
# Compose #
###########
# https://www.zigg.com/2018/natalie-nguyen.html
my_hdr X-Clacks-Overhead: GNU Elise Nodel, Laura, Natalie Nguyen, Terry Pratchett
set use_from # set a From: header
set use_envelope_from # which from?
set sig_dashes # dashes before sig
set edit_headers # show headers when composing
set fast_reply # skip to compose when replying
set askcc # ask for CC:
set fcc_attach # save attachments with the body
unset mime_forward # forward attachments as part of body
set forward_format = "Fwd: %s" # format of subject when forwarding
set forward_decode # decode when forwarding
set attribution = "On %d, %n wrote:" # format of quoting header
set reply_to # reply to Reply to: field
set reverse_name # reply as whomever it was to
set include # include message in replies
set forward_quote # include message in forwards
set send_charset = utf-8
set sendmail_wait = 0 # wait for msmtp to finish sending
set abort_noattach = ask-yes # warn for missing attachment
set abort_noattach_regex = "\\<(attach(|ed|ments?)|(attaché|attachés|attache|attachons|joint|jointe|joints|jointes|joins|joignons))\\>"
set editor = "vim -c 'set tw=70 et wrap' '+/^$' "
set mask = ".*" # Which files to match
# vim: syntax=neomuttrc

View file

@ -1,75 +0,0 @@
#!/bin/sh
set -euo pipefail
text="$(cat)"
# The Mime Format emails we're trying to parse have the following layout
#
# To: mail@example.org
# ... <misc headers>
#
# Content-Type: multipart/mixed;
# boundary="=_c4f4c8bf54a05b2b47ef558c3c61e418"
# ...<more headers>
#
# This is a message in Mime Format. If you see this, your mail reader does not support this format.
#
# --=_c4f4c8bf54a05b2b47ef558c3c61e418
# Content-Type: multipart/alternative;
# boundary="=_935b3ef6db1361fbfde9e3eb2b1debe5"
# Content-Transfer-Encoding: 8bit
#
#
# --=_935b3ef6db1361fbfde9e3eb2b1debe5
# Content-Type: text/plain; charset=iso-8859-1
# Content-Transfer-Encoding: quoted-printable
#
# ...<text content, if any>
#
# --=_935b3ef6db1361fbfde9e3eb2b1debe5
# Content-Type: text/html; charset=iso-8859-1
# Content-Transfer-Encoding: quoted-printable
#
# <html>=0A <head>=0A <meta http-equiv=3D"Content-Type" content=3D"text/=
# html; charset=3DISO-8859-1">=09=0A <link rel=3D"stylesheet" href=3D=
# ...<and more quoted-printable html>
# ...<and misc eventual attachment parts>
# --=_c4f4c8bf54a05b2b47ef558c3c61e418--
# We're only interested in the text/html part of the multipart email
# TODO parse actual encoding instead of defaulting to iso-8859-1
mailto="$(printf "%s" "$text" \
| awk '
boundary {
if ($0 ~ boundary) {
boundary = "";
next
}
print $0
}
/Content-Type: text\/html;/ {
boundary=line
}
{
line=$0
}' \
| qprint -d \
| iconv -f iso-8859-1 -t utf-8 \
| grep -Eo '<a href="mailto:.*?</a>')"
to="$(printf "%s" "$mailto" | sed -En 's/.*mailto:(.*?)\?subject=.*/\1/p')"
subject="$(printf "%s" "$mailto" | sed -En 's/.*\?subject=(.*?)" .*/\1/p')"
# TODO extract original To: to emulate use_envelope_from
datadir="${XDG_DATA_HOME:-"$HOME/.local/share"}/neomutt"
mkdir -p "$datadir"
format_str="unmy_hdr To: Subject:
my_hdr To: \"%s\"
my_hdr Subject: \"%s\"
echo \`rm \"%s\"\`"
printf "$format_str" "$to" "$subject" "$datadir/info.rc" > "$datadir/info.rc"

View file

@ -1,47 +0,0 @@
#!/bin/sh
usage() {
>&2 echo "$0 <mutt \$folder>"
>&2 echo " Generate mutt folder hooks for every maildir account in \$folder"
exit 1
}
if [ -z "$1" ]; then
usage
fi
acc_dir="$HOME/.config/neomutt/accounts/"
mail_dir="$1"
# Select default account
#default="$(find "$acc_dir" -name "*.mail" -printf "source '%p'\n" -quit)"
#if [ -z "$default" ]; then
# >&2 echo "No mail accounts found in $acc_dir"
# exit 1
#fi
# Order of the keys to use for the account switch macro
chars="1234567890azertyuiopqsdfghjklmwxcvbn"
i=1
# Setup folder hooks for all the accounts
for f in "$acc_dir"*.mail; do
account="$(basename -s '.mail' "$f")"
if [ ! -d "$mail_dir/$account" ]; then
continue
fi
if [ -z "$default" ]; then
default="source '$f'"
fi
inbox="$(find "$mail_dir/$account" -maxdepth 1 -iname "inbox" -type d -printf "%f" -quit)"
printf 'folder-hook =%s '\''source %s'\''\n' "$account" "$f"
key="$(printf '%s' "$chars" | cut -c "$i")"
printf 'macro index,pager <Esc>%s "<change-folder>=%s/%s<Return>" "Change to %s Inbox"\n' \
"$key" "$account" "$inbox" "$account"
i=$((i+1))
done
if [ ! -z "$default" ]; then
printf '%s\n' "$default"
fi

View file

@ -1,15 +0,0 @@
# Use GPGME
set crypt_use_gpgme
set crypt_replysign
set crypt_replyencrypt
set crypt_replysignencrypted
set crypt_verify_sig
set crypt_opportunistic_encrypt
set pgp_self_encrypt
set smime_self_encrypt
unset pgp_sign_as # Should be set by the accounts
# vim: syntax=neomuttrc

View file

@ -1,97 +0,0 @@
###########
# GENERAL #
###########
bind index,pager N search-opposite
bind generic,index,pager \Cu half-up
bind generic,index,pager \Cd half-down
bind generic,index,pager g noop # required to define multikeys binds
bind generic,index gg first-entry
bind generic,index G last-entry
bind index,pager <tab> sync-mailbox
macro index,pager ga "<shell-escape>mailsync<enter>" "Sync all IMAP mailboxes"
###########
# SIDEBAR #
###########
bind index,pager \Cj sidebar-next # Highlight next
bind index,pager \Ck sidebar-prev # Highlight previous
bind index,pager \Cl sidebar-open # Open highlighted
# For non vim users, up/down/right also work
bind index,pager B sidebar-toggle-visible # Toggle sidebar
# See also <sidebar-{page-up,page-down,next-new,prev-new}>
#########
# INDEX #
#########
bind index h noop # display-toggle-weed is rubbish in index view
bind index l display-message
bind index p recall-message
bind index R group-reply
bind index <space> collapse-thread
bind index p recall-message
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
# Saner copy/move/cd dialogs
macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"
macro index c "<change-folder>?<toggle-mailboxes>" "move a message to a mailbox"
#########
# PAGER #
#########
bind pager h exit
bind pager K previous-undeleted
bind pager J next-undeleted
bind pager k previous-line
bind pager j next-line
bind pager gg top
bind pager G bottom
bind pager R group-reply
bind pager gh display-toggle-weed
bind pager ge extract-keys
macro pager gu "<pipe-message> urlscan <enter>"
# Answer emails with a reply address in the body
# https://unix.stackexchange.com/a/586010/248368
macro pager gr "<pipe-message> ~/.config/neomutt/extract-reply.sh <enter>\
<enter-command>source ~/.local/share/neomutt/info.rc <enter>\
<mail><enter><enter><enter>"
# Use a hook to reset sender and subject just after creating the reply
send-hook . 'unmy_hdr To: Subject:'
##########
# ATTACH #
##########
bind attach l view-text # Force viewing as text
###########
# NOTMUCH #
###########
# https://a3nm.net/git/myconfig/file/mutt/muttrc.html
bind index,pager \Cf vfolder-from-query
bind index,pager z entire-thread
# Addresses autocompetion using notmuch
# https://github.com/neomutt/neomutt/issues/629
# https://github.com/neomutt/neomutt/issues/1333
set query_command = "echo '' && notmuch address from:%s"
bind editor <Tab> complete-query
bind editor ^T complete
set query_format="%4c %t %-70.70a %-70.70n %?e?(%e)?"
###########
# COMPOSE #
###########
bind compose p postpone-message
bind compose P pgp-menu
###########
# Browser #
###########
bind browser l descend-directory
bind browser h goto-parent
# vim: syntax=neomuttrc

View file

@ -1,29 +0,0 @@
#!/bin/sh
usage() {
>&2 echo "$0 <maildirs \$folder>"
>&2 echo " Generate neomutt mailboxes & named-mailboxes for every maildir in \$folder"
exit 1
}
if [ -z "$1" ]; then
usage
fi
maildir="$1"
mailboxes=$(find "$maildir" -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch | sort)
# Order of the keys to use for the account switch macro
chars="1234567890azertyuiopqsdfghjklmwxcvbn"
i=1
for m in $mailboxes; do
inbox="$(find "$m" -maxdepth 1 -iname "inbox" -type d -printf "%f" -quit)"
key="$(printf '%s' "$chars" | cut -c "$i")"
printf "named-mailboxes '[%s] %s' '%s'\n" "$key" "$(basename "$m")" "$m/$inbox"
printf "sidebar_whitelist '%s'\n" "$m/$inbox"
printf "mailboxes "
find "$m" -mindepth 1 -type d ! -name cur ! -name tmp ! -name new -printf '"%p"\0' | xargs -0
i=$((i+1))
done

View file

@ -1,6 +0,0 @@
# Default config
set mbox_type = Maildir
set folder = "~/mail"
set my_msmtp_conf = "" # Leave empty for default
set my_mbsync_conf = "" # Leave empty for default
source common.rc

View file

@ -1,21 +0,0 @@
set sidebar_visible
set mail_check_stats # update unread/flagged/total counts
set sidebar_format = '%D%?F? [%!]?%* %?N?%N/?%?S?%S?'
set sidebar_width = 32 # Note: some chars take two columns (chinese)
set sidebar_short_path # Keep only end of mailbox path
set sidebar_component_depth = 1 # nb of parent subdirs to hide
set sidebar_delim_chars = '/.' # mailbox path sep, '.' is used with IMAP
set sidebar_divider_char = '|' # UI separator bar char
set sidebar_folder_indent # indent according to path tree
set sidebar_indent_string = ' '
set sidebar_new_mail_only # Only display mailbox with new/flagged mail
unset sidebar_next_new_wrap # wrap <sidebar-{next,prev}-new> to beginning
unset sidebar_on_right # keep bar on the left
set sidebar_sort_method = 'path' # sort by mailbox path alphabetically
# Override sidebar_new_mail_only
sidebar_whitelist `find $folder -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch -printf '"%f"\0' | xargs -0`
sidebar_whitelist `find $folder -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch -printf '"%p"\0' | xargs -0`
sidebar_whitelist `find $folder -mindepth 1 -type d -iname inbox -printf '"%p"\0' | xargs -0`
# vim: syntax=neomuttrc

View file

@ -1,14 +0,0 @@
# Work config
set mbox_type = Maildir
set folder = "~/work/mail"
set my_msmtp_conf = "-C $folder/msmtprc" # Leave empty for default
set my_mbsync_conf = "-c $folder/mbsyncrc" # Leave empty for default
source common.rc
# Override sidebar_new_mail_only
# Move back to sidebar.rc once the issue is resolved
# https://github.com/neomutt/neomutt/issues/2208
sidebar_whitelist `find ~/work/mail -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch -printf '"%p"\0' | xargs -0`
sidebar_whitelist `find ~/work/mail -mindepth 1 -type d -iname inbox -printf '"%p"\0' | xargs -0`
# vim: syntax=neomuttrc

View file

@ -1,4 +0,0 @@
" http://vimcasts.org/episodes/meet-neovim/
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath
source ~/.vimrc

View file

@ -1,7 +0,0 @@
cli-history.txt
gtk-history.txt
instances.json
session.dat
users.txt
playlists
watched.txt

View file

@ -1,91 +0,0 @@
#!/usr/bin/perl
# GTK+ Pipe Viewer 0.0.5 - configuration file
our $CONFIG = {
active_channel_type_combobox => 0,
active_more_options_expander => 0,
active_panel_account_combobox => 0,
active_resolution_combobox => 4,
active_subscriptions_order_combobox => 0,
api_host => "auto",
audio_only => 0,
auto_captions => 0,
autoscroll_to_end => 0,
cache_dir => "$ENV{HOME}/.cache/pipe-viewer",
clear_search_list => 1,
clear_text_entries_on_click => 0,
comments_order => "top",
comments_width => 80,
cookie_file => undef,
dash => 1,
debug => 0,
default_notebook_page => 1,
downloads_dir => ".",
entry_completion_limit => 10,
env_proxy => 1,
fullscreen => 0,
get_captions => 1,
hfr => 1,
history => 1,
history_file => "$ENV{HOME}/.config/pipe-viewer/gtk-history.txt",
history_limit => 100000,
hpaned_position => 1152,
hpaned_width => 250,
http_proxy => undef,
ignore_av1 => 0,
m4a_audio => 1,
mainw_centered => 0,
mainw_fullscreen => 0,
mainw_maximized => 0,
mainw_size => "1920x1061",
maxResults => 10,
pipe_viewer => "/usr/bin/pipe-viewer",
pipe_viewer_args => [],
prefer_av1 => 0,
prefer_fork => 0,
prefer_mp4 => 0,
recent_history => 10,
region => undef,
remember_session => 1,
remember_session_depth => 10,
resolution => 720,
save_titles_to_history => 0,
show_thumbs => 1,
split_videos => 1,
srt_languages => ["en", "fr"],
terminal => "/usr/bin/fbterm",
terminal_exec => "-e '%s'",
thousand_separator => ",",
thumbnail_type => "medium",
timeout => undef,
tooltip_max_len => 512,
tooltips => 1,
user_agent => undef,
video_player_selected => "mpv",
video_players => {
mpv => {
arg => "--really-quiet --force-media-title=*TITLE* --no-ytdl *VIDEO*",
audio => "--audio-file=*AUDIO*",
cmd => "/usr/bin/mpv",
fs => "--fullscreen",
srt => "--sub-file=*SUB*",
},
vlc => {
arg => "--quiet --play-and-exit --no-video-title-show --input-title-format=*TITLE* *VIDEO*",
audio => "--input-slave=*AUDIO*",
cmd => "vlc",
fs => "--fullscreen",
srt => "--sub-file=*SUB*",
},
},
videoDimension => undef,
videoLicense => undef,
web_browser => undef,
youtube_channel_url => "https://www.youtube.com/channel/%s",
youtube_playlist_url => "https://www.youtube.com/playlist?list=%s",
youtube_users_file => "$ENV{HOME}/.config/pipe-viewer/users.txt",
youtube_video_url => "https://www.youtube.com/watch?v=%s",
ytdl => 1,
ytdl_cmd => "/usr/bin/youtube-dl",
}

View file

@ -1,132 +0,0 @@
#!/usr/bin/perl
# CLI Pipe Viewer 0.4.5 - configuration file
use utf8;
our $CONFIG = {
api_host => "auto",
audio_quality => "best",
auto_captions => 0,
autoplay_mode => 0,
bypass_age_gate_native => 0,
bypass_age_gate_with_proxy => 0,
cache_dir => "$ENV{HOME}/.cache/pipe-viewer",
colors => 1,
comments_order => "top",
confirm => 0,
convert_cmd => "ffmpeg -i *IN* *OUT*",
convert_to => undef,
cookie_file => undef,
copy_caption => 0,
custom_channel_layout_format => [
{ align => "right", color => "bold", text => "*NO*.", width => 3 },
{ align => "left", color => "bold blue", text => "*AUTHOR*", width => "55%" },
{ align => "right", color => "green", text => "*VIDEOS* videos", width => 14 },
{
align => "right",
color => "green",
text => "*SUBS_SHORT* subs",
width => 10,
},
],
custom_layout_format => [
{ align => "right", color => "bold", text => "*NO*.", width => 3 },
{ align => "left", color => "bold blue", text => "*TITLE*", width => "55%" },
{ align => "left", color => "yellow", text => "*AUTHOR*", width => "15%" },
{ align => "right", color => "green", text => "*AGE_SHORT*", width => 3 },
{ align => "right", color => "green", text => "*VIEWS_SHORT*", width => 5 },
{ align => "right", color => "blue", text => "*TIME*", width => 8 },
],
custom_playlist_layout_format => [
{ align => "right", color => "bold", text => "*NO*.", width => 3 },
{ align => "left", color => "bold blue", text => "*TITLE*", width => "55%" },
{ align => "right", color => "green", text => "*ITEMS* videos", width => 14 },
{ align => "left", color => "magenta", text => "*AUTHOR*", width => "20%" },
],
dash => 1,
date => undef,
debug => 0,
download_and_play => 0,
download_with_wget => 1,
download_with_ytdl => 1,
downloads_dir => ".",
env_proxy => 1,
fat32safe => 0,
features => [],
ffmpeg_cmd => "/usr/bin/ffmpeg",
force_fallback => 0,
fullscreen => 0,
get_captions => 1,
get_subscriptions_in_parallel => 0,
get_term_width => 1,
hfr => 1,
highlight_color => "bold",
highlight_watched => 1,
history => 1,
history_file => "$ENV{HOME}/.config/pipe-viewer/cli-history.txt",
history_limit => 100000,
http_proxy => undef,
ignore_av1 => 0,
ignored_projections => [],
interactive => 1,
keep_original_video => 0,
local_playlist_limit => -1,
maxResults => 20,
merge_into_mkv => 1,
merge_into_mkv_args => "-loglevel warning -c:s srt -c:v copy -c:a copy -disposition:s forced",
merge_with_captions => 1,
order => undef,
page => 1,
prefer_av1 => 0,
prefer_invidious => 0,
prefer_m4a => 0,
prefer_mp4 => 0,
region => undef,
remove_played_file => 0,
resolution => "720p",
saved_channels_file => "$ENV{HOME}/.config/pipe-viewer/users.txt",
show_video_info => 1,
skip_if_exists => 1,
skip_watched => 0,
split_videos => 1,
srt_languages => ["en", "fr"],
subscribed_channels_file => "$ENV{HOME}/.config/pipe-viewer/subscribed_channels.txt",
subscriptions_lifetime => 600,
subscriptions_limit => 10000,
thousand_separator => ",",
timeout => undef,
user_agent => undef,
video_filename_format => "*FTITLE* - *ID*.*FORMAT*",
video_player_selected => "mpv",
video_players => {
mpv => {
arg => "--really-quiet --force-media-title=*TITLE* --no-ytdl *VIDEO*",
audio => "--audio-file=*AUDIO*",
cmd => "/usr/bin/mpv",
fs => "--fullscreen",
novideo => "--no-video",
srt => "--sub-file=*SUB*",
},
vlc => {
arg => "--quiet --play-and-exit --no-video-title-show --input-title-format=*TITLE* *VIDEO*",
audio => "--input-slave=*AUDIO*",
cmd => "vlc",
fs => "--fullscreen",
novideo => "--intf=dummy --novideo",
srt => "--sub-file=*SUB*",
},
},
videoDuration => undef,
watch_history => 1,
watch_history_file => "$ENV{HOME}/.config/pipe-viewer/watched.txt",
wget_cmd => "/usr/bin/wget",
youtube_channel_url => "https://www.youtube.com/channel/%s",
youtube_playlist_url => "https://www.youtube.com/playlist?list=%s",
youtube_video_url => "https://www.youtube.com/watch?v=%s",
ytdl => 1,
ytdl_cmd => "/usr/bin/yt-dlp",
ytdlp_comments => 0,
ytdlp_max_comments => 10,
ytdlp_max_replies => 3,
}

View file

@ -1,4 +0,0 @@
local.py
qsettings
bookmarks
quickmarks

View file

@ -1,20 +0,0 @@
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova
# Gruvbox dark, medium scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
base00 = "#282828"
base01 = "#3c3836"
base02 = "#504945"
base03 = "#665c54"
base04 = "#bdae93"
base05 = "#d5c4a1"
base06 = "#ebdbb2"
base07 = "#fbf1c7"
base08 = "#fb4934"
base09 = "#fe8019"
base0A = "#fabd2f"
base0B = "#b8bb26"
base0C = "#8ec07c"
base0D = "#83a598"
base0E = "#d3869b"
base0F = "#d65d0e"

View file

@ -1,381 +0,0 @@
import base16_gruvbox_dark_medium as b16
from local import GPG_KEY, NOTIF_GRANTS
# pylint: disable=C0111
c = c # noqa: F821 pylint: disable=E0602,C0103
config = config # noqa: F821 pylint: disable=E0602,C0103
config.load_autoconfig(False)
########
# Misc #
########
config.set("auto_save.session", True)
config.set("colors.webpage.preferred_color_scheme", "dark")
config.set("content.autoplay", False)
config.set("content.default_encoding", "utf-8")
config.set("content.pdfjs", False)
config.set("content.plugins", False)
config.set("downloads.location.directory", "~/dl")
config.set("session.lazy_restore", True)
config.set("tabs.background", True)
config.set("tabs.last_close", "close")
config.set("tabs.mousewheel_switching", False)
config.set("tabs.new_position.unrelated", "next")
config.set("tabs.position", "left")
config.set("tabs.show", "multiple")
config.set("tabs.width", "10%")
##############
# Privileges #
##############
# Cookies
config.set("content.cookies.accept", "never", "*://*.medium.com/*")
# Media capture
config.set("content.media.audio_capture", True, "*://discord.com/*")
config.set("content.media.audio_video_capture", True, "*://discord.com/*")
config.set("content.media.video_capture", True, "*://discord.com/*")
# Notifications
for pattern in NOTIF_GRANTS:
config.set("content.notifications.enabled", True, pattern)
config.set("content.notifications.enabled", True, "*://app.slack.com/*")
config.set("content.notifications.enabled", True, "*://discord.com/*")
config.set("content.notifications.enabled", False, "*://*.reddit.com/*")
############
# Bindings #
############
# Hinting
config.bind("F", "hint all tab-bg")
config.bind(";p", "hint links spawn cliplumber {hint-url}")
config.bind(";v", "hint links spawn playvideo {hint-url}")
config.bind(";i", "hint images download")
config.bind("wi", "devtools window")
# Keepass autotype
config.bind("<Alt-Shift-u>",
"spawn --userscript qute-keepassxc --key " + GPG_KEY,
mode="insert")
config.bind("pw",
"spawn --userscript qute-keepassxc --key " + GPG_KEY,
mode="normal")
# Toggle socks proxy
config.bind("gp",
(
'config-cycle -t -p content.proxy '
'"socks://127.0.0.1:8080/" '
'"system"'
))
# Gruvbox dark theme hotswappable on demand
config.bind("<Ctrl-R>",
(
'config-cycle -t content.user_stylesheets '
'"~/.config/qutebrowser/css/gruvbox-all-sites.css" '
'""'
))
##############
# Adblocking #
##############
config.set("content.blocking.enabled", True)
config.set("content.blocking.method", "adblock")
config.set(
"content.blocking.adblock.lists",
[
str(config.configdir) + "/custom-block.txt",
"https://easylist.to/easylist/easylist.txt",
"https://easylist.to/easylist/easyprivacy.txt",
# "https://easylist.to/easylist/fanboy-annoyance.txt",
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt",
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt",
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt",
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt",
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt",
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt",
],
)
###############
# Color theme #
###############
# Text color of the completion widget. May be a single color to use for
# all columns or a list of three colors, one for each column.
c.colors.completion.fg = b16.base05
# Background color of the completion widget for odd rows.
c.colors.completion.odd.bg = b16.base03
# Background color of the completion widget for even rows.
c.colors.completion.even.bg = b16.base00
# Foreground color of completion widget category headers.
c.colors.completion.category.fg = b16.base0A
# Background color of the completion widget category headers.
c.colors.completion.category.bg = b16.base00
# Top border color of the completion widget category headers.
c.colors.completion.category.border.top = b16.base00
# Bottom border color of the completion widget category headers.
c.colors.completion.category.border.bottom = b16.base00
# Foreground color of the selected completion item.
c.colors.completion.item.selected.fg = b16.base01
# Background color of the selected completion item.
c.colors.completion.item.selected.bg = b16.base0A
# Top border color of the selected completion item.
c.colors.completion.item.selected.border.top = b16.base0A
# Bottom border color of the selected completion item.
c.colors.completion.item.selected.border.bottom = b16.base0A
# Foreground color of the matched text in the selected completion item.
c.colors.completion.item.selected.match.fg = b16.base08
# Foreground color of the matched text in the completion.
c.colors.completion.match.fg = b16.base0B
# Color of the scrollbar handle in the completion view.
c.colors.completion.scrollbar.fg = b16.base05
# Color of the scrollbar in the completion view.
c.colors.completion.scrollbar.bg = b16.base00
# Background color of the context menu. If set to null, the Qt default is used.
c.colors.contextmenu.menu.bg = b16.base00
# Foreground color of the context menu. If set to null, the Qt default is used.
c.colors.contextmenu.menu.fg = b16.base05
# Background color of the context menus selected item.
# If set to null, the Qt default is used.
c.colors.contextmenu.selected.bg = b16.base0A
# Foreground color of the context menus selected item.
# If set to null, the Qt default is used.
c.colors.contextmenu.selected.fg = b16.base01
# Background color for the download bar.
c.colors.downloads.bar.bg = b16.base00
# Color gradient start for download text.
c.colors.downloads.start.fg = b16.base00
# Color gradient start for download backgrounds.
c.colors.downloads.start.bg = b16.base0D
# Color gradient end for download text.
c.colors.downloads.stop.fg = b16.base00
# Color gradient stop for download backgrounds.
c.colors.downloads.stop.bg = b16.base0C
# Foreground color for downloads with errors.
c.colors.downloads.error.fg = b16.base08
# Font color for hints.
c.colors.hints.fg = b16.base00
# Background color for hints. Note that you can use a `rgba(...)` value
# for transparency.
c.colors.hints.bg = b16.base0A
# Font color for the matched part of hints.
c.colors.hints.match.fg = b16.base05
# Text color for the keyhint widget.
c.colors.keyhint.fg = b16.base05
# Highlight color for keys to complete the current keychain.
c.colors.keyhint.suffix.fg = b16.base05
# Background color of the keyhint widget.
c.colors.keyhint.bg = b16.base00
# Foreground color of an error message.
c.colors.messages.error.fg = b16.base00
# Background color of an error message.
c.colors.messages.error.bg = b16.base08
# Border color of an error message.
c.colors.messages.error.border = b16.base08
# Foreground color of a warning message.
c.colors.messages.warning.fg = b16.base00
# Background color of a warning message.
c.colors.messages.warning.bg = b16.base0E
# Border color of a warning message.
c.colors.messages.warning.border = b16.base0E
# Foreground color of an info message.
c.colors.messages.info.fg = b16.base05
# Background color of an info message.
c.colors.messages.info.bg = b16.base00
# Border color of an info message.
c.colors.messages.info.border = b16.base00
# Foreground color for prompts.
c.colors.prompts.fg = b16.base05
# Border used around UI elements in prompts.
c.colors.prompts.border = b16.base00
# Background color for prompts.
c.colors.prompts.bg = b16.base00
# Background color for the selected item in filename prompts.
c.colors.prompts.selected.bg = b16.base0A
# Foreground color of the statusbar.
c.colors.statusbar.normal.fg = b16.base0B
# Background color of the statusbar.
c.colors.statusbar.normal.bg = b16.base00
# Foreground color of the statusbar in insert mode.
c.colors.statusbar.insert.fg = b16.base00
# Background color of the statusbar in insert mode.
c.colors.statusbar.insert.bg = b16.base0D
# Foreground color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.fg = b16.base00
# Background color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.bg = b16.base0C
# Foreground color of the statusbar in private browsing mode.
c.colors.statusbar.private.fg = b16.base00
# Background color of the statusbar in private browsing mode.
c.colors.statusbar.private.bg = b16.base03
# Foreground color of the statusbar in command mode.
c.colors.statusbar.command.fg = b16.base05
# Background color of the statusbar in command mode.
c.colors.statusbar.command.bg = b16.base00
# Foreground color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.fg = b16.base05
# Background color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.bg = b16.base00
# Foreground color of the statusbar in caret mode.
c.colors.statusbar.caret.fg = b16.base00
# Background color of the statusbar in caret mode.
c.colors.statusbar.caret.bg = b16.base0E
# Foreground color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.fg = b16.base00
# Background color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.bg = b16.base0D
# Background color of the progress bar.
c.colors.statusbar.progress.bg = b16.base0D
# Default foreground color of the URL in the statusbar.
c.colors.statusbar.url.fg = b16.base05
# Foreground color of the URL in the statusbar on error.
c.colors.statusbar.url.error.fg = b16.base08
# Foreground color of the URL in the statusbar for hovered links.
c.colors.statusbar.url.hover.fg = b16.base05
# Foreground color of the URL in the statusbar on successful load
# (http).
c.colors.statusbar.url.success.http.fg = b16.base0C
# Foreground color of the URL in the statusbar on successful load
# (https).
c.colors.statusbar.url.success.https.fg = b16.base0B
# Foreground color of the URL in the statusbar when there's a warning.
c.colors.statusbar.url.warn.fg = b16.base0E
# Background color of the tab bar.
c.colors.tabs.bar.bg = b16.base00
# Color gradient start for the tab indicator.
c.colors.tabs.indicator.start = b16.base0D
# Color gradient end for the tab indicator.
c.colors.tabs.indicator.stop = b16.base0C
# Color for the tab indicator on errors.
c.colors.tabs.indicator.error = b16.base08
# Foreground color of unselected odd tabs.
c.colors.tabs.odd.fg = b16.base05
# Background color of unselected odd tabs.
c.colors.tabs.odd.bg = b16.base03
# Foreground color of unselected even tabs.
c.colors.tabs.even.fg = b16.base05
# Background color of unselected even tabs.
c.colors.tabs.even.bg = b16.base00
# Background color of pinned unselected even tabs.
c.colors.tabs.pinned.even.bg = b16.base0C
# Foreground color of pinned unselected even tabs.
c.colors.tabs.pinned.even.fg = b16.base07
# Background color of pinned unselected odd tabs.
c.colors.tabs.pinned.odd.bg = b16.base0B
# Foreground color of pinned unselected odd tabs.
c.colors.tabs.pinned.odd.fg = b16.base07
# Background color of pinned selected even tabs.
c.colors.tabs.pinned.selected.even.bg = b16.base05
# Foreground color of pinned selected even tabs.
c.colors.tabs.pinned.selected.even.fg = b16.base00
# Background color of pinned selected odd tabs.
c.colors.tabs.pinned.selected.odd.bg = b16.base05
# Foreground color of pinned selected odd tabs.
c.colors.tabs.pinned.selected.odd.fg = b16.base0E
# Foreground color of selected odd tabs.
c.colors.tabs.selected.odd.fg = b16.base00
# Background color of selected odd tabs.
c.colors.tabs.selected.odd.bg = b16.base05
# Foreground color of selected even tabs.
c.colors.tabs.selected.even.fg = b16.base00
# Background color of selected even tabs.
c.colors.tabs.selected.even.bg = b16.base05
# Background color for webpages if unset (or empty to use the theme's
# color).
# c.colors.webpage.bg = b16.base00

File diff suppressed because it is too large Load diff

View file

@ -1,3 +0,0 @@
||*.youtube.com
||tweetdeck.twitter.com
||twitter.com

View file

@ -1,332 +0,0 @@
// ==UserScript==
// @name Direct links out
// @name:ru Прямые ссылки наружу
// @description Removes all "You are leaving our site" and redirection stuff from links
// @description:ru Убирает "Бла-бла-бла, Вы покидаете наш сайт" и переадресации из ссылок
// @namespace https://github.com/nokeya
// @author nokeya
// @update https://github.com/nokeya/direct-links-out/raw/master/direct-links-out.user.js
// @icon https://raw.githubusercontent.com/nokeya/direct-links-out/master/icon.png
// @version 2.19
// @grant none
//google
// @include *://google.*
// @include *://www.google.*
// @include *://encrypted.google.*
//yandex
// @match *://yandex.ru/*
// @match *://yandex.ua/*
// @match *://yandex.by/*
// @match *://yandex.kz/*
// @match *://yandex.com.tr/*
// @match *://yandex.com/*
// @match *://*.yandex.ru/*
// @match *://*.yandex.ua/*
// @match *://*.yandex.by/*
// @match *://*.yandex.kz/*
// @match *://*.yandex.com.tr/*
// @match *://*.yandex.com/*
//youtube
// @match *://youtube.com/*
// @match *://*.youtube.com/*
//wikimapia
// @match *://wikimapia.org/*
//deviantart
// @match *://deviantart.com/*
// @match *://*.deviantart.com/*
//joyreactor
// @match *://joyreactor.cc/*
// @match *://*.joyreactor.cc/*
// @match *://reactor.cc/*
// @match *://*.reactor.cc/*
// @match *://joyreactor.com/*
// @match *://*.joyreactor.com/*
//vk
// @match *://vk.com/*
// @match *://*.vk.com/*
//ok
// @match *://ok.ru/*
// @match *://*.ok.ru/*
//steam
// @match *://steamcommunity.com/*
// @match *://*.steamcommunity.com/*
//fb
// @match *://facebook.com/*
// @match *://*.facebook.com/*
//twitter
// @match *://twitter.com/*
// @match *://*.twitter.com/*
//4pda
// @match *://4pda.ru/*
// @match *://*.4pda.ru/*
//kickass
// @match *://kat.cr/*
// @match *://kickassto.co/*
// @match *://katproxy.is/*
// @match *://thekat.tv/*
// @match *://*.kat.cr/*
// @match *://*.kickassto.co/*
// @match *://*.katproxy.is/*
// @match *://*.thekat.tv/*
//AMO
// @match *://addons.mozilla.org/*
//pixiv
// @match *://pixiv.net/*
// @match *://*.pixiv.net/*
//tumblr
// @match *://tumblr.com/*
// @match *://*.tumblr.com/*
//danieldefo
// @match *://danieldefo.ru/*
// @match *://*.danieldefo.ru/*
//yaplakal
// @match *://yaplakal.com/*
// @match *://*.yaplakal.com/*
//soundcloud
// @match *://soundcloud.com/*
// @match *://*.soundcloud.com/*
//upwork
// @match *://upwork.com/*
// @match *://*.upwork.com/*
//picarto
// @match *://picarto.tv/*
// @match *://*.picarto.tv/*
//taker
// @match *://taker.im/*
// @match *://*.taker.im/*
//forumavia
// @match *://*.forumavia.ru/*
//slack
// @match *://*.slack.com/*
//instagram
// @match *://instagram.com/*
// @match *://*.instagram.com/*
// ==/UserScript==
(function() {
// anchors and functions
var anchor;
var after;
var rwLink = function(){};
var rwAll = function(){};
var retTrue = function() { return true; }; //dummy function to always return true
// simple rewrite link - based on anchors
function rwSimple(link){
if (anchor){
var ndx = link.href.indexOf(anchor);
if (ndx != -1){
var newlink = link.href.substring(ndx + anchor.length);
if (after){
ndx = newlink.indexOf(after);
if (ndx != -1)
newlink = newlink.substring(0, ndx);
}
link.href = unescape(newlink);
}
}
}
function rwaSimple(){
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; ++i)
rwLink(links[i]);
}
// vk
function rwVK(link){
if (link.className === 'page_media_link_thumb')
{
var parent = link.parentNode;
link.href = parent.getAttribute("href");
parent.removeAttribute('href');
parent.removeAttribute('onclick');
link.removeAttribute('onclick');
}
var ndx = link.href.indexOf(anchor);
if (ndx != -1){
var newlink = link.href.substring(ndx + anchor.length);
var afterArr = ['&post=', '&el=snippet', '&cc_key='];
for (var i = 0; i < afterArr.length; ++i){
ndx = newlink.indexOf(afterArr[i]);
if (ndx != -1)
newlink = newlink.substring(0, ndx);
}
link.href = unescape(newlink);
}
}
// twitter
function rwTwitter(link){
if (link.hasAttribute('data-expanded-url')){
link.href = link.getAttribute('data-expanded-url');
link.removeAttribute('data-expanded-url');
}
}
function rwaTwitter(){
var links = document.getElementsByClassName('twitter-timeline-link');
for (var i = 0; i < links.length; ++i)
rwLink(links[i]);
}
// kickass
function rwKickass(link){
var ndx = link.href.indexOf(anchor);
if (ndx != -1){
link.href = window.atob(unescape(link.href.substring(ndx + anchor.length, link.href.length - 1)));
link.className = '';
}
}
// youtube
function rwYoutube(link){
if (/redirect/i.test(link.className))
link.setAttribute('data-redirect-href-updated', 'true');
rwSimple(link);
}
// facebook
function rwFacebook(link){
if (/referrer_log/i.test(link.onclick)){
link.removeAttribute('onclick');
link.removeAttribute('onmouseover');
}
rwSimple(link);
}
// google
function rwGoogle(link){
// replace global rwt script
if (window.rwt && window.rwt != retTrue){
delete window.rwt;
Object.defineProperty(window, 'rwt', { value: retTrue, writable: false });
}
// main search
if (link.hasAttribute('onmousedown'))
link.removeAttribute('onmousedown');
// images
if (link.hasAttribute('jsaction')){
var tmp = link.getAttribute('jsaction');
if (tmp)
link.setAttribute('jsaction', tmp.replace(/(mousedown:irc.rl|keydown:irc.rlk)/g,''));
}
}
// yandex
function rwYandex(link){
// main search
if (link.hasAttribute('onmousedown'))
link.removeAttribute('onmousedown');
// images
anchor = '&img_url=';
after = '&pos=';
rwSimple(link);
}
//mozilla addons store
function rwAMO(link){
if (/outgoing.prod.mozaws.net/i.test(link.href)){
var tmp = link.href;
link.href = "#";
// we have to fight mozilla's replacing of direct redirect string with jquery events
setTimeout(function(){ link.href = unescape(tmp.replace(/(http|https):\/\/outgoing.prod.mozaws.net\/v1\/[0-9a-zA-Z]+\//i,'')); }, 100);
}
}
// daniueldefo
function rwDanielDefo(link){
if (link.hasAttribute('data-proxy-href'))
link.removeAttribute('data-proxy-href');
}
// slack
function rwSlack(link){
link.removeAttribute('onclick');
link.removeAttribute('onmouseover');
}
// determine anchors, functions and listeners
(function ()
{
rwLink = rwSimple;
rwAll = rwaSimple;
var loc = window.location.hostname;
if (/google/i.test(loc))
rwLink = rwGoogle;
else if (/youtube/i.test(loc)){
anchor = 'redirect?q=';
after = '&redir_token=';
rwLink = rwYoutube;
}
else if (/facebook/i.test(loc)){
anchor = 'u=';
after = '&h=';
rwLink = rwFacebook;
}
else if (/instagram/i.test(loc)){
anchor = 'u=';
after = '&e=';
}
else if (/twitter/i.test(loc)){
rwLink = rwTwitter;
rwAll = rwaTwitter;
}
else if (/yandex/i.test(loc))
rwLink = rwYandex;
else if (/vk/i.test(loc)){
anchor = 'to=';
rwLink = rwVK;
}
else if (/ok/i.test(loc)){
anchor = 'st.link=';
after = '&st.name=';
}
else if (/pixiv/i.test(loc))
anchor = 'jump.php?';
else if (/tumblr/i.test(loc)){
anchor = "redirect?z=";
after = "&t=";
}
else if (/deviantart/i.test(loc))
anchor = 'outgoing?';
else if (/(steam|reactor)/i.test(loc))
anchor = 'url=';
else if (/(kat|kickass)/i.test(loc)){
anchor = 'confirm/url/';
rwLink = rwKickass;
}
else if (/soundcloud/i.test(loc))
anchor = "exit.sc/?url=";
else if (/upwork/i.test(loc))
anchor = 'leaving-odesk?ref=';
else if (/4pda/i.test(loc)){
anchor = 'go/?u=';
after = '&e=';
}
else if (/mozilla/i.test(loc))
rwLink = rwAMO;
else if (/danieldefo/i.test(loc))
rwLink = rwDanielDefo;
else if (/yaplakal/i.test(loc))
anchor = "go/?";
else if (/wikimapia.org/i.test(loc))
anchor = 'external_link?url=';
else if (/forumavia.ru/i.test(loc))
anchor = '/e/?l=';
else if (/picarto/i.test(loc)){
anchor = "referrer?go=";
after = "&ref=";
}
else if (/taker/i.test(loc))
anchor = "phpBB2/goto/";
else if (/slack/i.test(loc))
rwLink = rwSlack;
document.addEventListener('DOMNodeInserted', function(event){
if (!event || !event.target || !(event.target instanceof HTMLElement))
return;
var node = event.target;
if (node instanceof HTMLAnchorElement)
rwLink(node);
var links = node.getElementsByTagName('a');
for (var i = 0; i < links.length; ++i)
rwLink(links[i]);
}, false);
})();
rwAll();
})();

View file

@ -1,79 +0,0 @@
// https://github.com/joeywatts/disable-autogain-control-extension/blob/master/disableAutogain.js
(function() {
function setLegacyChromeConstraint(constraint, name, value) {
if (constraint.mandatory && name in constraint.mandatory) {
constraint.mandatory[name] = value;
return;
}
if (constraint.optional) {
const element = constraint.optional.find(opt => name in opt);
if (element) {
element[name] = value;
return;
}
}
// `mandatory` options throw errors for unknown keys, so avoid that by
// setting it under optional.
if (!constraint.optional) {
constraint.optional = [];
}
constraint.optional.push({ [name]: value });
}
function setConstraint(constraint, name, value) {
if (constraint.advanced) {
const element = constraint.advanced.find(opt => name in opt);
if (element) {
element[name] = value;
return;
}
}
constraint[name] = value;
}
function disableAutogain(constraints) {
console.log("Automatically unsetting gain!", constraints);
if (constraints && constraints.audio) {
if (typeof constraints.audio !== "object") {
constraints.audio = {};
}
if (constraints.audio.optional || constraints.audio.mandatory) {
setLegacyChromeConstraint(constraints.audio, "googAutoGainControl", false);
setLegacyChromeConstraint(constraints.audio, "googAutoGainControl2", false);
} else {
setConstraint(constraints.audio, "autoGainControl", false);
}
}
}
function patchFunction(object, name, createNewFunction) {
if (name in object) {
var original = object[name];
object[name] = createNewFunction(original);
}
}
patchFunction(navigator.mediaDevices, "getUserMedia", function (original) {
return function getUserMedia(constraints) {
disableAutogain(constraints);
return original.call(this, constraints);
};
});
function patchDeprecatedGetUserMedia(original) {
return function getUserMedia(constraints, success, error) {
disableAutogain(constraints);
return original.call(this, constraints, success, error);
};
}
patchFunction(navigator, "getUserMedia", patchDeprecatedGetUserMedia);
patchFunction(navigator, "mozGetUserMedia", patchDeprecatedGetUserMedia);
patchFunction(navigator, "webkitGetUserMedia", patchDeprecatedGetUserMedia);
patchFunction(MediaStreamTrack.prototype, "applyConstraints", function (original) {
return function applyConstraints(constraints) {
disableAutogain(constraints);
return original.call(this, constraints);
};
});
console.log(
"Disable Autogain by Joey Watts!",
navigator.mediaDevices.getUserMedia
);
})();

View file

@ -1,15 +0,0 @@
// ==UserScript==
// @name Nitter redirector
// @namespace https://gist.github.com/bitraid/d1901de54382532a03b9b22a207f0417
// @version 1.0
// @description reddit to teddit
// @match *://*.twitter.com/*
// @match *://twitter.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
top.location.hostname = "nitter.privacydev.net";
})();

View file

@ -1,7 +0,0 @@
GPG_KEY = "D1D400EBE283A278E72A6ED40FDA27891A60E157"
NOTIF_GRANTS = [
"*://example.com/*",
"*://cool.website/*",
]
# vim: syntax=python

View file

@ -1,69 +0,0 @@
####################
# sway config file #
# `man 5 sway` #
####################
# i3/sway common config
include ../i3/common
# exit sway (logs you out of your Wayland session)
set $exit swaymsg exit
# Screen locker
set $lock swaylock -f -c 000000
# Application launcher
# Note: it's recommended that you pass the final command to sway
set $menu dmenu_path | bemenu | xargs swaymsg exec --
# App specific settings
for_window [app_id="mpv"] floating enable
# Default wallpaper
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
# Apps autostart (run on each config reload)
exec_always {
import-gsettings
}
# Set keyboard layout
input * xkb_layout fr,ru,fr
input * xkb_variant oss,phonetic,bepo
input * xkb_options grp:shift_caps_toggle
input * xkb_numlock enable
# Configure touchpad (man 5 sway-input)
input type:touchpad {
tap enabled
tap_button_map lmr
}
############
# Examples #
############
# Output config
# output HDMI-A-1 resolution 1920x1080 position 1920,0
# Get outputs names
# swaymsg -t get_outputs
# Idle config
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' \
# resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
# Input configuration (man 5 sway-input)
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# Get inputs names
# swaymsg -t get_inputs
include /etc/sway/config.d/*

View file

@ -1,57 +0,0 @@
#!/usr/bin/perl
# trizen configuration file
our $CONFIG = {
ask_for_retry => 1, # bool -- When `makepkg` fails to build a package, offer the option for trying again.
aur_results_last_modified => 1, # bool -- Show the date when the packages were last updated in AUR results.
aur_results_popularity => 1, # bool -- Show the popularity score in AUR results.
aur_results_show_installed => 1, # bool -- Show when a package is installed in AUR results.
aur_results_sort_by => "name", # str -- Sort the AUR results by "name", "votes", "popularity" or "date".
aur_results_sort_order => "ascending", # str -- Sort the AUR results in "ascending" or "descending" order.
aur_results_votes => 1, # bool -- Show the number of votes in AUR results.
clone_dir => "$ENV{HOME}/aur", # str -- Absolute path to the directory where to clone and build packages.
color_code_dependencies => 1, # bool -- Display the dependencies of a package in specific colors (green = installed; cyan = in repo; purple = in AUR).
debug => 0, # bool -- Verbose mode.
flip_indices => 0, # bool -- In search+install mode, show the indices of packages in reverse order.
flip_results => 0, # bool -- Show the search results in reverse order.
forcecolors => 0, # bool -- Force output colors even when not writing to STDOUT.
git_clone_depth => 0, # int -- Pass the `--depth int` flag to `git clone`. (0 means no limit)
lwp_env_proxy => 1, # bool -- Use proxy settings defined in `env` (if any).
lwp_show_progress => 0, # bool -- Show the HTTPS requests made by LWP::UserAgent to the AUR servers.
lwp_timeout => 60, # int -- Seconds after which an HTTPS connection is aborted.
makepkg_command => "/usr/bin/makepkg -scf", # str -- The `makepkg` command that is used internally in building a package.
movepkg => 0, # bool -- Move built packages in the directory `movepkg_dir`.
movepkg_dir => "/var/cache/pacman/pkg", # str -- Absolute path to the directory where to move built packages (with `movepkg`).
nocolors => 0, # bool -- Disable output colors for `trizen`.
noedit => 0, # bool -- Do not prompt to edit files when installing an AUR package.
noinfo => 0, # bool -- Do not display package information when installing an AUR package.
noinstall => 0, # bool -- Do not install built packages -- builds only.
nopull => 0, # bool -- Do not `git pull` new changes from the AUR git server.
one_line_edit => 0, # bool -- Select one or more build files to view/edit with one-line prompt.
packages_in_stats => 5, # int -- The number of packages to display in `--stats`
pacman_command => "/usr/bin/pacman", # str -- The `pacman` command that is used internally for pacman operations.
pacman_local_dir => "/var/lib/pacman/local", # str -- Absolute path to the pacman's local directory.
pager_mode => 0, # bool -- Show the build files in pager mode using pager.
recompute_deps => 1, # bool -- Recompute the dependencies of a package (after its build files are inspected / edited).
show_build_files_content => 1, # bool -- Show the content of the build files of a package before building it.
show_comments => 0, # int -- Show the `n` most recent AUR comments for a package before building it. (max: 10)
show_diff_only => 0, # bool -- When the build files of a package already exist locally, show the diff only.
show_inexistent => 1, # bool -- Warn about packages that do not exist in AUR, during -Su.
show_ood => 0, # bool -- Warn about out-of-date marked packages, during -Su.
show_unmaintained => 1, # bool -- Warn about unmaintained packages, during -Su.
skipinteg => 0, # bool -- Pass the `--skipinteg` argument to `makepkg`.
split_packages => 1, # bool -- Ask about installing the other parts of a split package.
ssl_verify_hostname => 1, # bool -- Ensure LWP::UserAgent connects to servers that have a valid certificate.
su_command => "/usr/bin/su -c", # str -- Command used when special permissions are required and `use_sudo` is set to 0.
sudo_autorepeat => 0, # bool -- Automatically repeat `sudo -v` in the background after a `sudo` command was first executed.
sudo_autorepeat_at_runtime => 0, # bool -- Execute `sudo -v` when `trizen` is first executed and apply the behavior of `sudo_autorepeat`.
sudo_autorepeat_interval => 180, # int -- Interval, in seconds, after which `sudo -v` is executed in background (with `sudo_autorepeat`).
sudo_command => "/usr/bin/sudo", # str -- Command used when special permissions are required and `use_sudo` is set to 1.
sudo_remove_timestamp => 1, # bool -- Remove the cached sudo credentials before `makepkg` is executed (`sudo --remove-timestamp`).
syntax_highlighting => 1, # bool -- Syntax highlighting of the build files, using the `highlight` tool from [community].
syntax_highlighting_cmd => "/usr/bin/highlight -O ansi", # str -- The `highlight` command used in highlighting the syntax of the build files (with `syntax_highlighting`).
use_github_api => 1, # bool -- Check GitHub sources for updates using GitHub's API. (during `--devel --needed`)
use_gitlab_api => 1, # bool -- Check GitLab sources for updates using GitLab's API. (during `--devel --needed`)
use_sudo => 1, # bool -- Use the `sudo` command when special permissions are required.
}

View file

@ -1,26 +0,0 @@
partial alphanumeric_keys
xkb_symbols "fr_oss_ansi" {
// Brings < and > to ANSI keyboards
include "fr(oss)"
name[Group1]="French (alt., ansi)";
key <AB01> { [w, W, less, guillemotleft ] }; // w W < «
key <AB02> { [x, X, greater, guillemotright ] }; // x X > »
};
partial alphanumeric_keys
xkb_symbols "fr_afnor" {
// new AFNOR azerty adapted for programming and use with an ANSI keyboard
include "fr(afnor)"
key <AE07> {[ leftsinglequotemark, 7, grave, dead_macron ]}; // 7 `
key <AE12> {[ circumflex, dead_diaeresis, dead_circumflex, dead_caron ]}; // ^
key <AB06> {[ n, N, tilde, dead_tilde ]}; // n N ~
key <AD04> {[ r, R, registered, copyright ]}; // r R ® ©
key <AB01> { [w, W, less, lessthanequal ] }; // w W < ≤
key <AB02> { [x, X, greater, greaterthanequal ] }; // x X > ≥
}

View file

@ -1,52 +0,0 @@
# General
set statusbar-h-padding 0
set statusbar-v-padding 0
set window-title-basename "true"
set selection-clipboard "clipboard"
#Appearance
set font "Hack 10"
set notification-error-bg "#282828" # bg
set notification-error-fg "#fb4934" # bright:red
set notification-warning-bg "#282828" # bg
set notification-warning-fg "#fabd2f" # bright:yellow
set notification-bg "#282828" # bg
set notification-fg "#b8bb26" # bright:green
set completion-bg "#504945" # bg2
set completion-fg "#ebdbb2" # fg
set completion-group-bg "#3c3836" # bg1
set completion-group-fg "#928374" # gray
set completion-highlight-bg "#83a598" # bright:blue
set completion-highlight-fg "#504945" # bg2
# Define the color in index mode
set index-bg "#504945" # bg2
set index-fg "#ebdbb2" # fg
set index-active-bg "#83a598" # bright:blue
set index-active-fg "#504945" # bg2
set inputbar-bg "#282828" # bg
set inputbar-fg "#ebdbb2" # fg
set statusbar-bg "#504945" # bg2
set statusbar-fg "#ebdbb2" # fg
set highlight-color "#fabd2f" # bright:yellow
set highlight-active-color "#fe8019" # bright:orange
set default-bg "#282828" # bg
set default-fg "#ebdbb2" # fg
set render-loading true
set render-loading-bg "#282828" # bg
set render-loading-fg "#ebdbb2" # fg
# Recolor book content's color
set recolor-lightcolor "#282828" # bg
set recolor-darkcolor "#ebdbb2" # fg
set recolor "true"
set recolor-reverse-video "true" # Keep original image colors
set recolor-keephue "true"

View file

@ -1,3 +0,0 @@
¯\_(ツ)_/¯ whatever, shrug
¯\\_(ツ)_/¯ whatever, shrug
✽-(ˆ▽ˆ)/✽ cheerleader, pom-pom
1 ¯\_(ツ)_/¯ whatever, shrug
2 ¯\\_(ツ)_/¯ whatever, shrug
3 ✽-(ˆ▽ˆ)/✽ cheerleader, pom-pom

@ -1 +1 @@
Subproject commit a47b5088636c3678c7baa22710d10b0c45bc9265
Subproject commit edf7ac5c1e61c505201385846361fe3c2b69b31b

47
fsh_theme.zsh Normal file
View file

@ -0,0 +1,47 @@
zstyle :plugin:fast-syntax-highlighting theme "default"
typeset -g FAST_THEME_NAME="default"
: ${FAST_HIGHLIGHT_STYLES[defaultdefault]:=none}
: ${FAST_HIGHLIGHT_STYLES[defaultunknown-token]:=fg=red,bold}
: ${FAST_HIGHLIGHT_STYLES[defaultreserved-word]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaultalias]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultsuffix-alias]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultbuiltin]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultfunction]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultcommand]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultprecommand]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultcommandseparator]:=none}
: ${FAST_HIGHLIGHT_STYLES[defaulthashed-command]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultpath]:=fg=white,underline}
: ${FAST_HIGHLIGHT_STYLES[defaultpath_pathseparator]:=}
: ${FAST_HIGHLIGHT_STYLES[defaultglobbing]:=fg=blue,bold}
: ${FAST_HIGHLIGHT_STYLES[defaulthistory-expansion]:=fg=blue,bold}
: ${FAST_HIGHLIGHT_STYLES[defaultsingle-hyphen-option]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[defaultdouble-hyphen-option]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[defaultback-quoted-argument]:=none}
: ${FAST_HIGHLIGHT_STYLES[defaultsingle-quoted-argument]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaultdouble-quoted-argument]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaultdollar-quoted-argument]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaultback-or-dollar-double-quoted-argument]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[defaultback-dollar-quoted-argument]:=fg=cyan}
: ${FAST_HIGHLIGHT_STYLES[defaultassign]:=none}
: ${FAST_HIGHLIGHT_STYLES[defaultredirection]:=none}
: ${FAST_HIGHLIGHT_STYLES[defaultcomment]:=fg=black,bold}
: ${FAST_HIGHLIGHT_STYLES[defaultvariable]:=fg=113}
: ${FAST_HIGHLIGHT_STYLES[defaultmathvar]:=fg=blue,bold}
: ${FAST_HIGHLIGHT_STYLES[defaultmathnum]:=fg=magenta}
: ${FAST_HIGHLIGHT_STYLES[defaultmatherr]:=fg=red}
: ${FAST_HIGHLIGHT_STYLES[defaultassign-array-bracket]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-variable]:=none}
: ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-number]:=fg=magenta}
: ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-operator]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-separator]:=fg=yellow,bold}
: ${FAST_HIGHLIGHT_STYLES[defaultexec-descriptor]:=fg=yellow,bold}
: ${FAST_HIGHLIGHT_STYLES[defaulthere-string-tri]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaulthere-string-word]:=bg=blue}
: ${FAST_HIGHLIGHT_STYLES[defaultsecondary]:=}
: ${FAST_HIGHLIGHT_STYLES[defaultcase-input]:=fg=green}
: ${FAST_HIGHLIGHT_STYLES[defaultcase-parentheses]:=fg=yellow}
: ${FAST_HIGHLIGHT_STYLES[defaultcase-condition]:=bg=blue}
: ${FAST_HIGHLIGHT_STYLES[defaultcorrect-subtle]:=bg=blue}
: ${FAST_HIGHLIGHT_STYLES[defaultincorrect-subtle]:=fg=red}
: ${FAST_HIGHLIGHT_STYLES[defaultsubtle-bg]:=bg=blue}

View file

@ -1,35 +1,32 @@
#############
# Debugging #
#############
################################################################################
# Debugging #
################################################################################
# Detect if we have GNU coreutils or BSD
if date --version > /dev/null 2>&1 ;then
# Global counter that can be used to diagnose duplicated calls
printf "0" > /dev/shm/debug_counter
debug_counter_inc() {
count="$(cat /dev/shm/debug_counter)"
((count++))
printf "%d" "$count" > /dev/shm/debug_counter
}
debug_counter_print(){
printf "%d" "$(cat /dev/shm/debug_counter)"
}
fi
# Global counter that can be used to diagnose duplicated calls
printf "0" > /dev/shm/debug_counter
debug_counter_inc() {
count="$(cat /dev/shm/debug_counter)"
((count++))
printf "%d" "$count" > /dev/shm/debug_counter
}
debug_counter_print(){
printf "%d" "$(cat /dev/shm/debug_counter)"
}
###################
# Update checking #
###################
################################################################################
# Update checking #
################################################################################
check_rc_update () {
# Get rc dir path
RC_PATH=$(dirname "$(realpath -- "${(%):-%x}")")
RC_PATH=$(dirname "$(readlink -f ${(%):-%x})")
CUR_DIR="$(pwd)"
CUR_DIR=`pwd`
cd $RC_PATH
# In case the network is down, don't lock the terminal
GIT_SSH_COMMAND='ssh -oBatchMode=yes' GIT_TERMINAL_PROMPT=0 timeout 6 git fetch > /dev/null 2>&1
timeout 6 git fetch > /dev/null 2>&1
#
# Timeout returns 124 on timeout
if [ "$?" -ge "124" ]; then
echo 'git_network_unreachable' >> /dev/shm/prompt_msg
@ -37,9 +34,9 @@ check_rc_update () {
# Check if the repo is clean
git_st=$(command git status --porcelain -b 2> /dev/null)
if $(echo "$git_st" | grep '^## .*ahead' > /dev/null 2>&1); then
if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then
echo 'git_unpushed' >> /dev/shm/prompt_msg
elif $(echo "$git_st" | grep '^## .*behind' > /dev/null 2>&1); then
elif $(echo "$git_st" | grep '^## .*behind' &> /dev/null); then
echo 'update_rc' >> /dev/shm/prompt_msg
fi
@ -48,7 +45,7 @@ check_rc_update () {
check_sys_update () {
case $(lsb_release -i | awk -F ':\t' '/Distributor ID/{print $2}') in
Arch|Artix)
Arch)
nb_maj=$(checkupdates | wc -l);;
Debian|Ubuntu)
nb_maj=$(aptitude search '~U' | wc -l);;
@ -60,9 +57,9 @@ check_sys_update () {
fi
}
############
# Commands #
############
################################################################################
# Commands #
################################################################################
# Do the update
uprc () {
@ -97,13 +94,4 @@ ssh_kitty () {
kitty +kitten ssh "$@"
}
mp4togif() {
if [ "$1" = "-h" ] || [ "$#" -ne "2" ]; then
>&2 echo "Usage: $0 <input.mp4> <output.gif>"
return 1
fi
ffmpeg -i "$1" -vf "fps=10,scale=320:-1:flags=lanczos,split[x][z];[z]palettegen[y];[x][y]paletteuse" -loop 0 "$2"
}
# vim: ft=zsh

View file

@ -1,9 +1,5 @@
[init]
defaultBranch = dev
[core]
excludesfile = ~/.gitignore_global
[user]
useConfigOnly = true
[include]
path = ~/.git_user
[master]
@ -17,18 +13,13 @@
conflictstyle = diff3
[alias]
# Basics
am = commit --amend
br = branch
c = commit
ck = checkout
st = status -s
cl = clone
cm = commit -m
cma = commit -am
ds = diff --staged
g = grep -En
gf = grep -Fn --
gi = grep -iFn --
st = status -s
ck = checkout
br = branch
gr = grep -I
# Tweak defaults
bra = branch -ra
@ -39,13 +30,9 @@
# Pretty branch graph
lg = log --oneline --abbrev-commit --all --graph --decorate --color
# Graph with additional info (author, date)
lga = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(bold red)%d%C(reset) %C(blue)[%an]%C(reset) %C(green)(%ai)%C(reset) - %C(white)%s%C(reset)' --all
lga = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(bold red)%d%C(reset) %C(blue)[%an]%C(reset) %C(green)(%ar)%C(reset) - %C(white)%s%C(reset)' --all
# Same but also list modified files
lf = log --oneline --name-status --all --graph --decorate --color
# pull rebase
prb = pull --rebase
[status]
submoduleSummary = true
[pull]
rebase = false

View file

@ -1,43 +1,30 @@
#!/bin/sh
#SCRIPT=$(readlink -f "$0")
#RC_PATH=$(dirname "$SCRIPT")
RC_PATH=$(cd "$(dirname "$0")"; pwd)
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
HOST=$(hostname)
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
# List of the config files to install
FILES="vimrc zshrc gitconfig vim gitignore_global git_user ctags.d mailcap xinitrc"
CONF_DIR="config"
DATA_DIR="data"
FILES="vimrc zshrc gitconfig vim gitignore_global git_user ctags.d"
if [ ! -e "$HOME/.git_user" ]; then
cp "$RC_PATH/git_user.def" "$RC_PATH/git_user"
sed -i -e "s/{username}/$USER/" "$RC_PATH/git_user"
sed -i -e "s/{email}/$USER@$HOST/" "$RC_PATH/git_user"
cp "$SCRIPTPATH/git_user.def" "$SCRIPTPATH/git_user"
sed -i -e "s/{username}/$USER/" "$SCRIPTPATH/git_user"
sed -i -e "s/{email}/$USER@$HOST/" "$SCRIPTPATH/git_user"
fi
# Init or update submodules
cd "$RC_PATH" || exit
cd "$SCRIPTPATH"
git submodule update --init --recursive
cd - > /dev/null || exit
cd -
# Setup fast-syntax-highlighting theme customization
cp "$SCRIPTPATH/fsh_theme.zsh" "$SCRIPTPATH/fast-syntax-highlighting/current_theme.zsh"
# Create symbolic links in the user's home dir
for file in $FILES
do
if [ ! -e "$HOME/.${file}" ]; then
ln -s "${RC_PATH}/${file}" "$HOME/.${file}"
# Only warn if an actual file exist, else we suppose it is from a previous install
elif [ ! -L "$HOME/.$file" ]; then
>&2 echo "File $HOME/.$file exists. Keeping old version."
ln -s "${SCRIPTPATH}/${file}" "$HOME/.${file}"
fi
done
mkdir -p "$XDG_CONFIG_HOME"
mkdir -p "$XDG_DATA_HOME"
# https://github.com/koalaman/shellcheck/wiki/SC2156
find "$RC_PATH/$CONF_DIR" -mindepth 1 -maxdepth 1 -type d \
-exec sh -c 'ln -s "$2" "$1" 2> /dev/null || ( link="$1/$(basename "$2")"; test -L "$link" || >&2 echo "Folder $link exists. Keeping old version.")' _ "$XDG_CONFIG_HOME" '{}' \;
find "$RC_PATH/$DATA_DIR" -mindepth 1 -maxdepth 1 -type d \
-exec sh -c 'ln -s "$2" "$1" 2> /dev/null || ( link="$1/$(basename "$2")"; test -L "$link" || >&2 echo "Folder $link exists. Keeping old version.")' _ "$XDG_DATA_HOME" '{}' \;

View file

@ -1,24 +0,0 @@
die() {
# Use notify-send to send errors when not in a terminal
# [ -t 0 ] only works outside of pipes
[ -t 0 ] || notify-send "$@" && >&2 echo "$@"
exit 1
}
# Output error to stderr and to graphical notification
notify_err() {
tee /dev/fd/2 | xargs -r -n1 -d "\n" notify-send
}
assert_exists() {
for c in $@; do
which "$c" > /dev/null 2>&1 || die "$c doesn't appear to be installed"
done
}
check_exists() {
for c in $@; do
which "$c" > /dev/null 2>&1 || return 1
done
}

40
mailcap
View file

@ -1,40 +0,0 @@
text/html; unshare -n -r w3m -I %{charset} -T text/html; copiousoutput;
image/*; mutt_bgrun /usr/bin/feh -. %s; test=test -n "$DISPLAY"
application/pdf; mutt_bgrun /usr/bin/zathura %s; test=test -n "$DISPLAY"
# Fichiers LibreOffice, Word, Excel et PowerPoint
application/vnd.openxmlformats-officedocument.wordprocessingml.document; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.openxmlformats-officedocument.wordprocessingml.template; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.openxmlformats-officedocument.spreadsheetml.template; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.openxmlformats-officedocument.presentationml.presentation; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/msword; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.msword; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/msexcel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/x-excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/x-msexcel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.ms-excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/ms-Excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/vnd.ms-powerpoint; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/x-mspowerpoint; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/ppt; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
application/rtf; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY"
# # MS documents to txt
# application/msword; tika -t %s | less;
# application/vnd.msword; tika -t %s | less;
# application/excel; tika %s | less;
# application/msexcel; tika %s | less;
# application/x-excel; tika %s | less;
# application/x-msexcel; tika %s | less;
# application/vnd.ms-excel; tika %s | less;
# application/ms-Excel; tika %s | less;
# application/vnd.ms-powerpoint; tika %s | w3m -dump -T text/html | less;
# application/x-mspowerpoint; tika %s | w3m -dump -T text/html | less;
# application/ppt; tika %s | w3m -dump -T text/html | less;
# application/rtf; tika %s | w3m -dump -T text/html | less;

52
prompt
View file

@ -6,29 +6,27 @@
# and changes the color of the username
color_username () {
if [[ $EUID -eq 0 ]]; then
echo "%{$fg_no_bold[red]%}%n"
echo "%{$fg_bold[red]%}%n"
else
echo "%{$fg_no_bold[blue]%}%n"
echo "%{$fg_bold[green]%}%n"
fi
}
color_prompt_char () {
if [[ $EUID -eq 0 ]]; then
echo "%{$fg_no_bold[red]%G#$reset_color%}"
echo "%{$fg_no_bold[red]%}#%{$reset_color%}"
else
echo "%{$fg_no_bold[blue]%G\$$reset_color%}"
echo "%{$fg_no_bold[green]%}$%{$reset_color%}"
fi
}
# Host coloring, personalise to your own taste
# Host coloring, specific to Rezometz
color_host () {
local couleur_hote=""
case $HOST in
TwelveYearsAndStillGoingStrong|lharkinateur|BecauseROSThatSWhy|lharktop|blieuxor)
couleur_hote=green;;
pixie)
couleur_hote=cyan;;
chimay|orval|serenity)
chimay|orval)
couleur_hote=magenta;;
babel|taima|era|vidar|okami|athena)
couleur_hote=red;;
@ -45,7 +43,7 @@ last_status () {
}
virtual_env() {
local prefix="%{$fg_bold[green]%}(%{%b%}"
local prefix="%{$fg_bold[green]%}(%{%b$fg[green]%}"
local suffix="%{$reset_color$fg_bold[green]%})%{$reset_color%}"
[[ -n ${VIRTUAL_ENV} ]] || return
printf '%s' "${prefix}${VIRTUAL_ENV:t}${suffix}"
@ -54,9 +52,9 @@ virtual_env() {
prompt_chars() {
local git_char=''
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
local git_char="%{$fg_no_bold[blue]%$reset_color%}"
local git_char="%{$fg_no_bold[blue]%}±%{$reset_color%}"
fi
printf '%s' "$(last_status) $(color_prompt_char)"
printf '%s' "${_GIT_CHAR}$(last_status) $(color_prompt_char)"
}
charge_batterie() {
@ -118,8 +116,8 @@ prompt_msg () {
# Display vim mode while using zle line editing
# https://dougblack.io/words/zsh-vi-mode.html
vim_mode () {
VIM_NORMAL="%{$fg_bold[red]%}[N]"
VIM_INSERT="%{$fg_bold[blue]%}[I]"
VIM_NORMAL="%{$fg_bold[red]%}[% N]% "
VIM_INSERT="%{$fg_bold[green]%}[% I]% "
VIM_PROMPT="${${KEYMAP/vicmd/$VIM_NORMAL}/(main|viins)/$VIM_INSERT}"
echo "$VIM_PROMPT%{$reset_color%}"
}
@ -129,25 +127,25 @@ vim_mode () {
# %S - path in the repository
# %a - action (e.g. rebase-i)
# %b - branchname
# %c - stagedstr (see below)
# %c - stangedstr (see below)
# %i - The current revision number or identifier.
# %m - Misc. In case of Git, show information about stashes
# %r - The name of the root directory of the repository
# %s - The current version control system, like git or svn
# %u - unstagedstr (see below)
fmt_branch="%b%{$reset_color%}%u%c%m%{$reset_color%}" # e.g. master¹²
fmt_action="%{$fg[red]%}%a%{$reset_color%}" # e.g. (rebase-i)
fmt_pre="%{$fg_bold[blue]%G[$reset_color$fg[blue]%}"
fmt_post="%{$fg_bold[blue]%G]$reset_color%}"
fmt_branch="%b%{$reset_color%} %u%c%m%{$reset_color%}" # e.g. master¹²
fmt_action="(%{$fg[red]%}%a%{$reset_color%})" # e.g. (rebase-i)
fmt_pre="%{$fg_bold[blue]%}[%{$reset_color%}%{$fg[blue]%}"
fmt_post="%{$fg_bold[blue]%}]%{$reset_color%}"
# check-for-changes can be really slow.
# you should disable it, if you work with large repositories
zstyle ':vcs_info:*' enable git cvs svn
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr "%{$fg_no_bold[yellow]%G●%}"
zstyle ':vcs_info:*' stagedstr "%{$fg_no_bold[green]%G●%}"
zstyle ':vcs_info:*' actionformats "${fmt_pre}${fmt_branch}|${fmt_action}${fmt_post}"
zstyle ':vcs_info:*' formats "${fmt_pre}${fmt_branch}${fmt_post}"
zstyle ':vcs_info:*' unstagedstr "%{$fg_no_bold[yellow]%}"
zstyle ':vcs_info:*' stagedstr "%{$fg_no_bold[green]%}"
zstyle ':vcs_info:*' actionformats "${fmt_pre}${fmt_branch}${fmt_action}${fmt_post} "
zstyle ':vcs_info:*' formats "${fmt_pre}${fmt_branch}${fmt_post} "
zstyle ':vcs_info:*' nvcsformats ""
zstyle ':vcs_info:*+*:*' debug false # Set to true to see which hooks are being run
zstyle ':vcs_info:git*+set-message:*' hooks git-st git-untracked
@ -161,7 +159,7 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-st git-untracked
# If instead you want to show the marker only if there are untracked
# files in $PWD, use:
#[[ -n $(git ls-files --others --exclude-standard) ]] ; then
hook_com[unstaged]="%{$fg_no_bold[red]%G●$reset_color%}"$hook_com[unstaged]
hook_com[unstaged]="%{$fg_no_bold[red]%}●%{$reset_color%}"$hook_com[unstaged]
fi
}
@ -173,12 +171,12 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-st git-untracked
# for git prior to 1.7
# ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l)
ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
(( $ahead )) && gitstatus+="%{$fg_no_bold[cyan]%G▴$reset_color%}"
(( $ahead )) && gitstatus+="%{$fg_no_bold[cyan]%}▴%{$reset_color%}"
# for git prior to 1.7
# behind=$(git rev-list HEAD..origin/${hook_com[branch]} | wc -l)
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
(( $behind )) && gitstatus+="%{$fg_no_bold[magenta]%G▾$reset_color%}"
(( $behind )) && gitstatus+="%{$fg_no_bold[magenta]%}▾%{$reset_color%}"
hook_com[misc]+=${gitstatus}
}
@ -209,13 +207,13 @@ prompt_create zle-line-init zle-keymap-select () {
PROMPT+="%{$fg[red]%} $(prompt_msg)"
# Change the background for the whole line and line feed
PROMPT+=$'\n'
PROMPT+="%{$fg_bold[green]%}%E"$'\n'
# Prompt characters for virtualenv, git and zsh
PROMPT+="$(virtual_env)$(prompt_chars) %{$reset_color%}"
# Right prompt with current repo informations
RPROMPT="${vcs_info_msg_0_}%E"
RPROMPT="${vcs_info_msg_0_}%E%{$reset_color%}"
zle reset-prompt
}

View file

@ -1,8 +0,0 @@
detectbepo: detectbepo.c
${CC} -I/usr/include $^ -lX11 -lxkbfile -o $@
cp $@ ../bin/
.PHONY: clean
clean:
rm -f detectbepo

View file

@ -1,53 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
fprintf(stderr, "Cannot open display\n");
exit(-1);
}
XkbStateRec state;
XkbGetState(dpy, XkbUseCoreKbd, &state);
XkbDescPtr desc = XkbGetKeyboard(dpy, XkbAllComponentsMask, XkbUseCoreKbd);
char *group = XGetAtomName(dpy, desc->names->groups[state.group]);
//printf("Full name: %s\n", group);
XkbRF_VarDefsRec vd;
XkbRF_GetNamesProp(dpy, NULL, &vd);
char *layout = strtok(vd.layout, ",");
for (int i = 0; i < state.group; i++) {
layout = strtok(NULL, ",");
if (layout == NULL) {
return -1;
}
}
//printf("Layout name: %s\n", tok);
if (strcmp(layout, "fr"))
return 1;
char *variant = strtok(vd.variant, ",");
for (int i = 0; i < state.group; i++) {
variant = strtok(NULL, ",");
if (variant == NULL) {
return -1;
}
}
//printf("Variant name: %s\n", variant);
if (strcmp(variant, "bepo"))
return 1;
printf("Bépo détecté\n");
return 0;
}

@ -1 +0,0 @@
Subproject commit 858b3e36549e0415623218caa6f0a8d7a1f5edab

View file

@ -1,2 +0,0 @@
" Additional shader extensions
autocmd! BufNewFile,BufRead *.fsh,*.vsh set filetype=glsl

View file

@ -4,4 +4,3 @@ setlocal shiftwidth=4
setlocal expandtab
setlocal autoindent
setlocal fileformat=unix
setlocal colorcolumn=80

View file

@ -1,6 +0,0 @@
setlocal tw=79
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal expandtab
setlocal autoindent

View file

@ -1,41 +0,0 @@
let s:base00 = [ '#181818', 0 ] " black
let s:base01 = [ '#282828', 18 ]
let s:base02 = [ '#383838', 19 ]
let s:base03 = [ '#585858', 8 ]
let s:base04 = [ '#b8b8b8', 20 ]
let s:base05 = [ '#d8d8d8', 7 ]
let s:base06 = [ '#e8e8e8', 21 ]
let s:base07 = [ '#f8f8f8', 15 ] " white
let s:base08 = [ '#ab4642', 1 ] " red
let s:base09 = [ '#dc9656', 16 ] " orange
let s:base0A = [ '#f7ca88', 3 ] " yellow
let s:base0B = [ '#a1b56c', 2 ] " green
let s:base0C = [ '#86c1b9', 6 ] " teal
let s:base0D = [ '#7cafc2', 4 ] " blue
let s:base0E = [ '#ba8baf', 5 ] " pink
let s:base0F = [ '#a16946', 17 ] " brown
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:base00, s:base0D ], [ s:base05, s:base02 ] ]
let s:p.insert.left = [ [ s:base01, s:base0B ], [ s:base05, s:base02 ] ]
let s:p.visual.left = [ [ s:base00, s:base09 ], [ s:base05, s:base02 ] ]
let s:p.replace.left = [ [ s:base00, s:base08 ], [ s:base05, s:base02 ] ]
let s:p.inactive.left = [ [ s:base02, s:base00 ] ]
let s:p.normal.middle = [ [ s:base07, s:base01 ] ]
let s:p.inactive.middle = [ [ s:base01, s:base00 ] ]
let s:p.normal.right = [ [ s:base01, s:base03 ], [ s:base06, s:base02 ] ]
let s:p.inactive.right = [ [ s:base01, s:base00 ] ]
let s:p.normal.error = [ [ s:base07, s:base08 ] ]
let s:p.normal.warning = [ [ s:base07, s:base09 ] ]
let s:p.tabline.left = [ [ s:base05, s:base02 ] ]
let s:p.tabline.middle = [ [ s:base05, s:base01 ] ]
let s:p.tabline.right = [ [ s:base05, s:base02 ] ]
let s:p.tabline.tabsel = [ [ s:base02, s:base0A ] ]
let g:lightline#colorscheme#base16_default_dark#palette = lightline#colorscheme#flatten(s:p)

View file

@ -1,41 +0,0 @@
let s:base00 = [ '#f8f8f8', 0 ] " black
let s:base01 = [ '#e8e8e8', 18 ]
let s:base02 = [ '#d8d8d8', 19 ]
let s:base03 = [ '#b8b8b8', 8 ]
let s:base04 = [ '#585858', 20 ]
let s:base05 = [ '#383838', 7 ]
let s:base06 = [ '#282828', 21 ]
let s:base07 = [ '#181818', 15 ] " white
let s:base08 = [ '#ab4642', 1 ] " red
let s:base09 = [ '#dc9656', 16 ] " orange
let s:base0A = [ '#f7ca88', 3 ] " yellow
let s:base0B = [ '#a1b56c', 2 ] " green
let s:base0C = [ '#86c1b9', 6 ] " teal
let s:base0D = [ '#7cafc2', 4 ] " blue
let s:base0E = [ '#ba8baf', 5 ] " pink
let s:base0F = [ '#a16946', 17 ] " brown
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:base00, s:base0D ], [ s:base05, s:base02 ] ]
let s:p.insert.left = [ [ s:base01, s:base0B ], [ s:base05, s:base02 ] ]
let s:p.visual.left = [ [ s:base00, s:base09 ], [ s:base05, s:base02 ] ]
let s:p.replace.left = [ [ s:base00, s:base08 ], [ s:base05, s:base02 ] ]
let s:p.inactive.left = [ [ s:base02, s:base00 ] ]
let s:p.normal.middle = [ [ s:base07, s:base01 ] ]
let s:p.inactive.middle = [ [ s:base01, s:base00 ] ]
let s:p.normal.right = [ [ s:base01, s:base03 ], [ s:base06, s:base02 ] ]
let s:p.inactive.right = [ [ s:base01, s:base00 ] ]
let s:p.normal.error = [ [ s:base07, s:base08 ] ]
let s:p.normal.warning = [ [ s:base07, s:base09 ] ]
let s:p.tabline.left = [ [ s:base05, s:base02 ] ]
let s:p.tabline.middle = [ [ s:base05, s:base01 ] ]
let s:p.tabline.right = [ [ s:base05, s:base02 ] ]
let s:p.tabline.tabsel = [ [ s:base02, s:base0A ] ]
let g:lightline#colorscheme#base16_default_light#palette = lightline#colorscheme#flatten(s:p)

View file

@ -1,83 +0,0 @@
" From https://bepo.fr/wiki/Vim
"
" {W} -> [É]
" ——————————
" On remappe W sur É :
noremap é w
noremap É W
" Corollaire: on remplace les text objects aw, aW, iw et iW
" pour effacer/remplacer un mot quand on nest pas au début (daé / laé).
onoremap aw
onoremap aW
onoremap iw
onoremap iW
" Pour faciliter les manipulations de fenêtres, on utilise {W} comme un Ctrl+W :
noremap w <C-w>
noremap W <C-w><C-w>
" [HJKL] -> {CTSR}
" ————————————————
" {cr} = « gauche / droite »
noremap c h
noremap r l
" {ts} = « haut / bas »
map t j
map s k
" {CR} = « haut / bas de l'écran »
noremap C H
noremap R L
" {TS} = « joindre / aide »
noremap T J
noremap S K
" Corollaire : repli suivant / précédent
noremap zs zj
noremap zt zk
" {HJKL} <- [CTSR]
" ————————————————
" {J} = « Jusqu'à » (j = suivant, J = précédant)
noremap j t
noremap J T
" {L} = « Change » (l = attend un mvt, L = jusqu'à la fin de ligne)
noremap l c
noremap L C
" {H} = « Remplace » (h = un caractère slt, H = reste en « Remplace »)
noremap h r
noremap H R
" {K} = « Substitue » (k = caractère, K = ligne)
noremap k s
noremap K S
" Corollaire : correction orthographique
noremap ]k ]s
noremap [k [s
" Désambiguation de {g}
" —————————————————————
" ligne écran précédente / suivante (à l'intérieur d'une phrase)
noremap gs gk
noremap gt gj
" onglet précédent / suivant
noremap gb gT
noremap gt
" optionnel : {gB} / {gÉ} pour aller au premier / dernier onglet
noremap gB :exe "silent! tabfirst"<CR>
noremap :exe "silent! tablast"<CR>
" optionnel : {g"} pour aller au début de la ligne écran
noremap g" g0
" <> en direct
" ————————————
noremap « <
noremap » >
" Remaper la gestion des fenêtres
" ———————————————————————————————
nmap <C-t> <C-j>
nmap <C-s> <C-k>
nmap <C-c> <C-h>
nmap <C-r> <C-l>
noremap wd <C-w>c
noremap wo <C-w>s
noremap wp <C-w>o
noremap w<SPACE> :split<CR>
noremap w<CR> :vsplit<CR>

View file

@ -1,413 +0,0 @@
" vi:syntax=vim
" base16-vim (https://github.com/chriskempson/base16-vim)
" by Chris Kempson (http://chriskempson.com)
" Default Dark scheme by Chris Kempson (http://chriskempson.com)
" This enables the coresponding base16-shell script to run so that
" :colorscheme works in terminals supported by base16-shell scripts
" User must set this variable in .vimrc
" let g:base16_shell_path=base16-builder/output/shell/
if !has('gui_running')
if exists("g:base16_shell_path")
execute "silent !/bin/sh ".g:base16_shell_path."/base16-default-dark.sh"
endif
endif
" GUI color definitions
let s:gui00 = "181818"
let g:base16_gui00 = "181818"
let s:gui01 = "282828"
let g:base16_gui01 = "282828"
let s:gui02 = "383838"
let g:base16_gui02 = "383838"
let s:gui03 = "585858"
let g:base16_gui03 = "585858"
let s:gui04 = "b8b8b8"
let g:base16_gui04 = "b8b8b8"
let s:gui05 = "d8d8d8"
let g:base16_gui05 = "d8d8d8"
let s:gui06 = "e8e8e8"
let g:base16_gui06 = "e8e8e8"
let s:gui07 = "f8f8f8"
let g:base16_gui07 = "f8f8f8"
let s:gui08 = "ab4642"
let g:base16_gui08 = "ab4642"
let s:gui09 = "dc9656"
let g:base16_gui09 = "dc9656"
let s:gui0A = "f7ca88"
let g:base16_gui0A = "f7ca88"
let s:gui0B = "a1b56c"
let g:base16_gui0B = "a1b56c"
let s:gui0C = "86c1b9"
let g:base16_gui0C = "86c1b9"
let s:gui0D = "7cafc2"
let g:base16_gui0D = "7cafc2"
let s:gui0E = "ba8baf"
let g:base16_gui0E = "ba8baf"
let s:gui0F = "a16946"
let g:base16_gui0F = "a16946"
" Terminal color definitions
let s:cterm00 = "00"
let g:base16_cterm00 = "00"
let s:cterm03 = "08"
let g:base16_cterm03 = "08"
let s:cterm05 = "07"
let g:base16_cterm05 = "07"
let s:cterm07 = "15"
let g:base16_cterm07 = "15"
let s:cterm08 = "01"
let g:base16_cterm08 = "01"
let s:cterm0A = "03"
let g:base16_cterm0A = "03"
let s:cterm0B = "02"
let g:base16_cterm0B = "02"
let s:cterm0C = "06"
let g:base16_cterm0C = "06"
let s:cterm0D = "04"
let g:base16_cterm0D = "04"
let s:cterm0E = "05"
let g:base16_cterm0E = "05"
if exists('base16colorspace') && base16colorspace == "256"
let s:cterm01 = "18"
let g:base16_cterm01 = "18"
let s:cterm02 = "19"
let g:base16_cterm02 = "19"
let s:cterm04 = "20"
let g:base16_cterm04 = "20"
let s:cterm06 = "21"
let g:base16_cterm06 = "21"
let s:cterm09 = "16"
let g:base16_cterm09 = "16"
let s:cterm0F = "17"
let g:base16_cterm0F = "17"
else
let s:cterm01 = "10"
let g:base16_cterm01 = "10"
let s:cterm02 = "11"
let g:base16_cterm02 = "11"
let s:cterm04 = "12"
let g:base16_cterm04 = "12"
let s:cterm06 = "13"
let g:base16_cterm06 = "13"
let s:cterm09 = "09"
let g:base16_cterm09 = "09"
let s:cterm0F = "14"
let g:base16_cterm0F = "14"
endif
" Neovim terminal colours
if has("nvim")
let g:terminal_color_0 = "#181818"
let g:terminal_color_1 = "#ab4642"
let g:terminal_color_2 = "#a1b56c"
let g:terminal_color_3 = "#f7ca88"
let g:terminal_color_4 = "#7cafc2"
let g:terminal_color_5 = "#ba8baf"
let g:terminal_color_6 = "#86c1b9"
let g:terminal_color_7 = "#d8d8d8"
let g:terminal_color_8 = "#585858"
let g:terminal_color_9 = "#ab4642"
let g:terminal_color_10 = "#a1b56c"
let g:terminal_color_11 = "#f7ca88"
let g:terminal_color_12 = "#7cafc2"
let g:terminal_color_13 = "#ba8baf"
let g:terminal_color_14 = "#86c1b9"
let g:terminal_color_15 = "#f8f8f8"
let g:terminal_color_background = g:terminal_color_0
let g:terminal_color_foreground = g:terminal_color_5
if &background == "light"
let g:terminal_color_background = g:terminal_color_7
let g:terminal_color_foreground = g:terminal_color_2
endif
elseif has('terminal')
let g:terminal_ansi_colors = [
\ "#181818",
\ "#ab4642",
\ "#a1b56c",
\ "#f7ca88",
\ "#7cafc2",
\ "#ba8baf",
\ "#86c1b9",
\ "#d8d8d8",
\ "#585858",
\ "#ab4642",
\ "#a1b56c",
\ "#f7ca88",
\ "#7cafc2",
\ "#ba8baf",
\ "#86c1b9",
\ "#f8f8f8",
\ ]
endif
" Theme setup
hi clear
syntax reset
let g:colors_name = "base16-default-dark"
" Highlighting function
" Optional variables are attributes and guisp
function! g:Base16hi(group, guifg, guibg, ctermfg, ctermbg, ...)
let l:attr = get(a:, 1, "")
let l:guisp = get(a:, 2, "")
if a:guifg != ""
exec "hi " . a:group . " guifg=#" . a:guifg
endif
if a:guibg != ""
exec "hi " . a:group . " guibg=#" . a:guibg
endif
if a:ctermfg != ""
exec "hi " . a:group . " ctermfg=" . a:ctermfg
endif
if a:ctermbg != ""
exec "hi " . a:group . " ctermbg=" . a:ctermbg
endif
if l:attr != ""
exec "hi " . a:group . " gui=" . l:attr . " cterm=" . l:attr
endif
if l:guisp != ""
exec "hi " . a:group . " guisp=#" . l:guisp
endif
endfunction
fun <sid>hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
call g:Base16hi(a:group, a:guifg, a:guibg, a:ctermfg, a:ctermbg, a:attr, a:guisp)
endfun
" Vim editor colors
call <sid>hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("Bold", "", "", "", "", "bold", "")
call <sid>hi("Debug", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Directory", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "")
call <sid>hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("Exception", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "")
call <sid>hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "")
call <sid>hi("Italic", "", "", "", "", "none", "")
call <sid>hi("Macro", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("MatchParen", "", s:gui03, "", s:cterm03, "", "")
call <sid>hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Question", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Search", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "", "")
call <sid>hi("Substitute", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "none", "")
call <sid>hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("TooLong", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Underlined", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Visual", "", s:gui02, "", s:cterm02, "", "")
call <sid>hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "")
call <sid>hi("Title", s:gui0D, "", s:cterm0D, "", "none", "")
call <sid>hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "")
call <sid>hi("NonText", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "")
call <sid>hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "")
call <sid>hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLineNr", s:gui04, s:gui01, s:cterm04, s:cterm01, "", "")
call <sid>hi("QuickFixLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("PMenu", s:gui05, s:gui01, s:cterm05, s:cterm01, "none", "")
call <sid>hi("PMenuSel", s:gui01, s:gui05, s:cterm01, s:cterm05, "", "")
call <sid>hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "")
" Standard syntax highlighting
call <sid>hi("Boolean", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Character", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Comment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Constant", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Define", s:gui0E, "", s:cterm0E, "", "none", "")
call <sid>hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Float", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Function", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Identifier", s:gui08, "", s:cterm08, "", "none", "")
call <sid>hi("Include", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Label", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Number", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Operator", s:gui05, "", s:cterm05, "", "none", "")
call <sid>hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Special", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Statement", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("String", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Structure", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Tag", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "")
call <sid>hi("Type", s:gui0A, "", s:cterm0A, "", "none", "")
call <sid>hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "")
" C highlighting
call <sid>hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "")
" C# highlighting
call <sid>hi("csClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csType", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "")
" CSS highlighting
call <sid>hi("cssBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "")
" Diff highlighting
call <sid>hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
" Git highlighting
call <sid>hi("gitcommitOverflow", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("gitcommitSummary", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("gitcommitComment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitUntracked", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitDiscarded", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitSelected", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitHeader", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("gitcommitSelectedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitUnmergedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitDiscardedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitBranch", s:gui09, "", s:cterm09, "", "bold", "")
call <sid>hi("gitcommitUntrackedFile", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("gitcommitUnmergedFile", s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitDiscardedFile", s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitSelectedFile", s:gui0B, "", s:cterm0B, "", "bold", "")
" GitGutter highlighting
call <sid>hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "")
" HTML highlighting
call <sid>hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("htmlTag", s:gui05, "", s:cterm05, "", "", "")
" JavaScript highlighting
call <sid>hi("javaScript", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "")
" pangloss/vim-javascript highlighting
call <sid>hi("jsOperator", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsReturn", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsThis", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("jsClassDefinition", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsFunction", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsFuncName", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsFuncCall", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassFuncName", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassMethodType", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsRegexpString", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("jsGlobalObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsGlobalNodeObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsExceptions", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsBuiltins", s:gui0A, "", s:cterm0A, "", "", "")
" Mail highlighting
call <sid>hi("mailQuoted1", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailQuoted2", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("mailQuoted3", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("mailQuoted4", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("mailQuoted5", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailQuoted6", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailURL", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailEmail", s:gui0D, "", s:cterm0D, "", "", "")
" Markdown highlighting
call <sid>hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "")
" NERDTree highlighting
call <sid>hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "")
" PHP highlighting
call <sid>hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpComparison", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpParent", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpMethodsVar", s:gui0C, "", s:cterm0C, "", "", "")
" Python highlighting
call <sid>hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonStatement", s:gui0E, "", s:cterm0E, "", "", "")
" Ruby highlighting
call <sid>hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "")
" SASS highlighting
call <sid>hi("sassidChar", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "")
" Signify highlighting
call <sid>hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
" Spelling highlighting
call <sid>hi("SpellBad", "", "", "", "", "undercurl", s:gui08)
call <sid>hi("SpellLocal", "", "", "", "", "undercurl", s:gui0C)
call <sid>hi("SpellCap", "", "", "", "", "undercurl", s:gui0D)
call <sid>hi("SpellRare", "", "", "", "", "undercurl", s:gui0E)
" Startify highlighting
call <sid>hi("StartifyBracket", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyFile", s:gui07, "", s:cterm07, "", "", "")
call <sid>hi("StartifyFooter", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyHeader", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("StartifyNumber", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("StartifyPath", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySection", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("StartifySelect", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("StartifySlash", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySpecial", s:gui03, "", s:cterm03, "", "", "")
" Java highlighting
call <sid>hi("javaOperator", s:gui0D, "", s:cterm0D, "", "", "")
" Remove functions
delf <sid>hi
" Remove color variables
unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F
unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F

View file

@ -1,413 +0,0 @@
" vi:syntax=vim
" base16-vim (https://github.com/chriskempson/base16-vim)
" by Chris Kempson (http://chriskempson.com)
" Default Light scheme by Chris Kempson (http://chriskempson.com)
" This enables the coresponding base16-shell script to run so that
" :colorscheme works in terminals supported by base16-shell scripts
" User must set this variable in .vimrc
" let g:base16_shell_path=base16-builder/output/shell/
if !has('gui_running')
if exists("g:base16_shell_path")
execute "silent !/bin/sh ".g:base16_shell_path."/base16-default-light.sh"
endif
endif
" GUI color definitions
let s:gui00 = "f8f8f8"
let g:base16_gui00 = "f8f8f8"
let s:gui01 = "e8e8e8"
let g:base16_gui01 = "e8e8e8"
let s:gui02 = "d8d8d8"
let g:base16_gui02 = "d8d8d8"
let s:gui03 = "b8b8b8"
let g:base16_gui03 = "b8b8b8"
let s:gui04 = "585858"
let g:base16_gui04 = "585858"
let s:gui05 = "383838"
let g:base16_gui05 = "383838"
let s:gui06 = "282828"
let g:base16_gui06 = "282828"
let s:gui07 = "181818"
let g:base16_gui07 = "181818"
let s:gui08 = "ab4642"
let g:base16_gui08 = "ab4642"
let s:gui09 = "dc9656"
let g:base16_gui09 = "dc9656"
let s:gui0A = "f7ca88"
let g:base16_gui0A = "f7ca88"
let s:gui0B = "a1b56c"
let g:base16_gui0B = "a1b56c"
let s:gui0C = "86c1b9"
let g:base16_gui0C = "86c1b9"
let s:gui0D = "7cafc2"
let g:base16_gui0D = "7cafc2"
let s:gui0E = "ba8baf"
let g:base16_gui0E = "ba8baf"
let s:gui0F = "a16946"
let g:base16_gui0F = "a16946"
" Terminal color definitions
let s:cterm00 = "00"
let g:base16_cterm00 = "00"
let s:cterm03 = "08"
let g:base16_cterm03 = "08"
let s:cterm05 = "07"
let g:base16_cterm05 = "07"
let s:cterm07 = "15"
let g:base16_cterm07 = "15"
let s:cterm08 = "01"
let g:base16_cterm08 = "01"
let s:cterm0A = "03"
let g:base16_cterm0A = "03"
let s:cterm0B = "02"
let g:base16_cterm0B = "02"
let s:cterm0C = "06"
let g:base16_cterm0C = "06"
let s:cterm0D = "04"
let g:base16_cterm0D = "04"
let s:cterm0E = "05"
let g:base16_cterm0E = "05"
if exists('base16colorspace') && base16colorspace == "256"
let s:cterm01 = "18"
let g:base16_cterm01 = "18"
let s:cterm02 = "19"
let g:base16_cterm02 = "19"
let s:cterm04 = "20"
let g:base16_cterm04 = "20"
let s:cterm06 = "21"
let g:base16_cterm06 = "21"
let s:cterm09 = "16"
let g:base16_cterm09 = "16"
let s:cterm0F = "17"
let g:base16_cterm0F = "17"
else
let s:cterm01 = "10"
let g:base16_cterm01 = "10"
let s:cterm02 = "11"
let g:base16_cterm02 = "11"
let s:cterm04 = "12"
let g:base16_cterm04 = "12"
let s:cterm06 = "13"
let g:base16_cterm06 = "13"
let s:cterm09 = "09"
let g:base16_cterm09 = "09"
let s:cterm0F = "14"
let g:base16_cterm0F = "14"
endif
" Neovim terminal colours
if has("nvim")
let g:terminal_color_0 = "#f8f8f8"
let g:terminal_color_1 = "#ab4642"
let g:terminal_color_2 = "#a1b56c"
let g:terminal_color_3 = "#f7ca88"
let g:terminal_color_4 = "#7cafc2"
let g:terminal_color_5 = "#ba8baf"
let g:terminal_color_6 = "#86c1b9"
let g:terminal_color_7 = "#383838"
let g:terminal_color_8 = "#b8b8b8"
let g:terminal_color_9 = "#ab4642"
let g:terminal_color_10 = "#a1b56c"
let g:terminal_color_11 = "#f7ca88"
let g:terminal_color_12 = "#7cafc2"
let g:terminal_color_13 = "#ba8baf"
let g:terminal_color_14 = "#86c1b9"
let g:terminal_color_15 = "#181818"
let g:terminal_color_background = g:terminal_color_0
let g:terminal_color_foreground = g:terminal_color_5
if &background == "light"
let g:terminal_color_background = g:terminal_color_7
let g:terminal_color_foreground = g:terminal_color_2
endif
elseif has('terminal')
let g:terminal_ansi_colors = [
\ "#f8f8f8",
\ "#ab4642",
\ "#a1b56c",
\ "#f7ca88",
\ "#7cafc2",
\ "#ba8baf",
\ "#86c1b9",
\ "#383838",
\ "#b8b8b8",
\ "#ab4642",
\ "#a1b56c",
\ "#f7ca88",
\ "#7cafc2",
\ "#ba8baf",
\ "#86c1b9",
\ "#181818",
\ ]
endif
" Theme setup
hi clear
syntax reset
let g:colors_name = "base16-default-light"
" Highlighting function
" Optional variables are attributes and guisp
function! g:Base16hi(group, guifg, guibg, ctermfg, ctermbg, ...)
let l:attr = get(a:, 1, "")
let l:guisp = get(a:, 2, "")
if a:guifg != ""
exec "hi " . a:group . " guifg=#" . a:guifg
endif
if a:guibg != ""
exec "hi " . a:group . " guibg=#" . a:guibg
endif
if a:ctermfg != ""
exec "hi " . a:group . " ctermfg=" . a:ctermfg
endif
if a:ctermbg != ""
exec "hi " . a:group . " ctermbg=" . a:ctermbg
endif
if l:attr != ""
exec "hi " . a:group . " gui=" . l:attr . " cterm=" . l:attr
endif
if l:guisp != ""
exec "hi " . a:group . " guisp=#" . l:guisp
endif
endfunction
fun <sid>hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
call g:Base16hi(a:group, a:guifg, a:guibg, a:ctermfg, a:ctermbg, a:attr, a:guisp)
endfun
" Vim editor colors
call <sid>hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("Bold", "", "", "", "", "bold", "")
call <sid>hi("Debug", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Directory", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "")
call <sid>hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("Exception", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "")
call <sid>hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "")
call <sid>hi("Italic", "", "", "", "", "none", "")
call <sid>hi("Macro", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("MatchParen", "", s:gui03, "", s:cterm03, "", "")
call <sid>hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Question", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Search", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "", "")
call <sid>hi("Substitute", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "none", "")
call <sid>hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("TooLong", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Underlined", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Visual", "", s:gui02, "", s:cterm02, "", "")
call <sid>hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "")
call <sid>hi("Title", s:gui0D, "", s:cterm0D, "", "none", "")
call <sid>hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "")
call <sid>hi("NonText", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "")
call <sid>hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "")
call <sid>hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLineNr", s:gui04, s:gui01, s:cterm04, s:cterm01, "", "")
call <sid>hi("QuickFixLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("PMenu", s:gui05, s:gui01, s:cterm05, s:cterm01, "none", "")
call <sid>hi("PMenuSel", s:gui01, s:gui05, s:cterm01, s:cterm05, "", "")
call <sid>hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "")
" Standard syntax highlighting
call <sid>hi("Boolean", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Character", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Comment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Constant", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Define", s:gui0E, "", s:cterm0E, "", "none", "")
call <sid>hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Float", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Function", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Identifier", s:gui08, "", s:cterm08, "", "none", "")
call <sid>hi("Include", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Label", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Number", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Operator", s:gui05, "", s:cterm05, "", "none", "")
call <sid>hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Special", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Statement", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("String", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Structure", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Tag", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "")
call <sid>hi("Type", s:gui0A, "", s:cterm0A, "", "none", "")
call <sid>hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "")
" C highlighting
call <sid>hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "")
" C# highlighting
call <sid>hi("csClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csType", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "")
" CSS highlighting
call <sid>hi("cssBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "")
" Diff highlighting
call <sid>hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
" Git highlighting
call <sid>hi("gitcommitOverflow", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("gitcommitSummary", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("gitcommitComment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitUntracked", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitDiscarded", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitSelected", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitHeader", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("gitcommitSelectedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitUnmergedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitDiscardedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitBranch", s:gui09, "", s:cterm09, "", "bold", "")
call <sid>hi("gitcommitUntrackedFile", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("gitcommitUnmergedFile", s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitDiscardedFile", s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitSelectedFile", s:gui0B, "", s:cterm0B, "", "bold", "")
" GitGutter highlighting
call <sid>hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "")
" HTML highlighting
call <sid>hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("htmlTag", s:gui05, "", s:cterm05, "", "", "")
" JavaScript highlighting
call <sid>hi("javaScript", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "")
" pangloss/vim-javascript highlighting
call <sid>hi("jsOperator", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsReturn", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsThis", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("jsClassDefinition", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsFunction", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsFuncName", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsFuncCall", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassFuncName", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassMethodType", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsRegexpString", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("jsGlobalObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsGlobalNodeObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsExceptions", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsBuiltins", s:gui0A, "", s:cterm0A, "", "", "")
" Mail highlighting
call <sid>hi("mailQuoted1", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailQuoted2", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("mailQuoted3", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("mailQuoted4", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("mailQuoted5", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailQuoted6", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailURL", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailEmail", s:gui0D, "", s:cterm0D, "", "", "")
" Markdown highlighting
call <sid>hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "")
" NERDTree highlighting
call <sid>hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "")
" PHP highlighting
call <sid>hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpComparison", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpParent", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpMethodsVar", s:gui0C, "", s:cterm0C, "", "", "")
" Python highlighting
call <sid>hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonStatement", s:gui0E, "", s:cterm0E, "", "", "")
" Ruby highlighting
call <sid>hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "")
" SASS highlighting
call <sid>hi("sassidChar", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "")
" Signify highlighting
call <sid>hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
" Spelling highlighting
call <sid>hi("SpellBad", "", "", "", "", "undercurl", s:gui08)
call <sid>hi("SpellLocal", "", "", "", "", "undercurl", s:gui0C)
call <sid>hi("SpellCap", "", "", "", "", "undercurl", s:gui0D)
call <sid>hi("SpellRare", "", "", "", "", "undercurl", s:gui0E)
" Startify highlighting
call <sid>hi("StartifyBracket", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyFile", s:gui07, "", s:cterm07, "", "", "")
call <sid>hi("StartifyFooter", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyHeader", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("StartifyNumber", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("StartifyPath", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySection", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("StartifySelect", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("StartifySlash", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySpecial", s:gui03, "", s:cterm03, "", "", "")
" Java highlighting
call <sid>hi("javaOperator", s:gui0D, "", s:cterm0D, "", "", "")
" Remove functions
delf <sid>hi
" Remove color variables
unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F
unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F

768
vimrc
View file

@ -1,205 +1,150 @@
scriptencoding utf-8
"on: [1.8.8]"
"""""""""""""""""""""""""""""""""
"Authors: [Karlkorp, Inc. 2014; lhark, Inc. 2015]"
""""""""""""""""""""""""""""""""""""""""""""""""
"Type: [Vim/GVim/MacVim configuration file]"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Name: [.vimrc (unix/mac); _vimrc (MS Windows/DOS)]"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Location: [$HOME/.vimrc (unix/mac); $USERNAME\_vimrc (MS Windows)]"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"[Plug-ins list]""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"+------------------+-------------------------------------------------+"
"| AutoComplPop | https://github.com/vim-scripts/AutoComplPop |"
"| DelimitMate | https://github.com/Raimondi/delimitMate |"
"| DetectIndent | https://github.com/roryokane/detectindent |"
"| Gutentags | https://github.com/ludovicchabant/vim-gutentags |"
"| Multiple-Cursors | https://github.com/terryma/vim-multiple-cursors |"
"| Python-Mode | https://github.com/klen/python-mode |"
"| Surround | https://github.com/tpope/vim-surround |"
"| Undotree | https://github.com/mbbill/undotree |"
"| Vim-Airline | https://github.com/bling/vim-airline |"
"| Vim-GLSL | https://github.com/tikhomirov/vim-glsl |"
"| Vim-Gnupg | https://github.com/jamessan/vim-gnupg |"
"| Vundle | https://github.com/gmarik/Vundle.vim.git |"
"| YouCompleteMe | https://github.com/Valloric/YouCompleteMe |"
"+------------------+-------------------------------------------------+"
"[Colorschemes list]""""""""""""""""""""""""""""""""""""""""""""""""""""
"+------------------+-------------------------------------------------+"
"| Solarized | https://github.com/altercation/vim-colors-solarized |"
"+------------------+-------------------------------------------------+"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"[To disable compatibility with Vi]"
set nocompatible
if &shell =~# 'fish$'
set shell=sh
endif
"[Use Plug-ins and Plug-in Manager(Vundle) only on UNIX or MAC OS]"
if has("unix") || has("mac")
filetype off
"[Download and install Vundle Plug-in Manager]"
if !isdirectory(expand("$HOME/.vim/bundle"))
silent !mkdir -p $HOME/.vim/bundle
silent cd $HOME/.vim/bundle
silent !git clone https://github.com/gmarik/Vundle.vim.git
silent cd $HOME
endif
"[Run Plug-ins]"
set runtimepath+=$HOME/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
map <F3> :VundleUpdate<CR>
Plugin 'dag/vim-fish'
if isdirectory(expand("$HOME/.vim/bundle/YouCompleteMe"))
"[Workaround for YCM non-portability]"
Plugin 'Valloric/YouCompleteMe'
let g:ycm_global_ycm_extra_conf = expand("$HOME/.vim/ycm_global_conf.py")
let g:ycm_extra_conf_vim_data =[ "&filetype" ]
"[We're using ale for linting]"
let g:ycm_show_diagnostics_ui = 0
let g:ycm_collect_identifiers_from_tags_files=1
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_show_diagnostics_ui = 0
let g:ycm_use_ultisnips_completer = 0
else
Plugin 'AutoComplPop'
endif
Plugin 'w0rp/ale'
let g:ale_linters = {
\ 'cpp': ['g++'],
\ 'c': ['clang']
\ }
let g:ale_c_gcc_options='-std=c99 -pedantic'
let g:ale_sign_error = '●'
let g:ale_sign_warning = '●'
Plugin 'itchyny/lightline.vim'
let g:lightline = {'colorscheme': 'base16_default_dark'}
if executable('ctags')
Plugin 'ludovicchabant/vim-gutentags'
endif
Plugin 'beyondmarc/opengl.vim'
Plugin 'arrufat/vala.vim'
let g:vala_syntax_folding_enabled = 0
Plugin 'tikhomirov/vim-glsl'
Plugin 'jamessan/vim-gnupg'
Plugin 'https://git.sr.ht/~sircmpwn/hare.vim'
Plugin 'romainl/vim-cool'
Plugin 'machakann/vim-highlightedyank'
let g:highlightedyank_highlight_duration = 200
"[Needed only with old vim versions]"
if !exists('##TextYankPost')
map y <Plug>(highlightedyank)
endif
"[Autodetect indent style of a file]"
Plugin 'tcbbd/detectindent'
let g:detectindent_preferred_indent=4
let g:detectindent_autodetect=1
"[Allow writing of unwritable file with sudo, until neovim#1716 is fixed]"
if has('nvim')
Plugin 'lambdalisue/suda.vim'
let g:suda_smart_edit = 1
endif
call vundle#end()
try
if !isdirectory(expand("$HOME/.vim/bundle"))
silent !mkdir -p $HOME/.vim/bundle
silent cd $HOME/.vim/bundle
silent !git clone https://github.com/gmarik/Vundle.vim.git
silent cd $HOME
endif
"[Run Plug-ins]"
set runtimepath+=$HOME/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
map <F2> :VundleInstall<CR>
map <F3> :VundleUpdate<CR>
Plugin 'mbbill/undotree'
map <F5> :UndotreeToggle<CR>
Plugin 'vim-scripts/LaTeX-Box'
map <LocalLeader>ll :Latexmk<CR>
if isdirectory(expand("$HOME/.vim/bundle/YouCompleteMe"))
"[Workaround for YCM non-portability]"
Plugin 'Valloric/YouCompleteMe'
let g:ycm_global_ycm_extra_conf = expand("$HOME/.vim/ycm_global_conf.py")
let g:ycm_extra_conf_vim_data =[ "&filetype" ]
"[We're using ale for linting]"
let g:ycm_show_diagnostics_ui = 0
let g:ycm_collect_identifiers_from_tags_files=1
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_show_diagnostics_ui = 0
let g:ycm_use_ultisnips_completer = 0
else
Plugin 'AutoComplPop'
Plugin 'davidhalter/jedi-vim'
endif
Plugin 'w0rp/ale'
let g:ale_linters = {
\ 'cpp': ['g++'],
\ 'c': ['clang']
\ }
let g:ale_c_gcc_options='-std=c99 -pedantic'
let g:ale_sign_error = '●'
let g:ale_sign_warning = '●'
Plugin 'itchyny/lightline.vim'
let g:lightline = {
\'colorscheme': 'solarized',
\ 'active': {
\ 'left': [['mode', 'paste'], ['filename', 'modified']],
\ 'right': [['lineinfo'],
\ ['percent'],
\ ['readonly', 'linter_warnings', 'linter_errors', 'linter_ok'],
\ ['fileformat'],
\ ['fileencoding']
\ ]
\ },
\ 'component_expand': {
\ 'linter_warnings': 'LightlineLinterWarnings',
\ 'linter_errors': 'LightlineLinterErrors',
\ 'linter_ok': 'LightlineLinterOK',
\ 'lineinfo': 'LineInfo'
\ },
\ 'component_type': {
\ 'readonly': 'error',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error'
\ },
\}
if executable('ctags')
Plugin 'ludovicchabant/vim-gutentags'
endif
Plugin 'godlygeek/tabular'
Plugin 'beyondmarc/opengl.vim'
Plugin 'tikhomirov/vim-glsl'
Plugin 'beyondmarc/hlsl.vim'
Plugin 'rust-lang/rust.vim'
Plugin 'mzlogin/vim-smali'
Plugin 'jamessan/vim-gnupg'
Plugin 'petRUShka/vim-opencl'
Plugin 'hynek/vim-python-pep8-indent'
Plugin 'tpope/vim-surround'
Plugin 'captbaritone/better-indent-support-for-php-with-html'
"[Autodetect indent style of a file]"
Plugin 'roryokane/detectindent'
let g:detectindent_preferred_indent=4
let g:detectindent_autodetect=1
"[Solarized theme]"
"Plugin 'ericbn/vim-solarized'
Plugin 'https://gitlab.federez.net/lhark/vim-solarized.git'
call vundle#end()
catch
endtry
else
filetype on
endif
" Allow backspacing over everything in insert mode.
set backspace=indent,eol,start
set number
set relativenumber
"[Hide/show the white-space and more invisible symbols]"
set list
set listchars=tab:▸\ ,nbsp,trail:-
" | | + Trailing spaces
" | + Non breakable spaces
" + Tabulations: `tab xy`, x: first char, y: following chars
set nojoinspaces
"[Indent & Tab/mode-line settings]"
set breakindent
set nopaste
set smarttab
set tabstop=4 " tabs size on screen "
set expandtab " <tab> inserts spaces "
set autoindent
set copyindent " copy existing tab/spaces mix on newline "
set smartindent " overruled by cindent "
set cinwords=except,finally,def,class,with,do,if,elif,else,for,while,try,switch
set cinoptions+=l1 " switch case label alignement, :h cinoptions-values "
set shiftwidth=4 " number of space to use on indent. Use tabstop if 0"
"set softtabstop=4
"[Matching chars]"
set showmatch
set matchpairs=\":\"
set matchpairs+=(:)
set matchpairs+={:}
set matchpairs+=[:]
"[TextWidth settings]"
set textwidth=0
"[Look for a single modeline in files]"
set modeline
set modelines=1
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set laststatus=2
set noshowmode
"[Command mode autocompletion]"
set wildmenu
set wildmode=longest:full,full
" `------------|---- First complete till longest common string, open wildmenu
" `---- Then, complete next full match
set ttimeout " time out for key codes
set ttimeoutlen=100 " wait up to 100ms after Esc for special key
"[Turn backup off and value of history]"
set nobackup
set noswapfile
set history=1000
set nowritebackup
set undolevels=5000
"[Setup history file]"
set viminfo=%,<0,'10,/16,:16,h,f0
" | | | | | | + file marks 0-9,A-Z 0=NOT stored
" | | | | | + disable 'hlsearch' loading viminfo
" | | | | + command-line history saved
" | | | + search history saved
" | | + files marks saved
" | + lines saved each register (old name for <, vi6.2): NOT STORED
" + save/restore buffer list
if !has('nvim')
"[Declutter $HOME]"
set viminfo+=n~/.vim/cache/.viminfo
endif
" Show @@@ in the last line if it is truncated.
set display=truncate
"[Splitting rules]"
set splitbelow
set splitright
set equalalways
" Show a few lines of context around the cursor.
set scrolloff=5
" Try to keep the cursor in the same column while scrolling
set nostartofline
set autochdir
set autoread
set autowrite
"[Shared with OS clipboard]"
set clipboard=unnamed
"[For regular expressions turn magic on, use \v to get regex parent]"
set magic
"[Search settings]"
set hlsearch
set incsearch
set smartcase
set ignorecase
set wrapscan
"[When on, the ":substitute" flag 'g' is default on]"
set nogdefault
"[Enable realtime feedback for substitution]"
if has("nvim")
set inccommand=nosplit
endif
"[Kitty doesn't support background color erase]"
let &t_ut=''
let base16colorspace=256
set background=dark
colorscheme base16-default-dark
"[Fix background transparency]"
"[Recognize the type/syntax of the file]"
filetype plugin on
filetype indent on
set omnifunc=syntaxcomplete#Complete
"[Default to filetype=tex when viewing partial tex files]"
let g:tex_flavor="tex"
"[Enable built-in plug-ins/macros]"
runtime macros/matchit.vim
"[Enable syntax highlighting]"
syntax on
"[Read the changes after the save .vimrc]"
if has("autocmd")
autocmd ColorScheme * highlight Normal ctermbg=None
autocmd ColorScheme * highlight NonText ctermbg=None
autocmd! BufWritePost $MYVIMRC source $MYVIMRC
endif
"[Define the leader key]"
let mapleader=","
let maplocalleader=","
"[List of buffers]"
map <F7> :ls!<CR>:buffer<Space>
"[Reselect visual block after indent/outdent]"
vnoremap < <gv
vnoremap > >gv
@ -207,6 +152,14 @@ vnoremap > >gv
"[If preceded by a count, jump actual lines. Also if > 5, save to jumplist]"
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
" nnoremap <Down> gj
" nnoremap <Up> gk
" vnoremap <Down> gj
" vnoremap <Up> gk
" inoremap <Down> <C-o>gj
" inoremap <Up> <C-o>gk
"[Clear search highlights]"
nnoremap // :nohlsearch<CR>
"[Easy split navigation]"
nnoremap <C-j> <C-W>j
nnoremap <C-k> <C-W>k
@ -224,11 +177,17 @@ nnoremap <silent> # #zz
"[New line under/bellow current line without jump to insert-mode]"
nnoremap <leader>o o<Esc>
nnoremap <leader>O O<Esc>
"[Clear search highlights]"
nnoremap // :nohlsearch<CR>
"[Reflow current paragraph]"
"[http://stevelosh.com/blog/2010/09/coming-home-to-vim/]"
nnoremap <silent> <leader>q :call ReflowParagraph()<CR>
"[Auto-complete parenthesis, brackets and braces, quotes]"
"inoremap " ""<Left>
"inoremap ' ''<Left>
"inoremap ( ()<Left>
"inoremap [ []<Left>
"inoremap { {}<Left>
"[Easy jump into the normal-mode from the insert-mode]"
inoremap jj <Esc>
"[To move over parenthesis, brackets, quotes in insert-mode]"
inoremap kk <Right>
inoremap hh <Left>
" http://stackoverflow.com/questions/1005/getting-root-permissions-on-a-file-inside-of-vi
cmap w!! w !sudo tee >/dev/null %
"[To disable the arrow keys]"
@ -237,47 +196,245 @@ for prefix in ['i', 'n', 'v']
execute prefix . "noremap " . key . " <Nop>"
endfor
endfor
"[Switch quickly between source and header]"
nnoremap <leader>f :e <C-r>=SwapExtension()<CR><CR>
" Do incremental searching when it's possible to timeout.
if has('reltime')
set incsearch
"[Threshold for reporting number of lines changed]"
set report=0
"[Show command in the last line of the screen]"
set showcmd
"[Show both the tag name and a tidied-up form of the search pattern]"
set showfulltag
"[Don't give the intro message when starting Vim]"
set shortmess=""
if has("unix") || has("mac")
set shortmess+=I
endif
" LaTeX ftdetect
let g:tex_flavor = "latex"
" Switch syntax highlighting on when the terminal has colors or when using the
" GUI (which always has colors).
if &t_Co > 2 || has("gui_running")
" Revert with ":syntax off".
syntax on
" I like highlighting strings inside C comments.
" Revert with ":unlet c_comment_strings".
let c_comment_strings=1
"[Always show StatusLine]"
set laststatus=2
"[Do not show mode in command line]"
set noshowmode
"[Splitting rules]"
set splitbelow
set splitright
set equalalways
"[Lisp coding settings]"
if (&filetype == "lisp")
set lisp
endif
"[Reflow current paragraph]"
function! ReflowParagraph()
let l:view = winsaveview()
normal gwip
call winrestview(l:view)
endfunction
"[Remove tabs and spaces at the end of lines]"
function! DeleteTrailingTWS()
"[Do not clean up trailing spaces in binary mode or in diff files]"
if &binary || &ft =~ 'diff'
return
"[Don't use the mouse in terminal]"
set mouse=
set mousemodel=extend
"[Fix mouse past column 222]"
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
end
"[Hide mouse while printing the text]"
set mousehide
"[Visualisation settings]"
set background=dark
set ttyfast
set tabline=""
"[Kitty doesn't support background color erase]"
let &t_ut=''
" set cmdheight=1 : default
set showtabline=0
set colorcolumn=80
set nocursorcolumn
set cmdwinheight=10
set virtualedit=all
"[GUI/Color Scheme/Font settings]"
if has("gui_running")
winsize 90 50
silent cd $HOME
set linespace=0
set guioptions=""
set guitablabel=""
if has("autocmd")
autocmd InsertEnter * set cursorline
autocmd InsertLeave * set nocursorline
endif
let l:view = winsaveview()
silent %s/[ \t]*$//g
silent %s/\s\+$//ge
call winrestview(l:view)
endfunction
if has("win32") || has("win64")
try
colorscheme solarized
set guifont=PT_Mono:h12
catch
endtry
elseif has("unix")
try
colorscheme solarized
set guifont=Liberation\ Mono\ 10
catch
endtry
elseif has("mac")
try
set antialias
colorscheme solarized
set guifont=Monaco:h12
catch
endtry
endif
else
if has("unix") || has("mac")
try
set t_Co=16
let g:solarized_termtrans=1
let g:solarized_termcolors=16
colorscheme solarized
catch
endtry
endif
endif
"[Backspace functions]"
set backspace=indent,eol,start
"[Scroll settings]"
set scrolloff=10
set scrolljump=10
set showmatch
set matchpairs=\":\"
set matchpairs+=(:)
set matchpairs+={:}
set matchpairs+=[:]
"set matchpairs+=<:> : too annoying
"[Turn backup off and value of history]"
set nobackup
set noswapfile
set history=1000
set nowritebackup
set undolevels=5000
"[Indent & Tab/mode-line settings]"
set breakindent
set nopaste
set modeline
set smarttab
set tabstop=4
set expandtab
set autoindent
set copyindent
set smartindent
set cinwords=except,finally,def,class,with,do,if,elif,else,for,while,try,switch
set cinoptions+=l1
set modelines=1
set shiftwidth=4
set softtabstop=4
"[TextWidth settings]"
set textwidth=0
"[Settings of line numbers]"
set number
set numberwidth=2
set relativenumber
"[Don't show current position]"
set ruler
"[For regular expressions turn magic on]"
set magic
"[Search settings]"
set hlsearch
set incsearch
set smartcase
set ignorecase
set wrapscan
"[When on, the ":substitute" flag 'g' is default on]"
set nogdefault
"[Language settings]"
set iminsert=0
set imsearch=0
set helplang=en
set langmenu=en
language messages POSIX
"[Show DocName in title]"
set title
"[Hide/show the white-space and more invisible symbols]"
set list
set listchars=nbsp,trail:-
"set listchars+=tab:│\ ,
set listchars+=tab:▸\ ,
set nojoinspaces
"[Folding settings]"
set foldenable
set foldclose=""
set foldcolumn=0
set foldlevel=99
set foldlevelstart=99
set foldmethod=indent
set foldopen=block,hor,mark,percent,quickfix,search,tag,undo
"[Set to auto-read and to auto-write when
" a file is changed from the outside]"
set autoread
set autowrite
"[Vim will change the current working directory whenever you
" open a file, switch buffers, delete a buffer or open/close a window]"
set autochdir
"[Not be redrawn while executing macros,
" registers that have not been typed]"
set lazyredraw
"[Time-out settings]"
set timeout
set timeoutlen=3000
set ttimeoutlen=100
"[When off a buffer is unloaded when it is abandoned]"
set hidden
"[Switch between buffers. Settings]"
set switchbuf=useopen,usetab,newtab
"[Wrap settings]"
set wrap
set whichwrap=<,>,[,]
set nolinebreak
"[Encoding/FileType settings]"
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,latin1,cp1251,koi8-r,utf-16le
"[Use UNIX, DOS, MAC FileType]"
set fileformat=unix
set fileformats=unix,mac,dos
"[Better consistency between Windows and UNIX]"
set sessionoptions=""
set viewoptions=folds,options,cursor,unix,slash
set sessionoptions+=unix,slash,blank,buffers,curdir
set sessionoptions+=folds,help,options,tabpages,winsize
"[Completion settings]"
if has("autocmd")
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
if has("ruby")
autocmd FileType ruby set omnifunc=rubycomplete#Complete
endif
if has("perl")
autocmd FileType perl set omnifunc=perlcomplete#CompletePERL
endif
if has("python")
autocmd FileType python set omnifunc=pythoncomplete#Complete
endif
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
endif
"[Completion search settings]"
set complete=.,b,d,i,k,s,t,u,U,w
set completeopt=longest,menuone,preview,menu
"[For jump between Java import statement]"
set includeexpr=substitute(v:fname,'\\.','/','g')
"[Determines the maximum number of items
" to show in the popup menu for Insert mode completion]"
set pumheight=7
"[No annoying sound or errors]"
set noerrorbells
set novisualbell
"[Shared with OS clipboard]"
set clipboard=unnamed
"[Abbreviations]"
cnoreabbrev W w
cnoreabbrev Q q
"[Turn on the wild menu and wild-mode settings]"
set wildmenu
set wildmode=list:longest,full
set wildignore=*.o,*.obj,*.pyc,*.pyo,*.swp,*.bak,*.exe,*.class
"[Use a GUI dialog when confirming]"
set confirm
"[Method used for encryption when the buffer is written to a file]"
if (version <= 702)
set cryptmethod=zip
else
set cryptmethod=blowfish
endif
"[Make the scripts executable]"
function! ChangeScriptMode()
if getline(1) =~ "#!"
@ -286,69 +443,86 @@ function! ChangeScriptMode()
endif
endif
endfunction
"[Swap file extensions, for example cpp/h]"
"https://stackoverflow.com/a/22145246"
function! SwapExtension()
let [rest, ext] = [expand('%:r'), expand('%:e')]
if ext ==? 'h'
if filereadable(rest . '.c')
let ext = 'c'
elseif filereadable(rest . '.cpp')
let ext = 'cpp'
endif
elseif ext ==? 'cpp' || ext ==? 'c'
let ext = 'h'
"swap between vertex and fragment shader"
elseif ext ==? 'vsh'
let ext = 'fsh'
elseif ext ==? 'fsh'
let ext = 'vsh'
endif
return rest . '.' . ext
endfunction
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection. Use the default filetype settings, so that
" mail gets 'tw' set to 72, 'cindent' is on in C files, etc. Also load
" indent files, to automatically do language-dependent indenting.
" Revert with ":filetype off".
filetype plugin indent on
" Put these in an autocmd group, so that you can revert them with:
" ":augroup vimStartup | au! | augroup END"
augroup vimStartup
au!
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid, when inside an event handler
" (happens when dropping a file on gvim) and for a commit message (it's
" likely a different one than last time).
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' |
\ exe "normal! g`\"" |
\ endif
augroup END
"[Try not to pollute the undo tree (https://vi.stackexchange.com/a/13401)]"
autocmd BufWritePre *
\ try |
\ undojoin |
\ catch /^Vim\%((\a\+)\)\=:E790/ |
\ finally |
\ call DeleteTrailingTWS() |
\ endtry
if has("unix") || has("mac")
if has("unix") || has("mac")
if has("autocmd")
autocmd BufWritePost * call ChangeScriptMode()
endif
endif " has("autocmd")
" Enable bépo layout if detected
silent call system("detectbepo")
if v:shell_error == 0
source ~/.vim/bepo.vim
endif
"[Python/Perl scripts templates]"
function! InitScriptFile(type)
if (a:type == "python")
execute setline(1, "#!/usr/bin/env python3")
execute setline(2, "# -*- coding: utf-8 -*-")
elseif (a:type == "perl")
execute setline(1, "#!/usr/bin/env perl")
execute setline(2, "")
execute setline(3, "use warnings;")
execute setline(4, "use strict;")
endif
normal Go
endfunction
if has("autocmd")
autocmd BufNewFile *.pl,*.pm call InitScriptFile("perl")
autocmd BufNewFile *.py,*.pyw call InitScriptFile("python")
endif
"[Remove tabs and spaces at the end of lines]"
function! DeleteTrailingTWS()
if &ft =~ 'diff'
return
end
normal mb
silent %s/[ \t]*$//g
silent %s/\s\+$//ge
normal 'b
endfunction
"[Do not clean up trailing spaces in binary mode]"
if has("autocmd") && !&binary
autocmd BufWritePre *.py,*.pyw retab
autocmd BufWritePre * call DeleteTrailingTWS()
endif
"[Toggle relativenumber between normal & insert mode]"
"[Credit: https://jeffkreeftmeijer.com/vim-number/#relative-line-numbers ]"
if has("autocmd")
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
endif
"[ALELint & Lightline compat]"
function! LightlineLinterWarnings() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf('%d ◆', all_non_errors)
endfunction
function! LightlineLinterErrors() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf('%d ✗', all_errors)
endfunction
function! LightlineLinterOK() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '✓ ' : ''
endfunction
function! LineInfo()
return !&binary ? '%3l:%-2v' : '%3l:%-2v off:%o,0x%O'
endfunction
if has("autocmd")
autocmd User ALELint call s:MaybeUpdateLightline()
autocmd VimResized * wincmd =
endif
" Update and show lightline but only if it's visible (e.g., not in Goyo)
function! s:MaybeUpdateLightline()
if exists('#lightline')
call lightline#update()
end
endfunction

53
xinitrc
View file

@ -1,53 +0,0 @@
#!/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
# Run xinitrc.d setup scripts
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
#export QT_STYLE_OVERRIDE=kvantum
export QT_QPA_PLATFORMTHEME=qt5ct
# Statusbar loop
~/suckless/slstatus/slstatus&
while true; do
feh --randomize --no-fehbg --bg-scale "$HOME/wallpapers/"*.{jpeg,jpg,png}
sleep 10m
done &
pasystray &
##blueman-applet &
# In case of unwanted shadows, break glass:
# https://www.reddit.com/r/suckless/comments/hzop00/dwm_how_to_remove_picomcompton_shadow_from/
picom&
mpd&
#kitty --single-instance zsh -c 'task ready; zsh'&
exec ~/dev/linux-utils/loopdwm

@ -1 +0,0 @@
Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d

180
zshrc
View file

@ -1,48 +1,22 @@
# zshrc originaly inspired by ECP VIA's debian course file,
# and David_5-1's numerous improvements
#
# Regularly improved and tweaked by lhark since 2015
#
# Uses the following plugins:
# https://github.com/zsh-users/zsh-syntax-highlighting
# https://github.com/zsh-users/zsh-autosuggestions
# zshrc inspiré de celui de la formation debian de VIA
# modifié par David_5_1
# http://formation-debian.via.ecp.fr/
# Ajouts depuis le wiki de archlinux http://wiki.archlinux.fr/Zsh
# et depuis http://doc.ubuntu-fr.org/zsh
# et depuis http://zsh.sourceforge.net/Guide/zshguide.html
# utilisation de https://github.com/zsh-users/zsh-syntax-highlighting
# adapté et amélioré par lhark
# Uncomment this line for perfomance analysis
#zmodload zsh/zprof
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin"
# Get rc dir path
#RC_PATH=$(dirname "$(readlink -f ${(%):-%x})")
# https://stackoverflow.com/questions/9901210/bash-source0-equivalent-in-zsh#comment45012039_23259585
RC_PATH=$(dirname "$(realpath -- "${(%):-%x}")")
export PATH="$PATH:$RC_PATH/bin:~/bin:/opt/cuda/bin:~/.cargo/bin:~/go/bin"
# Prevent golang from littering $HOME and force it to follow XDG
export GOPATH="$HOME/.local/share/go"
# Use all cores when building with cmake (using number of physical cores)
# https://unix.stackexchange.com/a/377945/248368
# TODO Check if we should use virtual cores count instead
cores="$(cat /proc/cpuinfo | grep -c "cpu cores")"
export CMAKE_BUILD_PARALLEL_LEVEL="$cores"
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:~/bin:/opt/cuda/bin:~/.cargo/bin:~/go/bin
# Add ruby gems to path
if which ruby >/dev/null && which gem >/dev/null; then
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi
# Add emscripten to path
if [ -d "$HOME/emsdk" ]; then
PATH="$PATH:~/emsdk:~/emsdk/node/12.9.1_64bit/bin:~/emsdk/fastcomp/emscripten" #:~/emsdk/fastcomp/emscripten/tools"
fi
export BROWSER='/usr/bin/w3m -T "text/html"'
if which nvim > /dev/null 2>&1; then
export EDITOR=/usr/bin/nvim
else
export EDITOR=/usr/bin/vim
fi
# Disable `less` history file
export LESSHISTFILE='/dev/null'
export GPG_TTY="$(tty)"
export EDITOR=/usr/bin/vim
# Prevent mime associations by wine
export WINEPREFIX="$HOME/.wine"
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
@ -50,8 +24,6 @@ export CUDA_ROOT=/opt/cuda
# Android SDK setup
export ANDROID_HOME="/opt/android-sdk"
export PATH="$PATH:$ANDROID_HOME/tools/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
# Use Wayland when available
export MOZ_ENABLE_WAYLAND=1
# Configuration for virtualenv
export WORKON_HOME=$HOME/.virtualenvs
@ -64,6 +36,17 @@ source /opt/ros/indigo/setup.zsh > /dev/null 2>&1
export PYTHONPATH=/opt/ros/indigo/lib/python2.7/site-packages:$PYTHONPATH
export PKG_CONFIG_PATH="/opt/ros/indigo/lib/pkgconfig:$PKG_CONFIG_PATH"
#run ssh-agent
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ "$SSH_AGENT_PID" == "" ]]; then
eval "$(<~/.ssh-agent-thing)"
fi
# Get rc dir path
RC_PATH=$(dirname "$(readlink -f ${(%):-%x})")
# Import utility functions
# Colors needed for the prompt definition
autoload -U colors
@ -72,18 +55,65 @@ colors
. "$RC_PATH/aliases"
. "$RC_PATH/prompt"
# Detect if we have GNU coreutils or BSD
if date --version > /dev/null 2>&1 ;then
# Setup colors for GNU ls
eval "$(dircolors -b)"
fi
# Check for rc updates in the background
(check_rc_update&) 2> /dev/null
# Check for system updates inthe background
(check_sys_update&) 2> /dev/null
# Configuration for kubectl & helm
#if [ $commands[kubectl] ]; then
source <(kubectl completion zsh)
#fi
export TILLER_NAMESPACE=gitlab-ci
#if [ $commands[helm] ]; then
source <(helm completion zsh)
#fi
### TODO WHERE ARE THE ALIASES
###########
# Aliases #
###########
alias acs='apt-cache search'
alias ls='ls --classify --tabsize=0 --literal --color=auto --show-control-chars -h'
alias ll='ls -lha'
alias less='less --quiet'
alias df='df --human-readable'
alias du='du --human-readable'
# alias mutt='mutt -y'
alias upgrade='sudo apt-get update && sudo apt-get -dy dist-upgrade && sudo apt-get dist-upgrade'
# alias -g GP='|grep '
alias grep="grep --color"
#alias ssh='ssh -A'
# alias -s txt=cat
alias rm='rm -I'
alias ipa='ip -c route && echo && ip -c address'
alias ipr='ip -c address && echo && ip -c route'
alias which='which -a'
# Le fameux cd ...etc
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias -g .......='../../../../../..'
alias -g ........='../../../../../../..'
# Hackish tweaks
alias steam-wine="WINEDEBUG=-all wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite -no-cef-sandbox >/dev/null 2>&1 &"
alias pacaur='AURDEST=$HOME/aur pacaur'
alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm'
alias minecraft='java -jar $HOME/.minecraft/launcher.jar'
alias shuffle='mpv --shuffle --volume=50 --no-audio-display'
alias steam="LD_PRELOAD='/usr/\$LIB/libstdc++.so.6 /usr/\$LIB/libgcc_s.so.1 /usr/\$LIB/libxcb.so.1 /usr/\$LIB/libgpg-error.so' /usr/bin/steam"
alias surftor='http_proxy=socks5://127.0.0.1:9050/ surf'
alias ytmp3='youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s"'
# Fix pour archlinux
alias zbarcam='LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam'
alias gitprunelocal="git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d"
alias gitprunelocalforce="git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D"
alias cantine="curl -s https://timechef.elior.com/api/restaurant/22/menus | jq -r '.[0].famillePlats[0].plats[].libelle'"
# Term specific hacks
case $TERM in
*kitty)
@ -102,7 +132,8 @@ case $TERM in
preexec () {
print -n "\e]0;st - $1 - ${HOST} - ${PWD}\a"
}
alias ssh='TERM=xterm ssh -A'
# alias ssh='TERM=xterm ssh -A'
alias ssh='TERM=xterm ssh'
;;
esac
@ -114,13 +145,16 @@ stty -ixon
# ZSH options #
###############
# man zshoptions
unsetopt rm_star_silent # Ask before running 'rm *' or 'rm path/*'
unsetopt rm_star_silent # Demande confirmation pour 'rm *' -> ou 'rm path/*'
unsetopt promptsubst # ZLE is handling prompt recalculation
setopt clobber # Allow file overwrite with > instead of >|
setopt chase_links # cd resolves symbolic links
setopt hist_verify # check the result of !! before executing
# (disabled) If there is an unambiguous prefix to insert on
# the command line, that is done without a completion list being displayed
#setopt list_ambiguous
# >| doit être utilisé pour pouvoir écraser un fichier déjà existant ;
# # le fichier ne sera pas écrasé avec '>'
#unsetopt clobber
setopt chase_links # Traite les liens symboliques comme il faut
setopt hist_verify # !! n\'est pas exécuté directement
setopt hist_ignore_all_dups # Only keep last version of duplicate command
setopt sharehistory # Import new cmds from hist file & append typed cmds
setopt hist_ignore_space # Ignore cmds with leading space
@ -155,41 +189,36 @@ autoload -U zsh-mime-setup
unsetopt glob_dots # (disabled) Do not require a leading '.' in a filename to be matched explicitly.
setopt auto_remove_slash # Auto remove slash at the end of autocomp when appropriate
setopt complete_in_word # If the cursor is inside a word, completion is done from both ends
setopt extended_glob # Treat '#', '~' and '^' chars as part of patterns for filenames, etc.
setopt glob_complete # When the current word has a glob pattern, do not insert all the words resulting from the expansion
unsetopt null_glob # Error when no glob match found, instead of deleting
setopt completeinword # If the cursor is inside a word, completion is done from both ends
setopt extendedglob # Treat '#', '~' and '^' chars as part of patterns for filenames, etc.
setopt globcomplete # When the current word has a glob pattern, do not insert all the words resulting from the expansion
setopt null_glob # Delete pattern when no match found, instead of erroring
# man zshmodules (zstyle)
# man zshcompsys (styles)
# man zshcompwid (COMPLETION MATCHING CONTROL)
#zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'
# Max errors allowed while attempting completion
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'
zstyle ':completion:*' max-errors 3 numeric
# Disable legacy completion
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' auto-description 'specify: %d'
#zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' completer _complete _correct _approximate
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
# Start menu style completion if there are more than 2 matches
zstyle ':completion:*' menu select=2
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
# Add colors to the completion menu, eg. kill -9 <tab><tab>
# Des couleurs pour la complétion cf kill -9 <tab><tab>
zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"'
# Separate man page sections. Neat.
zstyle ':completion:*:manuals' separate-sections true
# Create completions cache
# Useful for slow completions like with package managers
# Crée un cache des complétion possibles
# très utile pour les complétion qui demandent beaucoup de temps
# comme la recherche d'un paquet aptitude install moz<tab>
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zs
# Enable ssh completion for kitty ssh
@ -213,10 +242,10 @@ zle -N zle-keymap-select
bindkey -v # Vim type keybinds for ZLE (line editing)
# Handling of special keys
# CTRL+V then press the key to display the code
# Gestion des touches spéciales pour mon clavier
# Pour connaître le code d'une touche, exécuter «cat»
typeset -A key
# CTRL + arrows keys
# CTRL + flèches
bindkey ";5D" beginning-of-line
bindkey ";5C" end-of-line
bindkey ";5A" up-line-or-history
@ -234,20 +263,17 @@ bindkey "^[[6~" history-beginning-search-forward
# CTRL + Page UP/Down
bindkey "^[[5;5~" beginning-of-buffer-or-history
bindkey "^[[6;5~" end-of-buffer-or-history
# Begin / End (numpad)
# Origine / Fin (pavé numérique)
bindkey "^[[H" beginning-of-line
bindkey "^[[4~" end-of-line
# Begin / End
## Origine / Fin
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
bindkey "^[[F" end-of-line
# Delete
bindkey "[3~" delete-char
# Shift-Tab
bindkey "^[[Z" reverse-menu-complete
ZSH_AUTOSUGGEST_STRATEGY=(history)
source "${RC_PATH}/zsh-autosuggestions/zsh-autosuggestions.zsh"
# ZSH syntax highlighting : /!\ keep at the bottom !
source "${RC_PATH}/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"