dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

commit 5f452e2f548e3a8f7d062f60c89acf9cfa80f347
Author: Chris Noxz <chris@noxz.tech>
Date:   Mon, 12 Aug 2019 16:00:40 +0200

Initial commit (public)

Diffstat:
A.exclude/etc/issue | 7+++++++
A.exclude/etc/mpv/scripts/ztatus.lua | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.exclude/etc/udev/rules.d/95-hotplug-drm.rules | 1+
A.exclude/etc/udev/rules.d/95-powerplug-change.rules | 1+
A.gitignore | 3+++
Abin/.bin/alias/backup | 33+++++++++++++++++++++++++++++++++
Abin/.bin/alias/bc | 3+++
Abin/.bin/alias/borg | 6++++++
Abin/.bin/alias/df | 3+++
Abin/.bin/alias/diff | 3+++
Abin/.bin/alias/egrep | 3+++
Abin/.bin/alias/fd | 5+++++
Abin/.bin/alias/fdr | 14++++++++++++++
Abin/.bin/alias/fe | 5+++++
Abin/.bin/alias/fgrep | 3+++
Abin/.bin/alias/free | 3+++
Abin/.bin/alias/grep | 3+++
Abin/.bin/alias/ipp | 3+++
Abin/.bin/alias/isopen | 19+++++++++++++++++++
Abin/.bin/alias/keys | 2++
Abin/.bin/alias/la | 3+++
Abin/.bin/alias/less | 3+++
Abin/.bin/alias/ll | 3+++
Abin/.bin/alias/ls | 3+++
Abin/.bin/alias/make | 13+++++++++++++
Abin/.bin/alias/mkdir | 3+++
Abin/.bin/alias/mutt | 3+++
Abin/.bin/alias/path | 3+++
Abin/.bin/alias/rm | 3+++
Abin/.bin/alias/ssh | 8++++++++
Abin/.bin/alias/v | 2++
Abin/.bin/alias/vi | 2++
Abin/.bin/alias/vifm | 3+++
Abin/.bin/alias/vim | 3+++
Abin/.bin/alias/wget | 3+++
Abin/.bin/auto-open | 23+++++++++++++++++++++++
Abin/.bin/borg-stat | 11+++++++++++
Abin/.bin/contacts | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_bookmarks | 27+++++++++++++++++++++++++++
Abin/.bin/dmenu_confirm | 32++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_di.fm | 40++++++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_kill | 11+++++++++++
Abin/.bin/dmenu_layouts | 10++++++++++
Abin/.bin/dmenu_main | 35+++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_man | 13+++++++++++++
Abin/.bin/dmenu_mount | 47+++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_passmenu | 24++++++++++++++++++++++++
Abin/.bin/dmenu_path | 13+++++++++++++
Abin/.bin/dmenu_power | 29+++++++++++++++++++++++++++++
Abin/.bin/dmenu_run | 3+++
Abin/.bin/dmenu_sscw | 25+++++++++++++++++++++++++
Abin/.bin/dmenu_themes | 8++++++++
Abin/.bin/dmenu_todo | 38++++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_umount | 37+++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_url_extract | 15+++++++++++++++
Abin/.bin/dmenu_url_open | 40++++++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_vtc | 47+++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/dmenu_yt_search | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/dwm-run | 4++++
Abin/.bin/fix-home-permissions | 20++++++++++++++++++++
Abin/.bin/fzf-url.tmux | 30++++++++++++++++++++++++++++++
Abin/.bin/gpg-edit | 10++++++++++
Abin/.bin/listen-ac-change | 8++++++++
Abin/.bin/listen-new-mail | 12++++++++++++
Abin/.bin/listen-new-pkg | 8++++++++
Abin/.bin/mbsync-stdin | 22++++++++++++++++++++++
Abin/.bin/mkthemes | 24++++++++++++++++++++++++
Abin/.bin/mnt | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/monitor | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/msmtp-tpl | 22++++++++++++++++++++++
Abin/.bin/nrowgrid.tmux | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/operations | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/pedit | 16++++++++++++++++
Abin/.bin/print-sxhkd | 42++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/proxify | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/set-wallpaper | 21+++++++++++++++++++++
Abin/.bin/ssh-add-pass | 15+++++++++++++++
Abin/.bin/ssh-agent-init | 14++++++++++++++
Abin/.bin/status.tmux | 18++++++++++++++++++
Abin/.bin/timer | 23+++++++++++++++++++++++
Abin/.bin/vifmimg | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.bin/vifmrun | 16++++++++++++++++
Acdm/.cdm-dialogrc | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acdm/.cdmrc | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Agit/.gitconfig | 7+++++++
Ainput/.inputrc | 7+++++++
Aksh/.kshrc | 9+++++++++
Aksh/.kshrc.d/00-options.sh | 5+++++
Aksh/.kshrc.d/10-enviornment.sh | 123+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aksh/.kshrc.d/20-completion.sh | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aksh/.kshrc.d/30-alias.sh | 21+++++++++++++++++++++
Aksh/.kshrc.d/51-ssh-agent.sh | 8++++++++
Aksh/.kshrc.d/90-prompt.sh | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Aksh/.profile | 17+++++++++++++++++
Alink | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ambsync/.mbsyncrc-template | 41+++++++++++++++++++++++++++++++++++++++++
Ampv/.config/mpv/input.conf | 7+++++++
Amsmtp/.msmtprc-template | 22++++++++++++++++++++++
Amutt/.mutt/mailcap | 17+++++++++++++++++
Amutt/.mutt/muttrc | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amutt/.mutt/signature.muttrc | 9+++++++++
Anewsboat/.newsboat/config | 44++++++++++++++++++++++++++++++++++++++++++++
Anewsboat/.newsboat/urls | 48++++++++++++++++++++++++++++++++++++++++++++++++
Assh/.ssh/config | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asurf/.surf/script.js | 0
Asurf/.surf/styles/default.css | 7+++++++
Asxhkd/.config/sxhkd/sxhkdrc | 161+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asxiv/.config/sxiv/exec/key-handler | 45+++++++++++++++++++++++++++++++++++++++++++++
Athemes/.themes/ashes.vt | 16++++++++++++++++
Athemes/.themes/blaquebeard.vt | 17+++++++++++++++++
Athemes/.themes/blue.vt | 16++++++++++++++++
Athemes/.themes/dark.vt | 16++++++++++++++++
Athemes/.themes/electric-warlock.vt | 17+++++++++++++++++
Athemes/.themes/fray.vt | 17+++++++++++++++++
Athemes/.themes/grey.vt | 16++++++++++++++++
Athemes/.themes/light.vt | 16++++++++++++++++
Athemes/.themes/lightv2.vt | 16++++++++++++++++
Athemes/.themes/nixio.vt | 17+++++++++++++++++
Athemes/.themes/ocean.vt | 16++++++++++++++++
Athemes/.themes/oxide.vt | 17+++++++++++++++++
Athemes/.themes/purple.vt | 16++++++++++++++++
Athemes/.themes/ricing-is-fun.vt | 17+++++++++++++++++
Athemes/.themes/synthwave.vt | 16++++++++++++++++
Athemes/.themes/tube.vt | 16++++++++++++++++
Athemes/.themes/vtrgb2theme | 12++++++++++++
Atmux/.tmux.conf | 195+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avifm/.vifm/colors/Default.vifm | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avifm/.vifm/scripts/README | 7+++++++
Avifm/.vifm/vifm-help.txt | 5902+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avifm/.vifm/vifmrc | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avim/.vim/plugins/vim-dfm/vim-dfm.vim | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avim/.vim/plugins/vim-status/vim-status.vim | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avim/.vim/plugins/vim-tabline/vim-tabline.vim | 40++++++++++++++++++++++++++++++++++++++++
Avim/.vim/syntax/markdown.vim | 943+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avim/.vimrc | 234+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avimb/.vimb/config | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ax/.xinitrc | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
137 files changed, 11127 insertions(+), 0 deletions(-)

diff --git a/.exclude/etc/issue b/.exclude/etc/issue @@ -0,0 +1,7 @@ + ■ [hackers] enjoys exploring the details of programmable systems and how + ■ to stretch their capabilities, as opposed to most users, who prefer to + ■ ■ ■ learn only the minimum necessary. + +Void Linux \r (\n) (\l) +\d \t + diff --git a/.exclude/etc/mpv/scripts/ztatus.lua b/.exclude/etc/mpv/scripts/ztatus.lua @@ -0,0 +1,111 @@ +function string.htmlescape(str) + local str = string.gsub(str, "<", "&lt;") + str = string.gsub(str, ">", "&gt;") + str = string.gsub(str, "&", "&amp;") + str = string.gsub(str, "\"", "&quot;") + str = string.gsub(str, "'", "&apos;") + return str +end + +function string.shellescape(str) + return "'"..string.gsub(str, "'", "'\"'\"'").."'" +end + +function string.starts(str,start) + return string.sub(str, 1, string.len(start)) == start +end + +function os.capture(cmd, raw) + local f = assert(io.popen(cmd, 'r')) + local s = assert(f:read('*a')) + f:close() + if raw then return s end + s = string.gsub(s, '^%s+', '') + s = string.gsub(s, '%s+$', '') + s = string.gsub(s, '[\n\r]+', ' ') + return s +end + +function notify_current_track() + local data = mp.get_property_native("metadata") + local state = "playing" + local artist = "" + local title = "" + local media_title = "" + local body = "" + local command = "" + + if not data then + return + end + + if mp.get_property_native("pause") then + state = "paused" + end + + function get_metadata(data, keys) + for _,v in pairs(keys) do + if data[v] and string.len(data[v]) > 0 then + return data[v] + end + end + return "" + end + + artist = get_metadata(data, {"artist", "ARTIST"}) + title = get_metadata(data, {"title", "TITLE", "icy-title"}) + media_title = mp.get_property_native("media-title") + + -- soundcloud user and title + if string.starts(mp.get_property_native("path"), "https://api.soundcloud.com/tracks/") then + body = string.shellescape(("%s: %s"):format( + state, + os.capture(("sscw-track %s"):format( + string.shellescape(mp.get_property_native("filename")) + )) + )) + -- filename only + elseif title ~= "" then + -- title only + if artist == "" then + body = string.shellescape(("%s: %s"):format( + state, + string.htmlescape(title) + )) + -- artist and title + else + body = string.shellescape(("%s: %s - %s"):format( + state, + string.htmlescape(artist), + string.htmlescape(title) + )) + end + -- media_title fallback + elseif media_title ~= "" then + body = string.shellescape(("%s: %s"):format( + state, + media_title + )) + -- filename fallback + else + body = string.shellescape(("%s: %s"):format( + state, + mp.get_property_native("filename") + )) + end + + os.execute(("ztatusc notify %s"):format(body)) +end + +function notify_metadata_updated(name, value) + notify_current_track() +end + +function notify_pause_change(name, value) + notify_current_track() +end + + +mp.register_event("file-loaded", notify_current_track) +mp.observe_property("metadata", nil, notify_metadata_updated) +mp.observe_property("pause", "bool", notify_pause_change) diff --git a/.exclude/etc/udev/rules.d/95-hotplug-drm.rules b/.exclude/etc/udev/rules.d/95-hotplug-drm.rules @@ -0,0 +1 @@ +ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", RUN+="/bin/sh -c 'cat /sys/class/drm/card0-HDMI-A-2/status > /tmp/.hdmi_status'" diff --git a/.exclude/etc/udev/rules.d/95-powerplug-change.rules b/.exclude/etc/udev/rules.d/95-powerplug-change.rules @@ -0,0 +1 @@ +ACTION=="change", SUBSYSTEM=="power_supply", RUN+="/bin/sh -c 'cat /sys/class/power_supply/AC/online > /tmp/.ac_status'" diff --git a/.gitignore b/.gitignore @@ -0,0 +1,3 @@ +offlineimap/offlineimap.pyc +vifm/.vifm/vifminfo +.netrwhist diff --git a/bin/.bin/alias/backup b/bin/.bin/alias/backup @@ -0,0 +1,33 @@ +#!/bin/sh + +echo -n "Do you wish to backup '$HOME' (y/N)? " +read answer && [ "$answer" = "${answer#[Yy]}" ] && return + +select _repo in local remote +do + case "$_repo" in + local) + borg create \ + --stats \ + --progress \ + --compression lz4 \ + --exclude "$HOME/mnt" \ + --exclude "$HOME/downloads" \ + --exclude "$HOME/.cache" \ + ::{user}-{now} "$HOME" + return ;; + remote) + borg create \ + --stats \ + --progress \ + --compression lz4 \ + --exclude "$HOME/mnt" \ + --exclude "$HOME/downloads" \ + --exclude "$HOME/.cache" \ + backup:void42::{user}-{now} "$HOME" + return ;; + *) + echo "select a valid option" + ;; + esac +done diff --git a/bin/.bin/alias/bc b/bin/.bin/alias/bc @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/bc -l $@ diff --git a/bin/.bin/alias/borg b/bin/.bin/alias/borg @@ -0,0 +1,6 @@ +#!/bin/sh + +export BORG_REPO="/xtra/backup/local" +export BORG_PASSCOMMAND="pass backup/borg/local/passphrase" + +/bin/borg $@ diff --git a/bin/.bin/alias/df b/bin/.bin/alias/df @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/df -h $@ diff --git a/bin/.bin/alias/diff b/bin/.bin/alias/diff @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/colordiff $@ diff --git a/bin/.bin/alias/egrep b/bin/.bin/alias/egrep @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/egrep --color=auto $@ diff --git a/bin/.bin/alias/fd b/bin/.bin/alias/fd @@ -0,0 +1,5 @@ +#!/bin/sh + +_dir="$(find ${1:-.} -type d 2>/dev/null | fzf-tmux +m --select-1 --exit-0)"\ + && cd "$_dir" +unset _dir diff --git a/bin/.bin/alias/fdr b/bin/.bin/alias/fdr @@ -0,0 +1,14 @@ +#!/bin/sh + +_dir="$(realpath "${1:-$PWD}")" +_dirs="$_dir" + +while [ -d "$_dir" ]; do + [ "$_dir" != '/' ] && _dir="$(dirname "$_dir")" || break + _dirs="$_dir\n$_dirs" +done + +cd "$(echo "$_dirs" | fzf-tmux --tac)" + +unset _dir +unset _dirs diff --git a/bin/.bin/alias/fe b/bin/.bin/alias/fe @@ -0,0 +1,5 @@ +#!/bin/sh + +_file="$(find ${1:-.} -type f 2>/dev/null | fzf-tmux +m --select-1 --exit-0)"\ + && ${EDITOR:-vim} "$_file" +unset _file diff --git a/bin/.bin/alias/fgrep b/bin/.bin/alias/fgrep @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/fgrep --color=auto $@ diff --git a/bin/.bin/alias/free b/bin/.bin/alias/free @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/free -h $@ diff --git a/bin/.bin/alias/grep b/bin/.bin/alias/grep @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/grep --color=auto $@ diff --git a/bin/.bin/alias/ipp b/bin/.bin/alias/ipp @@ -0,0 +1,3 @@ +#!/bin/sh + +curl ipecho.net/plain -s | xargs -0 printf '%s\n' diff --git a/bin/.bin/alias/isopen b/bin/.bin/alias/isopen @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -n "$1" ] && [ "$1" != "" ] && [ -n "$2" ] && [ "$2" != "" ]; then + case "$2" in + ''|*[!0-9]*) echo "PORT is not a number" ;; + *) + case $(( + ($2 <= 0) * 1 + + ($2 > 65535) * 2 + )) in + (1) echo "PORT must be greater than 0" ;; + (2) echo "PORT must be lower than or equal to 65535" ;; + (0) nc -vzw 1 "$1" "$2" ;; + esac + ;; + esac +else + echo "usage: isopen ADDRESS PORT" +fi diff --git a/bin/.bin/alias/keys b/bin/.bin/alias/keys @@ -0,0 +1 @@ +../print-sxhkd+ \ No newline at end of file diff --git a/bin/.bin/alias/la b/bin/.bin/alias/la @@ -0,0 +1,3 @@ +#!/bin/sh + +ls -A $@ diff --git a/bin/.bin/alias/less b/bin/.bin/alias/less @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/less -R $@ diff --git a/bin/.bin/alias/ll b/bin/.bin/alias/ll @@ -0,0 +1,3 @@ +#!/bin/sh + +ls -alh $@ diff --git a/bin/.bin/alias/ls b/bin/.bin/alias/ls @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/ls --color=auto --group-directories-first $@ diff --git a/bin/.bin/alias/make b/bin/.bin/alias/make @@ -0,0 +1,13 @@ +#!/bin/sh + +exec 4>&1 +( sed \ + -e "s/^\(.*warning.*\)$/$(tput setaf 3; tput bold)\1$(tput sgr0)/g" \ + -e "s/^\(.*error.*\)$/$(tput setaf 1; tput bold)\1$(tput sgr0)/g" \ + -e "s/^\(\s\{5,\}\)\(.*\)$/\1$(tput setaf 15; tput sitm)\2$(tput sgr0)/g"\ + >&4 |& +exec >&p +/usr/bin/make $@ 2>&1 ) +ec=$? +exec >&- >&4 +return ${ec} diff --git a/bin/.bin/alias/mkdir b/bin/.bin/alias/mkdir @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/mkdir -pv $@ diff --git a/bin/.bin/alias/mutt b/bin/.bin/alias/mutt @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/neomutt $@ diff --git a/bin/.bin/alias/path b/bin/.bin/alias/path @@ -0,0 +1,3 @@ +#!/bin/sh + +printf "%s\n" "$PATH" | /bin/tr ":" "\n" diff --git a/bin/.bin/alias/rm b/bin/.bin/alias/rm @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/rm -i $@ diff --git a/bin/.bin/alias/ssh b/bin/.bin/alias/ssh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ ! -f "$HOME/.tmp/.ssh-agent-init-done" ] +then + ssh-agent-init +fi + +/bin/ssh $@ diff --git a/bin/.bin/alias/v b/bin/.bin/alias/v @@ -0,0 +1 @@ +vim+ \ No newline at end of file diff --git a/bin/.bin/alias/vi b/bin/.bin/alias/vi @@ -0,0 +1 @@ +vim+ \ No newline at end of file diff --git a/bin/.bin/alias/vifm b/bin/.bin/alias/vifm @@ -0,0 +1,3 @@ +#!/bin/sh + +vifmrun $@ diff --git a/bin/.bin/alias/vim b/bin/.bin/alias/vim @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/vim $@ diff --git a/bin/.bin/alias/wget b/bin/.bin/alias/wget @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/wget -c $@ diff --git a/bin/.bin/auto-open b/bin/.bin/auto-open @@ -0,0 +1,23 @@ +#!/bin/sh + +case "$1" in + # images + *.jpg |\ + *.jpeg |\ + *.gif |\ + *.bmp |\ + *.png |\ + *.ff |\ + *.ff.bz |\ + *.ff.xz |\ + *.ff.gz \ + ) (: "${IMG_VIEWER?}") 2>/dev/null && "$IMG_VIEWER" "$1" & exit;; + # pdfs + *.pdf \ + ) (: "${PDF_VIEWER?}") 2>/dev/null && "$PDF_VIEWER" "$1" & exit;; +esac + +case "$(file -b --mime-type "$1")" in + image/*) (: "${IMG_VIEWER?}") 2>/dev/null && "$IMG_VIEWER" "$1" & exit;; +esac + diff --git a/bin/.bin/borg-stat b/bin/.bin/borg-stat @@ -0,0 +1,11 @@ +#!/bin/sh + +set -- $(ls ~/.password-store/backup/borg/nas); for repo +do + export BORG_REPO="backup:$repo" + export BORG_PASSCOMMAND="pass backup/borg/nas/$repo/passphrase" + + echo "status: $repo" + /bin/borg list + echo +done diff --git a/bin/.bin/contacts b/bin/.bin/contacts @@ -0,0 +1,72 @@ +#!/bin/sh + +[ "$1" = "" ] && exit + +get_header_index() { + echo "$1" \ + | grep "^[0-9]*:$2$" \ + | sed "s/:.*$//" +} + +# download data +data="$(curl \ + --silent "https://mail.noxz.tech/SOGo/so/$1/Contacts/personal/view" \ + --header "Accept: application/json" \ + --header "Content-Type: application/json" \ + --user "$(printf '%s:%s' "$1" "$(pass "/mail/$1/password")")" \ +)" + +# download headers (first row contains header names) +headers="$(echo "$data" \ + | jq '.headers | .[0]' \ + | grep '^ ' \ + | sed -e 's/"[,]*$//' -e 's/^ "//' \ + | awk '{print NR-1 ":" $0}' \ +)" + +# get header indices +h1="$(get_header_index "$headers" 'c_givenname')" +h2="$(get_header_index "$headers" 'c_sn')" +h3="$(get_header_index "$headers" 'c_cn')" +h4="$(get_header_index "$headers" 'c_mail')" + +# parse data +i=0 +alias="" +while true; do + i="$((i+1))" + row="$(echo "$data" \ + | jq ".headers | .[$i]" \ + )" + + # break on fail or null return + [ "$?" -ne 0 ] || [ "$row" = "null" ] && break + + alias="$alias$(echo "$row" \ + | jq -r ".|.[$h1],.[$h2],.[$h3],.[$h4]" \ + | tr '\n' ':')\n" +done + +# print generation string +printf "# this file was generated using: %s %s\n" "$0" "$@" + +# print aliases +echo "$alias" \ + | sort -t ':' -k 2,2 -k 1,1 \ + | awk "$(cat <<'EOT' + BEGIN { + FS=OFS=SUBSEP=":" + printf("unalias *\n") + } + $4 != "" { + arr[$2] = sprintf("%s,%.3s%.3s", arr[$2], $1, $2) + printf("alias %.3s%.3s %s (%s)\n", tolower($1), tolower($2), $4, $3) + } + END { + printf("\n") + for (x in arr) { + printf("alias %s %s\n", tolower(x), tolower(substr(arr[x], 2))) + } + } +EOT +)" diff --git a/bin/.bin/dmenu_bookmarks b/bin/.bin/dmenu_bookmarks @@ -0,0 +1,27 @@ +#!/bin/sh + +choice="" +data="" +filename="$1"; shift +options="" +args=" $@" + +[ ! -f "$filename" ] && exit 1 + +# for each line, remove url (after last space) and append value to options +# (while trimming the last blankspace of the value) +while read -r line; do + if [ "${line#\#}" = "${line}" ] && [ "$line" != "" ]; then + data="$data$line\n" + text="${line%%${line##*\ }}" + options="$options${text%?}\n" + fi +done < "$filename" + +# get url based on choice +choice=$(printf "$options" | sort | dmenu_vtc${args}) +choice=$(printf "$data" | grep "$choice") +choice="${choice##*\ }" + +# copy url to primary and clipboard +printf "$choice" | xclip -i -sel p -f | xclip -i -sel c diff --git a/bin/.bin/dmenu_confirm b/bin/.bin/dmenu_confirm @@ -0,0 +1,32 @@ +#!/bin/sh + +args="" +cmd="" + +while :; do + case "$1" in + -b | -f | -i) + args="$args $1" ;; + -l | -h | -m | -p | -fn | -nb | -nf | -sb | -sf ) + args="$args $1"; shift; args="$args $1";; + -w ) + args="$args $1"; shift; args="$args $(eval echo $1)" ;; + -cmd ) + shift; cmd="$1";; + --) + shift; break ;; + -*) + echo "invalid option: $1" 1>&2; exit 1 ;; + *) + break ;; + esac + shift +done + +if [ "$cmd" = "" ]; then + exit 0 +fi + +if [ "$(printf "no\nyes" | dmenu_vtc${args})" = "yes" ]; then + echo $cmd | ${SHELL:-"/bin/sh"} & +fi diff --git a/bin/.bin/dmenu_di.fm b/bin/.bin/dmenu_di.fm @@ -0,0 +1,40 @@ +#!/bin/sh + +choice="" +data="" +key="$1"; shift +options="" +args=" $@" + +[ "$key" = "" ] && exit 1 + +# download list of available channels +data="$( + curl -s "http://listen.di.fm/premium_high/" \ + | grep -Po "http://listen.*?pls" \ +)" +options="$( + echo $data \ + | tr ' ' '\n' \ + | sed 's/^.*\/premium_high\/\(.*\).pls/\1/g' \ +)" + +# get url based on choice +choice=$(printf "$options" | sort | dmenu_vtc${args}) +choice=$(printf "$data" | grep "/$choice.pls") +choice="${choice##*\ }" + +# exit if no station was picked +[ "$choice" = "" ] && exit 0 + +# make tmp +tmp="$(mktemp /tmp/pls.XXXXXXXXXX)" && chmod 600 "$tmp" || exit 1 + +# download channel playlist +curl -s "$choice" | sed "s/\(File[0-9].*$\)/\1?$key/g" > "$tmp" + +# load playlist +mpvc load "$tmp" + +# remove playlist after 60 seconds +sleep 60 && rm "$tmp" diff --git a/bin/.bin/dmenu_kill b/bin/.bin/dmenu_kill @@ -0,0 +1,11 @@ +#!/bin/sh + +dmenu_confirm \ + -p "kill:" \ + -nb "#fb2222" \ + -nf "#000000" \ + -sb "#000000" \ + -sf "#fb2222" \ + -w "$(grep < ~/.data/dwm/dwm.log 'dwm: client:' \ + | tail -n 1 | cut -d ' ' -f 3)" \ + -cmd "echo kill client > /tmp/dwm.fifo" diff --git a/bin/.bin/dmenu_layouts b/bin/.bin/dmenu_layouts @@ -0,0 +1,10 @@ +#!/bin/sh + +args=" -p layouts: -l 20" +options="grid\ncolumns\ntiled\nfloating\nmonocle\ntcl" + +layout="$(printf "$options" | dmenu_vtc${args})" +case "$layout" in + grid|columns|tiled|floating|monocle|tcl) + echo "set layout $layout" > "/tmp/dwm.fifo";; +esac diff --git a/bin/.bin/dmenu_main b/bin/.bin/dmenu_main @@ -0,0 +1,35 @@ +#!/bin/sh + +args=" -p main: -l 20" +options="bookmarks\ndi.fm\ntodo\nsoundcloud\noperations\nyoutube\nman\npass" + +get_fm_key () { + local key_location="/tmp/.di.fm.key" + local key_pass="di.fm/listen-key" + + [ ! -f "$key_location" ] \ + && touch "$key_location" \ + && chmod 600 "$key_location" \ + && pass "$key_pass" > "$key_location" + + echo $(cat "$key_location") +} + +case "$(printf "$options" | sort | dmenu_vtc${args})" in +man) + dmenu_man${args} -i -p man:;; +bookmarks) + dmenu_bookmarks "$HOME/.data/bookmarks" ${args} -i -p bookmark:;; +di.fm) + dmenu_di.fm "$(get_fm_key)" ${args} -i -p di.fm:;; +todo) + dmenu_todo "$HOME/.data/todo" ${args} -i -p todo:;; +pass) + dmenu_passmenu ${args} -i -p pass:;; +soundcloud) + dmenu_sscw${args} -i;; +youtube) + dmenu_yt_search${args} -i;; +operations) + operations dmenu${args} -i -p operations:;; +esac diff --git a/bin/.bin/dmenu_man b/bin/.bin/dmenu_man @@ -0,0 +1,13 @@ +#!/bin/sh + +args=" -p man: -l 30 $@" + +man="$( + man -k . \ + | dmenu_vtc${args} \ + | grep -oe '^[^(]*' \ +)" + +[ "$man" = "" ] && exit 1 + +echo "$man" | xargs -r man -Tpdf | zathura - & diff --git a/bin/.bin/dmenu_mount b/bin/.bin/dmenu_mount @@ -0,0 +1,47 @@ +#!/bin/sh + +# get mountable partitions +parts="$( + lsblk -lp \ + | grep "[0-9] part $" \ + | awk '{print $1, "(" $4 ")"}' \ +)" +[ "$parts" = "" ] && exit 1 + +# choose a partition to mount +args=" -i -p partition:" +part="$( + echo "$parts" \ + | dmenu_vtc${args} \ + | awk '{print $1}' \ +)" +[ "$part" = "" ] && exit 1 + +# try to mount using fstab, and exit on success +sudo mount "$part" 2>/dev/null && exit 0 + +# get available mount points +dirs="$( + find \ + /mnt \ + /media \ + /mount \ + ~/mnt \ + ~/media \ + ~/mount \ + -maxdepth 2 \ + -type d \ + -empty \ + 2>/dev/null \ +)" + +# choose a mount point +args=" -i -p directory:" +mntpnt="$( + echo "$dirs" \ + | dmenu_vtc${args} \ +)" +[ "$mntpnt" = "" ] || [ ! -d "$mntpnt" ] && exit 1 + +# finally mount the partition +sudo mount $part $mntpnt && ztatusc notify "'$part' mounted at '$mntpnt'" diff --git a/bin/.bin/dmenu_passmenu b/bin/.bin/dmenu_passmenu @@ -0,0 +1,24 @@ +#!/bin/sh + +typeit=0 +if [ "$1" = "--type" ]; then + typeit=1; shift +fi +args=" -l 20 -p pass: $@" + +prefix="$HOME/.password-store" +password_files="$( + find "$prefix" -name "*.gpg" \ + | sed -e "s,$prefix/,,g" -e "s,.gpg,,g" +)" + +password=$(echo "$password_files" | dmenu_vtc ${args}) +[ "$password" = "" ] && return + +if [ $typeit -eq 0 ]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" 2>/dev/null \ + | { read -r pass; printf %s "$pass"; } \ + | xdotool type --clearmodifiers --file - +fi diff --git a/bin/.bin/dmenu_path b/bin/.bin/dmenu_path @@ -0,0 +1,13 @@ +#!/bin/sh +cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} +if [ -d "$cachedir" ]; then + cache=$cachedir/dmenu_run +else + cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~ +fi +IFS=: +if stest -dqr -n "$cache" $PATH; then + stest -flx $PATH | sort -u | tee "$cache" +else + cat "$cache" +fi diff --git a/bin/.bin/dmenu_power b/bin/.bin/dmenu_power @@ -0,0 +1,29 @@ +#!/bin/sh + +args=" -p power:" +options="lock\nlogout\nshutdown\nreboot" + +if [ "$1" = "off" ]; then + dmenu_confirm \ + -p "shutdown:" \ + -nb "#fb2222" \ + -nf "#000000" \ + -sb "#000000" \ + -sf "#fb2222" \ + -cmd "sudo runit-init 0" + return 0; +fi + +case "$(printf "$options" | dmenu_vtc${args})" in +lock) + /usr/local/bin/slock -m "locked at $(date "+%H:%M:%S"; + echo '------------------'; + fortune /usr/share/fortunes/off/black-humor)" + ;; +logout) + killall dwm-run;; +shutdown) + sudo runit-init 0;; +reboot) + sudo runit-init 6;; +esac diff --git a/bin/.bin/dmenu_run b/bin/.bin/dmenu_run @@ -0,0 +1,3 @@ +#!/bin/sh + +dmenu_path | dmenu_vtc -p run: "$@" | ${SHELL:-"/bin/sh"} & diff --git a/bin/.bin/dmenu_sscw b/bin/.bin/dmenu_sscw @@ -0,0 +1,25 @@ +#!/bin/sh + +args=" -p soundcloud" +choice="" +existing="" +options="" +term="" + +term="$(echo -n | dmenu_vtc${args} -l 0)" +[ "$term" = "" ] && exit 0 +options="$(printf "$term" | sscw-search -s)" +[ "$options" = "" ] && exit 0 +titles="$(echo "$options" | \ + cut -d "$(printf '\t')" -f 1,2 --output-delimiter=" - " | \ + awk '{ print FNR " " $0 }')" +urls="$(echo "$options" | \ + cut -d "$(printf '\t')" -f 4 | \ + awk '{ print FNR " " $0 }')" +title="$(printf "$titles" | dmenu_vtc${args} -l 20 -p "soundcloud > $term:")" # get -p from input and append "\b > $term:" + +[ "$title" = "" ] && exit 0 +url="$(printf "$urls" | grep "^${title%% *} ")" +dmenu_url_open "${url#* }" "${title#* }" + +exit 0 diff --git a/bin/.bin/dmenu_themes b/bin/.bin/dmenu_themes @@ -0,0 +1,8 @@ +#!/bin/sh + +args=" -p theme: -l 20" + +theme="$(ttyc list | dmenu_vtc${args})" +sudo ttyc "$theme" \ + && echo $(killall -USR1 st 2>/dev/null) \ + && echo quit > /tmp/dwm.fifo diff --git a/bin/.bin/dmenu_todo b/bin/.bin/dmenu_todo @@ -0,0 +1,38 @@ +#!/bin/sh + +choice="" +existing="" +filename="$1"; shift; +args=" $@" +options="" + +[ ! -f "$filename" ] && exit 1 + +while true; do + # get current todo with line numbering + options="$(awk '{print NR,$0}' "$filename")" + + # get choice + choice="$(printf "$options" | dmenu_vtc${args})" + + # check if choice was made + [ ! -n "$choice" ] && exit + + # get existing record + existing="$(printf "$options" | grep "^${choice}$")" + + # check if existing or new + if [ "$existing" != "" ] && [ "${existing%%\ *}" -eq "${existing%%\ *}" ]; then + case "$(printf 'copy\ndelete' | dmenu_vtc${args})" in + copy) + printf "${existing#*\ }" | \ + xclip -i -sel p -f | \ + xclip -i -sel c + exit ;; + delete) + sed -i "${existing%%\ *}d" "$filename" ;; + esac + else + echo "${choice}" >> "$filename" + fi +done diff --git a/bin/.bin/dmenu_umount b/bin/.bin/dmenu_umount @@ -0,0 +1,37 @@ +#!/bin/sh + +# get partitions mounted through fstab (exclude these) +exclude="$( + sed -e '/^$/d' -e '/^#.*$/d' /etc/fstab \ + | awk ' + BEGIN { + C = 0; + printf "\\ \\(" + } END { + printf "\\)$" + } C++ > 1 { + printf "\\|" + } $2 ~ /^\/.*/ { + printf "%s",$2; + }' +)" + +# get mounted partitions +parts="$( + lsblk -lp \ + | grep "part /" \ + | grep -v "$exclude" \ + | awk '{print $1, "(" $4 ")", "on", $7}' \ +)" +[ "$parts" = "" ] && exit + +# choose a partition to unmount +args=" -i -p unmount:" +part="$( + echo "$parts" \ + | dmenu_vtc${args} \ + | awk '{print $1}' \ +)" +[ "$part" = "" ] && exit + +sudo umount $part && ztatusc notify "'$part' unmounted" diff --git a/bin/.bin/dmenu_url_extract b/bin/.bin/dmenu_url_extract @@ -0,0 +1,15 @@ +#!/bin/sh + +args=" -l 20 -w $WINDOWID" +stdin=$(cat) +url="" +urls="$(printf "$stdin" |\ + sed 's/\(\(https\|http\|sftp\|ftp\|telnet\)\:\/\/\)/\n\1/g' |\ + sed '/^\(http\|https\|ftp\|sftp\|telnet\)/!d' |\ + sed 's/\(^\(https\|http\|sftp\|ftp\|telnet\)\:\/\/[^ <]*\)\(.*\)/\1/g' |\ + sort -u)" + +[ "$urls" = "" ] && exit + +url="$(printf "$urls" | dmenu_vtc${args})" +[ "$url" != "" ] && dmenu_url_open "$url" ${args} diff --git a/bin/.bin/dmenu_url_open b/bin/.bin/dmenu_url_open @@ -0,0 +1,40 @@ +#!/bin/sh + +options="copy\nmpv\nwget\nyt-dl\nsurf\nvimb\nw3m" +url="$1"; shift +visual="$url" + +if [ "${#visual}" -gt 30 ]; then + visual="$(expr substr $url 1 20)...$(expr substr $url $((${#url} -6)) 7)" +fi + +args=" $@ -i -p $visual" + +case "$(printf "$options" | dmenu_vtc${args})" in +copy) + printf "$url" \ + | xclip -selection primary -f \ + | xclip -selection clipboard & ;; +mpv) + mpvc load "$url" ;; +yt-dl-video) + youtube-dl \ + -f webm \ + -o "$HOME/downloads/%(title)s-%(id)s.%(ext)s" \ + "$url" >/dev/null 2>&1 & ;; +yt-dl-audio) + youtube-dl \ + -extract-audio \ + --audio-format vorbis \ + --audio-quality 0 \ + -o "$HOME/downloads/%(title)s-%(id)s.%(ext)s" \ + "$url" >/dev/null 2>&1 & ;; +wget) + wget "$url" >/dev/null 2>&1 & ;; +surf) + surf "$url" >/dev/null 2>&1 & ;; +vimb) + vimb-tabbed "$url" >/dev/null 2>&1 & ;; +w3m) + w3m "$url" >/dev/null 2>&1 & ;; +esac diff --git a/bin/.bin/dmenu_vtc b/bin/.bin/dmenu_vtc @@ -0,0 +1,47 @@ +#!/bin/sh + +# check if running in X +inx=$([ ! -z $XAUTHORITY ] && echo 1 || echo 0) + +case $inx in +1) + pgrep -x dmenu && exit + + lumi="$(readvtc 0 | lumi)" + args=" + -fn "hack:size=9" \ + -nb $([ "$lumi" -gt 50 ] && printf '#fdfdfd' || printf '#030303') \ + -nf $(readvtc 6) \ + -sb $(readvtc 5) \ + -sf $(readvtc 6)" + + while :; do + case "$1" in + -b | -f | -i) + args="$args $1";; + -l | -h | -m | -p | -fn | -nb | -nf | -sb | -sf) + args="$args $1"; shift; args="$args $1";; + -w) + args="$args $1"; shift; args="$args $(eval echo $1)";; + --) + shift; break;; + -*) + echo "invalid option: $1" 1>&2; exit 1;; + *) + break;; + esac + shift + done + + dmenu${args} +;; +0) + # fix for 'cascading' fzfs + sleep 0.01 + + fzf-tmux \ + --reverse \ + --select-1 \ + --exit-0 +;; +esac diff --git a/bin/.bin/dmenu_yt_search b/bin/.bin/dmenu_yt_search @@ -0,0 +1,58 @@ +#!/bin/sh + +args=" -i -l 20 -p ▶ -sb #ca0200 -sf #ffffff -nb #000000 -nf #ffffff" +search_phrase="$(echo -n | dmenu_vtc${args} \ + | sed 's/\ /+/g' \ + | hexdump -v -e '/1 "%02x"' \ + | sed 's/\(..\)/%\1/g')" + +search_results="$(curl 2>/dev/null \ + "https://www.youtube.com/results?search_query=$search_phrase" \ + | sed 's/<a /\n<a /g')" +search_data="$(echo $search_results \ + | grep -o '<a href=\"/watch?v=[^>]*>' \ + | grep -v 'list=' \ + | sed -r "s/^<a(.*?)href=\"\/watch\?v=([^\"]+)\"(.*?)title=\"([^\"]+)\"(.*?)>/\2;\4/")" +time="" +line="" +data="" +options="" +nr="" +i="0" +id="" +name="" + +[ "$search_data" = "" ] && exit 0 + +while :; do + line="${search_data%% +*}" + i="$((i+1))" + nr="$(printf "%02d" "$i")" + id="${line%%;*}" + name="${line#*;}" + data="$data$nr $id\n" + time="$(echo "$search_results" | grep -B 1 -- "$id" 2>/dev/null \ + | grep "video-time" 2>/dev/null \ + | sed -r "s/<span[^>]*>([^<]*).*/\1/")" + + if [ "$time" = "" ]; then + time="LIVE!" + elif [ "$(echo "$time" | grep -o ':' | wc -l)" != "2" ]; then + time="$(date --date="00:$time" +"%M:%S")" + else + time="$(date --date="$time" +"%H:%M:%S")" + fi + + options="$options$nr [$time] "$(echo "$name" | recode html..unicode)"\n" + search_data="${search_data#* +}" + if [ "$line" = "$search_data" ]; then break; fi +done + +choice="$(echo $options | sed '/^\s*$/d' | sort | dmenu_vtc${args})" + +[ "$choice" = "" ] && exit 0 + +choice="$(printf "$data" | grep ^${choice%% *})" +dmenu_url_open "https://www.youtube.com/watch?v=${choice#* }" diff --git a/bin/.bin/dwm-run b/bin/.bin/dwm-run @@ -0,0 +1,4 @@ +#!/bin/sh +while true; do + /usr/local/bin/dwm 2>"$HOME/.data/dwm/dwm.log" +done diff --git a/bin/.bin/fix-home-permissions b/bin/.bin/fix-home-permissions @@ -0,0 +1,20 @@ +#!/bin/sh + +mount | grep "[[:space:]]$HOME" 2>&1 >/dev/null && { + tput setaf 1 + echo "there is something mounted under '$HOME'" + tput sgr0 + exit 1 +} + +echo "All permissions are about to be changed." + +read -r -p "Are you sure? [y/N] " response +case "$response" in + [yY][eE][sS]|[yY]) + # set a max of rwx --- --- for all files and directories (non symlinks) + find /home/* \! -type l -perm /g+rwx,o+rwx -print -exec chmod g-rwx,o-rwx '{}' + + ;; + *) exit 0 ;; +esac + diff --git a/bin/.bin/fzf-url.tmux b/bin/.bin/fzf-url.tmux @@ -0,0 +1,30 @@ +#!/bin/sh + +pane="$(tmux capture-pane -J -p)" +urls=$( + echo "$pane" \ + | grep -oE '(https?|s?ftps?|telnet|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]' +) +wwws=$( + echo "$pane" \ + | grep -oE 'www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' \ + | sed 's/^\(.*\)$/http:\/\/\1/' +) +ips=$( + echo "$pane" \ + | grep -oE '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}(:[0-9]{1,5})?(/\S+)*' \ + | sed 's/^\(.*\)$/http:\/\/\1/' +) + +printf '%s\n' "$urls" "$wwws" "$ips" \ + | sort -u \ + | sed -r '/^\s*$/d' \ + | nl -w3 -s ' ' \ + | fzf-tmux \ + -d 35% \ + --exit-0 \ + --cycle \ + --reverse \ + --no-preview \ + | awk '{print $2}' \ + | xargs -n1 -I {} dmenu_url_open {} &>/dev/null || true diff --git a/bin/.bin/gpg-edit b/bin/.bin/gpg-edit @@ -0,0 +1,10 @@ +#!/bin/sh + +[ ! -f "$1" ] && exit +data="$(gpg2 --decrypt --output - "$1")" + +[ "$?" -ne 0 ] && exit "$?" +data="$(echo "$data" | pedit)" + +[ "$?" -ne 0 ] && exit "$?" +echo "$data" | gpg2 --symmetric --output "$1" --yes diff --git a/bin/.bin/listen-ac-change b/bin/.bin/listen-ac-change @@ -0,0 +1,8 @@ +#!/bin/sh + +STATUS_FILE="/tmp/.ac_status" + +[ ! -f "$STATUS_FILE" ] && touch "$STATUS_FILE" + +# Listen for changes forever +echo "$STATUS_FILE" | entr -n -p 2>/dev/null ztatusc update power diff --git a/bin/.bin/listen-new-mail b/bin/.bin/listen-new-mail @@ -0,0 +1,12 @@ +#!/bin/sh + +# Listen for changes forever +while true; do + ls -d \ + "$HOME"/mail/webmail-*/INBOX/new/ \ + "$HOME"/mail/webmail-*/INBOX/new/* \ + 2>/dev/null | entr -n -r -a -d -p 2>/dev/null echo + count="$(find "$HOME"/mail/webmail-*/INBOX/new/* 2>/dev/null | wc -l)" + [ "$count" != "0" ] && ztatusc notify "you have $count new mail(s)" + ztatusc update mail +done diff --git a/bin/.bin/listen-new-pkg b/bin/.bin/listen-new-pkg @@ -0,0 +1,8 @@ +#!/bin/sh + +# Listen for changes forever +ls /var/db/xbps/pkgdb*.plist | entr -n -p -s ' + count="$(pkg queue | wc -l)" + [ "$count" != "0" ] && ztatusc notify "you have $count new pakage(s)" + ztatusc update updates +' diff --git a/bin/.bin/mbsync-stdin b/bin/.bin/mbsync-stdin @@ -0,0 +1,22 @@ +#!/bin/sh + +# call using `cat .mbsyncconf | mbsync-stdin <channelname> -V...` + +stdin="$(cat -)" +regex="::{\([0-9]\);\([^}]*\)}" +targets="$(echo "$stdin" | grep -oe "$regex" | uniq)" +tmpfile="$(mktemp /tmp/.mbsyncrc.XXXXXX)" + +load_encypted_conf() { + acc="$(pass mail/account-id | sed "$(($1+1))q;d")" + printf "%s" "$(pass mail/"$acc"/"$2")" +} + +echo "$targets" | while read -r target; do + args="$(echo "$target" | sed -e "s/$regex/\1 \2/")" + stdin="$(echo "$stdin" | sed -e "s/$target/$(load_encypted_conf $args)/")" + echo "$stdin" > "$tmpfile" +done + +mbsync -c "$tmpfile" "$@" +rm -f "$tmpfile" diff --git a/bin/.bin/mkthemes b/bin/.bin/mkthemes @@ -0,0 +1,24 @@ +#!/bin/sh + +for vt in $HOME/.themes/*.vt +do + _r=""; _g=""; _b="" + _n=${vt##*/} + _n=${_n%%.*} + _f=/usr/share/kbd/vtrgb/vtrgb.$_n + + set -- $(sed -e 's/#.*$//' -e '/^$/d' "$vt") + for line + do + _r="$_r,$(echo $line | cut -c1-2 | xargs -I . printf '%d' '0x.')" + _g="$_g,$(echo $line | cut -c3-4 | xargs -I . printf '%d' '0x.')" + _b="$_b,$(echo $line | cut -c5-6 | xargs -I . printf '%d' '0x.')" + done + + { + echo "[ -f \"$_f\" ] && rm -f \"$_f\"" + echo "echo \"${_r#*,}\" >> \"$_f\"" + echo "echo \"${_g#*,}\" >> \"$_f\"" + echo "echo \"${_b#*,}\" >> \"$_f\"" + } | sudo +done diff --git a/bin/.bin/mnt b/bin/.bin/mnt @@ -0,0 +1,82 @@ +#!/bin/sh + +_usage=" +usage: + mnt [options] + mnt [NAME] + +Wrapper for managing named mounts. + +Options: + -h, --help shows this help text + -l, --list list current mounts formated as a table + +Name: + NAME tries to mount named mount + +Other: + if no option is specified 'fzf' is used to specify named mount +" + +# <name>|<command>|<source>|<mountpoint> +_table=" +shared|sshfs|nas:/strg/shared|~/mnt/shr +sources|sshfs|nas:/strg/src|~/mnt/src +" + +_lines() { + local _tmp="${_table}" + local _fmt='{print $0}' + local _opt="$1"; shift + + while :; do + line="${_tmp%% +*}" + _tmp="${_tmp#* +}" + _id="${line%%|*}" + [ "$line" = "$_tmp" ] && break + [ "$line" = "" ] && continue + [ "$1" != "" ] && [ "$@" != "$_id" ] && continue + case "$_opt" in + 'name') _fmt='{print $1}' ;; + 'src') _fmt='{print $3}' ;; + 'target') _fmt='{print $4}' ;; + 'cmd') _fmt='{print $2, $3, $4}' ;; + 'state') + printf '[%-1s] %s\n' \ + "$(grep -qs "^$(_lines src $_id)" /proc/mounts && echo '*')"\ + "$(_lines name $_id)" + continue + ;; + esac + echo "${line}" | awk -F '|' "$_fmt" + done +} + +[ "$#" -gt 1 ] && echo "$_usage" && return + +case "$1" in +--list|-l) + /bin/column -t /proc/mounts + ;; +--help|-h) + echo "$_usage" + ;; +'') + echo "$(_lines state)" \ + | fzf --multi --layout=reverse-list \ + | cut -c 4- \ + | xargs -r -n 1 mnt + ;; +*) + echo "$(_lines name)" | grep "^$1$" 2>&1 >/dev/null || return + + if grep -qs "^$(_lines src $1)" /proc/mounts + then + echo sudo /bin/umount "$(_lines target "$1")" | ${SHELL:-"/bin/sh"} + else + echo "$(_lines cmd "$1")" | ${SHELL:-"/bin/sh"} + fi + ;; +esac diff --git a/bin/.bin/monitor b/bin/.bin/monitor @@ -0,0 +1,70 @@ +#!/bin/sh + +hdmi_status="/tmp/.hdmi_status" +hdmi="/sys/class/drm/card0-HDMI-A-2/status" +lvds="/sys/class/drm/card0-LVDS-1/enabled" + +print_help() { + echo "Usage: ${0##*/} ACTION\n" + echo "ACTIONS:" + echo " setup normal setup." + echo " daemon start monitor daemon." + echo " force-lvds enable lvds forcefully." + echo " help print this help message." +} + +install_udev_rule() { + if [ "$(id -u)" = 0 ]; then + rule="" + rule="${rule}ACTION==\"change\", " + rule="${rule}SUBSYSTEM==\"drm\", " + rule="${rule}ENV{HOTPLUG}==\"1\", " + rule="${rule}RUN+=\"/bin/sh -c 'cat ${hdmi} > ${hdmi_status}'\"" + mkdir -p /etc/udev/rules.d + printf "$rule" > /etc/udev/rules.d/95-hotplug-drm.rules + else + echo "must run as root" + fi +} + +enable_lvds() { + xrandr --output LVDS1 --mode 1280x800 --rate 60 + xrandr --output HDMI2 --off +} + +enable_hdmi() { + # create new resolution for 21:9 (under 160 mhz bandwidth) + xrandr --delmode HDMI2 2560x1080_43 + xrandr --rmmode 2560x1080_43 + xrandr --newmode "2560x1080_43" \ + 159.94 2560 2688 2960 3360 1080 1081 1084 1107 -HSync +Vsync + xrandr --addmode HDMI2 2560x1080_43 + + xrandr --output HDMI2 --mode 2560x1080_43 --rate 43.0 + xrandr --output LVDS1 --off +} + +case "$1" in +force-lvds) + if [ "$(cat ${lvds})" != "enabled" ]; then + enable_lvds + fi +;; +setup) + if [ "$(cat ${hdmi})" = "connected" ]; then + enable_hdmi + else + enable_lvds + fi +;; +daemon) + [ ! -f ${hdmi_status} ] && touch ${hdmi_status} + echo "${hdmi_status}" | entr -n -p "${0}" setup +;; +install-udev-rule) + install_udev_rule +;; +*) + print_help +;; +esac diff --git a/bin/.bin/msmtp-tpl b/bin/.bin/msmtp-tpl @@ -0,0 +1,22 @@ +#!/bin/sh + +stdin="$(cat -)" +template_file="$(echo "$1" | sed "s,^~,$HOME,")"; shift +template="$(cat "$template_file")" +regex="::{\([0-9]\);\([^}]*\)}" +targets="$(echo "$template" | grep -oe "$regex" | uniq)" +tmpfile="$(mktemp /tmp/.msmtprc.XXXXXX)" + +load_encypted_conf() { + acc="$(pass mail/account-id | sed "$(($1+1))q;d")" + printf "%s" "$(pass mail/"$acc"/"$2")" +} + +echo "$targets" | while read -r target; do + args="$(echo "$target" | sed -e "s/$regex/\1 \2/")" + template="$(echo "$template" | sed -e "s/$target/$(load_encypted_conf $args)/")" + echo "$template" > "$tmpfile" +done + +echo "$stdin" | msmtp -C "$tmpfile" $@ +rm -f "$tmpfile" diff --git a/bin/.bin/nrowgrid.tmux b/bin/.bin/nrowgrid.tmux @@ -0,0 +1,101 @@ +#!/bin/sh -eu + +# make sure 'nrows' variable exist +tmux showenv nrows 1>&2 2>/dev/null || tmux setenv nrows 1 +rows=$(tmux showenv nrows | sed 's|^.*=||') +rows=${rows:-1} + +# read number of desired rows from input +input=${@:-} +if [ -n "$input" ] +then + case "$input" in + # increase row number + '++') rows=$((rows + 1)) ;; + + # decrease row number + '--') rows=$((rows - 1)) ;; + + # allow numeric input for row count + *) [ $input -eq $input 2>/dev/null ] && rows=$input ;; + esac +fi + +# get some initial data +set -- $(tmux list-panes -F '#{pane_id}') +spane=$(tmux display -p '#{pane_id}') +hpane=$(tmux last-pane 2>/dev/null \;display -p '#{pane_id}' \;last-pane) || : +wd=$(tmux display -p '#{window_width}x#{window_height}') +ww=${wd%%x*} +wh=${wd##*x} + +exec tmux $({ + + n=$# + + [ $rows -lt 1 ] && rows=1 # at least one row, please + [ $n -lt $rows ] && rows=$n # never allow empty rows + + tmux setenv nrows $rows + + # counters + ri=0; ci=0; uc=0; uw=0; uh=0 + + # define first row + cols=$((n / rows)) # number of columns + ch=$((wh / rows)) # client/pane height + uc=$cols # utilized columns + uh=$ch # utilized height + rs="" # resolutions tracker + + # stack panes + echo select-layout even-vertical + + # format panes in a grid + for pid + do + if [ $ci -eq $cols ] + then + uw=0 # utilized width + ci=0 # column index + ri=$((ri + 1)) # row index + + # next row + cols=$(((n - uc) / (rows - ri))) + uc=$((uc + cols)) + ch=$(((wh - uh) / (rows - ri))) + uh=$((uh + ch)) + fi + + cw=$(((ww - uw) / (cols - ci))) # client/pane width + uw=$((uw + cw)) + rs="$rs$cw:$ch;" + + echo select-pane -t $pid + + # move pane if it's not first in the row + if [ $ci -gt 0 ] + then + echo move-pane -d -s . -t .-1 -h + echo resize-pane -t . -x $((cw - 1)) + fi + + ci=$((ci+1)) + done + + # resize panes in the new grid layout + for pid + do + r="${rs%%;*}" # resolution + w="${r%%:*}" # width + h="${r##*:}" # height + rs="${rs#*;}" + + echo resize-pane -t $pid -x $((w - 1)) -y $((h - 1)) + done + + # restore selection + [ -n "$hpane" ] && echo select-pane -t $hpane + echo select-pane -t $spane + +} | sed 's/$/ ;/') diff --git a/bin/.bin/operations b/bin/.bin/operations @@ -0,0 +1,57 @@ +#!/bin/sh + +args="${@}" +args="${args#$1}" +args="${args#dmenu}" +option="$([ "$1" = "-" ] && cat - || echo "$1")" + +case "$option" in +list) + echo notify + echo sync-mail + echo ztatus +;; +notify) + text="$( + [ "$2" = "" ] \ + && echo "$(echo -n | dmenu_vtc${args} -l 0 -p text:)" \ + || echo "$2" + )" + if [ "$text" != "" ]; then + ztatusc notify "$text" + else + operations dmenu ${args} + fi +;; +ztatus) + case "$2" in + list) + echo show-time + ;; + show-time) + ztatusc toggle datetime + ;; + dmenu|"") + option="$(operations ztatus list | dmenu_vtc${args} -p ztatus:)" + if [ "$option" != "" ]; then + operations ztatus "$option" + else + operations dmenu "${args}" + fi + ;; + esac +;; +sync-mail) + ~/.bin/mbsync-stdin < ~/.mbsyncrc-template -a -V + for f in ~/mail/webmail-*/INBOX/new/*; do touch "$f" 2>/dev/null; done +;; +dmenu|"") + option="$(operations list | dmenu_vtc${@#dmenu})" + if [ "$option" != "" ]; then + operations "$option" "${@#dmenu}" + fi +;; +*) + printf 'the operation "%s" is not implamented.\n' "$option" +;; +esac diff --git a/bin/.bin/pedit b/bin/.bin/pedit @@ -0,0 +1,16 @@ +#!/bin/sh + +# get current tty +tty="/dev/$(ps -o tty= -p $$)" + +# create tmp file +tmp="$(mktemp)" + +# cat stdin to tmp file +[ ! -t 0 ] && cat > "$tmp" + +# open vim in current tty, and cat to stdout when done +${EDITOR} "$tmp" < "$tty" > "$tty" && cat "$tmp" + +# remove tmp file +rm "$tmp" diff --git a/bin/.bin/print-sxhkd b/bin/.bin/print-sxhkd @@ -0,0 +1,42 @@ +#!/bin/sh + +raw="$(sed -e 's/shift + \([a-z]\)$/\U\1/g' ~/.config/sxhkd/sxhkdrc | awk ' +BEGIN { + first = 1; + desc = ""; + len = 0; +} +desc!="" { + printf "|%s|%s|\n", $0, desc; + desc = ""; +} +match($0, /# ---([^-]*)/, a) { + if (!first) printf "\n"; + printf "#%s#\n", substr($0, 6, RLENGTH - 5); + first = 0; +} +/# :.*/ { + desc = substr($0, 4); +} +{ + if (length > len) len = length; +} +END { + print len; +} +')" +length="$(echo "$raw" | sed '$!d')" + +echo "$raw" \ +| sed '$d' \ +| pr \ + -t \ + -"$((($(tput cols)+$length-1)/$length))" \ + -w "$(tput cols)" \ +| sed \ + -e "s/|\([^#|]*\)|\([^|]*\)|/`printf \ + "\033[38;1;255m"`\1`printf \ + "\033[0m"` \2 /g" \ + -e "s/#\([^#]*\)#/`printf \ + "\033[48;5;255m\033[30m"`\1`printf \ + "\033[0m "`/g" diff --git a/bin/.bin/proxify b/bin/.bin/proxify @@ -0,0 +1,59 @@ +#!/bin/sh + +readonly dmz_name="noxz.tech" +readonly lan_name="lanprox.system.local" +readonly dmz_port="9949" +readonly lan_port="9950" +readonly dmz_pid="$(pgrep -a ssh | grep "ssh -g -f -N -D $dmz_port $dmz_name" | awk '{print $1}')" +readonly lan_pid="$(pgrep -a ssh | grep "ssh -g -f -N -D $lan_port $lan_name" | awk '{print $1}')" + +check_proxy() { + if [ "$lan_pid" != "" ] && [ "$dmz_pid" != "" ]; then + printf "[$(tput setaf 6)$(tput bold)+$(tput sgr0)] %s\n" \ + "proxy is opened at 127.0.0.1:$lan_port" + return 0 + else + printf "[$(tput setaf 1)$(tput bold)-$(tput sgr0)] %s\n" \ + "proxy is closed" + return 1 + fi +} + +kill_proxy() { + [ "$lan_pid" != "" ] && kill "$lan_pid" + [ "$dmz_pid" != "" ] && kill "$dmz_pid" +} + +start_proxy() { + printf "[$(tput setaf 6)$(tput bold)*$(tput sgr0)] %s\n" \ + "(1/2) connecting to noxz.tech..." + ssh -g -f -N -D "$dmz_port" "$dmz_name" -p 9922 + [ "$?" != "0" ] && return 1 + + printf "\n[$(tput setaf 6)$(tput bold)*$(tput sgr0)] %s\n" \ + "(2/2) connecting to lanprox.system.local..." + ssh -g -f -N -D "$lan_port" "$lan_name" -o ProxyCommand="ncat --proxy 127.0.0.1:$dmz_port --proxy-type socks4 %h %p" + [ "$?" != "0" ] && return 1 + + printf "\n[$(tput setaf 2)$(tput bold)+$(tput sgr0)] %s\n" \ + "proxy successfully opened at 127.0.0.1:$lan_port" + + return 0 + + ## Usage examples: + # + # setup the proxy for vimb + # # export http_proxy='socks4://localhost:9950' + # + # start ksh through the proxy + # # proxychains4 -q -f /etc/proxychains.noxz.conf ksh +} + +case "$1" in + ""|status) check_proxy ;; + start) kill_proxy; start_proxy;; + stop) kill_proxy;; + string) [ "$lan_pid" != "" ] && [ "$dmz_pid" != "" ] && echo\ + "/bin/ncat --proxy 127.0.0.1:$lan_port --proxy-type socks4 %h %p";; + *) echo "usage: "$0" status|start|stop|string" +esac diff --git a/bin/.bin/set-wallpaper b/bin/.bin/set-wallpaper @@ -0,0 +1,21 @@ +#!/bin/sh + +STDIN="$(cat -)" + +[ ! -f "$STDIN" ] && exit 1 + +case "$STDIN" in +*.ff.gz) + cp "$STDIN" "$HOME/.wallpaper.ff.gz" + ;; +*.png | *.jpg | *.jpeg | *.gif | *.bmp) + tmp="$(mktemp)" + convert "$STDIN" png:- | png2ff | gzip -c > "$tmp" && \ + mv "$tmp" "$HOME/.wallpaper.ff.gz" + ;; +*) + exit 1 + ;; +esac + +swall "$HOME/.wallpaper.ff.gz" diff --git a/bin/.bin/ssh-add-pass b/bin/.bin/ssh-add-pass @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ $# -ne 1 ] ; then + echo "Usage: ssh-add-pass keyfile" + exit 1 +fi + +_KEYFILE="$1" +_PASS="$(cat - | sed -e "s|\"|\\\"|g")" + +expect -c " \ + spawn ssh-add $_KEYFILE; \ + expect -re \".*passphrase.*\"; \ + send -- \"$_PASS\r\"; \ + expect eof" diff --git a/bin/.bin/ssh-agent-init b/bin/.bin/ssh-agent-init @@ -0,0 +1,14 @@ +#!/bin/sh + +ssh-add -D +set -- $(ls ~/.password-store/ssh); for key +do + pass ssh/$key/passphrase | ssh-add-pass "$HOME/.ssh/keys/.$key.key" \ + 2>&1 >/dev/null && printf '[%s+%s] identity added: %s%s%s\n' \ + "$(tput setaf 10)" \ + "$(tput sgr0)" \ + "$(tput setaf 15)" \ + "$key" \ + "$(tput sgr0)" +done +touch "$HOME/.tmp/.ssh-agent-init-done" diff --git a/bin/.bin/status.tmux b/bin/.bin/status.tmux @@ -0,0 +1,18 @@ +#!/bin/sh + +case "$1" in +battery) + _PATH="/sys/class/power_supply/BAT0" + _STATUS="$(cat "$_PATH/status")" + _FULL="$(cat "$_PATH/energy_full")" + _NOW="$(cat "$_PATH/energy_now")" + + [ "$_STATUS" = "Discharging" ] && _STATUS="-" || _STATUS="+" + echo "$_STATUS$((100 * _NOW / _FULL))%" + ;; +temp) + _TEMP="$(sensors | awk '/Core\ 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}')" + + echo "$_TEMP°c" + ;; +esac diff --git a/bin/.bin/timer b/bin/.bin/timer @@ -0,0 +1,23 @@ +#!/bin/sh + +timeout="$1"; + +case "$timeout" in +''|*[!0-9]*) + echo "usage: timer SECONDS" + ;; +*) + while [ "$timeout" != "0" ]; do + printf '\b\b\b\b\b\b\b\b' + printf '%02d:%02d:%02d' \ + "$((timeout/3600))" \ + "$((timeout/60))" \ + "$((timeout % 60))"; + + timeout="$((timeout-1))"; + sleep 1; + done + ;; +esac +printf '\b\b\b\b\b\b\b\b' +printf '00:00:00\n' diff --git a/bin/.bin/vifmimg b/bin/.bin/vifmimg @@ -0,0 +1,79 @@ +#!/bin/sh +readonly ID_PREVIEW="preview" +readonly TMP="/tmp$PWD" +readonly _X="$2" +readonly _Y="$3" +readonly _W="$4" +readonly _H="$5" + +#PLAY_GIF="yes" +#AUTO_REMOVE="yes" + +# exit if required FIFO doesn't exist +[ ! -e "$FIFO_UEBERZUG" ] && exit + +_draw () { + echo "{ \ + \"action\" : \"add\", \ + \"identifier\" : \"$ID_PREVIEW\", \ + \"x\" : $_X, \ + \"y\" : $_Y, \ + \"width\" : $_W, \ + \"height\" : $_H, \ + \"path\" : \"$1\" \ + }" > "$FIFO_UEBERZUG" +} + +case "$1" in +draw) + _draw "$PWD/$6" + ;; +drawff) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + if [ ! -f "$TMP/$6.png" ]; then + case "$6" in + *.ff.bz) bzip2 -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; + *.ff.gz) gzip -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; + *.ff.xz) xz -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; + *.ff) ff2png < "$PWD/$6" > "$TMP/$6.png" ;; + *) exit ;; + esac + convert -resize 512x512\> "$TMP/$6.png" "$TMP/$6.png" + fi + _draw "$TMP/$6.png" + ;; +videopreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && ffmpegthumbnailer -i "$PWD/$6" -o "$TMP/$6.png" -s 0 -q 10 + _draw "$TMP/$6.png" + ;; +gifpreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" && convert -coalesce "$PWD/$6" "$TMP/$6/$6.png" + if [ -n "$PLAY_GIF" ]; then + for frame in $(find "$TMP/$6" -name "*.png" | sort -V); do + _draw "$frame" + sleep .07 + done + else + _draw "$TMP/$6/$6-0.png" + fi + ;; +epubpreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && epub-thumbnailer "$6" "$TMP/$6.png" 512 + _draw "$TMP/$6.png" + ;; +pdfpreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && pdftoppm -png -singlefile "$6" "$TMP/$6" + _draw "$TMP/$6.png" + ;; +clear) + echo "{ \ + \"action\" : \"remove\", \ + \"identifier\" : \"$ID_PREVIEW\" \ + }" > "$FIFO_UEBERZUG" + [ -n "$AUTO_REMOVE" ] && [ -f "$TMP/$6.png" ] && rm -f "$TMP/$6.png" + [ -n "$AUTO_REMOVE" ] && [ -d "$TMP/$6/" ] && rm -rf "$TMP/$6/" + ;; +esac diff --git a/bin/.bin/vifmrun b/bin/.bin/vifmrun @@ -0,0 +1,16 @@ +#!/bin/sh +export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}" + +cleanup() { + rm "$FIFO_UEBERZUG" 2>/dev/null + pkill -P $$ 2>/dev/null +} + +pkill -P $$ 2>/dev/null +rm "$FIFO_UEBERZUG" 2>/dev/null +mkfifo "$FIFO_UEBERZUG" >/dev/null +trap cleanup EXIT 2>/dev/null +tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser json 2>&1 >/dev/null & + +vifm +cleanup diff --git a/cdm/.cdm-dialogrc b/cdm/.cdm-dialogrc @@ -0,0 +1,132 @@ +# Types of values: +# +# Number - <number> +# String - "string" +# Boolean - <ON|OFF> +# Attribute - (foreground,background,highlight?) + +# Set aspect-ration. +aspect = 0 + +# Set separator (for multiple widgets output). +separate_widget = "" + +# Set tab-length (for textbox tab-conversion). +tab_len = 0 + +# Make tab-traversal for checklist, etc., include the list. +visit_items = OFF + +# Shadow dialog boxes? This also turns on color. +use_shadow = OFF + +# Turn color support ON or OFF +use_colors = ON + +# Screen color +screen_color = (WHITE,BLACK,ON) + +# Shadow color +shadow_color = (BLACK,WHITE,ON) + +# Dialog box color +dialog_color = (WHITE,BLACK,OFF) + +# Dialog box title color +title_color = (WHITE,WHITE,ON) + +# Dialog box border color +border2_color = (WHITE,BLACK,OFF) +border_color = (WHITE,BLACK,OFF) + +# Active button color +button_active_color = (WHITE,BLACK,ON) + +# Inactive button color +button_inactive_color = (WHITE,BLACK,OFF) + +# Active button key color +button_key_active_color = (WHITE,BLACK,ON) + +# Inactive button key color +button_key_inactive_color = (WHITE,BLACK,OFF) + +# Active button label color +button_label_active_color = (WHITE,BLACK,ON) + +# Inactive button label color +button_label_inactive_color = (WHITE,BLACK,OFF) + +# Input box color +inputbox_color = (BLACK,WHITE,OFF) + +# Input box border color +inputbox_border_color = (BLACK,WHITE,OFF) + +# Search box color +searchbox_color = (BLACK,WHITE,OFF) + +# Search box title color +searchbox_title_color = (WHITE,WHITE,ON) + +# Search box border color +searchbox_border_color = (WHITE,WHITE,OFF) + +# File position indicator color +position_indicator_color = (WHITE,WHITE,ON) + +# Menu box color +menubox_color = (WHITE,BLACK,OFF) + +# Menu box border color +menubox_border_color = (WHITE,BLACK,OFF) +menubox_border2_color = (WHITE,BLACK,OFF) + +# Item color +item_color = (WHITE,BLACK,OFF) + +# Selected item color +item_selected_color = (WHITE,BLACK,ON) + +# Tag color +tag_color = (WHITE,BLACK,ON) + +# Selected tag color +tag_selected_color = (WHITE,BLACK,ON) + +# Tag key color +tag_key_color = (WHITE,BLACK,OFF) + +# Selected tag key color +tag_key_selected_color = (WHITE,BLACK,ON) + +# Check box color +check_color = (BLACK,WHITE,OFF) + +# Selected check box color +check_selected_color = (WHITE,WHITE,ON) + +# Up arrow color +uarrow_color = (WHITE,BLACK,ON) + +# Down arrow color +darrow_color = (WHITE,BLACK,ON) + +# Item help-text color +itemhelp_color = (WHITE,BLACK,OFF) + +# Active form text color +form_active_text_color = (BLACK,WHITE,ON) + +# Form text color +form_text_color = (WHITE,WHITE,ON) + +# Readonly form item color +form_item_readonly_color = (WHITE,WHITE,ON) + +#bindkey * ^j ITEM_NEXT +#bindkey * ^k ITEM_PREV +bindkey menubox ^J ITEM_NEXT +bindkey menubox ^K ITEM_PREV +bindkey menubox ^L ENTER +bindkey menubox ENTER ENTER diff --git a/cdm/.cdmrc b/cdm/.cdmrc @@ -0,0 +1,91 @@ +#!/bin/bash +# +# Example config file for cdm(1). +# Values set here is the default as in cdm(1). + +# List of programs, commands with whitespaces should be quoted or escaped. +# If unset, all sessions in /etc/X11/Sessions or /usr/share/xsessions are +# offered as choices. +# +# (An example:) +# binlist=( +# '~/.xsession' # Launch your X session, +# '/bin/bash --login' # or just execute your shell, +# '/usr/bin/fbterm' # or start a frame buffer console, +# '/usr/bin/cdm ~/.submenu.cdmrc' # or go to a submenu :) +# ) + +binlist=( + '/usr/bin/startx /home/z0noxz/.xinitrc dwm' + 'echo /bin/tmux | /usr/bin/ksh -l' + '/usr/bin/ksh -l' + 'sudo runit-init 6' + 'sudo runit-init 0' +) + +# List all program display names, one-by-one matched with $binlist. +# Names with whitespaces should be quoted or escaped. +# +# (Continued example:) +# namelist=('X session' Console FBTerm 'Sub menu') + +namelist=( + 'dwm (x11)' + 'tmux (tty)' + 'ksh (tty)' + 'reboot' + 'shutdown' +) + +# Type of the programs, one-by-one matched with $binlist. +# `C' for *C*onsole programs, which would be `exec'ed. +# `X' for *X* programs, which would be run with cdm-xlaunch(1). +# +# (Continued example:) +# flaglist=(X C C C) + +flaglist=( + C # Override cdm-xlaunch, and use startx + C + C + C + C +) + +# Style for the cdm dialog, which is printed with dialog(1). +# Default to unset, causing dialog(1) to use the system wide default. +# See /usr/share/doc/cdm/themes for some nice choices. +dialogrc=~/.cdm-dialogrc + +# Index of the first item in the menu. +countfrom=1 + +# Set default display. +display=0 + +# Where should the first X tty be spawned? +# special value `keep' causes to run X in current tty. +xtty=keep + +# Should cdm(1) stick to the specified display? +locktty=no + +# Use ConsoleKit for X session? +consolekit=yes + +# Timeout for waiting for X session to register with ConsoleKit. +cktimeout=30 + +# Additional arguments to pass to X server, which is usually called as: +# /usr/bin/X :$display "${serverargs[@]}" vt$((xtty+display)) +# Arguments with whitespaces should be quoted or escaped. +serverargs=(-nolisten tcp) + +# Alternative method of calling startx(/setsid). Should only be set if cdm +# does not start X as expected (bash -x shows call to setsid startx, but for +# no apparent reason does not start X). +# Only provided in the hope it may be useful, not a guaranteed fix. +altstartx=no + +# Destination for stdout and stderr output from startx. +startxlog=/dev/null diff --git a/git/.gitconfig b/git/.gitconfig @@ -0,0 +1,7 @@ +[user] + name = Chris Noxz + email = chris@noxz.tech +[color] + ui = true +[alias] + lg = log --color --graph --date=format:'%Y-%d-%m %H:%M:%S' --pretty=format:'%Cred%h%Creset - %Cgreen%cd%C(magenta)%d%Creset %C(bold blue)%an:%Creset %s %Creset' --abbrev-commit diff --git a/input/.inputrc b/input/.inputrc @@ -0,0 +1,7 @@ +$include /etc/inputrc + +set keyseq-timeout 50 +set editing-mode vi +##set show-mode-in-prompt on +##set vi-ins-mode-string "\1\e[32;1m\2[INS]\1\e[0m\2 " +##set vi-cmd-mode-string "\1\e[31;1m\2[CMD]\1\e[0m\2 " diff --git a/ksh/.kshrc b/ksh/.kshrc @@ -0,0 +1,9 @@ +#!/bin/ksh + +# if not running interactively, don't do anything +[ "${-#*i}" = "${-}" ] && return + +for sh in $HOME/.kshrc.d/*.sh +do + . $sh +done diff --git a/ksh/.kshrc.d/00-options.sh b/ksh/.kshrc.d/00-options.sh @@ -0,0 +1,5 @@ +#!/bin/ksh + +umask 022 # umask (rwx r-x r-x) +set -o vi # enable vi command-line mode +stty -ixon # disable terminal scroll lock (fix for vim 'hang') diff --git a/ksh/.kshrc.d/10-enviornment.sh b/ksh/.kshrc.d/10-enviornment.sh @@ -0,0 +1,123 @@ +#!/bin/ksh + +export VISUAL="vim" +export EDITOR="$VISUAL" +export BROWSER="/usr/local/bin/surf" +export IMG_VIEWER="/usr/local/bin/sxiv" +export PDF_VIEWER="/bin/zathura" +export HISTFILE="$HOME/.cache/ksh/history" +export RTV_BROWSER="$BROWSER -y surf_rtv" +export LESSHISTFILE="$HOME/.cache/less/history" +export FZF_DEFAULT_OPTS="--bind='K:up,J:down,H:preview-up,L:preview-down'" +export GREP_COLORS="\ +ms=01;31:\ +mc=01;31:\ +sl=:\ +cx=:\ +fn=01;37:\ +ln=32:\ +bn=32:\ +se=36" +export LS_COLORS="\ +no=00:\ +fi=00:\ +di=01;34:\ +ln=01;36:\ +pi=40;33:\ +so=01;36:\ +do=01;36:\ +bd=40;33;01:\ +cd=40;33;01:\ +or=40;31;01:\ +mi=01;05;37;41:\ +su=37;41:\ +sg=30;43:\ +ca=30;41:\ +tw=30;42:\ +ow=34;42:\ +st=37;44:\ +ex=01;32:\ +\ +*.tar=01;31:\ +*.tgz=01;31:\ +*.svgz=01;31:\ +*.arj=01;31:\ +*.taz=01;31:\ +*.lzh=01;31:\ +*.lzma=01;31:\ +*.zip=01;31:\ +*.z=01;31:\ +*.Z=01;31:\ +*.dz=01;31:\ +*.gz=01;31:\ +*.bz2=01;31:\ +*.tbz2=01;31:\ +*.bz=01;31:\ +*.tz=01;31:\ +*.deb=01;31:\ +*.rpm=01;31:\ +*.jar=01;31:\ +*.rar=01;31:\ +*.ace=01;31:\ +*.zoo=01;31:\ +*.cpio=01;31:\ +*.7z=01;31:\ +*.rz=01;31:\ +\ +*.jpg=01;36:\ +*.jpeg=01;36:\ +*.gif=01;36:\ +*.bmp=01;36:\ +*.pbm=01;36:\ +*.pgm=01;36:\ +*.ppm=01;36:\ +*.tga=01;36:\ +*.xbm=01;36:\ +*.xpm=01;36:\ +*.tif=01;36:\ +*.tiff=01;36:\ +*.ff.bz=01;36:\ +*.ff.gz=01;36:\ +*.ff.xz=01;36:\ +*.png=01;36:\ +*.mng=01;36:\ +*.pcx=01;36:\ +*.mov=01;36:\ +*.mpg=01;36:\ +*.mpeg=01;36:\ +*.m2v=01;36:\ +*.mkv=01;36:\ +*.ogm=01;36:\ +*.mp4=01;36:\ +*.m4v=01;36:\ +*.mp4v=01;36:\ +*.vob=01;36:\ +*.qt=01;36:\ +*.nuv=01;36:\ +*.wmv=01;36:\ +*.asf=01;36:\ +*.rm=01;36:\ +*.rmvb=01;36:\ +*.flc=01;36:\ +*.avi=01;36:\ +*.fli=01;36:\ +*.gl=01;36:\ +*.dl=01;36:\ +*.xcf=01;36:\ +*.xwd=01;36:\ +*.yuv=01;36:\ +*.svg=01;36:\ +*.pdf=01;36:\ +\ +*.aac=00;36:\ +*.au=00;36:\ +*.flac=00;36:\ +*.mid=00;36:\ +*.midi=00;36:\ +*.mka=00;36:\ +*.mp3=00;36:\ +*.mpc=00;36:\ +*.ogg=00;36:\ +*.ra=00;36:\ +*.wav=00;36:\ +" diff --git a/ksh/.kshrc.d/20-completion.sh b/ksh/.kshrc.d/20-completion.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +readonly _tmp_ksh_completion="/tmp/ksh_completion" +readonly _tmp_sv_list="$_tmp_ksh_completion/sv_list" +readonly _tmp_mpvc_cmds="$_tmp_ksh_completion/mpvc_cmds" +readonly _tmp_host_list="$_tmp_ksh_completion/host_list" +readonly _tmp_pkg_cmds="$_tmp_ksh_completion/pkg_cmds" +readonly _tmp_pass_list="$_tmp_ksh_completion/pass_list" +readonly _tmp_man_list="$_tmp_ksh_completion/man_list" +readonly _tmp_op_list="$_tmp_ksh_completion/op_list" + +ksh_completion_load () { + [ ! -d "$_tmp_ksh_completion" ] && mkdir -p "$_tmp_ksh_completion" + [ ! -f "$_tmp_sv_list" ] && \ + ls -1 /var/service > "$_tmp_sv_list" + [ ! -f "$_tmp_mpvc_cmds" ] && \ + mpvc | grep -e '^ [a-z]*' | grep -v -e '^[[:space:]]*$' | awk '{print $1;}' > "$_tmp_mpvc_cmds" + [ ! -f "$_tmp_host_list" ] && \ + awk '{split($1,a,","); gsub("].*", "", a[1]); gsub("\\[", "", a[1]); print a[1] " root@" a[1]}' "$HOME/.ssh/known_hosts" | sort | uniq > "$_tmp_host_list" + [ ! -f "$_tmp_pkg_cmds" ] && \ + pkg | grep -e '^ [a-z]*' | grep -v -e '^[[:space:]]*$' | awk '{print $1;}' > "$_tmp_pkg_cmds" + [ ! -f "$_tmp_pass_list" ] && \ + find "$HOME/.password-store/" -type f | grep "gpg$" | sed 's/^.*\.password-store\///' | sed 's/\.gpg$//' > "$_tmp_pass_list" + [ ! -f "$_tmp_man_list" ] && \ + man -k Nm~. | cut -d\( -f1 | tr -d , > "$_tmp_man_list" + [ ! -f "$_tmp_op_list" ] && \ + operations list > "$_tmp_op_list" + + typeset _sv_list="$(cat "$_tmp_sv_list")" + typeset _mpvc_cmds="$(cat "$_tmp_mpvc_cmds")" + typeset _host_list="$(cat "$_tmp_host_list")" + typeset _pkg_cmds="$(cat "$_tmp_pkg_cmds")" + typeset _pass_list="$(cat "$_tmp_pass_list")" + typeset _man_list="$(cat "$_tmp_man_list")" + typeset _op_list="$(cat "$_tmp_op_list")" + + set -A complete_sv_1 -- reload restart start status stop + set -A complete_sv_2 -- ${_sv_list} + set -A complete_mpvc_1 -- ${_mpvc_cmds} + set -A complete_ssh -- ${_host_list} + set -A complete_pkg_1 -- ${_pkg_cmds} + set -A complete_pass -- ${_pass_list} ls find show grep insert edit generate rm mv cp git help version + set -A complete_operations_1 -- ${_op_list} + set -A complete_make_1 -- clean install publish + set -A complete_git_1 -- clone checkout commit pull push status + + case "$1" in + # slow completion commands here + full) + set -A complete_man_1 -- ${_man_list} + ;; + esac +} + +ksh_completion_reload () { + rm "$_tmp_sv_list" + rm "$_tmp_mpvc_cmds" + rm "$_tmp_host_list" + rm "$_tmp_pkg_cmds" + rm "$_tmp_pass_list" + rm "$_tmp_man_list" + rm "$_tmp_op_list" + + ksh_completion_load +} + +ksh_completion_load + +# https://deftly.net/posts/2017-05-01-openbsd-ksh-tab-complete.html diff --git a/ksh/.kshrc.d/30-alias.sh b/ksh/.kshrc.d/30-alias.sh @@ -0,0 +1,21 @@ +#=====================================# +# Personnal aliases # +#=====================================# +## TODO :: https://www.bigeekfan.com/post/20190315_refining_ksh_and_fzf/ + +# quickies +alias ..='cd ..' +alias :r='. ~/.kshrc' +alias :q='exit' + +# source aliases into functions +for a in ~/.bin/alias/*; do + unalias "${a##*/}" + eval "${a##*/}() { + . $a + }" +done + +# extra +alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla" +alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""' diff --git a/ksh/.kshrc.d/51-ssh-agent.sh b/ksh/.kshrc.d/51-ssh-agent.sh @@ -0,0 +1,8 @@ +#!/bin/ksh + +export SSH_AUTH_SOCK="$HOME/.ssh-agent" + +[ -S "$SSH_AUTH_SOCK" ] && return + +rm -f "$SSH_AUTH_SOCK" +ssh-agent -a "$SSH_AUTH_SOCK" 2>&1 >/dev/null diff --git a/ksh/.kshrc.d/90-prompt.sh b/ksh/.kshrc.d/90-prompt.sh @@ -0,0 +1,50 @@ +#!/bin/ksh + +export PS1="$(printf '[xxx] %s\[%s\]\\u\[%s\] \\w%s \$ ' \ + '$(_ksh_set_title)' \ + '$(tput bold)' \ + '$(tput sgr0)' \ + '$(_ksh_git_prompt)' \ +)" + +_ksh_git_prompt() { + + # abort if not a git repository + [ ! -d .git ] && return + + # variable + local branch="" + local status="" + local flags="" + + # collect necessary data + branch="$(git branch 2>/dev/null | sed 's/* \(.*\)/\1/')" + status="$(git status 2> /dev/null)" + + # parse git status into flags + [ "${status#*renamed:}" != "$status" ] && flags=">$flags" + [ "${status#*Your branch is ahead of:}" != "$status" ] && flags="*$flags" + [ "${status#*new file:}" != "$status" ] && flags="+$flags" + [ "${status#*Untracked files:}" != "$status" ] && flags="?$flags" + [ "${status#*deleted:}" != "$status" ] && flags="x$flags" + [ "${status#*modified:}" != "$status" ] && flags="!!$flags" + [ ! "$flags" = "" ] && flags=" $flags" + + # print git prompt + printf ' \[%s\](%s%s)\[%s\]' \ + "$(tput setaf 3)" \ + "$branch" \ + "$flags" \ + "$(tput sgr0)" +} + +_ksh_set_title() { + # variable + local term="" + + # collect necessary data + term="$(cat /proc/$PPID/comm)" + + # set title + printf '\[\033]2;%s (\w)\007\]' "${term##*/}" +} diff --git a/ksh/.profile b/ksh/.profile @@ -0,0 +1,17 @@ +# set .kshrc as ENV if it exists +[ -f "$HOME/.kshrc" ] && export ENV="$HOME/.kshrc" + +# add local paths +export PATH="$PATH:$HOME/.bin" + +export TERMINAL="/usr/local/bin/st" + +# To avoid potential situation where cdm(1) crashes on every TTY, here we +# default to execute cdm(1) on tty1 only, and leave other TTYs untouched. +if [ "$(tty)" = '/dev/tty1' ] +then + [ -n "$CDM_SPAWN" ] && return + # Avoid executing cdm(1) when X11 has already been started. + [ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ] && exec cdm +fi + diff --git a/link b/link @@ -0,0 +1,90 @@ +#!/bin/sh + +[ $# -ne 2 ] && printf 'usage: link [status|install|remove] MODULE\n' +[ "$1" = "" ] && printf '\nmodules:\n' + +self="$(realpath $0 --relative-to="$HOME")" +selfpath="${self%%/*}" + +apply_action() { + local readonly dir="$1" + local readonly into="$2" + local readonly action="$3" + local readonly path="$HOME$([ "$into" != "" ] && echo "/$into")" + + [ "$into" = "" ] && printf "$(tput bold)%s:$(tput sgr0)\n" "${dir##*/}" + for subdir in `find $dir -maxdepth 1`; do + local _name="${subdir##*/}" + local _link="$path/$_name" + local _target="$(realpath "$subdir" --relative-to="$path")" + + # ignore container + [ "$subdir" = "$dir" ] && continue + + case "$_name" in + # special folders + .config|.ssh) + [ "$into" = "" ] && apply_action "$subdir" "$_name" "$action" + ;; + *) + # check if link path is unoccupied, and then create link + # NOT INSTALLED + if [ ! -d "$_link" ] && [ ! -f "$_link" ]; then + case "$action" in + status|remove) + printf \ + "[$(tput setaf 3)$(tput bold)m$(tput sgr0)] %s\n" \ + "'$_link' ->" + ;; + install) + printf \ + "[$(tput setaf 2)$(tput bold)+$(tput sgr0)] %s\n" \ + "$(ln -vs "$_target" "$_link" 2>&1)" + ;; + esac + # check if the path is already occupied, by a non link + # ERROR + elif [ ! -h "$_link" ]; then + printf \ + "$(tput setaf 1)$(tput bold)%s$(tput sgr0)\n" \ + "[E] '$_link' is already occupied" + # check if the link is already created + # INSTALLED + elif [ "$(readlink "$_link")" = "$_target" ]; then + case "$action" in + status|install) + printf \ + "[$(tput setaf 6)$(tput bold)i$(tput sgr0)] %s\n" \ + "'$_link' -> '$_target'" + ;; + remove) + printf \ + "[$(tput setaf 1)$(tput bold)-$(tput sgr0)] %s\n" \ + "$(rm -v "$_link" 2>&1)" + ;; + esac + # check if link is pointing at wrong target + # ERROR + elif [ "$(readlink "$_link")" != "$_target" ]; then + printf \ + "$(tput setaf 1)$(tput bold)%s$(tput sgr0)\n" \ + "[E] '$_link' -> '"$(readlink "$_link")"'" + fi + ;; + esac + done + [ "$into" = "" ] && echo +} + +for dir in `find $HOME/$selfpath/* -maxdepth 0 -type d`; do + _name="${dir##*/}" + if [ "$_name" != ".exclude" ] && [ "$_name" != "all" ]; then + [ "$1" = "" ] && echo " $_name" && continue + [ "$2" != "all" ] && [ "$2" != "$_name" ] && continue + case "$1" in + status) apply_action "$dir" "" "status" ;; + install) apply_action "$dir" "" "install" ;; + remove) apply_action "$dir" "" "remove";; + esac + fi +done diff --git a/mbsync/.mbsyncrc-template b/mbsync/.mbsyncrc-template @@ -0,0 +1,41 @@ +IMAPStore webmail-0-remote +Host ::{0;host} +Port ::{0;imap-port} +User ::{0;username} +PassCmd "pass mail/::{0;username}/password" +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore webmail-0-local +Path ~/mail/webmail-0-local/ +Inbox ~/mail/webmail-0-local/INBOX +Subfolders Verbatim + +Channel webmail-0 +Master :webmail-0-remote: +Slave :webmail-0-local: +Create Both +Expunge Both +Patterns * +SyncState * + +IMAPStore webmail-1-remote +Host ::{1;host} +Port ::{1;imap-port} +User ::{1;username} +PassCmd "pass mail/::{1;username}/password" +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore webmail-1-local +Path ~/mail/webmail-1-local/ +Inbox ~/mail/webmail-1-local/INBOX +Subfolders Verbatim + +Channel webmail-1 +Master :webmail-1-remote: +Slave :webmail-1-local: +Create Both +Expunge Both +Patterns * +SyncState * diff --git a/mpv/.config/mpv/input.conf b/mpv/.config/mpv/input.conf @@ -0,0 +1,7 @@ +0x19 add volume 5 +0x5 add volume -5 +l seek 5 +h seek -5 +k seek 15 +j seek -15 +Shift+h ab-loop diff --git a/msmtp/.msmtprc-template b/msmtp/.msmtprc-template @@ -0,0 +1,22 @@ +defaults +protocol smtp +auth on +tls on +tls_starttls on +tls_trust_file /etc/ssl/certs/ca-certificates.crt + +account webmail-0 +from ::{0;username} +user ::{0;username} +passwordeval pass mail/::{0;username}/password +host ::{0;host} +port ::{0;smtp-port} + +account webmail-1 +from ::{1;username} +user ::{1;username} +passwordeval pass mail/::{1;username}/password +host ::{1;host} +port ::{1;smtp-port} + +account default : webmail-0 diff --git a/mutt/.mutt/mailcap b/mutt/.mutt/mailcap @@ -0,0 +1,17 @@ +# PDF +application;zathura %s +image/pdf;zathura %s + +# Pictures +image/bmp;sxiv %s +image/gif;sxiv %s +image/libm;sxiv %s +image/jpg;sxiv %s +image/jpeg;sxiv %s +image/png;sxiv %s +image/tiff;sxiv %s +image/x-ong;sxiv %s + +# HTML +#text/html;w3m %s; nametemplate=%s.html; needsterminal +text/html;w3m -I %{charset} -T text/html; copiousoutput diff --git a/mutt/.mutt/muttrc b/mutt/.mutt/muttrc @@ -0,0 +1,126 @@ +# Basic +set editor = "/usr/bin/vim" +set sendmail = "msmtp-tpl ~/.msmtprc-template" +set use_from = yes +set envelope_from = yes +set mail_check = 0 + +# composing mail +set forward_format = "Fwd: %s" +set include +set forward_quote +set signature = "~/.mutt/signature.muttrc" +set sig_dashes = yes +set send_charset = "us-ascii:utf-8" + +# Bindings +bind index j next-entry +bind index k previous-entry +bind attach,index,pager \ej next-page +bind attach,index,pager \ek previous-page +bind pager g noop +bind pager gg top +bind pager G bottom +bind attach,index g noop +bind attach,index gg first-entry +bind attach,index G last-entry +bind index,pager D delete-message +bind index d noop +bind index \Cy previous-entry +bind index \Ce next-entry +macro index,pager c "<change-folder>?<toggle-mailboxes>" +macro index,pager >m "<tag-prefix><save-message>?<toggle-mailboxes>" +macro index,pager >c "<tag-prefix><copy-message>?<toggle-mailboxes>" +macro compose >a "<attach-message>?<toggle-mailboxes>" +macro index,pager >SS "<shell-escape>operations sync-mail<enter><change-folder>!<enter>" + +# Sidebar +set sleep_time = 0 +set sidebar_visible = yes +set sidebar_format = " %B%?F? [%F]?%* %?N?%N/?%?S?%S? " +set sidebar_short_path +set sidebar_delim_chars = "/" +set sidebar_folder_indent +set sidebar_indent_string = " " +set sidebar_width = 34 +set sidebar_divider_char = '│' +set mail_check_stats +bind index,pager J sidebar-next +bind index,pager K sidebar-prev +bind index,pager L sidebar-open +bind index,pager B sidebar-toggle-visible + +# Index +set date_format = "%Y-%m-%d %H:%M:%S" +set index_format = "%3C [ %Z ] %D %-20.20F %s (%-4.4c)" +set sort = "threads" +set sort_aux = "reverse-date" + +# Hide help +set help = "yes" + +# Colorize index +color normal default default +color tilde color2 color0 +color index color14 default "~b \".*\" !~N !~O !~U !~F !~T !~D" +color indicator color6 color5 +color index color15 default ~N +color index color15 default ~O +color index color15 default ~U +color index color10 default ~F +color index color11 default ~T +color index color9 default ~D +color index_number color15 default +color index_size color8 default +color body color9 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ +color body color12 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ +color status color6 color5 +color message color14 default +color attachment color14 color5 +color error color9 default +color tree color13 default +color search color6 color5 +color hdrdefault color30 color6 +color header color0 color2 '^date:' +color header color0 color2 '^(to|cc|bcc):' +color header color0 color2 '^from:' +color header color0 color2 '^subject:' +color header color0 color2 '^user-agent:' +color header color0 color2 '^reply-to:' +color quoted color14 color2 + +# mailcap +set mailcap_path = "~/.mutt/mailcap" +auto_view = text/plain +alternative_order = text/plain text/enriched text/html +# open message in html view +bind index,pager V noop +macro index,pager V "<view-attachments><search>html<enter><view-mailcap>" + +# Pager +set pager_index_lines = 10 +set pager_context = 3 +set tilde +unset markers + +# status bar +set status_chars = " *%A" +set status_format = " %f (%m messages%?n?, %n new?%?d?, %d to delete?%?t?, %t tagged?)%> %?p?(%p postponed)? %P " + +# headers +set edit_headers = yes +unset use_domain +unset user_agent +unmy_hdr * +my_hdr X-Info: Keep It Simple, Stupid. +my_hdr X-Operating-System: `uname -s`, kernel `uname -r` +my_hdr X-Message-Flag: WARNING: you are using an inferior email client +my_hdr User-Agent: Every email client sucks, this one just sucks less. + +set my_accf_0 = "/tmp/mutt-webmail-0-local.tld" +set my_accf_1 = "/tmp/mutt-webmail-1-local.tld" +source "[ ! -f $my_accf_0 ] && pass mail/muttrc/webmail-0-local.tld > $my_accf_0; cat $my_accf_0 |" +source "[ ! -f $my_accf_1 ] && pass mail/muttrc/webmail-1-local.tld > $my_accf_1; cat $my_accf_1 |" +source "$my_accf_0" +macro index "\e1" ":source $my_accf_0<enter><change-folder>!<enter>" +macro index "\e2" ":source $my_accf_1<enter><change-folder>!<enter>" diff --git a/mutt/.mutt/signature.muttrc b/mutt/.mutt/signature.muttrc @@ -0,0 +1,9 @@ +----------------------------------- + + Chris Noxz + + e-mail : chris@noxz.tech + web : https://noxz.tech + git : https://git.noxz.tech + +----------------------------------- diff --git a/newsboat/.newsboat/config b/newsboat/.newsboat/config @@ -0,0 +1,44 @@ +# https://github.com/newsboat/newsboat/blob/master/src/configcontainer.cpp +browser "dmenu_url_open" +cache-file ".data/newsboat/cache.db" +history-limit 0 +datetime-format "%Y-%m-%d %H:%M" +articlelist-format " %4i %D %?T? %-20T ? %t" +feedlist-format " %4i %n %11u %t" +articlelist-title-format " %T (%u unread, %t total) - %U" +feedlist-title-format " Feeds (%u unread, %t total)" +itemview-title-format " %T (%u unread, %t total)" +swap-title-and-hints yes +show-keymap-hint no + +bind-key j down +bind-key k up +bind-key j next articlelist +bind-key k prev articlelist +bind-key J next-feed articlelist +bind-key K prev-feed articlelist +bind-key g home +bind-key G end +bind-key d pagedown +bind-key u pageup +bind-key l open +bind-key h quit +bind-key a toggle-article-read +bind-key n next-unread +bind-key N prev-unread +bind-key D pb-download +bind-key U show-urls +bind-key x pb-delete + +# element fg bg attr +# ---------------------------------------------- +color background default default +color info black color5 bold +color listnormal color14 default +color listfocus color14 color5 +color listnormal_unread blue default bold +color listfocus_unread blue color5 bold +color article color14 default + + +macro p set browser "dmenu_url_open"; open-in-browser diff --git a/newsboat/.newsboat/urls b/newsboat/.newsboat/urls @@ -0,0 +1,48 @@ +http://esr.ibiblio.org/?feed=rss2 +https://noxz.tech/pub/feed.rss +https://peertube.anon-kenkai.com/feeds/videos.atom?videoChannelId=3 +------------------ +"query:YouTube Subscriptions:tags # \"YouTubeSubscriptions\"" +https://www.youtube.com/feeds/videos.xml?playlist_id=PLEM4vOSCprStXXKWjBO7spTi70ewbXV5S "FIL FAR :: Calm Minds" +https://www.youtube.com/feeds/videos.xml?channel_id=UCgp_adxCQiesfxKYIqIE9yQ "ICARUSLIV3S" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "DistroTube" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC6x7GwJxuoABSosgVXDYtTw "I Like To Make Stuff" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCu5jfQcpRLm9xhmlSd5S8xw "Armin Van Buuren" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCFzGyNKXPAglNq28qWYTDFA "Kai Hendry" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCkf4VIqu3Acnfzuk3kRIFwA "gotbletu" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCsXVk37bltHxD1rDPwtNM8Q "Kurzgesagt – In a Nutshell" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC-LilqU9p_r0_Dxz_k-IpYQ "アノニマスの見解" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCjr2bPAyPV7t35MvcgT3W8Q "The Hated One" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCJm2TgUqtK1_NLBrjNQ1P-w "Second Thought" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCf93fPKwotph47H3_KDcRyg "Kris Occhipinti" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "Luke Smith" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC6vImVkvofpMUOlYt6LiRXA "Keystone Science" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCAldq8BAAGdsX9UyK_09-ZA "Jeff Holiday" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC7e57qWIEAZTQAaFwHpKdlw "SomeBlackGuy" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCETeXD_3awsQv-9rSdCYXQQ "Get Hands Dirty" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA "Veritasium" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCLhtZqdkjshgq8TqwIjMdCQ "DarkMatter2525" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCE1jXbVAGJQEORz9nZqb5bQ "Ahoy" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC8uT9cgJorJPWu7ITLGo9Ww "The 8-Bit Guy" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCmb8hO2ilV9vRa8cilis88A "Thunderf00t" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCoxcjq-8xIDTYp3uz647V5A "Numberphile" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC1BWMtZbNLVMSFgwSukjqCw "Armoured Skeptic" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCUHW94eEFW7hkUMVaZz4eDg "minutephysics" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC0aanx5rpr7D1M7KCFYzrLQ "Shoe0nHead" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCEOXxzW2vU0P-0THehuIIeg "CaptainDisillusion" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC9-y-6csu5WGm29I7JiwpnA "Computerphile" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCctjGdm2NlMNzIlxz02IsXA "Chris Ray Gun" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCRlICXvO4XR4HMeEB9JjDlA "Thoughty2" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCtM5z2gkrGRuWd0JQMx76qA "bigclivedotcom" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC-Wj4ughUZGmVgvAacL9pMA "Wasted Penguinz" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UChturLXwYxwTOf_5krs0qvA "The Ben Heck Show" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC6mIxFTvXkWQVEHPsEdflzQ "GreatScott!" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCMXHtrkazQjeCOteE4sof8g "Fil Far" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCvrLvII5oxSWEMEkszrxXEA "N-O-D-E" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCB6PV0cvJpzlcXRG7nz6PpQ "Motherboard" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC6107grRI4m0o2-emgoDnAA "SmarterEveryDay" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC0A3ldncnGQ1M_RU2Wb4L2A "quidsup" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCRE3NFNtdjR96-H4QG4U1Fg "Hex DSL" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCm4nLrtw4bSYFNUsvHMaP1Q "Chris Whippit" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UCxycITFG0dE4cMiJ78yE0CA "SoftisFFS" YouTubeSubscriptions +https://www.youtube.com/feeds/videos.xml?channel_id=UC-lHJZR3Gqxm24_Vd_AJ5Yw "PewDiePie" YouTubeSubscriptions diff --git a/ssh/.ssh/config b/ssh/.ssh/config @@ -0,0 +1,59 @@ +Host noxz.tech noxz.tech.tmux + Hostname noxz.tech + Port 9922 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + +Host 10.0.42.46 nas.system.local nas.system.local.tmux nas nas.tmux + Hostname nas.system.local + Port 22 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + ProxyCommand /bin/ncat --proxy 127.0.0.1:9950 --proxy-type socks4 %h %p + AddKeysToAgent yes + +Host 10.88.88.26 mail.system.local mail + Hostname mail.system.local + Port 22 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + ProxyCommand /bin/ncat --proxy 127.0.0.1:9950 --proxy-type socks4 %h %p + AddKeysToAgent yes + +Host 10.88.88.42 ogma.system.local ogma + Hostname ogma.system.local + Port 22 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + ProxyCommand /bin/ncat --proxy 127.0.0.1:9950 --proxy-type socks4 %h %p + AddKeysToAgent yes + +Host 10.88.88.88 anthra.system.local anthra + Hostname anthra.system.local + Port 22 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + ProxyCommand /bin/ncat --proxy 127.0.0.1:9950 --proxy-type socks4 %h %p + AddKeysToAgent yes + +Host 10.88.88.99 arx.system.local arx.system.local.tmux arx arx.tmux + Hostname arx.system.local + Port 22 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + ProxyCommand /bin/ncat --proxy 127.0.0.1:9950 --proxy-type socks4 %h %p + AddKeysToAgent yes + +Host lanprox.system.local lanprox 10.0.42.56 + Hostname lanprox.system.local + Port 22 + IdentityFile ~/.ssh/keys/.chrisnoxz.key + AddKeysToAgent yes + +Host backup + Hostname nas.system.local + Port 22 + User backup + IdentityFile ~/.ssh/keys/.backup.key + ProxyCommand /bin/ncat --proxy 127.0.0.1:9950 --proxy-type socks4 %h %p + ServerAliveInterval 10 + ServerAliveCountMax 30 + AddKeysToAgent yes + +Host *.tmux + RemoteCommand /usr/local/bin/tmux-start attach + RequestTTY force diff --git a/surf/.surf/script.js b/surf/.surf/script.js diff --git a/surf/.surf/styles/default.css b/surf/.surf/styles/default.css @@ -0,0 +1,7 @@ +* { + font-family: hack; +} + +input { + font-family: hack !important; +} diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc @@ -0,0 +1,161 @@ +# --- dwm --------------------------------------------------------------------- +# :restart dwm +super + shift + r + echo quit > /tmp/dwm.fifo +# :toggle between layouts +super + space + echo toggle layout > /tmp/dwm.fifo +# :toggle fullscreen/monocle +super + f + echo toggle monocle > /tmp/dwm.fifo +# :toggle floating client +super + shift + space + echo toggle floating > /tmp/dwm.fifo +# :toggle sticky client +super + s + echo toggle sticky > /tmp/dwm.fifo +# :toggle bar visibillity +super + b + echo toggle bar > /tmp/dwm.fifo +# :change client focus in stack +super + {j,k} + echo focus stack {+,-} > /tmp/dwm.fifo +# :move client in stack +super + shift + {j,k} + echo move stack {+,-} > /tmp/dwm.fifo +# :increase/decrease change mfact +super + {h,l} + echo set mfact {+,-} > /tmp/dwm.fifo +# :rotate stack +super + shift + {h,l} + echo rotate stack {+,-} > /tmp/dwm.fifo +# :increase/decrease nmaster +super + {equal,minus} + echo inc nmaster {+,-} > /tmp/dwm.fifo +# :rotate through latouts +super + {_,shift} z + echo rotate layout {+,-} > /tmp/dwm.fifo +# :toggle between views +super + Tab + echo view > /tmp/dwm.fifo +# :change monitor focus +super + {comma,period} + echo focus mon {+,-} > /tmp/dwm.fifo +# :move client to monitor +super + shift + {comma,period} + echo tag mon {+,-} > /tmp/dwm.fifo +# :show all tags +super + 0 + echo view all > /tmp/dwm.fifo +# :show client on all tags +super + shift 0 + echo tag all > /tmp/dwm.fifo +# :show view +super + {1-9} + echo view {0-8} > /tmp/dwm.fifo +# :toggle view +super + control + {1-9} + echo toggle view {0-8} > /tmp/dwm.fifo +# :send client to view +super + shift + {1-9} + echo tag {0-8} > /tmp/dwm.fifo +# :toggle client on view +super + control + shift + {1-9} + echo toggle tag {0-8} > /tmp/dwm.fifo +# :spawn terminal (with tmux) +super + Return + echo spawn $TERMINAL -e tmux > /tmp/dwm.fifo +# :spawn terminal +super + shift + Return + echo spawn $TERMINAL > /tmp/dwm.fifo + +# --- browsers ---------------------------------------------------------------- +# :vimb tabbed +super + shift + w + /usr/local/bin/vimb-tabbed +# :surf vdi (remove later) +super + shift + v + /usr/local/bin/surf-vdi + +# --- dmenus ------------------------------------------------------------------ +# :run menu +super + o + dmenu_run +# :main menu +super + p + dmenu_main +# :layouts menu +super + grave + dmenu_layouts +# :mount menu +super + m + dmenu_mount +# :umount menu +super + shift + m + dmenu_umount +# :themes menu +super + shift + t + dmenu_themes +# :kill menu +super + q + dmenu_kill +# :YouTube search menu +super + y + dmenu_yt_search +# :power menu +super + F4 + dmenu_power + +# --- operations -------------------------------------------------------------- +# :toggle date time visibillity +super + t + operations ztatus show-time +# :sync email +super + shift + e + operations sync-mail + +# --- mpv controler ----------------------------------------------------------- +# :mute volume +super + XF86AudioMute + mpvc mute +# :lower volume +super + XF86AudioLowerVolume + mpvc lower +# :raise volume +super + XF86AudioRaiseVolume + mpvc raise +# :mute alsa volume +super + shift + XF86AudioMute + mpvc amute +# :lower alsa volume +super + shift + XF86AudioLowerVolume + mpvc alower +# :raise alsa volume +super + shift + XF86AudioRaiseVolume + mpvc araise +# :toggle play/pause playback +super + XF86AudioPlay + mpvc toggle +# :stop playback +super + shift + XF86AudioPlay + mpvc stop +# :seek 5 seconds backwards +super + XF86AudioRewind + mpvc seek -5 +# :seek 5 seconds forward +super + XF86AudioForward + mpvc seek 5 +# :goto previous track +super + XF86AudioPrev + mpvc prev +# :goto next track +super + XF86AudioNext + mpvc next + +# --- ztatus ------------------------------------------------------------------ +# :toggle volume +super + apostrophe; 1 + echo toggle volume > /tmp/ztatus.fifo +# :toggle power +super + apostrophe; 2 + echo toggle power > /tmp/ztatus.fifo diff --git a/sxiv/.config/sxiv/exec/key-handler b/sxiv/.config/sxiv/exec/key-handler @@ -0,0 +1,45 @@ +#!/bin/sh + +while read file; do + path="$(readlink -f "$file")" + case "$1" in + + # set as wallpaper + 'w') + if [ "${path#*.ff.gz}" != "$path" ]; then + cp "$path" "$HOME/.wallpaper.ff.gz" + else + tmpfile="$(mktemp /tmp/sxiv-wallpaper.XXXXXX)" + convert "$path" png:- | png2ff | gzip -c > "$tmpfile" && \ + mv "$tmpfile" "$HOME/.wallpaper.ff.gz" + fi + swall "$HOME/.wallpaper.ff.gz" + ;; + + # rotate 90 degrees clockwise + 'r') + if [ "${path#*.ff.gz}" != "$path" ]; then + tmpfile="$(mktemp /tmp/sxiv-rotate.XXXXXX)" + gunzip -c < "$path" | ff2png | \ + convert png:- -rotate 90 png:- | \ + png2ff | gzip -c > "$tmpfile" && \ + mv "$tmpfile" "$path" + else + convert -rotate 90 "$path" "$path" + fi + ;; + + # rotate 90 degrees counter-clockwise + 'R') + if [ "${path#*.ff.gz}" != "$path" ]; then + tmpfile="$(mktemp /tmp/sxiv-rotate.XXXXXX)" + gunzip -c < "$path" | ff2png | \ + convert png:- -rotate -90 png:- | \ + png2ff | gzip -c > "$tmpfile" && \ + mv "$tmpfile" "$path" + else + convert -rotate -90 "$path" "$path" + fi + ;; + esac +done diff --git a/themes/.themes/ashes.vt b/themes/.themes/ashes.vt @@ -0,0 +1,16 @@ +1c2023 +c7ae95 +95c7ae +aec795 +ae95c7 +c795ae +95aec7 +c7ccd1 +747c84 +c7ae95 +95c7ae +aec795 +ae95c7 +c795ae +95aec7 +f3f4f5 diff --git a/themes/.themes/blaquebeard.vt b/themes/.themes/blaquebeard.vt @@ -0,0 +1,17 @@ +# http://dotshare.it/dots/8336/ +222222 +924650 +666666 +ba9864 +888888 +4f8396 +777777 +c2c2b0 +222222 +924650 +666666 +ba9864 +888888 +4f8396 +777777 +c2c2b0 diff --git a/themes/.themes/blue.vt b/themes/.themes/blue.vt @@ -0,0 +1,16 @@ +030b14 +000000 +3081bf +174a83 +1d5fa7 +001c7d +1f4fb1 +418af1 +071b30 +2551bf +2584bf +1c5ba1 +4a76bf +0c43b1 +2872db +6aa2f1 diff --git a/themes/.themes/dark.vt b/themes/.themes/dark.vt @@ -0,0 +1,16 @@ +020714 +c21d3e +265165 +f99085 +4a46c2 +071124 +6dd1c9 +baa6a3 +55677a +db6993 +d9de97 +b5288f +8e9bcc +7e2ac4 +2a99a8 +ffffff diff --git a/themes/.themes/electric-warlock.vt b/themes/.themes/electric-warlock.vt @@ -0,0 +1,17 @@ +# http://dotshare.it/dots/1513/ +272227 +ed191b +41a442 +d6cd3f +282c4f +ea2d93 +40aea5 +b8c5b4 +635f58 +b83c28 +968e72 +cec647 +4e628a +b65097 +46909b +efe9da diff --git a/themes/.themes/fray.vt b/themes/.themes/fray.vt @@ -0,0 +1,17 @@ +# http://dotshare.it/dots/1386/ +151617 +F8F8F8 +AADB0F +F7F7F7 +F2F2F2 +91BA0D +E2E2E2 +F9F9F9 +191A1C +F0F0F0 +B2E610 +E8E8E8 +E1E1E1 +91BF0D +D9D9D9 +FFFFFF diff --git a/themes/.themes/grey.vt b/themes/.themes/grey.vt @@ -0,0 +1,16 @@ +111111 +000000 +a0a0a0 +666666 +838383 +787878 +808080 +eeeeee +111111 +8c8c8c +c8c8c8 +666666 +838383 +787878 +808080 +eeeeee diff --git a/themes/.themes/light.vt b/themes/.themes/light.vt @@ -0,0 +1,16 @@ +fef1ce +ebbe39 +ea8235 +df5029 +b4171e +850f25 +550c27 +2a2a20 +887f57 +c39d2f +c36c2c +c54724 +9b141a +660c1d +39081a +280c22 diff --git a/themes/.themes/lightv2.vt b/themes/.themes/lightv2.vt @@ -0,0 +1,16 @@ +dde6fc +c21d3e +889ea9 +ba4141 +4a46c2 +d1d1d1 +0dcdcd +171717 +55677a +db6993 +538e00 +b5288f +8e9bcc +fd28ff +0b8686 +000000 diff --git a/themes/.themes/nixio.vt b/themes/.themes/nixio.vt @@ -0,0 +1,17 @@ +# http://dotshare.it/dots/1545/ +051519 +f8818e +84969a +97a6aa +5e6f73 +677a7e +7b8e93 +b3bec1 +323b3e +fb3d66 +22292a +3e494c +a2b0b3 +e0e5e6 +556468 +f7f8f8 diff --git a/themes/.themes/ocean.vt b/themes/.themes/ocean.vt @@ -0,0 +1,16 @@ +2b303b +bf616a +a3be8c +ebcb8b +8fa1b3 +b48ead +96b5b4 +c0c5ce +65737e +bf616a +a3be8c +ebcb8b +8fa1b3 +b48ead +96b5b4 +eff1f5 diff --git a/themes/.themes/oxide.vt b/themes/.themes/oxide.vt @@ -0,0 +1,17 @@ +# http://dotshare.it/dots/8267/ +212121 +e57373 +a6bc69 +fac863 +6699cc +c594c5 +5fb3b3 +c0c5ce +5c5c5c +e57373 +a6bc69 +fac863 +6699cc +c594c5 +5fb3b3 +f3f4f5 diff --git a/themes/.themes/purple.vt b/themes/.themes/purple.vt @@ -0,0 +1,16 @@ +14030b +000000 +bf3081 +83174a +a71d5f +7d001c +b11f4f +f1418a +30071b +bf2551 +bf2584 +a11c5b +bf4a76 +b10c43 +db2872 +f16aa2 diff --git a/themes/.themes/ricing-is-fun.vt b/themes/.themes/ricing-is-fun.vt @@ -0,0 +1,17 @@ +# http://dotshare.it/dots/1439/ +222222 +ca4a4b +aa2a2a +830c0c +ca4a4b +aa2a2a +830c0c +ffffff +222222 +ca4a4b +aa2a2a +830c0c +ca4a4b +aa2a2a +830c0c +ffffff diff --git a/themes/.themes/synthwave.vt b/themes/.themes/synthwave.vt @@ -0,0 +1,16 @@ +312e39 +87404f +4c9882 +71949a +615772 +783e57 +554757 +554757 +33303b +87404f +87404f +71949a +71949a +783e57 +554757 +c0a79a diff --git a/themes/.themes/tube.vt b/themes/.themes/tube.vt @@ -0,0 +1,16 @@ +140b03 +000000 +bf8130 +45270c +a75f1d +7d1c00 +b14f1f +f18a41 +301b07 +bf5125 +bf8425 +a15b1c +bf764a +b1430c +db7228 +f1a26a diff --git a/themes/.themes/vtrgb2theme b/themes/.themes/vtrgb2theme @@ -0,0 +1,12 @@ +#!/bin/sh + +for i in $(seq 1 16) +do + awk -F, " + BEGIN {OFS = FS} + { + printf \"%02x\",\$$i + }" $1 + echo +done + diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf @@ -0,0 +1,195 @@ +############################################################################# +# _ __ # +# | |_ _ __ ___ _ ___ __ ___ ___ _ __ / _| # +# | __| '_ ` _ \| | | \ \/ / / __/ _ \| '_ \| |_ # +# | |_| | | | | | |_| |> < | (_| (_) | | | | _| # +# (_)__|_| |_| |_|\__,_/_/\_(_)___\___/|_| |_|_| # +# # +############################################################################# + +############################################################################# +# base settings # +############################################################################# + +# set default terminal and shell +set -g default-terminal "st-256color" +set -g default-shell /bin/ksh + +# enable mouse mode +set -g mouse on + +# 1-based index +set -g base-index 1 +set -g pane-base-index 1 + +# use vi keys where possible +setw -g mode-keys vi +set -g status-keys vi + +# misc. settings +set -s escape-time 0 +set -g renumber-windows on +set -g status-interval 10 + +############################################################################# +# functionality # +############################################################################# + +# bind prefix to M-` instead +unbind -T root C-b +set -g prefix M-` + +# copy mode extensions +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi C-v send -X rectangle-toggle \; \ + send -X begin-selection +bind -T copy-mode-vi y send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" \; \ + send -X cancel +bind -T copy-mode-vi Enter send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" \; \ + send -X cancel +bind -T copy-mode-vi MouseDragEnd1Pane \ + send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" \; \ + send -X cancel +bind -T copy-mode-vi Escape send -X cancel + +# split panes using | and - instead +unbind -T prefix '"' +unbind -T prefix % +bind -T prefix | split-window -h -c "#{pane_current_path}" +bind -T prefix - split-window -v -c "#{pane_current_path}" + +# quick reload config using 'r' +bind -T prefix r source-file ~/.tmux.conf \; \ + display "config reloaded" + +# switch panes using hjkl (dwm like) +bind -T root M-j select-pane -t :.+ +bind -T root M-k select-pane -t :.- +bind -T root M-J swap-pane -s :. -t :.+ \; select-pane -t :.+ +bind -T root M-K swap-pane -s :. -t :.- \; select-pane -t :.- + +# copy and paste +bind -T prefix v run "xclip -o -sel p | tmux loadb -bp -" \; \ + pasteb -bp +bind -T prefix V run "xclip -o -sel c | tmux loadb -bc -" \; \ + pasteb -bc +bind -n MouseDown3Pane run "xclip -o -sel p | tmux loadb -bp -" \; \ + pasteb -bp +bind -n C-MouseDown3Pane run "xclip -o -sel c | tmux loadb -bc -" \; \ + pasteb -bc +# misc. key bindings +unbind -T prefix c +bind -T root M-z resize-pane -Z +bind -T prefix w new-window +bind -T prefix u run -b "fzf-url.tmux" + +# mouse scrolling +unbind -T root WheelUpPane +unbind -T copy-mode WheelUpPane +unbind -T copy-mode WheelDownPane +unbind -T copy-mode-vi WheelUpPane +unbind -T copy-mode-vi WheelDownPane +bind -T root C-WheelUpPane \ + if-shell -F -t = "#{mouse_any_flag}" \ + "send-keys -M" \ + "if -Ft= \"#{pane_in_mode}\" \ + \"send-keys -M\" \"copy-mode -et=\"" +bind -T copy-mode-vi WheelUpPane \ + select-pane \; send-keys -X -N 1 scroll-up +bind -T copy-mode-vi WheelDownPane \ + select-pane \; send-keys -X -N 1 scroll-down +bind -T copy-mode-vi C-WheelUpPane \ + select-pane \; send-keys -X -N 5 scroll-up +bind -T copy-mode-vi C-WheelDownPane \ + select-pane \; send-keys -X -N 5 scroll-down + +# double and tripple click, to select word and line +bind -T copy-mode-vi DoubleClick1Pane \ + select-pane \; \ + send -X select-word \; \ + send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" +bind -T root DoubleClick1Pane \ + select-pane \; \ + copy-mode -M \; \ + send -X select-word \; \ + send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" +bind -T copy-mode-vi TripleClick1Pane \ + select-pane \; \ + send -X select-line \; \ + send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" +bind -T root TripleClick1Pane \ + select-pane \; \ + copy-mode -M \; \ + send -X select-line \; \ + send -X copy-pipe \ + "xclip -i -sel p -f | xclip -i -sel c" + +# nrowgrid implementation for tmux +bind -T root M-Enter split-window -b -t :.1 \ + -c "#{pane_current_path}" \; \ + run "nrowgrid.tmux" \; \ + select-pane -t :.1 +bind -T root M-= run "nrowgrid.tmux ++" +bind -T root M-- run "nrowgrid.tmux --" +set-hook -g after-kill-pane 'run "nrowgrid.tmux"' +set-hook -g pane-exited 'run "nrowgrid.tmux"' + +############################################################################# +# look and feel # +############################################################################# + +# quiet +set -g visual-activity off +set -g visual-bell off +set -g visual-silence off +setw -g monitor-activity off +set -g bell-action none + +# modes +setw -g clock-mode-colour 'colour6' +setw -g mode-style 'fg=colour0,bg=colour6' + +# panes +set -g pane-border-style 'bg=colour0,fg=colour5' +set -g pane-active-border-style 'bg=colour0,fg=colour11' + +# statusbar +set -g status-position top +set -g status-justify left +set -g status-right-length 64 +set -g status-style 'bg=colour0,fg=colour15' +set -g status-right-style 'bg=colour0,fg=colour15' +set -g status-right '#(/bin/hostname) #[ \ + fg=colour5,bg=colour0]#[ \ + fg=colour6,bg=colour5 \ + ] #(status.tmux battery) #[ \ + ] #(status.tmux temp) #[ \ + fg=colour5,bg=colour6,reverse]#[ \ + fg=colour0,bg=colour6,noreverse \ + ] %Y-%m-%d  %R #[ \ + ]#{?client_prefix,#[ \ + ]#[fg=colour1]#[reverse \ + bg=colour0]#[fg=colour1] PREFIX #[ \ + ],#[ \ + bg=colour6,fg=colour0]#[ \ + bg=colour0,fg=colour1] NORMAL }' +set -g status-left '' + +# window tabs +setw -g window-status-format '#[ \ + fg=colour5,bg=colour2] #I #[ \ + fg=colour2,bg=colour5] #W ' +setw -g window-status-current-format \ + '#[ \ + fg=colour5,bg=colour6] #I #[ \ + fg=colour6,bg=colour5] #W ' + +# messages +set -g message-style 'bg=colour5,fg=colour6' +setw -g message-command-style 'fg=colour0,bg=colour6' diff --git a/vifm/.vifm/colors/Default.vifm b/vifm/.vifm/colors/Default.vifm @@ -0,0 +1,86 @@ +" You can edit this file by hand. +" The " character at the beginning of a line comments out the line. +" Blank lines are ignored. + +" The Default color scheme is used for any directory that does not have +" a specified scheme and for parts of user interface like menus. A +" color scheme set for a base directory will also +" be used for the sub directories. + +" The standard ncurses colors are: +" Default = -1 = None, can be used for transparency or default color +" Black = 0 +" Red = 1 +" Green = 2 +" Yellow = 3 +" Blue = 4 +" Magenta = 5 +" Cyan = 6 +" White = 7 + +" Light versions of colors are also available (set bold attribute): +" LightBlack +" LightRed +" LightGreen +" LightYellow +" LightBlue +" LightMagenta +" LightCyan +" LightWhite + +" Available attributes (some of them can be combined): +" bold +" underline +" reverse or inverse +" standout +" italic (on unsupported systems becomes reverse) +" none + +" Vifm supports 256 colors you can use color numbers 0-255 +" (requires properly set up terminal: set your TERM environment variable +" (directly or using resources) to some color terminal name (e.g. +" xterm-256color) from /usr/lib/terminfo/; you can check current number +" of colors in your terminal with tput colors command) + +" highlight group cterm=attrs ctermfg=foreground_color ctermbg=background_color + +highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black +highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white +highlight SuggestBox cterm=bold ctermfg=default ctermbg=default +highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red +highlight AuxWin cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default + +highlight clear + +highlight Win cterm=none ctermfg=default ctermbg=none + +highlight TopLine cterm=bold ctermfg=black ctermbg=5 +highlight TopLineSel cterm=bold ctermfg=black ctermbg=5 +highlight StatusLine cterm=none ctermfg=black ctermbg=5 +highlight Border cterm=none ctermfg=black ctermbg=5 + +highlight Selected cterm=bold ctermfg=cyan ctermbg=default +highlight CurrLine cterm=default ctermfg=none ctermbg=5 + +highlight WildMenu cterm=bold ctermfg=5 ctermbg=2 +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=none ctermfg=red ctermbg=black + +highlight Directory cterm=none ctermfg=cyan ctermbg=default +highlight Link cterm=none ctermfg=yellow ctermbg=default +highlight BrokenLink cterm=none ctermfg=red ctermbg=default +highlight Socket cterm=none ctermfg=magenta ctermbg=default +highlight Device cterm=none ctermfg=red ctermbg=default +highlight Fifo cterm=none ctermfg=cyan ctermbg=default +highlight Executable cterm=none ctermfg=10 ctermbg=default + +highlight User1 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User2 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User3 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User4 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User5 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User6 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User7 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User8 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User9 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default + diff --git a/vifm/.vifm/scripts/README b/vifm/.vifm/scripts/README @@ -0,0 +1,6 @@ +This directory is dedicated for user-supplied scripts/executables. +vifm modifies its PATH environment variable to let user run those +scripts without specifying full path. All subdirectories are added +as well. File in a subdirectory overrules file with the same name +in parent directories. Restart might be needed to recognize files +in newly created or renamed subdirectories.+ \ No newline at end of file diff --git a/vifm/.vifm/vifm-help.txt b/vifm/.vifm/vifm-help.txt @@ -0,0 +1,5902 @@ +VIFM(1) General Commands Manual VIFM(1) + + + +NAME + vifm - vi file manager + +SYNOPSIS + vifm [OPTION]... + vifm [OPTION]... path + vifm [OPTION]... path path + +DESCRIPTION + Vifm is an ncurses based file manager with vi like keybindings. If you + use vi, vifm gives you complete keyboard control over your files + without having to learn a new set of commands. + +OPTIONS + vifm starts in the current directory unless it is given a different + directory on the command line or 'vifminfo' option includes "savedirs" + (in which case last visited directories are used as defaults). + + - Read list of files from standard input stream and compose custom + view out of them (see "Custom views" section). Current working + directory is used as a base for relative paths. + + <path> Starts Vifm in the specified path. + + <path> <path> + Starts Vifm in the specified paths. + + Specifying two directories triggers split view even when vifm was in + single-view mode on finishing previous session. To suppress this + behaviour :only command can be put in the vifmrc file. + + When only one path argument is found on command-line, the left/top pane + is automatically set as the current view. + + Paths to files are also allowed in case you want vifm to start with + some archive opened. + + --select <path> + Open parent directory of the given path and select specified + file in it. + + -f Makes vifm instead of opening files write selection to + $VIFM/vimfiles and quit. + + --choose-files <path>|- + Sets output file to write selection into on exit instead of + opening files. "-" means standard output. Use empty value to + disable it. + + --choose-dir <path>|- + Sets output file to write last visited directory into on exit. + "-" means standard output. Use empty value to disable it. + + --delimiter <delimiter> + Sets separator for list of file paths written out by vifm. + Empty value means null character. Default is new line + character. + + --on-choose <command> + Sets command to be executed on selected files instead of opening + them. The command may use any of macros described in "Command + macros" section below. The command is executed once for whole + selection. + + --logging[=<startup log path>] + Log some operational details $VIFM/log. If the optional startup + log path is specified and permissions allow to open it for + writing, then logging of early initialization (before value of + $VIFM is determined) is put there. + + --server-list + List available server names and exit. + + --server-name <name> + Name of target or this instance (sequential numbers are appended + on name conflict). + + --remote + Sends the rest of the command line to another instance of vifm, + --server-name is treated just like any other argument and should + precede --remote on the command line. When there is no server, + quits silently. There is no limit on how many arguments can be + processed. One can combine --remote with -c <command> or + +<command> to execute commands in already running instance of + vifm. See also "Client-Server" section below. + + --remote-expr + passes expression to vifm server and prints result. See also + "Client-Server" section below. + + -c <command> or +<command> + Run command-line mode <command> on startup. Commands in such + arguments are executed in the order they appear in command line. + Commands with spaces or special symbols must be enclosed in + double or single quotes or all special symbols should be escaped + (the exact syntax strongly depends on shell). "+" argument is + equivalent to "$" and thus picks last item of of the view. + + --help, -h + Show a brief command summary and exit vifm. + + --version, -v + Show version information and quit. + + --no-configs + Skip reading vifmrc and vifminfo. + + + See "Startup" section below for the explanations on $VIFM. + +General keys + Ctrl-C or Escape + cancel most operations (see "Cancellation" section below), clear + all selected files. + + Ctrl-L clear and redraw the screen. + +Basic Movement + The basic vi key bindings are used to move through the files and pop-up + windows. + + k, gk, or Ctrl-P + move cursor up one line. + + j, gj or Ctrl-N + move cursor down one line. + + h when 'lsview' is off move up one directory (moves to parent + directory node in tree view), otherwise move left one file. + + l when 'lsview' is off move into a directory or launches a file, + otherwise move right one file. + + gg move to the first line of the file list. + + G move to the last line in the file list. + + gh go up one directory regardless of view representation (regular, + ls-like). Also can be used to leave custom views including tree + view. + + gl or Enter + enter directory or launch a file. + + H move to the first file in the window. + + M move to the file in the middle of the window. + + L move to the last file in the window. + + Ctrl-F or Page Down + move forward one page. + + Ctrl-B or Page Up + move back one page. + + Ctrl-D jump back one half page. + + Ctrl-U jump forward one half page. + + n% move to the file that is n percent from the top of the list (for + example 25%). + + 0 or ^ move cursor to the first column. See 'lsview' option + description. + + $ move cursor to the last column. See 'lsview' option + description. + + Space switch file lists. + + gt switch to the next tab (wrapping around). + + {n}gt switch to the tab number {n} (wrapping around). + + gT switch to the previous tab (wrapping around). + + {n}gT switch to {n}-th previous tab. + +Movement with Count + Most movement commands also accept a count, 12j would move down 12 + files. + + [count]% + move to percent of the file list. + + [count]j + move down [count] files. + + [count]k + move up [count] files. + + [count]G or [count]gg + move to list position [count]. + + [count]h + go up [count] directories. + +Scrolling panes + zt redraw pane with file in top of list. + + zz redraw pane with file in center of list. + + zb redraw pane with file in bottom of list. + + Ctrl-E scroll pane one line down. + + Ctrl-Y scroll pane one line up. + +Pane manipulation + Second character can be entered with or without Control key. + + Ctrl-W H + move the pane to the far left. + + Ctrl-W J + move the pane to the very bottom. + + Ctrl-W K + move the pane to the very top. + + Ctrl-W L + move the pane to the far right. + + + Ctrl-W h + switch to the left pane. + + Ctrl-W j + switch to the pane below. + + Ctrl-W k + switch to the pane above. + + Ctrl-W l + switch to the right pane. + + + Ctrl-W b + switch to bottom-right window. + + Ctrl-W t + switch to top-left window. + + + Ctrl-W p + switch to previous window. + + Ctrl-W w + switch to other pane. + + + Ctrl-W o + leave only one pane. + + Ctrl-W s + split window horizontally. + + Ctrl-W v + split window vertically. + + + Ctrl-W x + exchange panes. + + Ctrl-W z + quit preview pane or view modes. + + + Ctrl-W - + decrease size of the view by count. + + Ctrl-W + + increase size of the view by count. + + Ctrl-W < + decrease size of the view by count. + + Ctrl-W > + increase size of the view by count. + + + Ctrl-W | + set current view size to count. + + Ctrl-W _ + set current view size to count. + + Ctrl-W = + make size of two views equal. + + For Ctrl-W +, Ctrl-W -, Ctrl-W <, Ctrl-W >, Ctrl-W | and Ctrl-W _ + commands count can be given before and/or after Ctrl-W. The resulting + count is a multiplication of those two. So "2 Ctrl-W 2 -" decreases + window size by 4 lines or columns. + + Ctrl-W | and Ctrl-W _ maximise current view by default. + +Marks + Marks are set the same way as they are in vi. + + You can use these characters for marks [a-z][A-Z][0-9]. + + m[a-z][A-Z][0-9] + set a mark for the file at the current cursor position. + + '[a-z][A-Z][0-9] + navigate to the file set for the mark. + + + There are also several special marks that can't be set manually: + + - ' (single quote) - previously visited directory of the view, thus + hitting '' allows switching between two last locations + + - < - the first file of the last visually selected block + + - > - the last file of the last visually selected block + +Searching + /regular expression pattern + search for files matching regular expression in forward + direction and advance cursor to next match. + + / perform forward search with top item of search pattern history. + + ?regular expression pattern + search for files matching regular expression in backward + direction and advance cursor to previous match. + + ? perform backward search with top item of search pattern history. + + Trailing slash for directories is taken into account, so /\/ searches + for directories and symbolic links to directories. At the moment // + works too, but this can change in the future, so consider escaping the + slash if not typing pattern by hand. + + Matches are automatically selected if 'hlsearch' is set. Enabling + 'incsearch' makes search interactive. 'ignorecase' and 'smartcase' + options affect case sensitivity of search queries. + + + [count]n + go to the next file matching last search pattern. Takes last + search direction into account. + + [count]N + go to the previous file matching last search pattern. Takes + last search direction into account. + + If 'hlsearch' option is set, hitting n/N to perform search and go to + the first matching item resets current selection in normal mode. It is + not the case if search was already performed on files in the directory, + thus selection is not reset after clearing selection with escape key + and hitting n/N key again. + + Note: vifm uses extended regular expressions for / and ?. + + + [count]f[character] + search forward for file with [character] as first character in + name. Search wraps around the end of the list. + + [count]F[character] + search backward for file with [character] as first character in + name. Search wraps around the end of the list. + + [count]; + find the next match of f or F. + + [count], + find the previous match of f or F. + + Note: f, F, ; and , wrap around list beginning and end when they are + used alone and they don't wrap when they are used as selectors. + +File Filters + There are three basic file filters: + + - dot files filter (excluding "." and ".." special directories, whose + appearance is controlled by the 'dotdirs' option); + + - manual filter for file names; + + - automatic filter for file names; + + - local filter for file names (see description of the "=" normal mode + command). + + Performing operations on manual filter for file names automatically + does the same on automatic one. The file name filter is separated + mainly for convenience purpose and to get more deterministic behaviour. + + The basic vim folding key bindings are used for filtering files. + + Each file list has its own copy of each filter. + + Filtered files are not checked in / search or :commands. + + Files and directories are filtered separately. For this a slash is + appended to a directory name before testing whether it matches the + filter. Examples: + + + " filter directories which names end with '.files' + :filter /^.*\.files\/$/ + + " filter files which names end with '.d' + :filter /^.*\.d$/ + + " filter files and directories which names end with '.o' + :filter /^.*\.o\/?$/ + + Note: vifm uses extended regular expressions. + + za toggle visibility of dot files. + + zo show dot files. + + zm hide dot files. + + zf add selected files to file name filter. + + zO show files hidden by file name filter. + + zM restore all filters. + + zR remove all filters. + + zr remove local filter. + + zd exclude selection or current file from a custom view. Does + nothing for regular view. For tree view excluding directory + excludes that sub-tree. For compare views zd hides group of + adjacent identical files, count can be specified as 1 to exclude + just single file or selected items instead. Files excluded this + way are not counted as filtered out and can't be returned unless + view is reloaded. + + =regular expression pattern + filter out files that don't match regular expression. Whether + view is updated as regular expression is changed depends on the + value of the 'incsearch' option. This kind of filter is + automatically reset when directory is changed. + +Other Normal Mode Keys + [count]: + enter command line mode. [count] generates range. + + q: open external editor to prompt for command-line command. See + "Command line editing" section for details. + + q/ open external editor to prompt for search pattern to be searched + in forward direction. See "Command line editing" section for + details. + + q? open external editor to prompt for search pattern to be searched + in backward direction. See "Command line editing" section for + details. + + q= open external editor to prompt for filter pattern. See "Command + line editing" section for details. Unlike other q{x} commands + this one doesn't work in Visual mode. + + [count]!! and [count]!<selector> + enter command line mode with entered ! command. [count] + modifies range. + + Ctrl-O go backwards through directory history of current view. + Nonexistent directories are automatically skipped. + + Ctrl-I if 'cpoptions' contains "t" flag, <tab> and <c-i> switch active + pane just like <space> does, otherwise it goes forward through + directory history of current view. Nonexistent directories are + automatically skipped. + + Ctrl-G create a window showing detailed information about the current + file. + + Shift-Tab + enters view mode (works only after activating view pane with + :view command). + + ga calculate directory size. Uses cached directory sizes when + possible for better performance. As a special case calculating + size of ".." entry results in calculation of size of current + directory. + + gA like ga, but force update. Ignores old values of directory + sizes. + + If file under cursor is selected, each selected item is processed, + otherwise only current file is updated. + + gf find link destination (like l with 'followlinks' off, but also + finds directories). + + gr only for MS-Windows + same as l key, but tries to run program with administrative + privileges. + + av go to visual mode into selection amending state preserving + current selection. + + gv go to visual mode restoring last selection. + + [reg]gs + when no register is specified, restore last t selection (similar + to what gv does for visual mode selection). If register is + present, then all files listed in that register and which are + visible in current view are selected. + + gu<selector> + make names of selected files lowercase. + + [count]guu and [count]gugu + make names of [count] files starting from the current one + lowercase. Without [count] only current file is affected. + + gU<selector> + make names of selected files uppercase. + + [count]gUU and [count]gUgU + make names of [count] files starting from the current one + uppercase. Without [count] only current file is affected. + + e explore file in the current pane. + + i handle file (even if it's an executable and 'runexec' option is + set). + + cw change word is used to rename a file or files. + + cW change WORD is used to change only name of file (without + extension). + + cl change link target. + + co only for *nix + change file owner. + + cg only for *nix + change file group. + + [count]cp + change file attributes (permission on *nix and properties on + Windows). If [count] is specified, it's treated as numerical + argument for non-recursive `chmod` command (of the form + [0-7]{3,4}). + + [count]C + clone file [count] times. + + [count]dd or d[count]selector + move selected file or files to trash directory (if 'trash' + option is set, otherwise delete). See "Trash directory" section + below. + + [count]DD or D[count]selector + like dd and d<selector>, but omitting trash directory (even when + 'trash' option is set). + + Y, [count]yy or y[count]selector + yank selected files. + + p copy yanked files to the current directory or move the files to + the current directory if they were deleted with dd or :d[elete] + or if the files were yanked from trash directory. See "Trash + directory" section below. + + P move the last yanked files. The advantage of using P instead of + d followed by p is that P moves files only once. This isn't + important in case you're moving files in the same file system + where your home directory is, but using P to move files on some + other file system (or file systems, in case you want to move + files from fs1 to fs2 and your home is on fs3) can save your + time. + + al put symbolic links with absolute paths. + + rl put symbolic links with relative paths. + + t select or unselect (tag) the current file. + + u undo last change. + + Ctrl-R redo last change. + + dp in compare view of "ofboth grouppaths" kind, makes corresponding + entry of the other pane equal to the current one. The semantics + is as follows: + - nothing done for identical entries + - if file is missing in current view, its pair gets removed + - if file is missing or differs in other view, it's replaced + - file pairs are defined by matching relative paths + File removal obeys 'trash' option. When the option is enabled, + the operation can be undone/redone (although results won't be + visible automatically). + Unlike in Vim, this operation is performed on a single line + rather than a set of adjacent changes. + + do same as dp, but applies changes in the opposite direction. + + v or V enter visual mode, clears current selection. + + [count]Ctrl-A + increment first number in file name by [count] (1 by default). + + [count]Ctrl-X + decrement first number in file name by [count] (1 by default). + + ZQ same as :quit!. + + ZZ same as :quit. + + . repeat last command-line command (not normal mode command) of + this session (does nothing right after startup or :restart + command). The command doesn't depend on command-line history + and can be used with completely disabled history. + + ( go to previous group. Groups are defined by primary sorting + key. For name and iname members of each group have same first + letter, for all other sorting keys vifm uses size, uid, ... + + ) go to next group. See ( key description above. + + { speeds up navigation to closest previous entry of the opposite + type by moving to the first file backwards when cursor is on a + directory and to the first directory backwards when cursor is on + a file. This is essentially a special case of ( that is locked + on "dirs". + + } same as {, but in forward direction. + + [c go to previous mismatched entry in directory comparison view or + do nothing. + + ]c go to next mismatched entry in directory comparison view or do + nothing. + + [d go to previous directory entry or do nothing. + + ]d go to next directory entry or do nothing. + + [r same as :siblprev. + + ]r same as :siblnext. + + [R same as :siblprev!. + + ]R same as :siblnext!. + + [s go to previous selected entry or do nothing. + + ]s go to next selected entry or do nothing. + + [z go to first sibling of current entry. + + ]z go to last sibling of current entry. + + zj go to next directory sibling of current entry or do nothing. + + zk go to previous directory sibling of current entry or do nothing. + +Using Count + You can use count with commands like yy. + + [count]yy + yank count files starting from current cursor position downward. + + Or you can use count with motions passed to y, d or D. + + d[count]j + delete (count + 1) files starting from current cursor position + upward. + +Registers + vifm supports multiple registers for temporary storing list of yanked + or deleted files. + + Registers should be specified by hitting double quote key followed by a + register name. Count is specified after register name. By default + commands use unnamed register, which has double quote as its name. + + Though all commands accept registers, most of commands ignores them + (for example H or Ctrl-U). Other commands can fill register or append + new files to it. + + Presently vifm supports ", _, a-z and A-Z characters as register names. + + As mentioned above " is unnamed register and has special meaning of the + default register. Every time when you use named registers (a-z and A- + Z) unnamed register is updated to contain same list of files as the + last used register. + + _ is black hole register. It can be used for writing, but its list is + always empty. + + Registers with names from a to z and from A to Z are named ones. + Lowercase registers are cleared before adding new files, while + uppercase aren't and should be used to append new files to the existing + file list of appropriate lowercase register (A for a, B for b, ...). + + Registers can be changed on :empty command if they contain files under + trash directory (see "Trash directory" section below). + + Registers do not contain one file more than once. + + Example: + + "a2yy + + puts names of two files to register a (and to the unnamed register), + + "Ad + + removes one file and append its name to register a (and to the unnamed + register), + + p or "ap or "Ap + + inserts previously yanked and deleted files into current directory. + +Selectors + y, d, D, !, gu and gU commands accept selectors. You can combine them + with any of selectors below to quickly remove or yank several files. + + Most of selectors are like vi motions: j, k, gg, G, H, L, M, %, f, F, + ;, comma, ', ^, 0 and $. But there are some additional ones. + + a all files in current view. + + s selected files. + + S all files except selected. + + Examples: + + - dj - delete file under cursor and one below; + + - d2j - delete file under cursor and two below; + + - y6gg - yank all files from cursor position to 6th file in the list. + + When you pass a count to whole command and its selector they are + multiplied. So: + + - 2d2j - delete file under cursor and four below; + + - 2dj - delete file under cursor and two below; + + - 2y6gg - yank all files from cursor position to 12th file in the + list. + +Visual Mode + Visual mode has to generic operating submodes: + + - plain selection as it is in Vim; + + - selection editing submode. + + Both modes select files in range from cursor position at which visual + mode was entered to current cursor position (let's call it "selection + region"). Each of two borders can be adjusted by swapping them via "o" + or "O" keys and updating cursor position with regular cursor motion + keys. Obviously, once initial cursor position is altered this way, + real start position becomes unavailable. + + Plain Vim-like visual mode starts with cleared selection, which is not + restored on rejecting selection ("Escape", "Ctrl-C", "v", "V"). + Contrary to it, selection editing doesn't clear previously selected + files and restores them after reject. Accepting selection by + performing an operation on selected items (e.g. yanking them via "y") + moves cursor to the top of current selection region (not to the top + most selected file of the view). + + In turn, selection editing supports three types of editing (look at + statusbar to know which one is currently active): + + - append - amend selection by selecting elements in selection region; + + - remove - amend selection by deselecting elements in selection + region; + + - invert - amend selection by inverting selection of elements in + selection region. + + No matter how you activate selection editing it starts in "append". + One can switch type of operation (in the order given above) via "Ctrl- + G" key. + + Almost all normal mode keys work in visual mode, but instead of + accepting selectors they operate on selected items. + + Enter save selection and go back to normal mode not moving cursor. + + av leave visual mode if in amending mode (restores previous + selection), otherwise switch to amending selection mode. + + gv restore previous visual selection. + + v, V, Ctrl-C or Escape + leave visual mode if not in amending mode, otherwise switch to + normal visual selection. + + Ctrl-G switch type of amending by round robin scheme: append -> remove + -> invert. + + : enter command line mode. Selection is cleared on leaving the + mode. + + o switch active selection bound. + + O switch active selection bound. + + gu, u make names of selected files lowercase. + + gU, U make names of selected files uppercase. + +View Mode + This mode tries to imitate the less program. List of builtin shortcuts + can be found below. Shortcuts can be customized using :qmap, :qnoremap + and :qunmap command-line commands. + + Shift-Tab, Tab, q, Q, ZZ + return to normal mode. + + [count]e, [count]Ctrl-E, [count]j, [count]Ctrl-N, [count]Enter + scroll forward one line (or [count] lines). + + [count]y, [count]Ctrl-Y, [count]k, [count]Ctrl-K, [count]Ctrl-P + scroll backward one line (or [count] lines). + + [count]f, [count]Ctrl-F, [count]Ctrl-V, [count]Space + scroll forward one window (or [count] lines). + + [count]b, [count]Ctrl-B, [count]Alt-V + scroll backward one window (or [count] lines). + + [count]z + scroll forward one window (and set window to [count]). + + [count]w + scroll backward one window (and set window to [count]). + + [count]Alt-Space + scroll forward one window, but don't stop at end-of-file. + + [count]d, [count]Ctrl-D + scroll forward one half-window (and set half-window to [count]). + + [count]u, [count]Ctrl-U + scroll backward one half-window (and set half-window to + [count]). + + r, Ctrl-R, Ctrl-L + repaint screen. + + R reload view preserving scroll position. + + F toggle automatic forwarding. Roughly equivalent to periodic + file reload and scrolling to the bottom. The behaviour is + similar to `tail -F` or F key in less. + + [count]/pattern + search forward for ([count]-th) matching line. + + [count]?pattern + search backward for ([count]-th) matching line. + + [count]n + repeat previous search (for [count]-th occurrence). + + [count]N + repeat previous search in reverse direction (for [count]-th + occurrence). + + [count]g, [count]<, [count]Alt-< + scroll to the first line of the file (or line [count]). + + [count]G, [count]>, [count]Alt-> + scroll to the last line of the file (or line [count]). + + [count]p, [count]% + scroll to the beginning of the file (or N percent into file). + + v invoke an editor to edit the current file being viewed. The + command for editing is taken from the 'vicmd'/'vixcmd' option + value and extended with middle line number prepended by a plus + sign and name of the current file. + + All "Ctrl-W x" keys work the same was as in Normal mode. Active mode + is automatically changed on navigating among windows. When less-like + mode activated on file preview is left using one by "Ctrl-W x" keys, + its state is stored until another file is displayed using preview (it's + possible to leave the mode, hide preview pane, do something else, then + get back to the file and show preview pane again with previously stored + state in it). + +Command line Mode + These keys are available in all submodes of the command line mode: + command, search, prompt and filtering. + + Down, Up, Left, Right, Home, End and Delete are extended keys and they + are not available if vifm is compiled with --disable-extended-keys + option. + + Esc, Ctrl-C + leave command line mode, cancels input. Cancelled input is + saved into appropriate history and can be recalled later. + + Ctrl-M, Enter + execute command and leave command line mode. + + Ctrl-I, Tab + complete command or its argument. + + Shift-Tab + complete in reverse order. + + Ctrl-_ stop completion and return original input. + + Ctrl-B, Left + move cursor to the left. + + Ctrl-F, Right + move cursor to the right. + + Ctrl-A, Home + go to line beginning. + + Ctrl-E, End + go to line end. + + Alt-B go to the beginning of previous word. + + Alt-F go to the end of next word. + + Ctrl-U remove characters from cursor position till the beginning of + line. + + Ctrl-K remove characters from cursor position till the end of line. + + Ctrl-H, Backspace + remove character before the cursor. + + Ctrl-D, Delete + remove character under the cursor. + + Ctrl-W remove characters from cursor position till the beginning of + previous word. + + Alt-D remove characters from cursor position till the beginning of + next word. + + Ctrl-T swap the order of current and previous character and move cursor + forward or, if cursor past the end of line, swap the order of + two last characters in the line. + + Alt-. insert last part of previous command to current cursor position. + Each next call will insert last part of older command. + + Ctrl-G edit command-line content in external editor. See "Command line + editing" section for details. + + Ctrl-N recall more recent command-line from history. + + Ctrl-P recall older command-line from history. + + Up recall more recent command-line from history, that begins as the + current command-line. + + Down recall older command-line from history, that begins as the + current command-line. + + Ctrl-] trigger abbreviation expansion. + +Pasting special values + The shortcuts listed below insert specified values into current cursor + position. Last key of every shortcut references value that it inserts: + - c - [c]urrent file + - d - [d]irectory path + - e - [e]xtension of a file name + - r - [r]oot part of a file name + - t - [t]ail part of directory path + + - a - [a]utomatic filter + - m - [m]anual filter + - = - local filter, which is bound to "=" in normal mode + + Values related to filelist in current pane are available through Ctrl-X + prefix, while values from the other pane have doubled Ctrl-X key as + their prefix (doubled Ctrl-X is presumably easier to type than + uppercase letters; it's still easy to remap the keys to correspond to + names of similar macros). + + Ctrl-X c + name of the current file of the active pane. + + Ctrl-X d + path to the current directory of the active pane. + + Ctrl-X e + extension of the current file of the active pane. + + Ctrl-X r + name root of current file of the active pane. + + Ctrl-X t + the last component of path to the current directory of the + active pane. + + Ctrl-X Ctrl-X c + name of the current file of the inactive pane. + + Ctrl-X Ctrl-X d + path to the current directory of the inactive pane. + + Ctrl-X Ctrl-X e + extension of the current file of the inactive pane. + + Ctrl-X Ctrl-X r + name root of current file of the inactive pane. + + Ctrl-X Ctrl-X t + the last component of path to the current directory of the + inactive pane. + + + Ctrl-X a + value of automatic filter of the active pane. + + Ctrl-X m + value of manual filter of the active pane. + + Ctrl-X = + value of local filter of the active pane. + + + Ctrl-X / + last pattern from search history. + +Command line editing + vifm provides a facility to edit several kinds of data, that is usually + edited in command-line mode, in external editor (using command + specified by 'vicmd' or 'vixcmd' option). This has at least two + advantages over built-in command-line mode: + - one can use full power of Vim to edit text; + - finding and reusing history entries becomes possible. + + The facility is supported by four input submodes of the command-line: + - command; + - forward search; + - backward search; + - file rename (see description of cw and cW normal mode keys). + + Editing command-line using external editor is activated by the Ctrl-G + shortcut. It's also possible to do almost the same from Normal and + Visual modes using q:, q/ and q? commands. + + Temporary file created for the purpose of editing the line has the + following structure: + + 1. First line, which is either empty or contains text already entered + in command-line. + + 2. 2nd and all other lines with history items starting with the most + recent one. Altering this lines in any way won't change history + items stored by vifm. + + After editing application is finished the first line of the file is + taken as the result of operation, when the application returns zero + exit code. If the application returns an error (see :cquit command in + Vim), all the edits made to the file are ignored, but the initial value + of the first line is saved in appropriate history. + +More Mode + This is the mode that appears when status bar content is so big that it + doesn't fit on the screen. One can identify the mode by "-- More --" + message at the bottom. + + The following keys are handled in this mode: + + + Enter, Ctrl-J, j or Down + scroll one line down. + + Backspace, k or Up + scroll one line up. + + + d scroll one page (half of a screen) down. + + u scroll one page (half of a screen) up. + + + Space, f or PageDown + scroll down a screen. + + b or PageUp + scroll up a screen. + + + G scroll to the bottom. + + g scroll to the top. + + + q, Escape or Ctrl-C + quit the mode. + + : switch to command-line mode. + +Commands + Commands are executed with :command_name<Enter> + + Commented out lines should start with the double quote symbol ("), + which may be preceded by whitespace characters intermixed with colons. + Inline comments can be added at the end of the line after double quote + symbol, only last line of a multi-line command can contain such + comment. Not all commands support inline comments as their syntax + conflicts with names of registers and fields where double quotes are + allowed. + + Most of the commands have two forms: complete and the short one. + Example: + + :noh[lsearch] + + This means the complete command is nohlsearch, and the short one is + noh. + + Most of command-line commands completely reset selection in the current + view. However, there are several exceptions: + + - `:invert s` most likely leaves some files selected; + + - :normal command (when it doesn't leave command-line mode); + + - :if and :else commands don't affect selection on successful + execution. + + '|' can be used to separate commands, so you can give multiple commands + in one line. If you want to use '|' in an argument, precede it with + '\'. + + These commands see '|' as part of their arguments even when it's + escaped: + + :[range]! + :autocmd + :cabbrev + :cmap + :cnoreabbrev + :cnoremap + :command + :dmap + :dnoremap + :filetype + :fileviewer + :filextype + :map + :mmap + :mnoremap + :nmap + :nnoremap + :noremap + :normal + :qmap + :qnoremap + :vmap + :vnoremap + :wincmd + :windo + :winrun + + To be able to use another command after one of these, wrap it with the + :execute command. An example: + + if filetype('.') == 'reg' | execute '!!echo regular file' | endif + + :[count] + + :number + move to the file number. + :12 would move to the 12th file in the list. + :0 move to the top of the list. + :$ move to the bottom of the list. + + :[count]command + The only builtin :[count]command are :[count]d[elete] and + :[count]y[ank]. + + :d3 would delete three files starting at the current file position + moving down. + + :3d would delete one file at the third line in the list. + + :command [args] + + :[range]!program + execute command via shell. Accepts macros. + + :[range]!command & + + same as above, but the command is run in the background using vifm's + means. + + Programs that write to stdout like "ls" create an error message showing + partial output of the command. + + Note the space before ampersand symbol, if you omit it, command will be + run in the background using job control of your shell. + + Accepts macros. + + :!! + + :[range]!!command + same as :!, but pauses before returning. + + :!! repeat the last command. + + :alink + + :[range]alink[!?] + create absolute symbolic links to files in directory of inactive + view. With "?" prompts for destination file names in an editor. + "!" forces overwrite. + + :[range]alink[!] path + create absolute symbolic links to files in directory specified + by the path (absolute or relative to directory of inactive + view). + + :[range]alink[!] name1 name2... + create absolute symbolic links of files in directory of other + view giving each next link a corresponding name from the + argument list. + + :apropos + + :apropos keyword... + create a menu of items returned by the apropos command. + Selecting an item in the menu opens corresponding man page. By + default the command relies on the external "apropos" utility, + which can be customized by altering value of the 'aproposprg' + option. + + :autocmd + + :au[tocmd] {event} {pat} {cmd} + register autocommand for the {event}, which can be: + - DirEnter - performed on entering a directory + Event name is case insensitive. + + {pat} is a comma-separated list of modified globs patterns, + which can contain tilde or environment variables. All paths use + slash ('/') as directory separator. The pattern can start with + a '!', which negates it. Patterns that do not contain slashes + are matched against the last item of the path only (e.g. "dir" + in "/path/dir"). Literal comma can be entered by doubling it. + Two modifications to globs matching are as follows: + - * - never matches a slash (i.e., can signify single + directory level) + - ** - matches any character (i.e., can match path of + arbitrary depth) + + {cmd} is a :command or several of them separated with '|'. + + Examples of patterns: + - conf.d - matches conf.d directory anywhere + - *.d - matches directories ending with ".d" anywhere + - **.git - matches something.git, but not .git anywhere + - **/.git/** - matches /path/.git/objects, but not /path/.git + - **/.git/**/ - matches /path/.git/ only (because of trailing + slash) + - /etc/* - matches /etc/conf.d/, /etc/X11, but not + /etc/X11/fs + - /etc/**/*.d - matches /etc/conf.d, /etc/X11/conf.d, etc. + - /etc/**/* - matches /etc/ itself and any file below it + - /etc/**/** - matches /etc/ itself and any file below it + + :au[tocmd] [{event}] [{pat}] + list those autocommands that match given event-pattern + combination. + {event} and {pat} can be omitted to list all autocommands. To + list any autocommands for specific pattern one can use * + placeholder in place of {event}. + + :au[tocmd]! [{event}] [{pat}] + remove autocommands that match given event-pattern combination. + Syntax is the same as for listing above. + + :apropos + repeat last :apropos command. + + :bmark + + :bmark tag1 [tag2 [tag3...]] + bookmark current directory with specified tags. + + :bmark! path tag1 [tag2 [tag3...]] + same as :bmark, but allows bookmarking specific path instead of + current directory. This is for use in vifmrc and for + bookmarking files. + + Path can contain macros that expand to single path (%c, %C, %d, + %D) or those that can expand to multiple paths, but contain only + one (%f, %F, %rx). The latter is done for convenience on using + the command interactively. Complex macros that include spaces + (e.g. "%c:gs/ /_") should be escaped. + + :bmarks + + :bmarks + display all bookmarks in a menu. + + :bmarks [tag1 [tag2...]] + display menu of bookmarks that include all of the specified + tags. + + :bmgo + + :bmgo [tag1 [tag2...]] + when there are more than one match acts exactly like :bmarks, + otherwise navigates to single match immediately (and fails if + there is no match). + + :cabbrev + + :ca[bbrev] + display menu of command-line mode abbreviations. + + :ca[bbrev] lhs-prefix + display command-line mode abbreviations which left-hand side + starts with specified prefix. + + :ca[bbrev] lhs rhs + register new or overwrites existing abbreviation for command- + line mode. rhs can contain spaces and any special sequences + accepted in rhs of mappings (see "Mappings" section below). + Abbreviations are expanded non-recursively. + + :cnoreabbrev + + :cnorea[bbrev] + display menu of command-line mode abbreviations. + + :cnorea[bbrev] lhs-prefix + display command-line mode abbreviations which left-hand side + starts with specified prefix. + + :cnorea[bbrev] lhs rhs + same as :cabbrev, but mappings in rhs are ignored during + expansion. + + :cd + + :cd or :cd ~ or :cd $HOME + change to home directory. + + :cd - go to the last visited directory. + + :cd ~/dir + change directory to ~/dir. + + :cd /curr/dir /other/dir + change directory of the current pane to /curr/dir and directory + of the other pane to /other/dir. Relative paths are assumed to + be relative to directory of current view. Command won't fail if + one of directories is invalid. All forms of the command accept + macros. + + :cd! /dir + same as :cd /dir /dir. + + :change + + :c[hange] + create a menu window to alter a files properties. + + :chmod + + :[range]chmod + display file attributes (permission on *nix and properties on + Windows) change dialog. + + :[range]chmod[!] arg... + only for *nix + change permissions for files. See `man 1 chmod` for arg format. + "!" means set permissions recursively. + + :chown + + :[range]chown + only for *nix + same as co key in normal mode. + + :[range]chown [user][:][group] + only for *nix + change owner and/or group of files. Operates on directories + recursively. + + :clone + + :[range]clone[!?] + clones files in current directory. With "?" vifm will open vi + to edit file names. "!" forces overwrite. Macros are expanded. + + :[range]clone[!] path + clones files to directory specified with the path (absolute or + relative to current directory). "!" forces overwrite. Macros + are expanded. + + :[range]clone[!] name1 name2... + clones files in current directory giving each next clone a + corresponding name from the argument list. "!" forces + overwrite. Macros are expanded. + + :colorscheme + + :colo[rscheme]? + print current color scheme name on the status bar. + + :colo[rscheme] + display a menu with a list of available color schemes. You can + choose primary color scheme here. It is used for view if no + directory specific colorscheme fits current path. It's also + used to set border color (except view titles) and colors in + menus and dialogs. + + :colo[rscheme] color_scheme_name + change primary color scheme to color_scheme_name. In case of + errors (e.g. some colors are not supported by terminal) either + nothing is changed or color scheme is reset to builtin colors to + ensure that TUI is left in a usable state. + + :colo[rscheme] color_scheme_name directory + associate directory with the color scheme. The directory + argument can be either absolute or relative path when + :colorscheme command is executed from command line, but + mandatory should be an absolute path when the command is + executed in scripts loaded at startup (until vifm is completely + loaded). + + :comclear + + :comc[lear] + remove all user defined commands. + + :command + + :com[mand] + display a menu of user commands. + + :com[mand] beginning + display user defined commands that start with the beginning. + + :com[mand] name action + set a new user command. + Trying to use a reserved command name will result in an error + message. + Use :com[mand]! to overwrite a previously set command. + Unlike vim user commands do not have to start with a capital + letter. User commands are run in a shell by default. To run a + command in the background you must set it as a background + command with & at the end of the commands action (:com rm rm %f + &). Command name cannot contain numbers or special symbols + (except '?' and '!'). + + :com[mand] name /pattern + set search pattern. + + :com[mand] name =pattern + set local filter value. + + :com[mand] name filter{:filter args} + set file name filter (see :filter command description). For + example: + + " display only audio files + :command onlyaudio filter/.+.\(mp3|wav|mp3|flac|ogg|m4a|wma|ape\)$/i + " display everything except audio files + :command noaudio filter!/.+.\(mp3|wav|mp3|flac|ogg|m4a|wma|ape\)$/i + + :com[mand] cmd :commands + set kind of an alias for internal command (like in a shell). + Passes range given to alias to an aliased command, so running + :%cp after + :command cp :copy %a + equals + :%copy + + :compare + + :compare [byname | bysize | bycontents | listall | listunique | + listdups | ofboth | ofone | groupids | grouppaths | skipempty]... + compare files in one or two views according the arguments. The + default is "bycontents listall ofboth grouppaths". See "Compare + views" section below for details. Tree structure is + incompatible with alternative representations, so values of + 'lsview' and 'millerview' options are ignored. + + :copen + + :cope[n] + opens menu with contents of the last displayed menu with + navigation to files by default, if any. + + :copy + + :[range]co[py][!?][ &] + copy files to directory of other view. With "?" prompts for + destination file names in an editor. "!" forces overwrite. + + :[range]co[py][!] path[ &] + copy files to directory specified with the path (absolute or + relative to directory of other view). "!" forces overwrite. + + :[range]co[py][!] name1 name2...[ &] + copy files to directory of other view giving each next file a + corresponding name from the argument list. "!" forces + overwrite. + + :cquit + + :cq[uit][!] + same as :quit, but also aborts directory choosing via + --choose-dir (empties output file) and returns non-zero exit + code. + + :cunabbrev + + :cuna[bbrev] lhs + unregister command-line mode abbreviation by its lhs. + + :cuna[bbrev] rhs + unregister command-line mode abbreviation by its rhs, so that + abbreviation could be removed even after expansion. + + :delbmarks + + :delbmarks + remove bookmarks from current directory. + + :delbmarks tag1 [tag2 [tag3...]] + remove set of bookmarks that include all of the specified tags. + + :delbmarks! + remove all bookmarks. + + :delbmarks! path1 [path2 [path3...]] + remove bookmarks of listed paths. + + :delcommand + + :delc[ommand] user_command + remove user defined command named user_command. + + :delete + + :[range]d[elete][!][ &] + delete selected file or files. "!" means complete removal + (omitting trash). + + :[range]d[elete][!] [reg] [count][ &] + delete selected or [count] files to the reg register. "!" means + complete removal (omitting trash). + + :delmarks + + :delm[arks]! + delete all marks. + + :delm[arks] marks ... + delete specified marks, each argument is treated as a set of + marks. + + :display + + :di[splay] + display menu with registers content. + + :di[splay] list ... + display the contents of the numbered and named registers that + are mentioned in list (for example "az to display "", "a and "z + content). + + :dirs + + :dirs display directory stack. + + :echo + + :ec[ho] [<expr>...] + evaluate each argument as an expression and output them + separated with a space. See help on :let command for a + definition of <expr>. + + :edit + + :[range]e[dit] [file...] + open selected or passed file(s) in editor. Macros and + environment variables are expanded. + + :else + + :el[se] + execute commands until next matching :endif if all other + conditions didn't match. See also help on :if and :endif + commands. + + :elseif + + :elsei[f] {expr1} + execute commands until next matching :elseif, :else or :endif if + conditions of previous :if and :elseif branches were evaluated + to zero. See also help on :if and :endif commands. + + :empty + + :empty permanently remove files from all existing non-empty trash + directories (see "Trash directory" section below). Trash + directories which are specified via %r and/or %u also get + deleted completely. Also remove all operations from undolist + that have no sense after :empty and remove all records about + files located inside directories from all registers. Removal is + performed as background task with undetermined amount of work + and can be checked via :jobs menu. + + :endif + + :en[dif] + end conditional block. See also help on :if and :else commands. + + :execute + + :exe[cute] [<expr>...] + evaluate each argument as an expression and join results + separated by a space to get a single string which is then + executed as a command-line command. See help on :let command + for a definition of <expr>. + + :exit + + :exi[t][!] + same as :quit. + + :file + + :f[ile][ &] + display menu of programs set for the file type of the current + file. " &" forces running associated program in background. + + :f[ile] arg[ &] + run associated command that begins with the arg skipping opening + menu. " &" forces running associated program in background. + + :filetype + + :filet[ype] pattern-list [{descr}]def_prog[ &],[{descr}]prog2[ &],... + associate given program list to each of the patterns. + Associated program (command) is used by handlers of l and Enter + keys (and also in the :file menu). If you need to insert comma + into command just double it (",,"). Space followed by an + ampersand as two last characters of a command means running of + the command in the background. Optional description can be + given to each command to ease understanding of what command will + do in the :file menu. Vifm will try the rest of the programs + for an association when the default isn't found. When program + entry doesn't contain any of vifm macros, name of current file + is appended as if program entry ended with %c macro on *nix and + %"c on Windows. On Windows path to executables containing + spaces can (and should be for correct work with such paths) be + double quoted. See "Patterns" section below for pattern + definition. See also "Automatic FUSE mounts" section below. + Example for zip archives and several actions: + + filetype *.zip,*.jar,*.war,*.ear + \ {Mount with fuse-zip} + \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, + \ {View contents} + \ zip -sf %c | less, + \ {Extract here} + \ tar -xf %c, + + Note that on OS X when `open` is used to call an app, vifm is + unable to check whether that app is actually available. So if + automatic skipping of programs that aren't there is desirable, + `open` should be replaced with an actual command. + + :filet[ype] filename + list (in menu mode) currently registered patterns that match + specified file name. Same as ":filextype filename". + + :filextype + + :filex[type] pattern-list [{ description }] def_program,program2,... + same as :filetype, but this command is ignored if not running in + X. In X :filextype is equal to :filetype. See "Patterns" + section below for pattern definition. See also "Automatic FUSE + mounts" section below. + + For example, consider the following settings (the order might + seem strange, but it's for the demonstration purpose): + + filetype *.html,*.htm + \ {View in lynx} + \ lynx + filextype *.html,*.htm + \ {Open with dwb} + \ dwb %f %i &, + filetype *.html,*.htm + \ {View in links} + \ links + filextype *.html,*.htm + \ {Open with firefox} + \ firefox %f &, + \ {Open with uzbl} + \ uzbl-browser %f %i &, + + If you're using vifm inside a terminal emulator that is running + in graphical environment (when X is used on *nix; always on + Windows), vifm attempts to run application in this order: + + 1. lynx + 2. dwb + 3. links + 4. firefox + 5. uzbl + + If there is no graphical environment (checked presence of + $DISPLAY environment variable on *nix; never happens on + Windows), the list will look like: + + 1. lynx + 2. links + + Just as if all :filextype commands were not there. + + The purpose of such differentiation is to allow comfortable use + of vifm with same settings in desktop environment/through remote + connection (SSH)/in native console. + + Note that on OS X $DISPLAY isn't defined unless you define it, + so :filextype should be used only if you set $DISPLAY in some + way. + + :filext[ype] filename + list (in menu mode) currently registered patterns that match + specified file name. Same as ":filetype filename". + + :fileviewer + + :filev[iewer] pattern-list command1,command2,... + register specified list of commands as viewers for each of the + patterns. Viewer is a command which output is captured and + displayed in one of the panes of vifm after pressing "e" or + running :view command. When the command doesn't contain any of + vifm macros, name of current file is appended as if command + ended with %c macro. Comma escaping and missing commands + processing rules as for :filetype apply to this command. See + "Patterns" section below for pattern definition. + + Example for zip archives: + + fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c, echo "No zip to preview:" + + :filev[iewer] filename + list (in menu mode) currently registered patterns that match + specified filename. + + :filter + + :filter[!] {pattern} + filter files matching the pattern out of directory listings. + '!' controls state of filter inversion after updating filter + value (see also 'cpoptions' description). Filter is matched + case sensitively on *nix and case insensitively on Windows. See + "File Filters" and "Patterns" sections. + + Example: + + " filter all files ending in .o from the filelist. + :filter /.o$/ + + + :filter[!] {empty-pattern} + same as above, but use last search pattern as pattern value. + + Example: + + :filter //I + + + :filter + reset filter (set it to an empty string) and show all files. + + :filter! + same as :invert. + + :filter? + show information on local, name and auto filters. + + :find + + :[range]fin[d] pattern + display results of find command in the menu. Searches among + selected files if any. Accepts macros. By default the command + relies on the external "find" utility, which can be customized + by altering value of the 'findprg' option. + + :[range]fin[d] -opt... + same as :find above, but user defines all find arguments. + Searches among selected files if any. + + :[range]fin[d] path -opt... + same as :find above, but user defines all find arguments. + Ignores selection and range. + + :[range]fin[d] + repeat last :find command. + + :finish + + :fini[sh] + stop sourcing a script. Can only be used in a vifm script file. + This is a quick way to skip the rest of the file. + + :goto + + :go[to] + change directory if necessary and put specified path under the + cursor. The path should be existing non-root path. Macros and + environment variables are expanded. + + :grep + + :[range]gr[ep][!] pattern + will show results of grep command in the menu. Add "!" to + request inversion of search (look for lines that do not match + pattern). Searches among selected files if any and no range + given. Ignores binary files by default. By default the command + relies on the external "grep" utility, which can be customized + by altering value of the 'grepprg' option. + + :[range]gr[ep][!] -opt... + same as :grep above, but user defines all grep arguments, which + are not escaped. Searches among selected files if any. + + :[range]gr[ep][!] + repeats last :grep command. "!" of this command inverts "!" in + repeated command. + + :help + + :h[elp] + show the help file. + + :h[elp] argument + is the same as using ':h argument' in vim. Use vifm-<something> + to get help on vifm (tab completion works). This form of the + command doesn't work when 'vimhelp' option is off. + + :highlight + + :hi[ghlight] + display information about all highlight groups active at the + moment. + + :hi[ghlight] clear + reset all highlighting to builtin defaults and removed all + filename-specific rules. + + :hi[ghlight] clear ( {pat1,pat2,...} | /regexp/ ) + removes specified rule. + + :hi[ghlight] ( group-name | {pat1,pat2,...} | /regexp/ ) + display information on given highlight group or file name + pattern of color scheme used in the active view. + + :hi[ghlight] ( group-name | {pat1,pat2,...} | /regexp/[iI] ) + cterm=style | ctermfg=color | ctermbg=color + set style (cterm), foreground (ctermfg) or/and background + (ctermbg) parameters of highlight group or file name pattern for + color scheme used in the active view. + + All style values as well as color names are case insensitive. + + Available style values (some of them can be combined): + - bold + - underline + - reverse or inverse + - standout + - italic (on unsupported systems becomes reverse) + - none + + Available group-name values: + - Win - color of all windows (views, dialogs, menus) and default color + for their content (e.g. regular files in views) + - AuxWin - color of auxiliary areas of windows + - Border - color of vertical parts of the border + - TabLine - tab line color + - TabLineSel - color of the tip of selected tab + - TopLineSel - top line color of the current pane + - TopLine - top line color of the other pane + - CmdLine - the command line/status bar color + - ErrorMsg - color of error messages in the status bar + - StatusLine - color of the line above the status bar + - JobLine - color of job line that appears above the status line + - WildMenu - color of the wild menu items + - SuggestBox - color of key suggestion box + - CurrLine - line at cursor position in active view + - OtherLine - line at cursor position in inactive view + - Selected - color of selected files + - Directory - color of directories + - Link - color of symbolic links in the views + - BrokenLink - color of broken symbolic links + - Socket - color of sockets + - Device - color of block and character devices + - Executable - color of executable files + - Fifo - color of fifo pipes + - CmpMismatch - color of mismatched files in side-by-side comparison + by path + - User1..User9 - 9 colors which can be used via %* 'statusline' macro + + Available colors: + - -1 or default or none - default or transparent + - black and lightblack + - red and lightred + - green and lightgreen + - yellow and lightyellow + - blue and lightblue + - magenta and lightmagenta + - cyan and lightcyan + - white and lightwhite + - 0-255 - corresponding colors from 256-color palette + + Light versions of colors are regular colors with bold attribute set. + So order of arguments of :highlight command is important and it's + better to put "cterm" in front of others to prevent it from overwriting + attributes set by "ctermfg" or "ctermbg" arguments. + + For convenience of color scheme authors xterm-like names for 256 color + palette is also supported. The mapping is taken from + http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim + Duplicated entries were altered by adding an underscore followed by + numerical suffix. + + 0 Black 86 Aquamarine1 172 Orange3 + 1 Red 87 DarkSlateGray2 173 LightSalmon3_2 + 2 Green 88 DarkRed_2 174 LightPink3 + 3 Yellow 89 DeepPink4_2 175 Pink3 + 4 Blue 90 DarkMagenta 176 Plum3 + 5 Magenta 91 DarkMagenta_2 177 Violet + 6 Cyan 92 DarkViolet 178 Gold3_2 + 7 White 93 Purple 179 LightGoldenrod3 + 8 LightBlack 94 Orange4_2 180 Tan + 9 LightRed 95 LightPink4 181 MistyRose3 + 10 LightGreen 96 Plum4 182 Thistle3 + 11 LightYellow 97 MediumPurple3 183 Plum2 + 12 LightBlue 98 MediumPurple3_2 184 Yellow3_2 + 13 LightMagenta 99 SlateBlue1 185 Khaki3 + 14 LightCyan 100 Yellow4 186 LightGoldenrod2 + 15 LightWhite 101 Wheat4 187 LightYellow3 + 16 Grey0 102 Grey53 188 Grey84 + 17 NavyBlue 103 LightSlateGrey 189 LightSteelBlue1 + 18 DarkBlue 104 MediumPurple 190 Yellow2 + 19 Blue3 105 LightSlateBlue 191 DarkOliveGreen1 + 20 Blue3_2 106 Yellow4_2 192 + DarkOliveGreen1_2 + 21 Blue1 107 DarkOliveGreen3 193 DarkSeaGreen1_2 + 22 DarkGreen 108 DarkSeaGreen 194 Honeydew2 + 23 DeepSkyBlue4 109 LightSkyBlue3 195 LightCyan1 + 24 DeepSkyBlue4_2 110 LightSkyBlue3_2 196 Red1 + 25 DeepSkyBlue4_3 111 SkyBlue2 197 DeepPink2 + 26 DodgerBlue3 112 Chartreuse2_2 198 DeepPink1 + 27 DodgerBlue2 113 DarkOliveGreen3_2 199 DeepPink1_2 + 28 Green4 114 PaleGreen3_2 200 Magenta2_2 + 29 SpringGreen4 115 DarkSeaGreen3 201 Magenta1 + 30 Turquoise4 116 DarkSlateGray3 202 OrangeRed1 + 31 DeepSkyBlue3 117 SkyBlue1 203 IndianRed1 + 32 DeepSkyBlue3_2 118 Chartreuse1 204 IndianRed1_2 + 33 DodgerBlue1 119 LightGreen_2 205 HotPink + 34 Green3 120 LightGreen_3 206 HotPink_2 + 35 SpringGreen3 121 PaleGreen1 207 MediumOrchid1_2 + 36 DarkCyan 122 Aquamarine1_2 208 DarkOrange + 37 LightSeaGreen 123 DarkSlateGray1 209 Salmon1 + 38 DeepSkyBlue2 124 Red3 210 LightCoral + 39 DeepSkyBlue1 125 DeepPink4_3 211 PaleVioletRed1 + 40 Green3_2 126 MediumVioletRed 212 Orchid2 + 41 SpringGreen3_2 127 Magenta3 213 Orchid1 + 42 SpringGreen2 128 DarkViolet_2 214 Orange1 + 43 Cyan3 129 Purple_2 215 SandyBrown + 44 DarkTurquoise 130 DarkOrange3 216 LightSalmon1 + 45 Turquoise2 131 IndianRed 217 LightPink1 + 46 Green1 132 HotPink3 218 Pink1 + 47 SpringGreen2_2 133 MediumOrchid3 219 Plum1 + 48 SpringGreen1 134 MediumOrchid 220 Gold1 + 49 MediumSpringGreen 135 MediumPurple2 221 + LightGoldenrod2_2 + 50 Cyan2 136 DarkGoldenrod 222 + LightGoldenrod2_3 + 51 Cyan1 137 LightSalmon3 223 NavajoWhite1 + 52 DarkRed 138 RosyBrown 224 MistyRose1 + 53 DeepPink4 139 Grey63 225 Thistle1 + 54 Purple4 140 MediumPurple2_2 226 Yellow1 + 55 Purple4_2 141 MediumPurple1 227 LightGoldenrod1 + 56 Purple3 142 Gold3 228 Khaki1 + 57 BlueViolet 143 DarkKhaki 229 Wheat1 + 58 Orange4 144 NavajoWhite3 230 Cornsilk1 + 59 Grey37 145 Grey69 231 Grey100 + 60 MediumPurple4 146 LightSteelBlue3 232 Grey3 + 61 SlateBlue3 147 LightSteelBlue 233 Grey7 + 62 SlateBlue3_2 148 Yellow3 234 Grey11 + 63 RoyalBlue1 149 DarkOliveGreen3_3 235 Grey15 + 64 Chartreuse4 150 DarkSeaGreen3_2 236 Grey19 + 65 DarkSeaGreen4 151 DarkSeaGreen2 237 Grey23 + 66 PaleTurquoise4 152 LightCyan3 238 Grey27 + 67 SteelBlue 153 LightSkyBlue1 239 Grey30 + 68 SteelBlue3 154 GreenYellow 240 Grey35 + 69 CornflowerBlue 155 DarkOliveGreen2 241 Grey39 + 70 Chartreuse3 156 PaleGreen1_2 242 Grey42 + 71 DarkSeaGreen4_2 157 DarkSeaGreen2_2 243 Grey46 + 72 CadetBlue 158 DarkSeaGreen1 244 Grey50 + 73 CadetBlue_2 159 PaleTurquoise1 245 Grey54 + 74 SkyBlue3 160 Red3_2 246 Grey58 + 75 SteelBlue1 161 DeepPink3 247 Grey62 + 76 Chartreuse3_2 162 DeepPink3_2 248 Grey66 + 77 PaleGreen3 163 Magenta3_2 249 Grey70 + 78 SeaGreen3 164 Magenta3_3 250 Grey74 + 79 Aquamarine3 165 Magenta2 251 Grey78 + 80 MediumTurquoise 166 DarkOrange3_2 252 Grey82 + 81 SteelBlue1_2 167 IndianRed_2 253 Grey85 + 82 Chartreuse2 168 HotPink3_2 254 Grey89 + 83 SeaGreen2 169 HotPink2 255 Grey93 + 84 SeaGreen1 170 Orchid + 85 SeaGreen1_2 171 MediumOrchid1 + + There are two colors (foreground and background) and only one bold + attribute. Thus single bold attribute affects both colors when + "reverse" attribute is used in vifm run inside terminal emulator. At + the same time linux native console can handle boldness of foreground + and background colors independently, but for consistency with terminal + emulators this is available only implicitly by using light versions of + colors. This behaviour might be changed in the future. + + Although vifm supports 256 colors in a sense they are supported by UI + drawing library, whether you will be able to use all of them highly + depends on your terminal. To set up terminal properly, make sure that + $TERM in the environment you run vifm is set to name of 256-color + terminal (on *nixes it can also be set via X resources), e.g. + xterm-256color. One can find list of available terminal names by + listing /usr/lib/terminfo/. Number of colors supported by terminal + with current settings can be checked via "tput colors" command. + + Here is the hierarchy of highlight groups, which you need to know for + using transparency: + JobLine + SuggestBox + StatusLine + WildMenu + User1..User9 + Border + CmdLine + ErrorMsg + Win + AuxWin + File name specific highlights + Directory + Link + BrokenLink + Socket + Device + Fifo + Executable + Selected + CurrLine + OtherLine + TopLine + TopLineSel + TabLine + TabLineSel + + "none" means default terminal color for highlight groups at the first + level of the hierarchy and transparency for all others. + + Here file name specific highlights mean those configured via globs ({}) + or regular expressions (//). At most one of them is applied per file + entry, namely the first that matches file name, hence order of + :highlight commands might be important in certain cases. + + :history + + :his[tory] + creates a pop-up menu of directories visited. + + :his[tory] x + x can be: + d[ir] or . show directory history. + c[md] or : show command line history. + s[earch] or / show search history and search forward on l key. + f[search] or / show search history and search forward on l key. + b[search] or ? show search history and search backward on l key. + i[nput] or @ show prompt history (e.g. on one file renaming). + fi[lter] or = show filter history (see description of the "=" + normal mode command). + + :histnext + + :histnext + same as <c-i>. The main use case for this command is to work + around the common pain point of <tab> and <c-i> being the same + ASCII character: one could alter the terminal emulator settings + to emit, for example, the `F1` keycode when Ctrl-I is pressed, + then `:noremap <f1> :histnext<cr>` in vifm, add "t" flag to the + 'cpoptions', and thus have both <c-i> and <tab> working as + expected. + + :histprev + + :histprev + same as <c-o>. + + :if + + :if {expr1} + starts conditional block. Commands are executed until next + matching :elseif, :else or :endif command if {expr1} evaluates + to non-zero, otherwise they are ignored. See also help on :else + and :endif commands. + + Example: + + if $TERM == 'screen.linux' + highlight CurrLine ctermfg=lightwhite ctermbg=lightblack + elseif $TERM == 'tmux' + highlight CurrLine cterm=reverse ctermfg=black ctermbg=white + else + highlight CurrLine cterm=bold,reverse ctermfg=black ctermbg=white + endif + + :invert + + :invert [f] + invert file name filter. + + :invert? [f] + show current filter state. + + :invert s + invert selection. + + :invert o + invert sorting order of the primary sorting key. + + :invert? o + show sorting order of the primary sorting key. + + :jobs + + :jobs shows menu of current backgrounded processes. + + :let + + :let $ENV_VAR = <expr> + sets environment variable. Warning: setting environment + variable to an empty string on Windows removes it. + + :let $ENV_VAR .= <expr> + append value to environment variable. + + :let &[l:|g:]opt = <expr> + sets option value. + + :let &[l:|g:]opt .= <expr> + append value to string option. + + :let &[l:|g:]opt += <expr> + increasing option value, adding sub-values. + + :let &[l:|g:]opt -= <expr> + decreasing option value, removing sub-values. + + Where <expr> could be a single-quoted string, double-quoted string, an + environment variable, function call or a concatanation of any of them + in any order using the '.' operator. Any whitespace is ignored. + + :locate + + :locate filename + use "locate" command to create a menu of filenames. Selecting a + file from the menu will reload the current file list in vifm to + show the selected file. By default the command relies on the + external "locate" utility (it's assumed that its database is + already built), which can be customized by altering value of the + 'locateprg' option. + + :locate + repeats last :locate command. + + :ls + + :ls lists windows of active terminal multiplexer (only when terminal + multiplexer is used). This is achieved by issuing proper + command for active terminal multiplexer, thus the list is not + handled by vifm. + + :lstrash + + :lstrash + displays a menu with list of files in trash. Each element of + the list is original path of a deleted file, thus the list can + contain duplicates. + + :mark + + :[range]ma[rk][?] x [/full/path] [filename] + Set mark x (a-zA-Z0-9) at /full/path and filename. By default + current directory is being used. If no filename was given and + /full/path is current directory then last file in [range] is + used. Using of macros is allowed. Question mark will stop + command from overwriting existing marks. + + :marks + + :marks create a pop-up menu of marks. + + :marks list ... + display the contents of the marks that are mentioned in list. + + :media + + :media only for *nix + display media management menu. See also 'mediaprg' option. + + :messages + + :mes[sages] + shows previously given messages (up to 50). + + :mkdir + + :[line]mkdir[!] dir ... + create directories at specified paths. The [line] can be used + to pick node in a tree-view. "!" means make parent directories + as needed. Macros are expanded. + + :move + + :[range]m[ove][!?][ &] + move files to directory of other view. With "?" prompts for + destination file names in an editor. "!" forces overwrite. + + :[range]m[ove][!] path[ &] + move files to directory specified with the path (absolute or + relative to directory of other view). "!" forces overwrite. + + :[range]m[ove][!] name1 name2...[ &] + move files to directory of other view giving each next file a + corresponding name from the argument list. "!" forces + overwrite. + + :nohlsearch + + :noh[lsearch] + clear selection in current pane. + + :normal + + :norm[al][!] commands + execute normal mode commands. If "!" is used, user defined + mappings are ignored. Unfinished last command is aborted as if + <esc> or <c-c> was typed. A ":" should be completed as well. + Commands can't start with a space, so put a count of 1 (one) + before it. + + :only + + :on[ly] + switch to a one window view. + + :popd + + :popd remove pane directories from stack. + + :pushd + + :pushd[!] /curr/dir [/other/dir] + add pane directories to stack and process arguments like :cd + command. + + :pushd exchange the top two items of the directory stack. + + :put + + :[line]pu[t][!] [reg] [ &] + puts files from specified register (" by default) into current + directory. The [line] can be used to pick node in a tree-view. + "!" moves files "!" moves files from their original location + instead of copying them. During this operation no confirmation + dialogs will be shown, all checks are performed beforehand. + + :pwd + + :pw[d] show the present working directory. + + :qall + + :qa[ll][!] + exit vifm (add ! to skip saving changes and checking for active + backgrounded commands). + + :quit + + :q[uit][!] + if there is more than one tab, close the current one, otherwise + exit vifm (add ! to skip saving changes and checking for active + backgrounded commands). + + :redraw + + :redr[aw] + redraw the screen immediately. + + :registers + + :reg[isters] + display menu with registers content. + + :reg[isters] list ... + display the contents of the numbered and named registers that + are mentioned in list (for example "az to display "", "a and "z + content). + + :regular + + :regular + + switch to regular view leaving custom view. + :rename + + :[range]rename[!] + rename files using vi to edit names. ! means go recursively + through directories. + + :[range]rename name1 name2... + rename each of selected files to a corresponding name. + + :restart + + :restart + free a lot of things (histories, commands, etc.), reread + vifminfo and vifmrc files and run startup commands passed in the + argument list, thus losing all unsaved changes (e.g. recent + history or keys mapped in current session). + + :restore + + :[range]restore + restore file from trash directory, doesn't work outside one of + trash directories. See "Trash directory" section below. + + :rlink + + :[range]rlink[!?] + create relative symbolic links to files in directory of other + view. With "?" prompts for destination file names in an editor. + "!" forces overwrite. + + :[range]rlink[!] path + create relative symbolic links of files in directory specified + with the path (absolute or relative to directory of other view). + "!" forces overwrite. + + :[range]rlink[!] name1 name2... + create relative symbolic links of files in directory of other + view giving each next link a corresponding name from the + argument list. "!" forces overwrite. + + :screen + + :screen + toggle whether to use the terminal multiplexer or not. + A terminal multiplexer uses pseudo terminals to allow multiple + windows to be used in the console or in a single xterm. + Starting vifm from terminal multiplexer with appropriate support + turned on will cause vifm to open a new terminal multiplexer + window for each new file edited or program launched from vifm. + This requires screen version 3.9.9 or newer for the screen -X + argument or tmux (1.8 version or newer is recommended). + + :screen! + enable integration with terminal multiplexers. + + :screen? + display whether integration with terminal multiplexers is + enabled. + + Note: the command is called screen for historical reasons (when tmux + wasn't yet supported) and might be changed in future releases, or get + an alias. + + :select + + :[range]select + select files in the given range (current file if no range is + given). + + :select {pattern} + select files that match specified pattern. Possible {pattern} + forms are described in "Patterns" section below. Trailing slash + for directories is taken into account, so `:select! */ | invert + s` selects only files. + + :select //[iI] + same as item above, but reuses last search pattern. + + :select !{external command} + select files from the list supplied by external command. Files + are matched by full paths, relative paths are converted to + absolute ones beforehand. + + :[range]select! [{pattern}] + same as above, but resets previously selected items before + proceeding. + + :set + + :se[t] display all options that differ from their default value. + + :se[t] all + display all options. + + :se[t] opt1=val1 opt2='val2' opt3="val3" ... + sets given options. For local options both values are set. + You can use following syntax: + - for all options - option, option? and option& + - for boolean options - nooption, invoption and option! + - for integer options - option=x, option+=x and option-=x + - for string options - option=x and option+=x + - for string list options - option=x, option+=x and option-=x + - for enumeration options - option=x, option+=x and option-=x + - for set options - option=x, option+=x and option-=x + - for charset options - option=x, option+=x, option-=x and + option^=x + + the meaning: + - option - turn option on (for boolean) or print its value (for + all others) + - nooption - turn option off + - invoption - invert option state + - option! - invert option state + - option? - print option value + - option& - reset option to its default value + - option=x or option:x - set option to x + - option+=x - add/append x to option + - option-=x - remove (or subtract) x from option + - option^=x - toggle x presence among values of the option + + Option name can be prepended and appended by any number of + whitespace characters. + + :setglobal + + :setg[lobal] + display all global options that differ from their default value. + + :setg[lobal] all + display all global options. + + :setg[lobal] opt1=val1 opt2='val2' opt3="val3" ... + same as :set, but changes/prints only global options or global + values of local options. Changes to the latter might be not + visible until directory is changed. + + :setlocal + + :setl[ocal] + display all local options that differ from their default value. + + :setl[ocal] all + display all local options. + + :setl[ocal] opt1=val1 opt2='val2' opt3="val3" ... + same as :set, but changes/prints only local values of local + options. + + :shell + + :sh[ell][!] + start a shell in current directory. "!" suppresses spawning + dedicated window of terminal multiplexer for a shell. To make + vifm adaptive to environment it uses $SHELL if it's defined, + otherwise 'shell' value is used. + + + :siblnext + + :[count]siblnext[!] + + change directory to [count]th next sibling directory after + current path using value of global sort option of current pane. + "!" enables wrapping. + + For example, say, you're at /boot and root listing starts like + this: + + bin/ + boot/ + dev/ + ... + + Issuing :siblnext will navigate to /dev. + + + :siblprev + + :[count]siblprev[!] + same as :siblnext, but in the opposite direction. + + :sort + + :sor[t] + display dialog with different sorting methods, when one can + select primary sorting key. When 'viewcolumns' options is empty + and 'lsview' is off, changing primary sorting key will also + affect view look (in particular the second column of the view + will be changed). + + :source + + :so[urce] file + read command-line commands from the file. + + :split + + :sp[lit] + switch to a two window horizontal view. + + :sp[lit]! + toggle horizontal window splitting. + + :sp[lit] path + splits the window horizontally to show both file directories. + Also changes other pane to path (absolute or relative to current + directory of active pane). + + :substitute + + :[range]s[ubstitute]/pattern/string/[flags] + for each file in range replace a match of pattern with string. + + String can contain \0...\9 to link to capture groups (\0 - all match, + \1 - first group, etc.). + + Pattern is stored in search history. + + Available flags: + + - i - ignore case (the 'ignorecase' and 'smartcase' options are not + used) + + - I - don't ignore case (the 'ignorecase' and 'smartcase' options are + not used) + + - g - substitute all matches in each file name (each g toggles this) + + :[range]s[ubstitute]/pattern + substitute pattern with an empty string. + + :[range]s[ubstitute]//string/[flags] + use last pattern from search history. + + :[range]s[ubstitute] + repeat previous substitution command. + + :sync + + :sync [relative path] + change the other pane to the current pane directory or to some + path relative to the current directory. Using macros is + allowed. + + :sync! change the other pane to the current pane directory and + synchronize cursor position. If current pane displays custom + list of files, position before entering it is used (current one + might not make any sense). + + + :sync! [location | cursorpos | localopts | filters | filelist | tree | + all]... + change enumerated properties of the other pane to match + corresponding properties of the current pane. Arguments have + the following meanings: + + - location - current directory of the pane; + + - cursorpos - cursor position (doesn't make sense without + "location"); + + - localopts - all local options; + + - filters - all filters; + + - filelist - list of files for custom view (implies + "location"); + + - tree - tree structure for tree view (implies "location"); + + - all - all of the above. + + :tabclose + + :tabc[lose] + close current tab, unless it's the only one open at current + scope. + + :tabmove + + :tabm[ove] [N] + without the argument or with `$` as the argument, current tab + becomes the last tab. With the argument, current tab is moved + after the tab with the specified number. Argument of `0` moves + current tab to the first position. + + :tabname + + :tabname [name] + set, update or reset (when no argument is provided) name of the + current tab. + + :tabnew + + :tabnew [path] + create new tab. Accepts optional path for the new tab. Macros + and environment variables are expanded. + + :tabnext + + :tabn[ext] + switch to the next tab (wrapping around). + + :tabn[ext] {n} + go to the tab number {n}. Tab numeration starts with 1. + + :tabprevious + + :tabp[revious] + switch to the previous tab (wrapping around). + + :tabp[revious] {n} + go to the {n}-th previous tab. Note that :tabnext handles its + argument differently. + + :touch + + :[line]touch file... + create files at specified paths. Aborts on errors. Doesn't + update time of existing files. The [line] can be used to pick + node in a tree-view. Macros are expanded. + + :tr + + :[range]tr/pattern/string/ + for each file in range transliterate the characters which appear + in pattern to the corresponding character in string. When + string is shorter than pattern, it's padded with its last + character. + + :trashes + + :trashes + lists all valid trash directories in a menu. Only non-empty and + writable trash directories are shown. This is exactly the list + of directories that are cleared when :empty command is executed. + + :trashes? + same as :trashes, but also displays size of each trash + directory. + + :tree + + :tree turn pane into tree view with current directory as its root. + The tree view is implemented on top of a custom view, but is + automatically kept in sync with file system state and considers + all the filters. Thus the structure corresponds to what one + would see on visiting the directories manually. As a special + case for trees built out of custom view file-system tracking + isn't performed. + + To leave tree view go up from its root or use gh at any level of + the tree. Any command that changes directory will also do, in + particular, `:cd ..`. + + Tree structure is incompatible with alternative representations, + so values of 'lsview' and 'millerview' options are ignored. + + :tree! toggle current view in and out of tree mode. + + :undolist + + :undol[ist] + display list of latest changes. Use "!" to see actual commands. + + :unlet + + :unl[et][!] $ENV_VAR1 $ENV_VAR2 ... + remove environment variables. Add ! to omit displaying of + warnings about nonexistent variables. + + :unselect + + :[range]unselect + unselect files in the given range (current file if no range is + given). + + :unselect {pattern} + unselect files that match specified pattern. Possible {pattern} + forms are described in "Patterns" section below. Trailing slash + for directories is taken into account, so `:unselect */` + unselects directories. + + :unselect !{external command} + unselect files from the list supplied by external command. + Files are matched by full paths, relative paths are converted to + absolute ones beforehand. + + :unselect //[iI] + same as item above, but reuses last search pattern. + + :version + + :ve[rsion] + show menu with version information. + + :vifm + + :vifm same as :version. + + :view + + :vie[w] + toggle on and off the quick file view. See also 'quickview' + option. + + :vie[w]! + turn on quick file view if it's off. + + :volumes + + :volumes + only for MS-Windows + display menu with volume list. Hitting l (or Enter) key opens + appropriate volume in the current pane. + + :vsplit + + :vs[plit] + switch to a two window vertical view. + + :vs[plit]! + toggle window vertical splitting. + + :vs[plit] path + split the window vertically to show both file directories. And + changes other pane to path (absolute or relative to current + directory of active pane). + + :wincmd + + :[count]winc[md] {arg} + same as running Ctrl-W [count] {arg}. + + :windo + + :windo [command...] + execute command for each pane (same as :winrun % command). + + :winrun + + :winrun type [command...] + execute command for pane(s), which is determined by type + argument: + - ^ - top-left pane + - $ - bottom-right pane + - % - all panes + - . - current pane + - , - other pane + + :write + + :w[rite] + write vifminfo file. + + :wq + + :wq[!] same as :quit, but ! only disables check of backgrounded + commands. :wqall + + :wqa[ll][!] + same as :qall, but ! only disables check of backgrounded + commands. + + :xall + + :xa[ll][!] + same as :qall. + + :xit + + :x[it][!] + same as :quit. + + :yank + + :[range]y[ank] [reg] [count] + will yank files to the reg register. + + :map lhs rhs + + :map lhs rhs + map lhs key sequence to rhs in normal and visual modes. + + :map! lhs rhs + map lhs key sequence to rhs in command line mode. + + + :cmap :dmap :mmap :nmap :qmap + :vmap + + :cm[ap] lhs rhs + map lhs to rhs in command line mode. + + :dm[ap] lhs rhs + map lhs to rhs in dialog modes. + + :mm[ap] lhs rhs + map lhs to rhs in menu mode. + + :nm[ap] lhs rhs + map lhs to rhs in normal mode. + + :qm[ap] lhs rhs + map lhs to rhs in view mode. + + :vm[ap] lhs rhs + map lhs to rhs in visual mode. + + + :*map + + :cm[ap] + list all maps in command line mode. + + :dm[ap] + list all maps in dialog modes. + + :mm[ap] + list all maps in menu mode. + + :nm[ap] + list all maps in normal mode. + + :qm[ap] + list all maps in view mode. + + :vm[ap] + list all maps in visual mode. + + :*map beginning + + :cm[ap] beginning + list all maps in command line mode that start with the + beginning. + + :dm[ap] beginning + list all maps in dialog modes that start with the beginning. + + :mm[ap] beginning + list all maps in menu mode that start with the beginning. + + :nm[ap] beginning + list all maps in normal mode that start with the beginning. + + :qm[ap] beginning + list all maps in view mode that start with the beginning. + + :vm[ap] beginning + list all maps in visual mode that start with the beginning. + + :noremap + + :no[remap] lhs rhs + map the key sequence lhs to rhs for normal and visual modes, but + disallow mapping of rhs. + + :no[remap]! lhs rhs + map the key sequence lhs to rhs for command line mode, but + disallow mapping of rhs. + + :cnoremap :dnoremap :mnoremap :nnoremap :qnoremap + :vnoremap + + :cno[remap] lhs rhs + map the key sequence lhs to rhs for command line mode, but + disallow mapping of rhs. + + :dn[oremap] lhs rhs + map the key sequence lhs to rhs for dialog modes, but disallow + mapping of rhs. + + :mn[oremap] lhs rhs + map the key sequence lhs to rhs for menu mode, but disallow + mapping of rhs. + + :nn[oremap] lhs rhs + map the key sequence lhs to rhs for normal mode, but disallow + mapping of rhs. + + :qn[oremap] lhs rhs + map the key sequence lhs to rhs for view mode, but disallow + mapping of rhs. + + :vn[oremap] lhs rhs + map the key sequence lhs to rhs for visual mode, but disallow + mapping of rhs. + + :unmap + + :unm[ap] lhs + remove the mapping of lhs from normal and visual modes. + + :unm[ap]! lhs + remove the mapping of lhs from command line mode. + + :cunmap :dunmap :munmap :nunmap :qunmap + :vunmap + + :cu[nmap] lhs + remove the mapping of lhs from command line mode. + + :du[nmap] lhs + remove the mapping of lhs from dialog modes. + + :mu[nmap] lhs + remove the mapping of lhs from menu mode. + + :nun[map] lhs + remove the mapping of lhs from normal mode. + + :qun[map] lhs + remove the mapping of lhs from view mode. + + :vu[nmap] lhs + remove the mapping of lhs from visual mode. + +Ranges + The ranges implemented include: + 2,3 - from second to third file in the list (including it) + % - the entire directory. + . - the current position in the filelist. + $ - the end of the filelist. + 't - the mark position t. + + Examples: + + :%delete + + would delete all files in the directory. + + :2,4delete + + would delete the files in the list positions 2 through 4. + + :.,$delete + + would delete the files from the current position to the end of the + filelist. + + :3delete4 + + would delete the files in the list positions 3, 4, 5, 6. + + If a backward range is given :4,2delete - an query message is given and + user can chose what to do next. + + The builtin commands that accept a range are :d[elete] and :y[ank]. + +Command macros + The command macros may be used in user commands. + + %a User arguments. When user arguments contain macros, they are + expanded before preforming substitution of %a. + + %c %"c The current file under the cursor. + + %C %"C The current file under the cursor in the other directory. + + %f %"f All of the selected files. + + %F %"F All of the selected files in the other directory list. + + %b %"b Same as %f %F. + + %d %"d Full path to current directory. + + %D %"D Full path to other file list directory. + + %rx %"rx + Full paths to files in the register {x}. In case of invalid + symbol in place of {x}, it's processed with the rest of the line + and default register is used. + + %m Show command output in a menu. + + %M Same as %m, but l (or Enter) key is handled like for :locate and + :find commands. + + %u Process command output as list of paths and compose custom view + out of it. + + %U Same as %u, but implies less list updates inside vifm, which is + absence of sorting at the moment. + + %Iu same as %u, but gives up terminal before running external + command. + + %IU same as %U, but gives up terminal before running external + command. + + %S Show command output in the status bar. + + %q redirect command output to quick view, which is activated if + disabled. + + %s Execute command in split window of active terminal multiplexer + (ignored if not running inside one). + + %n Forbid using of terminal multiplexer to run the command. + + %i Completely ignore command output. + + + %pc Marks end of the main command and beginning of the clear command + for graphical preview, which is invoked on closing preview of a + file. + + The following dimensions and coordinates are in characters: + + %px x coordinate of top-left corner of preview area. + + %py y coordinate of top-left corner of preview area. + + %pw width of preview area. + + %ph height of preview area. + + + Use %% if you need to put a percent sign in your command. + + Note that %m, %M, %s, %S, %i, %u and %U macros are mutually exclusive. + Only the last one of them on the command will take effect. + + You can use file name modifiers after %c, %C, %f, %F, %b, %d and %D + macros. Supported modifiers are: + + - :p - full path + + - :u - UNC name of path (e.g. "\\server" in + "\\server\share"), Windows only. Expands to current computer name + for not UNC paths. + + - :~ - relative to the home directory + + - :. - relative to current directory + + - :h - head of the file name + + - :t - tail of the file name + + - :r - root of the file name (without last extension) + + - :e - extension of the file name (last one) + + - :s?pat?sub? - substitute the first occurrence of pat with sub. + You can use any character for '?', but it must not occur in pat or + sub. + + - :gs?pat?sub? - like :s, but substitutes all occurrences of pat with + sub. + + See ':h filename-modifiers' in Vim's documentation for the detailed + description. + + Using %x means expand corresponding macro escaping all characters that + have special meaning. And %"x means using of double quotes and escape + only backslash and double quote characters, which is more useful on + Windows systems. + + Position and quantity (if there is any) of %m, %M, %S or %s macros in + the command is unimportant. All their occurrences are removed from the + resulting command. + + %c and %f macros are expanded to file names only, when %C and %F are + expanded to full paths. %f and %F follow this in %b too. + + :com move mv %f %D + set the :move command to move all of the files selected in the + current directory to the other directory. + + The %a macro is replaced with any arguments given to an alias command. + All arguments are considered optional. + :com lsl !!ls -l %a - set the lsl command to execute ls -l with + or without an argument. + + :lsl<Enter> + will list the directory contents of the current directory. + + :lsl filename<Enter> + will list only the given filename. + + The macros can also be used in directly executing commands. ":!mv %f + %D" would move the current directory selected files to the other + directory. + + Appending & to the end of a command causes it to be executed in the + background. Typically you want to run two kinds of external commands + in the background: + + - GUI applications that doesn't fork thus block vifm (:!sxiv %f &); + + - console tools that do not work with terminal (:!mv %f %D &). + + You don't want to run terminal commands, which require terminal input + or output something in background because they will mess up vifm's TUI. + Anyway, if you did run such a command, you can use Ctrl-L key to update + vifm's TUI. + + Rewriting the example command with macros given above with + backgrounding: + + %m, %M, %s, %S, %u and %U macros cannot be combined with background + mark (" &") as it doesn't make much sense. + +Command backgrounding + Copy and move operation can take a lot of time to proceed. That's why + vifm supports backgrounding of this two operations. To run :copy, + :move or :delete command in the background just add " &" at the end of + a command. + + For each background operation a new thread is created. Currently job + cannot be stopped or paused. + + You can see if command is still running in the :jobs menu. + Backgrounded commands have progress instead of process id at the line + beginning. + + Background operations cannot be undone. + +Cancellation + Note that cancellation works somewhat different on Windows platform due + to different mechanism of break signal propagation. One also might + need to use Ctrl-Break shortcut instead of Ctrl-C. + + There are two types of operations that can be cancelled: + + - file system operations; + + - mounting with FUSE (but not unmounting as it can cause loss of + data); + + - calls of external applications. + + Note that vifm never terminates applications, it sends SIGINT signal + and lets the application quit normally. + + When one of set of operations is cancelled (e.g. copying of 5th file of + 10 files), further operations are cancelled too. In this case undo + history will contain only actually performed operations. + + Cancelled operations are indicated by "(cancelled)" suffix appended to + information message on statusbar. + + File system operations + + Currently the following commands can be cancelled: :alink, :chmod, + :chown, :clone, :copy, :delete, :mkdir, :move, :restore, :rlink, + :touch. File putting (on p/P key) can be cancelled as well. It's not + hard to see that these are mainly long-running operations. + + Cancelling commands when they are repeated for undo/redo operations is + allowed for convenience, but is not recommended as further undo/redo + operations might get blocked by side-effects of partially cancelled + group of operations. + + These commands can't be cancelled: :empty, :rename, :substitute, :tr. + + Mounting with FUSE + + It's not considered to be an error, so only notification on the status + bar is shown. + + External application calls + + Each of this operations can be cancelled: :apropos, :find, :grep, + :locate. + +Patterns + :highlight, :filetype, :filextype, :fileviewer commands and 'classify' + option support globs, regular expressions and mime types to match file + names or their paths. + + There are six possible ways to write a single pattern: + + 1. [!]{comma-separated-name-globs} + + 2. [!]{{comma-separated-path-globs}} + + 3. [!]/name-regular-expression/[iI] + + 4. [!]//path-regular-expression//[iI] + + 5. [!]<comma-separated-mime-type-globs> + + 6. undecorated-pattern + + Flags of regular expressions mean the following: + - "i" makes filter case insensitive; + - "I" makes filter case sensitive. They can be repeated multiple + times, but the later one takes precedence (e.g. "iiiI" is equivalent + to "I" and "IiIi" is the same as "i"). + + To combine several patterns (AND them), make sure you're using one of + the first five forms and write patterns one after another, like this: + <text/plain>{*.vifm} + Mind that if you make a mistake the whole string will be treated as the + sixth form. + + :filetype, :filextype and :fileviewer commands accept comma-separated + list of patterns instead of a single pattern, thus effectively handling + OR operation on them: + <text/plain>{*.vifm},<application/pdf>{*.pdf} + + Five first forms can include leading exclamation mark that negates + pattern matching. + + The last form is implicitly refers to one of others. :highlight does + not accept undecorated form, while :filetype, :filextype, :fileviewer, + :select, :unselect and 'classify' treat it as list of name globs. + + Regular expression patterns are case insensitive by default, see + description of commands, which might override default behaviour. + + "Globs" section below provides short overview of globs and some + important points that one needs to know about them. + + Mime type matching is essentially globs matching applied to mime type + of a file instead of its name/path. Note: mime types aren't detected + on Windows. + +Globs + Globs are always case insensitive as it makes sense in general case. + + *, ?, [ and ] are treated as special symbols in the pattern. E.g. + + :filetype * less %c + + matches all files. One can use character classes for escaping, so + + :filetype [*] less %c + + matches only one file name, the one which contains only asterisk + symbol. + + * means any number of any characters (possibly an empty substring), + with one exception: asterisk at the pattern beginning doesn't match dot + in the first position. E.g. + + :fileviewer *.zip,*.jar zip -sf %c + + associates using of zip program to preview all files with zip or jar + extensions as listing of their content. + + ? means any character at this position. E.g. + + :fileviewer ?.out file %c + + calls file tool for all files which has exactly one character before + their extension (e.g. a.out, b.out). + + Square brackets designate character class, which means that whole + character class matches against any of characters listed in it. For + example + + :fileviewer *.[ch] highlight -O xterm256 -s dante --syntax c %c + + makes vifm call highlight program to colorize source and header files + in C language for a 256-color terminal. Equal command would be + + :fileviewer *.c,*.h highlight -O xterm256 -s dante --syntax c %c + + + Inside square brackets ^ or ! can be used for symbol class negotiation + and the - symbol to set a range. ^ and ! should appear right after the + opening square bracket. For example + + :filetype *.[!d]/ inspect_dir + + associates inspect_dir as additional handler for all directories that + have one character extension unless it's "d" letter. And + + :filetype [0-9].jpg sxiv + + associates sxiv picture viewer only for JPEG-files that contain single + digit in their name. + +:set options + Local options + These are kind of options that are local to a specific view. So + you can set ascending sorting order for left pane and descending + order for right pane. + + In addition to being local to views, each such option also has + two values: + + - local to current directory (value associated with current + location); + + - global to current directory (value associated with the + pane). + + The idea is that current directory can be made a temporary + exception to regular configuration of the view, until directory + change. Use :setlocal for that. :setglobal changes view value + not affecting settings until directory change. :set applies + changes immediately to all values. + + + 'aproposprg' + type: string + default: "apropos %a" + Specifies format for an external command to be invoked by the + :apropos command. The format supports expanding of macros, + specific for a particular *prg option, and %% sequence for + inserting percent sign literally. This option should include + the %a macro to specify placement of arguments passed to the + :apropos command. If the macro is not used, it will be + implicitly added after a space to the value of this option. + + 'autochpos' + type: boolean + default: true + When disabled vifm will set cursor to the first line in the view + after :cd and :pushd commands instead of saved cursor position. + Disabling this will also make vifm clear information about + cursor position in the view history on :cd and :pushd commands + (and on startup if 'autochpos' is disabled in the vifmrc). l + key in the ":history ." and ":trashes" menus are treated like + :cd command. This option also affects marks so that navigating + to a mark doesn't restore cursor position. + + When this option is enabled, more fine grained control over + cursor position is available via 'histcursor' option. + + 'columns' 'co' + type: integer + default: terminal width on startup + Terminal width in characters. + + 'caseoptions' + type: charset + default: "" + This option gives additional control over case sensitivity by + allowing overriding default behaviour to either always be case + sensitive or always be case insensitive. Possible values form + pairs of lower and upper case letters that configure specific + aspect of behaviour: + p - always ignore case of paths during completion. + P - always match case of paths during completion. + g - always ignore case of characters for f/F/;/,. + G - always match case of characters for f/F/;/,. + + At most one item of each pair takes affect, if both or more are + present, only the last one matters. When none of pair's + elements are present, the behaviour is default (depends on + operating system for path completion and on values of + 'ignorecase' and 'smartcase' options for file navigation). + + 'cdpath' 'cd' + type: string list + default: value of $CDPATH with commas instead of colons + Specifies locations to check on changing directory with relative + path that doesn't start with "./" or "../". When non-empty, + current directory is examined after directories listed in the + option. + + This option doesn't affect completion of :cd command. + + Example: + + set cdpath=~ + + This way ":cd bin" will switch to "~/bin" even if directory + named "bin" exists in current directory, while ":cd ./bin" + command will ignore value of 'cdpath'. + + 'chaselinks' + type: boolean + default: false + When enabled path of view is always resolved to real path (with + all symbolic links expanded). + + 'classify' + type: string list + default: ":dir:/" + Specifies file name prefixes and suffixes depending on file type + or name. The format is either of: + - [{prefix}]:{filetype}:[{suffix}] + - [{prefix}]::{pattern}::[{suffix}] + Possible {pattern} forms are described in "Patterns" section + above. + + Priority rules: + - file name patterns have priority over type patterns + - file name patterns are matched in left-to-right order of + their appearance in this option + + Either {prefix} or {suffix} or both can be omitted (which is the + default for all unspecified file types), this means empty + {prefix} and/or {suffix}. {prefix} and {suffix} should consist + of at most eight characters. Elements are separated by commas. + Neither prefixes nor suffixes are part of file names, so they + don't affect commands which operate on file names in any way. + Comma (',') character can be inserted by doubling it. List of + file type names can be found in the description of filetype() + function. + + 'confirm' 'cf' + type: set + default: delete,permdelete + Defines which operations require confirmation: + - delete - moving files to trash (on d or :delete); + - permdelete - permanent deletion of files (on D or :delete! + command or on undo/redo operation). + + 'cpoptions' 'cpo' + type: charset + default: "fst" + Contains a sequence of single-character flags. Each flag + enables behaviour of older versions of vifm. Flags: + - f - when included, running :filter command results in not + inverted (matching files are filtered out) and :filter! in + inverted (matching files are left) filter, when omitted, meaning + of the exclamation mark changes to the opposite; + - s - when included, yy, dd and DD normal mode commands act on + selection, otherwise they operate on current file only; + - t - when included, <tab> (thus <c-i>) behave as <space> and + switches active pane, otherwise <tab> and <c-i> go forward in + the view history. It's possible to make both <tab> and <c-i> to + work as expected by setting up the terminal to emit a custom + sequence when <c-i> is pressed; see :histnext for details. + + 'cvoptions' + type: set + default: + Specifies whether entering/leaving custom views triggers events + that normally happen on entering/leaving directories: + - autocmds - trigger autocommands on entering/leaving custom + views; + - localopts - reset local options on entering/leaving custom + views; + - localfilter - reset local filter on entering/leaving custom + views. + + 'deleteprg' + type: string + default: "" + Specifies program to run on files that are permanently removed. + When empty, files are removed as usual, otherwise this command + is invoked on each file by appending its name. If the command + doesn't remove files, they will remain on the file system. + + 'dirsize' + type: enumeration + default: size + Controls how size of directories is displayed in file views. + The following values are possible: + - size - size of directory (i.e., size used to store list of + files) + - nitems - number of entries in the directory (excluding . and + ..) + + Size obtained via ga/gA overwrites this setting so seeing count + of files and occasionally size of directories is possible. + + 'dotdirs' + type: set + default: nonrootparent + Controls displaying of dot directories. The following values + are possible: + - rootparent - show "../" in root directory of file system + - nonrootparent - show "../" in non-root directories of file + system + + Note that empty directories always contain "../" entry + regardless of value of this option. "../" disappears at the + moment at least one file is created. + + 'dotfiles' + type: boolean + default: false + Whether dot files are shown in the view. Can be controlled with + z* bindings. + + 'fastrun' + type: boolean + default: false + With this option turned on you can run partially entered + commands with unambiguous beginning using :! (e.g. :!Te instead + of :!Terminal or :!Te<tab>). + + 'fillchars' 'fcs' + type: string list + default: "" + Sets characters used to fill borders. + + item default used for + vborder:c ' ' left, middle and right vertical + borders + + If value is omitted, its default value is used. Example: + + set fillchars=vborder:. + + 'findprg' + type: string + default: "find %s %a -print , -type d \( ! -readable -o ! + -executable \) -prune" + Specifies format for an external command to be invoked by the + :find command. The format supports expanding of macros, + specific for a particular *prg option, and %% sequence for + inserting percent sign literally. This option should include + the %s macro to specify placement of list of paths to search in + and %a or %A macro to specify placement of arguments passed to + the :find command. If some of the macros are not used, they + will be implicitly added after a space to the value of the + option in the following order: %s, %a. Note that when neither + %a nor %A are specified, it's %a which is added implicitly. + + The macros can slightly change their meaning depending on :find + command arguments. When the first argument points to an + existing directory, %s is assigned all arguments and %a/%A are + left empty. Otherwise, %s is assigned a dot (".") meaning + current directory or list of selected file names, if any. %a/%A + are assigned arguments when first argument starts with a dash + ("-"), otherwise %a gets an escaped version of arguments, + prepended by "-name" (on *nix) or "-iname" (on Windows) + predicate. + + %a and %A macros contain almost the same value, the difference + is that %a can be escaped and %A is never escaped. %A is to be + used mainly on Windows, where shell escaping is a mess and can + break command execution. + + Optional %u or %U macro could be used (if both specified %U is + chosen) to force redirection to custom or unsorted custom view + respectively. + + Starting from Windows Server 2003 a where command is available, + one can configure vifm to use it in the following way: + + set findprg="where /R %s %A" + + As the syntax of this command is rather limited, one can't use + :find command with selection of more than one item in this case. + The command looks for files only completely ignoring + directories. + + When using find port on Windows, another option is to setup + 'findprg' like this: + + set findprg="find %s %a" + + 'followlinks' + type: boolean + default: true + Follow links on l or Enter. That is navigate to destination + file instead of treating the link as if it were target file. + Doesn't affects links to directories, which are always entered + (use gf key for directories). + + 'fusehome' + type: string + default: "($XDG_DATA_HOME/.local/share | $VIFM)/fuse/" + Directory to be used as a root dir for FUSE mounts. Value of + the option can contain environment variables (in form + "$envname"), which will be expanded (prepend it with a slash to + prevent expansion). The value should expand to an absolute + path. + + If you change this option, vifm won't remount anything. It + affects future mounts only. See "Automatic FUSE mounts" section + below for more information. + + 'gdefault' 'gd' + type: boolean + default: false + When on, 'g' flag is on for :substitute by default. + + 'grepprg' + type: string + default: "grep -n -H -I -r %i %a %s" + Specifies format for an external command to be invoked by the + :grep command. The format supports expanding of macros, + specific for a particular *prg option, and %% sequence for + inserting percent sign literally. This option should include + the %i macro to specify placement of "-v" string when inversion + of results is requested, %a or %A macro to specify placement of + arguments passed to the :grep command and the %s macro to + specify placement of list of files to search in. If some of the + macros are not used, they will be implicitly added after a space + to the value of the 'grepprg' option in the following order: %i, + %a, %s. Note that when neither %a nor %A are specified, it's %a + which is added implicitly. + + Optional %u or %U macro could be used (if both specified %U is + chosen) to force redirection to custom or unsorted custom view + respectively. + + See 'findprg' option for description of difference between %a + and %A. + + Example of setup to use ack (http://beyondgrep.com/) instead of + grep: + + set grepprg='ack -H -r %i %a %s' + + or The Silver Searcher + (https://github.com/ggreer/the_silver_searcher): + + set grepprg='ag --line-numbers %i %a %s' + + + + 'histcursor' + type: set + default: startup,dirmark,direnter + Defines situations when cursor should be moved according to + directory history: + - startup - on loading file lists during startup + - dirmark - after navigating to a mark that doesn't specify + file + - direnter - on opening directory from a file list + + This option has no effect when 'autochpos' is disabled. + + Note that the list is not exhaustive and there are other + situations when cursor is positioned automatically. + + 'history' 'hi' + type: integer + default: 15 + Maximum number of stored items in all histories. + + 'hlsearch' 'hls' + type: boolean + default: true + Highlight all matches of search pattern. + + 'iec' type: boolean + default: false + Use KiB, MiB, ... suffixes instead of K, M, ... when printing + size in human-friendly format. + + 'ignorecase' 'ic' + type: boolean + default: false + Ignore case in search patterns (:substitute, / and ? commands) + and characters after f and F commands. It doesn't affect file + filtering. + + 'incsearch' 'is' + type: boolean + default: false + When this option is set, search and view update for local filter + is be performed starting from initial cursor position each time + search pattern is changed. + + 'iooptions' + type: set + default: + Controls details of file operations. The following values are + available: + - fastfilecloning - perform fast file cloning (copy-on-write), + when available + (available on Linux and btrfs file system). + + 'laststatus' 'ls' + type: boolean + default: true + Controls if status bar is visible. + + 'lines' + type: integer + default: terminal height on startup + Terminal height in lines. + + 'locateprg' + type: string + default: "locate %a" + Specifies format for an external command to be invoked by the + :locate command. The format supports expanding of macros, + specific for a particular *prg option, and %% sequence for + inserting percent sign literally. This option should include + the %a macro to specify placement of arguments passed to the + :locate command. If the macro is not used, it will be + implicitly added after a space to the value of this option. + + Optional %u or %U macro could be used (if both specified %U is + chosen) to force redirection to custom or unsorted custom view + respectively. + + 'mediaprg' + type: string + default: path to bundled script that supports udevil and udisks + {only for *nix} + Specifies command to be used to manage media devices. Used by + :media command. + + The command can be passed the following parameters: + - list -- list media + - mount {device} -- mount a device + - unmount {path} -- unmount given mount point + + The output of `list` subcommand is parsed in search of lines + that start with one of the following prefixes: + - device= - specifies device path (e.g., "/dev/sde") + - label= - specifies optional device label (e.g., "Memory + card") + - mount-point= - specifies a mount point (can be absent or + appear more than once) + + All other lines are ignored. Each `device=` starts a new + section describing a device which should include two other + possible prefixes. + + `list` subcommand is assumed to always succeed, while error + stream and exit code of `mount` and `unmount` is taken into + account to determine whether operation was performed + successfully. + + 'lsoptions' + type: string list + default: "" + scope: local + + Configures ls-like view. + + item used for + transposed filling view grid by columns rather than by + lines + + + 'lsview' + type: boolean + default: false + scope: local + When this option is set, directory view will be displayed in + multiple columns with file names similar to output of `ls -x` + command. See "ls-like view" section below for format + description. This option has no effect if 'millerview' is on. + + 'milleroptions' + type: string list + default: "lsize:1,csize:1,rsize:1" + scope: local + + Configures miller view. + + item default used for + lsize:num 0 left column + csize:num 1 center column (can't be disabled) + rsize:num 0 right column + + *size specifies ratios of columns. Each ratio is in the range + from 0 to 100 and values are adjusted to fit the limits. Zero + disables a column, but central (main) column can't be disabled. + + Example of two-column mode which is useful in combination with + :view command: + + set milleroptions=lsize:1,csize:2 + + + 'millerview' + type: boolean + default: false + scope: local + When this option is set, directory view will be displayed in + multiple cascading columns. Ignores 'lsview'. + + 'mintimeoutlen' + type: integer + default: 150 + The fracture of 'timeoutlen' in milliseconds that is waited + between subsequent input polls, which affects various + asynchronous operations (detecting changes made by external + applications, monitoring background jobs, redrawing UI). There + are no strict guarantees, however the higher this value is, the + less is CPU load in idle mode. + + 'number' 'nu' + type: boolean + default: false + scope: local + Print line number in front of each file name when 'lsview' + option is turned off. Use 'numberwidth' to control width of + line number. Also see 'relativenumber'. + + 'numberwidth' 'nuw' + type: integer + default: 4 + scope: local + Minimal number of characters for line number field. + + 'previewprg' + type: string + default: "" + scope: local + + External command to be used instead of preview programs + configured via :fileviewer command. + + Example: + + " always show git log in preview of files inside some repository + au DirEnter '~/git-repo/**/*' setl previewprg='git log --color -- %c 2>&1' + + 'quickview' + type: boolean + default: false + Whether quick view (:view) is currently active or not. + + 'relativenumber' 'rnu' + type: boolean + default: false + scope: local + Print relative line number in front of each file name when + 'lsview' option is turned off. Use 'numberwidth' to control + width of line number. Various combinations of 'number' and + 'relativenumber' lead to such results: + + nonumber number + + norelativenumber | first | 1 first + | second | 2 second + | third | 3 third + + relativenumber | 1 first | 1 first + | 0 second |2 second + | 1 third | 1 third + + + 'rulerformat' 'ruf' + type: string + default: "%l/%S " + Determines the content of the ruler. Its minimal width is 13 + characters and it's right aligned. Following macros are + supported: + %= - separation point between left and right aligned halves of + the line + %l - file number + %L - total number of files in view (including filtered out + ones) + %x - number of files excluded by filters + %0- - old name for %x macro + %S - number of displayed files + %= - separation point between left and right align items + %% - percent sign + %[ - designates beginning of an optional block + %] - designates end of an optional block + + Percent sign can be followed by optional minimum field width. + Add '-' before minimum field width if you want field to be right + aligned. + + Example: + + set rulerformat='%2l-%S%[ +%x%]' + + 'runexec' + type: boolean + default: false + Run executable file on Enter or l. + + 'scrollbind' 'scb' + type: boolean + default: false + When this option is set, vifm will try to keep difference of + scrolling positions of two windows constant. + + 'scrolloff' 'so' + type: integer + default: 0 + Minimal number of screen lines to keep above and below the + cursor. If you want cursor line to always be in the middle of + the view (except at the beginning or end of the file list), set + this option to some large value (e.g. 999). + + 'shell' 'sh' + type: string + default: $SHELL or "/bin/sh" or "cmd" (on MS-Windows) + Full path to the shell to use to run external commands. On *nix + a shell argument can be supplied. + + 'shortmess' 'shm' + type: charset + default: "p" + Contains a sequence of single-character flags. Each flag + enables shortening of some message displayed by vifm in the TUI. + Flags: + - M - shorten titles in windows of terminal multiplexers + created by vifm down to file name instead of using full path. + - T - truncate status-bar messages in the middle if they are + too long to fit on the command line. "..." will appear in the + middle. + - p - use tilde shortening in view titles. + + + 'showtabline' 'stal' + type: enumeration + default: multiple + Specifies when tab line should be displayed. Possible values: + - never - never display tab line + - multiple - show tab line only when there are at least two + tabs + - always - display tab line always + + Alternatively 0, 1 and 2 Vim-like values are also accepted and + correspond to "never", "multiple" and "always" respectively. + + 'sizefmt' + type: string list + default: "units:iec" + Configures the way size is formatted in human-friendly way. + + item value meaning + units: iec Use 1024 byte units (K or KiB, + etc.). + See 'iec' option. + si Use 1000 byte units (KB, etc.). + precision: i > 0 How many fraction digits to + consider. + {not set} Precision of 1 for integer part + < 10, + 0 otherwise (provides old + behaviour). + + Numbers are rounded from zero. Trailing zeros are dropped. + + Example: + + set sizefmt=units:iec,precision:2 + + + 'slowfs' + type: string list + default: "" + only for *nix + A list of mounter fs name beginnings (first column in /etc/mtab + or /proc/mounts) or paths prefixes for fs/directories that work + too slow for you. This option can be used to stop vifm from + making some requests to particular kinds of file systems that + can slow down file browsing. Currently this means don't check + if directory has changed, skip check if target of symbolic links + exists, assume that link target located on slow fs to be a + directory (allows entering directories and navigating to files + via gf). If you set the option to "*", it means all the systems + are considered slow (useful for cygwin, where all the checks + might render vifm very slow if there are network mounts). + + Example for autofs root /mnt/autofs: + + set slowfs+=/mnt/autofs + + 'smartcase' 'scs' + type: boolean + default: false + Overrides the ignorecase option if the search pattern contains + at least one upper case character. Only used when ignorecase + option is enabled. It doesn't affect file filtering. + + 'sort' type: string list + default: +name on *nix and +iname on Windows + scope: local + Sets list of sorting keys (first item is primary key, second is + secondary key, etc.): + [+-]ext - extension of files and directories + [+-]fileext - extension of files only + [+-]name - name (including extension) + [+-]iname - name (including extension, ignores case) + [+-]type - file type + (dir/reg/exe/link/char/block/sock/fifo) + [+-]dir - directory grouping (directory < file) + [+-]gid - group id (*nix only) + [+-]gname - group name (*nix only) + [+-]mode - file type derived from its mode (*nix only) + [+-]perms - permissions string (*nix only) + [+-]uid - owner id (*nix only) + [+-]uname - owner name (*nix only) + [+-]nlinks - number of hard links (*nix only) + [+-]inode - inode number (*nix only) + [+-]size - size + [+-]nitems - number of items in a directory (zero for files) + [+-]groups - groups extracted via regexps from 'sortgroups' + [+-]target - symbolic link target (empty for other file + types) + [+-]atime - time accessed (e.g. read, executed) + [+-]ctime - time changed (changes in metadata, e.g. mode) + [+-]mtime - time modified (when file contents is changed) + + Note: look for st_atime, st_ctime and st_mtime in "man 2 stat" + for more information on time keys. + + '+' means ascending sort for this key, and '-' means descending + sort. + + "dir" key is somewhat similar in this regard but it's added + implicitly: when "dir" is not specified, sorting behaves as if + it was the first key in the list. That's why if one wants + sorting algorithm to mix directories and files, "dir" should be + appended to sorting option, for example like this: + + set sort+=dir + + or + + set sort=-size,dir + + Value of the option is checked to include dir key and default + sorting key (name on *nix, iname on Windows). Here is what + happens if one of them is missing: + + - type key is added at the beginning; + + - default key is added at the end; + + all other keys are left untouched (at most they are moved). + + This option also changes view columns according to primary + sorting key set, unless 'viewcolumns' option is not empty. + + 'sortnumbers' + type: boolean + default: false + scope: local + Natural sort of (version) numbers within text. + + 'sortgroups' + type: string + default: "" + scope: local + Sets comma-separated list of regular expressions to use for + group sorting, double comma is literal comma. Each expression + should contain at least one group or its value will be + considered to be always empty. Only first match of each regular + expression is considered. Groups are considered from right to + first similar to 'sort', first group divides list of files into + sub-groups, each of which is sorted by the second group and so + on. + + Example: + set sortgroups=-(done|todo).* + this would put files with "-done" in their names above all files + with "-todo". + + 'sortorder' + type: enumeration + default: ascending + Sets sort order for primary key: ascending, descending. + + 'statusline' 'stl' + type: string + default: "" + Determines the content of the status line (the line right above + command-line). Empty string means use same format like in + previous versions. Following macros are supported: + + - %t - file name (considering value of the 'classify' option) + + - %T - symbolic link target (empty for other filetypes) + + - %f - file name relative to current directory (considers + 'classify') + + - %A - file attributes (permissions on *nix or properties on + Windows) %u - user name or uid (if it cannot be resolved) + + - %g - group name or gid (if it cannot be resolved) + + - %s - file size in human readable format + + - %E - size of selected files in human readable format, same as + %s when no files are selected, except that it will never show + size of ../ in visual mode, since it cannot be selected + + - %d - file modification date (uses 'timefmt' option) + + - %D - path of the other pane for single-pane layout + + - %a - amount of free space available at current partition + + - %z - short tips/tricks/hints that chosen randomly after one + minute period + + - %{<expr>} - evaluate arbitrary vifm expression '<expr>', e.g. + '&sort' + + - %* - resets or applies one of User1..User9 highlight groups; + reset happens when width field is 0 or not specified, one of + groups gets picked when width field is in the range from 1 to + 9 + + - all 'rulerformat' macros + + Percent sign can be followed by optional minimum field width. + Add '-' before minimum field width if you want field to be right + aligned. + + On Windows file properties include the following flags (upper + case means flag is on): + A - archive + H - hidden + I - content isn't indexed + R - readonly + S - system + C - compressed + D - directory + E - encrypted + P - reparse point (e.g. symbolic link) + Z - sparse file + + Example without colors: + + set statusline=" %t%= %A %10u:%-7g %15s %20d %{&sort} " + + Example with colors: + + highlight User1 ctermbg=yellow + highlight User2 ctermbg=blue ctermfg=white cterm=bold + set statusline="%1* %-26t %2* %= %1* %A %2* %7u:%-7g %1* %-5s %2* %d " + + + 'suggestoptions' + type: string list + default: + Controls when, for what and how suggestions are displayed. The + following values are available: + - normal - in normal mode; + - visual - in visual mode; + - view - in view mode; + - otherpane - use other pane to display suggestions, when + available; + - delay[:num] - display suggestions after a small delay (to + do not annoy if you just want to type a fast shortcut consisting + of multiple keys), num specifies the delay in ms (500 by + default), 'timeoutlen' at most; + - keys - include shortcuts (commands and selectors); + - foldsubkeys - fold multiple keys with common prefix; + - marks - include marks; + - registers[:num] - include registers, at most num files (5 by + default). + + 'syncregs' + type: string + default: + Specifies identifier of group of instances that share registers + between each other. When several instances of vifm have this + option set to identical value, they automatically synchronize + contents of their registers on operations which use them. + + 'syscalls' + type: boolean + default: false + When disabled, vifm will rely on external applications to + perform file-system operations, otherwise system calls are used + instead (much faster and supports progress tracking). The + option should eventually be removed. Mostly *nix-like systems + are affected. + + 'tabscope' + type: enumeration + default: global + Picks style of tabs, which defines what a single tab contains. + Possible values: + - global - tab describes complete UI of two views and how they + are arranged + - pane - tab is located "inside" a pane and manages it and + quick view + + 'tabstop' 'ts' + type: integer + default: value from curses library + Number of spaces that a Tab in the file counts for. + + 'timefmt' + type: string + default: "%m/%d %H:%M" + Format of time in file list. See "man 1 date" or "man 3 + strftime" for details. + + 'timeoutlen' 'tm' + type: integer + default: 1000 + The time in milliseconds that is waited for a mapped key in case + of already typed key sequence is ambiguous. + + 'title' + type: boolean + default: true when title can be restored, false otherwise + When enabled title of the terminal or terminal multiplexer's + window is updated according to current location. + + 'trash' + type: boolean + default: true + Use trash directory. See "Trash directory" section below. + + 'trashdir' + type: string + default: on *nix: + "%r/.vifm-Trash-%u,$VIFM/Trash,%r/.vifm-Trash" + or if $VIFM/Trash doesn't exist + "%r/.vifm-Trash-%u,$XDG_DATA_HOME/vifm/Trash,%r/.vifm-Trash" + on Windows: + "%r/.vifm-Trash,$XDG_DATA_HOME/vifm/Trash" + List of trash directory path specifications, separated with + commas. Each list item either defines an absolute path to trash + directory or a path relative to a mount point root when list + element starts with "%r/". Value of the option can contain + environment variables (of form "$envname"), which will be + expanded (prepend $ with a slash to prevent expansion). + Environment variables are expanded when the option is set. + + On *nix, if element ends with "%u", the mark is replaced with + real user ID and permissions are set so that only that only + owner is able to use it. + Note that even this setup is not completely secure when combined + with "%r/" and it's overall safer to keep files in home + directory, but that implies cost of copying files between + partitions. + + When new file gets cut (deleted) vifm traverses each element of + the option in the order of their appearance and uses first trash + directory that it was able to create or that is already + writable. + + Default value tries to use trash directory per mount point and + falls back to ~/.vifm/Trash on failure. + + Will attempt to create the directory if it does not exist. See + "Trash directory" section below. + + 'tuioptions' 'to' + type: charset + default: "ps" + Each flag configures some aspect of TUI appearance. The flags + are: + p - when included: + * file list inside a pane gets additional single character + padding on left and right sides; + * quick view and view mode get single character padding. + s - when included, left and right borders (side borders, hence + "s" character) are visible. + u - use Unicode characters in the TUI (Unicode ellipsis instead + of "..."). + + 'undolevels' 'ul' + type: integer + default: 100 + Maximum number of changes that can be undone. Note that here + single file operation is used as a unit, not operation, i.e. + deletion of 101 files will exceed default limit. + + 'vicmd' + type: string + default: "vim" + The actual command used to start vi. Ampersand sign at the end + (regardless whether it's preceded by space or not) means + backgrounding of command. + + Background flag is ignored in certain context where vifm waits + for the editor to finish. Such contexts include any command + that spawns editor to change list of file names or a command, + with :rename being one example. `-f` is also appended to + prevent forking in such cases, so the command needs to handle + the flag. + + Additionally `+{num}` and `+'call cursor()'` arguments are used + to position cursor when location is known. + + 'viewcolumns' + type: string + default: "" + scope: local + Format string containing list of columns in the view. When this + option is empty, view columns to show are chosen automatically + using sorting keys (see 'sort') as a base. Value of this option + is ignored if 'lsview' is set. See "Column view" section below + for format description. + + An example of setting the options for both panes (note :windo + command): + + windo set viewcolumns=-{name}..,6{size},11{perms} + + 'vixcmd' + type: string + default: value of 'vicmd' + Same as 'vicmd', but takes precedence over it when running in X. + + 'vifminfo' + type: set + default: bookmarks,bmarks + Controls what will be saved in the $VIFM/vifminfo file. + + bmarks - named bookmarks + bookmarks - marks, except special ones like '< and '> + tui - state of the user interface (sorting, number of + windows, quick + view state, active view) + dhistory - directory history + state - file name and dot filters and terminal + multiplexers integration + state + cs - primary color scheme + savedirs - save last visited directory (requires dhistory) + chistory - command line history + shistory - search history (/ and ? commands) + phistory - prompt history + fhistory - history of local filter (see description of the + "=" normal mode + command) + dirstack - directory stack overwrites previous stack, unless + stack of + current session is empty + registers - registers content + options - all options that can be set with the :set command + (obsolete) + filetypes - associated programs and viewers (obsolete) + commands - user defined commands (see :command description) + (obsolete) + + 'vimhelp' + type: boolean + default: false + Use vim help format. + + 'wildmenu' 'wmnu' + type: boolean + default: false + Controls whether possible matches of completion will be shown + above the command line. + + 'wildstyle' + type: enumeration + default: bar + Picks presentation style of wild menu. Possible values: + - bar - one-line with left-to-right cursor + - popup - multi-line with top-to-bottom cursor + + 'wordchars' + type: string list + default: "1-8,14-31,33-255" (that is all non-whitespace + characters) + Specifies which characters in command-line mode should be + considered as part of a word. Value of the option is comma- + separated list of ranges. If both endpoints of a range match, + single endpoint is enough (e.g. "a" = "a-a"). Both endpoints + are inclusive. There are two accepted forms: character + representing itself or number encoding character according to + ASCII table. In case of ambiguous characters (dash, comma, + digit) use numeric form. Accepted characters are in the range + from 0 to 255. Any Unicode character with code greater than 255 + is considered to be part of a word. + + The option affects Alt-D, Alt-B and Alt-F, but not Ctrl-W. This + is intentionally to allow two use cases: + + - Moving by WORDS and deletion by words. + - Moving by words and deletion by WORDS. + + To get the latter use the following mapping: + + cnoremap <c-w> <a-b><a-d> + + Also used for abbreviations. + + 'wrap' type: boolean + default: true + Controls whether to wrap text in quick view. + + 'wrapscan' 'ws' + type: boolean + default: true + Searches wrap around end of the list. + +Mappings + Map arguments + + LHS of mappings can be preceded by arguments which take the form of + special sequences: + + <silent> + Postpone UI updates until RHS is completely processed. + + <wait> In case of builtin mapping causing conflict for a user-defined + mapping (e.g., `t` builtin to a partially typed `ta` user- + defined mapping), ignore the builtin mapping and wait for input + indefinitely as opposed to default behaviour of triggering the + builtin mapping after a delay defined by 'timeoutlen'. Example: + + nnoremap <wait> tw :set wrap!<cr> + nnoremap <wait> tn :set number!<cr> + nnoremap <wait> tr :set relativenumber!<cr> + + Special sequences + + Since it's not easy to enter special characters there are several + special sequences that can be used in place of them. They are: + + <cr> Enter key. + + <esc> Escape key. + + <space> + Space key. + + <lt> Less-than character (<). + + <nop> provides a way to disable a mapping (by mapping it to <nop>). + + <bs> Backspace key (see key conflict description below). + + <tab> <s-tab> + Tabulation and Shift+Tabulation keys. + + <home> <end> + Home/End. + + <left> <right> <up> <down> + Arrow keys. + + <pageup> <pagedown> + PageUp/PageDown. + + <del> <delete> + Delete key. <del> and <delete> mean different codes, but + <delete> is more common. + + <insert> + Insert key. + + <c-a>,<c-b>,...,<c-z>,<c-[>,<c->,<c-]>,<c-^>,<c-_> + Control + some key (see key conflict description below). + + <c-@> only for *nix + Control + Space. + + <a-a>,<a-b>,...,<a-z> + <m-a>,<m-b>,...,<m-z> Alt + some key. + + <a-c-a>,<a-c-b>,...,<a-c-z> + <m-c-a>,<m-c-b>,...,<m-c-z> only for *nix + Alt + Ctrl + some key. + + <f0> - <f63> + Functional keys. + + <c-f1> - <c-f12> + only for MS-Windows + functional keys with Control key pressed. + + <a-f1> - <a-f12> + only for MS-Windows + functional keys with Alt key pressed. + + <s-f1> - <s-f12> + only for MS-Windows + functional keys with Shift key pressed. + + Note that due to the way terminals process their input, several + keyboard keys might be mapped to single key code, for example: + + - <cr> and <c-m>; + + - <tab> and <c-i>; + + - <c-h> and <bs>; + + - etc. + + Most of the time they are defined consistently and don't cause + surprises, but <c-h> and <bs> are treated differently in different + environments (although they match each other all the time), that's why + they correspond to different keys in vifm. As a consequence, if you + map <c-h> or <bs> be sure to repeat the mapping with the other one so + that it works in all environments. Alternatively, provide your mapping + in one form and add one of the following: + + " if mappings with <c-h> in the LHS work + map <c-h> <bs> + " if mappings with <bs> in the LHS work + map <bs> <c-h> + + Whitespace + + vifm removes whitespace characters at the beginning and end of + commands. That's why you may want to use <space> at the end of rhs in + mappings. For example: + + cmap <f1> man<space> + + will put "man " in line when you hit the <f1> key in the command line + mode. + +Expression syntax + Supported expressions is a subset of what VimL provides. + + Expression syntax summary, from least to most significant: + + expr1 expr2 + expr2 || expr2 .. logical OR + + expr2 expr3 + expr3 && expr3 .. logical AND + + expr3 expr4 + expr4 == expr4 equal + expr4 != expr4 not equal + expr4 > expr4 greater than + expr4 >= expr4 greater than or equal + expr4 < expr4 smaller than + expr4 <= expr4 smaller than or equal + + expr4 expr5 + expr5 + expr5 .. number addition + expr5 - expr5 .. number subtraction + + expr5 expr6 + expr6 . expr6 .. string concatenation + + expr6 expr7 + - expr6 unary minus + + expr6 unary plus + ! expr6 logical NOT + + expr7 number number constant + "string" string constant, \ is special + 'string' string constant, ' is doubled + &option option value + $VAR environment variable + v:var builtin variable + function(expr1, ...) function call + (expr1) nested expression + + ".." indicates that the operations in this level can be concatenated. + + expr1 + ----- + expr2 || expr2 + + Arguments are converted to numbers before evaluation. + + Result is non-zero if at least one of arguments is non-zero. + + It's right associative and with short-circuiting, so sub-expressions + are evaluated from left to right until result of whole expression is + determined (i.e., until first non-zero) or end of the expression. + + expr2 + ----- + expr3 && expr3 + + Arguments are converted to numbers before evaluation. + + Result is non-zero only if both arguments are non-zero. + + It's right associative and with short-circuiting, so sub-expressions + are evaluated from left to right until result of whole expression is + determined (i.e., until first zero) or end of the expression. + + expr3 + ----- + expr4 {cmp} expr4 + + Compare two expr4 expressions, resulting in a 0 if it evaluates to + false or 1 if it evaluates to true. + + equal == + not equal != + greater than > + greater than or equal >= + smaller than < + smaller than or equal <= + + Examples: + + 'a' == 'a' == 1 + 'a' > 'b' == 1 + 'a' == 'b' == 0 + '2' > 'b' == 0 + 2 > 'b' == 1 + 2 > '1b' == 1 + 2 > '9b' == 0 + -1 == -'1' == 1 + 0 == '--1' == 1 + + expr4 + ----- + expr5 + expr5 .. number addition expr5 - expr5 .. number + subtraction + + Examples: + + 1 + 3 - 3 == 1 + 1 + '2' == 3 + + expr5 + ----- + expr6 . expr6 .. string concatenation + + Examples: + + 'a' . 'b' == 'ab' + 'aaa' . '' . 'c' == 'aaac' + + expr6 + ----- + + - expr6 unary minus + + expr6 unary plus + ! expr6 logical NOT + + For '-' the sign of the number is changed. + For '+' the number is unchanged. + For '!' non-zero becomes zero, zero becomes one. + + A String will be converted to a Number first. + + These operations can be repeated and mixed. Examples: + + --9 == 9 + ---9 == -9 + -+9 == 9 + !-9 == 0 + !'' == 1 + !'x' == 0 + !!9 == 1 + + expr7 + ----- + + number number constant + ----- + + Decimal number. Examples: + + 0 == 0 + 0000 == 0 + 01 == 1 + 123 == 123 + 10000 == 10000 + + string + ------ + "string" string constant + + Note that double quotes are used. + + A string constant accepts these special characters: + \b backspace <bs> + \e escape <esc> + \n newline + \r return <cr> + \t tab <tab> + \\ backslash + \" double quote + + Examples: + + "\"Hello,\tWorld!\"" + "Hi,\nthere!" + + literal-string + -------------- + 'string' string constant + + Note that single quotes are used. + + This string is taken as it is. No backslashes are removed or have a + special meaning. The only exception is that two quotes stand for one + quote. + + Examples: + + 'All\slashes\are\saved.' + 'This string contains doubled single quotes ''here''' + + option + ------ + &option option value (local one is preferred, if exists) + &g:option global option value &l:option local + option value + + Examples: + + echo 'Terminal size: '.&columns.'x'.&lines + if &columns > 100 + + Any valid option name can be used here (note that "all" in ":set all" + is a pseudo option). See ":set options" section above. + + environment variable + -------------------- + $VAR environment variable + + The String value of any environment variable. When it is not defined, + the result is an empty string. + + Examples: + + 'This is my $PATH env: ' . $PATH + 'vifmrc at ' . $MYVIFMRC . ' is used.' + + builtin variable + -------------------- + v:var builtin variable + + Information exposed by vifm for use in scripting. + + v:count + count passed to : command, 0 by default. Can be used in mappings to + pass + count to a different command. + v:count1 + same as v:count, but 1 by default. + v:servername + See below. + + function call + ------------- + function(expr1, ...) function call + + See "Functions" section below. + + Examples: + + "'" . filetype('.') . "'" + filetype('.') == 'reg' + + expression nesting + ------------------ + (expr1) nested expression + + Groups any other expression of arbitrary complexity enforcing order in + which operators are applied. + + +Functions + USAGE RESULT DESCRIPTION + + chooseopt({opt}) String Queries choose parameters passed on + startup. + executable({expr}) Integer Checks whether {expr} command + available. + expand({expr}) String Expands special keywords in {expr}. + filetype({fnum} [, {resolve}]) + String Returns file type from position. + fnameescape({expr}) String Escapes {expr} for use in a :command. + getpanetype() String Returns type of current pane. + has({property}) Integer Checks whether instance has + {property}. + layoutis({type}) Integer Checks whether layout is of type + {type}. + paneisat({loc}) Integer Checks whether current pane is at + {loc}. + system({command}) String Executes shell command and returns + its output. + tabpagenr([{arg}]) Integer Returns number of current or last + tab. + term({command}) String Like system(), but for interactive + commands. + + chooseopt({opt}) + + Retrieves values of options related to file choosing. {opt} can be one + of: + files returns argument of --choose-files or empty string + dir returns argument of --choose-dir or empty string + cmd returns argument of --on-choose or empty string + delimiter returns argument of --delimiter or the default one (\n) + + executable({expr}) + + If {expr} is absolute or relative path, checks whether path destination + exists and refers to an executable, otherwise checks whether command + named {expr} is present in directories listed in $PATH. Checks for + various executable extensions on Windows. Returns boolean value + describing result of the check. + + Example: + + " use custom default viewer script if it's available and installed + " in predefined system directory, otherwise try to find it elsewhere + if executable('/usr/local/bin/defviewer') + fileview * /usr/local/bin/defviewer %c + else + if executable('defviewer') + fileview * defviewer %c + endif + endif + + expand({expr}) + + Expands environment variables and macros in {expr} just like it's done + for command-line commands. Returns a string. See "Command macros" + section above. + + Examples: + + " percent sign + :echo expand('%%') + " the last part of directory name of the other pane + :echo expand('%D:t') + " $PATH environment variable (same as `:echo $PATH`) + :echo expand('$PATH') + + filetype({fnum}[,{resolve}]) + + The result is a string, which represents file type and is one of the + list: + exe executables + reg regular files + link symbolic links + broken broken symbolic links (appears only when resolving) + dir directories + char character devices + block block devices + fifo pipes + sock *nix domain sockets + ? unknown file type (should not normally appear) + + The result can also be an empty string in case of invalid argument. + + Parameter {fnum} can have following values: + - '.' to get type of file under the cursor in the active pane + - numerical value base 1 to get type of file on specified line + number + + Optional parameter {resolve} is treated as a boolean and specifies + whether symbolic links should be resolved. + + fnameescape({expr}) + + Escapes parameter to make it suitable for use as an argument of a + :command. List of escaped characters includes %, which is doubled. + + Usage example: + + " navigate to most recently modified file in current directory + execute 'goto' fnameescape(system('ls -t | head -1')) + + getpanetype() + + Retrieves string describing type of current pane. Possible return + values: + regular regular file listing of some directory + custom custom file list (%u) + very-custom very custom file list (%U) + tree tree view + + has({property}) + + Allows examining internal parameters from scripts to e.g. figure out + environment in which application is running. Returns 1 if property is + true/present, otherwise 0 is returned. Currently the following + properties are supported (anything else will yield 0): + unix runs in *nix-like environment (including Cygwin) + win runs on Windows + + Usage example: + + " skip user/group on Windows + if !has('win') + let $RIGHTS = '%10u:%-7g ' + endif + + execute 'set' 'statusline=" %t%= %A '.$RIGHTS.'%15E %20d "' + + layoutis({type}) + + Checks whether current interface layout is {type} or not, where {type} + can be: + only single-pane mode + split double-pane mode (either vertical or horizon split) + vsplit vertical split (left and right panes) + hsplit horizontal split (top and bottom panes) + + Usage example: + + " automatically split vertically before enabling preview + :nnoremap w :if layoutis('only') | vsplit | endif | view!<cr> + + paneisat({loc}) + + Checks whether position of active pane in current layout matches one of + the following locations: + top pane reaches top border + bottom pane reaches bottom border + left pane reaches left border + right pane reaches right border + + system({command}) + + Runs the command in shell and returns its output (joined standard + output and standard error streams). All trailing newline characters + are stripped to allow easy appending to command output. Ctrl-C should + interrupt the command. + + Use this function to consume output of external commands that don't + require user interaction and term() for interactive commands that make + use of terminal and are capable of handling stream redirection. + + Usage example: + + " command to enter .git/ directory of git-repository (when ran inside one) + command! cdgit :execute 'cd' system('git rev-parse --git-dir') + + tabpagenr([{arg}]) + + When called without arguments returns number of current tab page base + one. + + When called with "$" as an argument returns number of the last tab page + base one, which is the same as number of tabs. + + term({command}) + + Same as system() function, but user interface is shutdown during the + execution of the command, which makes sure that external interactive + applications won't affect the way terminal is used by vifm. + + Usage example: + + " command to change directory by picking it via fzf + command! fzfcd :execute 'cd' "'".term('find -type d | fzf 2> /dev/tty')."'" + +Menus and dialogs + When navigating to some path from a menu there is a difference in end + location depending on whether path has trailing slash or not. Files + normally don't have trailing slashes so "file/" won't work and one can + only navigate to a file anyway. On the other hand with directories + there are two options: navigate to a directory or inside of it. To + allow both use cases, the first one is used on paths like "dir" and the + second one for "dir/". + + Commands + + :range navigate to a menu line. + + :exi[t][!] :q[uit][!] :x[it][!] + leave menu mode. + + :noh[lsearch] + reset search match highlighting. + + :w[rite] {dest} + write all menu lines into file specified by {dest}. + + General + + j, Ctrl-N - move down. + k, Ctrl-P - move up. + Enter, l - select and exit the menu. + Ctrl-L - redraw the menu. + + Escape, Ctrl-C, ZZ, ZQ, q - quit. + + In all menus + + The following set of keys has the same meaning as in normal mode. + + Ctrl-B, Ctrl-F + Ctrl-D, Ctrl-U + Ctrl-E, Ctrl-Y + /, ? + n, N + [count]G, [count]gg + H, M, L + zb, zt, zz + + zh - scroll menu items [count] characters to the right. + zl - scroll menu items [count] characters to the left. + zH - scroll menu items half of screen width characters to the right. + zL - scroll menu items half of screen width characters to the left. + + : - enter command line mode for menus (currently only :exi[t], :q[uit], + :x[it] and :{range} are supported). + + b - interpret content of the menu as list of paths and use it to create + custom view in place of previously active pane. See "Custom views" + section below. + B - same as above, but creates unsorted view. + + v - load menu content into quickfix list of the editor (Vim compatible + by assumption) or if list doesn't have separators after file names + (colons) open each line as a file name. + + + Below is description of additional commands and reaction on selection + in some menus and dialogs. + + Apropos menu + + Selecting menu item runs man on a given topic. Menu won't be closed + automatically to allow view several pages one by one. + + Command-line mode abbreviations menu + + Type dd on an abbreviation to remove it. + + c leaves menu preserving file selection and inserts right-hand side of + selected command into command-line. + + Color scheme menu + + Selecting name of a color scheme applies it the same way as if + ":colorscheme <name>" was executed on the command-line. + + Commands menu + + Selecting command executes it with empty arguments (%a). + + dd on a command to remove. + + Marks menu + + Selecting mark navigates to it. + + dd on a mark to remove it. + + Bookmarks menu + + Selecting a bookmark navigates to it. + + Type dd on a bookmark to remove it. + + gf and e also work to make it more convenient to bookmark files. + + Trash (:lstrash) menu + + r on a file name to restore it from trash. + + dd deletes file under the cursor. + + Trashes menu + + dd empties selected trash in background. + + Directory history and Trashes menus + + Selecting directory name will change directory of the current view as + if :cd command was used. + + Directory stack menu + + Selecting directory name will rotate stack to put selected directory + pair at the top of the stack. + + Filetype menu + + Commands from vifmrc or typed in command-line are displayed above empty + line. All commands below empty line are from .desktop files. + + c leaves menu preserving file selection and inserts command after :! in + command-line mode. + + Grep, find, locate, bookmarks and user menu with navigation (%M macro) + + gf - navigate previously active view to currently selected item. + Leaves menu mode except for grep menu. Pressing Enter key has the same + effect. + + e - open selected path in the editor, stays in menu mode. + + c - leave menu preserving file selection and insert file name after :! + in command-line mode. + + User menu without navigation (%m macro) + + c leaves menu preserving file selection and inserts whole line after :! + in command-line mode. + + Grep menu + + Selecting file (via Enter or l key) opens it in editor set by 'vicmd' + at given line number. Menu won't be closed automatically to allow + viewing more than one result. + + See above for "gf" and "e" keys description. + + Command-line history menu + + Selecting an item executes it as command-line command, search query or + local filter. + + c leaves menu preserving file selection and inserts line into command- + line of appropriate kind. + + Volumes menu + + Selecting a drive navigates previously active pane to the root of that + drive. + + Fileinfo dialog + + Enter, q - close dialog + + Sort dialog + + h, Space - switch ascending/descending. + q - close dialog + + One shortcut per sorting key (see the dialog). + + Attributes (permissions or properties) dialog + + h, Space - check/uncheck. + q - close dialog + + Item states: + + - * - checked flag. + + - X - means that it has different value for files in selection. + + - d (*nix only) - (only for execute flags) means u-x+X, g-x+X or o-x+X + argument for the chmod program. If you're not on OS X and want to + remove execute permission bit from all files, but preserve it for + directories, set all execute flags to 'd' and check 'Set Recursively' + flag. + + Jobs menu + + dd requests cancellation of job under cursor. The job won't be removed + from the list, but marked as being cancelled (if cancellation was + successfully requested). A message will pop up if the job has already + stopped. Note that on Windows cancelling external programs like this + might not work, because their parent shell doesn't have any windows. + + e key displays errors of selected job if any were collected. They are + displayed in a new menu, but you can get back to jobs menu by pressing + h. + + + Undolist menu + + r - reset undo position to group under the cursor. + + + Media menu + + r - reload the list. + + m - mount/unmount device (cursor should be positioned on lines under + device information). + + +Custom views + Definition + + Normally file views contain list of files from a single directory, but + sometimes it's useful to populate them with list of files that do not + belong to the same directory, which is what custom views are for. + + Presentation + + Custom views are still related to directory they were in before custom + list was loaded. Path to that directory (original directory) can be + seen in the title of a custom view. + + Files in same directory have to be named differently, this doesn't hold + for custom views thus seeing just file names might be rather confusing. + In order to give an idea where files come from and when possible, + relative paths to original directory of the view is displayed, + otherwise full path is used instead. + + Custom views normally don't contain any inexistent files. + + Navigation + + Custom views have some differences related to navigation in regular + views. + + gf - acts similar to gf on symbolic links and navigates to the file at + its real + location. + + h - go to closes parent node in tree view, otherwise return to the + original directory. + + gh - return to the original directory. + + Opening ".." entry also causes return to the original directory. + + History + + Custom list exists only while it's visible, once left one can't return + to it, so there is no appearances of it in any history. + + Filters + + Only local filter affects content of the view. This is intentional, + presumably if one loads list, precisely that list should be displayed + (except for inexistent paths, which are ignored). + + Search + + Although directory names are visible in listing, they are not + searchable. Only file names are taken into account (might be changed + in future, searching whole lines seems quite reasonable). + + Sorting + + Contrary to search sorting by name works on whole visible part of file + path. + + Highlight + + Whole file name is highlighted as one entity, even if there are + directory elements. + + Updates + + Reloads can occur, though they are not automatic due to files being + scattered among different places. On a reload, inexistent files are + removed and meta-data of all other files is updated. + + Once custom view forgets about the file, it won't add it back even if + it's created again. So not seeing file previously affected by an + operation, which was undone is normal. + + Operations + + All operations that add files are forbidden for custom views. For + example, moving/copying/putting files into a custom view doesn't work, + because it doesn't make much sense. + + On the other hand, operations that use files of a custom view as a + source (e.g. yanking, copying, moving file from custom view, deletion) + and operations that modify names are all allowed. + +Compare views + Kinds + + :compare can produce four different results depending on arguments: + - single compare view (ofone and either listall or listdups); + - single custom view (ofone and listunique); + - two compare views (ofboth and either listall or listdups); + - two custom views (ofboth and listunique). + + The first two display files of one file system tree. Here duplicates + are files that have at least one copy in the same tree. The other two + kinds of operation compare two trees, in which duplicates are files + that are found in both trees. + + Lists of unique files are presented in custom views because there is no + file grouping to preserve as all file ids are guaranteed to be + distinct. + + Creation + + Arguments passed to :compare form four categories each with its own + prefix and is responsible for particular property of operation. + + Which files to compare: + - ofboth - compares files of two panes against each other; + - ofone - compares files of the same directory. + + How files are compared: + - byname - by their name only; + - bysize - only by their size; + - bycontents - by combination of size and hash of file contents. + + Which files to display: + - listall - all files; + - listunique - unique files only; + - listdups - only duplicated files. + + How results are grouped (has no effect if "ofone" specified): + - groupids - files considered identical are always adjacent in + output; + - grouppaths - file system ordering is preferred (this also enables + displaying identically named files as mismatches). + + Which files to omit: + - skipempty - ignore empty files. + + Each argument can appear multiple times, the rightmost one of the group + is considered. Arguments alter default behaviour instead of + substituting it. + + Examples + + The defaults corresponds to probably the most common use case of + comparing files in two trees with grouping by paths, so the following + are equivalent: + + :compare + :compare bycontents grouppaths + :compare bycontents listall ofboth grouppaths + + Another use case is to find duplicates in the current sub-tree: + + :compare listdups ofone + + The following command lists files that are unique to each pane: + + :compare listunique + + Look + + The view can't switch to ls-like view as it's unable to display diff- + like data. + + Comparison views have second column displaying id of the file, files + with same id are considered to be equal. The view columns + configuration is predefined. + + Behaviour + + When two views are being compared against each other the following + changes to the regular behaviour apply: + - views are scrolled synchronously (as if 'scrollbind' was set); + - views' cursors are synchronized; + - local filtering is disabled (its results wouldn't be meaningful); + - zd excludes groups of adjacent identical files, 1zd gives usual + behaviour; + - sorting is permanently disabled (ordering is fixed); + - removed files hide their counter pairs; + - exiting one of the views terminates the other immediately; + - renaming files isn't blocked, but isn't taken into account and might + require regeneration of comparison; + - entries which indicate absence of equivalent file have empty names + and can be matched as such; + - when unique files of both views are listed custom views can be + empty, this absence of unique files is stated clearly. + + One compare view has similar properties (those that are applicable for + single pane). + + Files are gathered in this way: + - recursively starting at current location of the view; + - dot files are excluded if view hides them at the moment of + comparison; + - directories are not taken into account; + - symbolic links to directories are ignored. + +Startup + On startup vifm determines several variables that are used during the + session. They are determined in the order they appear below. + + On *nix systems $HOME is normally present and used as is. On Windows + systems vifm tries to find correct home directory in the following + order: + - $HOME variable; + - $USERPROFILE variable (on Windows only); + - a combination of $HOMEDRIVE and $HOMEPATH variables (on Windows + only). + + vifm tries to find correct configuration directory by checking the + following places: + - $VIFM variable; + - parent directory of the executable file (on Windows only); + - $HOME/.vifm directory; + - $APPDATA/Vifm directory (on Windows only); + - $XDG_CONFIG_HOME/vifm directory; + - $HOME/.config/vifm directory. + + vifm tries to find correct configuration file by checking the following + places: + - $MYVIFMRC variable; + - vifmrc in parent directory of the executable file (on Windows only); + - $VIFM/vifmrc file. + +Configure + See "Startup" section above for the explanations on $VIFM and + $MYVIFMRC. + + The vifmrc file contains commands that will be executed on vifm + startup. There are two such files: global and local. Global one is at + {prefix}/etc/vifm/vifmrc, see $MYVIFMRC variable description for the + search algorithm used to find local vifmrc. Global vifmrc is loaded + before the local one, so that the later one can redefine anything + configured globally. + + Use vifmrc to set settings, mappings, filetypes etc. To use multi line + commands precede each next line with a slash (whitespace before slash + is ignored, but all spaces at the end of the lines are saved). For + example: + + set + \smartcase + + equals "setsmartcase". When + + set<space here> + \ smartcase + + equals "set smartcase". + + The $VIFM/vifminfo file contains session settings. You may edit it by + hand to change the settings, but it's not recommended to do that, edit + vifmrc instead. You can control what settings will be saved in + vifminfo by setting 'vifminfo' option. Vifm always writes this file on + exit unless 'vifminfo' option is empty. Marks, bookmarks, commands, + histories, filetypes, fileviewers and registers in the file are merged + with vifm configuration (which has bigger priority). + + Generally, runtime configuration has bigger priority during merging, + but there are some exceptions: + + - directory stack stored in the file is not overwritten unless + something is changed in vifm session that performs merge; + + - each mark or bookmark is marked with a timestamp, so that newer + value is not overwritten by older one, thus no matter from where it + comes, the newer one wins. + + The $VIFM/scripts directory can contain shell scripts. vifm modifies + its PATH environment variable to let user run those scripts without + specifying full path. All subdirectories of the $VIFM/scripts will be + added to PATH too. Script in a subdirectory overlaps script with the + same name in all its parent directories. + + The $VIFM/colors/ and {prefix}/etc/vifm/colors/ directories contain + color schemes. Available color schemes are searched in that order, so + on name conflict the one in $VIFM/colors/ wins. + + Each color scheme should have ".vifm" extension. This wasn't the case + before and for this reason the following rules apply during lookup: + + - if there is no file with .vifm extension, all regular files are + listed; + + - otherwise only files with .vifm extension are listed (with the + extension being truncated). + +Automatic FUSE mounts + vifm has a builtin support of automated FUSE file system mounts. It is + implemented using file associations mechanism. To enable automated + mounts, one needs to use a specially formatted program line in filetype + or filextype commands. Currently two formats are supported: + + 1) FUSE_MOUNT This format should be used in case when all information + needed for mounting all files of a particular type is the same. E.g. + mounting of tar files don't require any file specific options. + + Format line: + FUSE_MOUNT|mounter %SOURCE_FILE %DESTINATION_DIR [%FOREGROUND] + + Example filetype command: + + :filetype FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR + + 2) FUSE_MOUNT2 This format allows one to use specially formatted files + to perform mounting and is useful for mounting remotes, for example + remote file systems over ftp or ssh. + + Format line: + FUSE_MOUNT2|mounter %PARAM %DESTINATION_DIR [%FOREGROUND] + + Example filetype command: + + :filetype FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR + + Example file content: + + root@127.0.0.1:/ + + All % macros are expanded by vifm at runtime and have the following + meaning: + - %SOURCE_FILE is replaced by full path to selected file; + - %DESTINATION_DIR is replaced by full path to mount directory, which + is created by vifm basing on the value of 'fusehome' option; + - %PARAM value is filled from the first line of file (whole line), + though in the future it can be changed to whole file content; + - %FOREGROUND means that you want to run mount command as a regular + command (required to be able to provide input for communication with + mounter in interactive way). + + %FOREGROUND is an optional macro. Other macros are not mandatory, but + mount commands likely won't work without them. + + %CLEAR is obsolete name of %FOREGROUND, which is still supported, but + might be removed in future. Its use is discouraged. + + The mounted FUSE file systems will be automatically unmounted in two + cases: + + - when vifm quits (with ZZ, :q, etc. or when killed by signal); + + - when you explicitly leave mount point going up to its parent + directory (with h, Enter on "../" or ":cd ..") and other pane is + not in the same directory or its child directories. + +View look + vifm supports displaying of file list view in two different ways: + + - in a table mode, when multiple columns can be set using + 'viewcolumns' option (see "Column view" section below for details); + + - in a multicolumn list manner which looks almost like `ls -x` + command output (see "ls-like view" section below for details). + + The look is local for each view and can be chosen by changing value of + the 'lsview' boolean option. + + Depending on view look some of keys change their meaning to allow more + natural cursor moving. This concerns mainly h, j, k, l and other + similar navigation keys. + + Also some of options can be ignored if they don't affect view + displaying in selected look. For example value of 'viewcolumns' when + 'lsview' is set. + +ls-like view + When this view look is enabled by setting 'lsview' option on, vifm will + display files in multiple columns. Number of columns depends on the + length of the longest file name present in current directory of the + view. Whole file list is automatically reflowed on directory change, + terminal or view resize. + + View looks close to output of `ls -x` command, so files are listed left + to right in rows. + + In this mode file manipulation commands (e.g. d) don't work line-wise + like they do in Vim, since such operations would be uncommon for file + manipulation tasks. Thus, for example, dd will remove only current + file. + + By default the view is filled by lines, 'lsoptions' can be used to get + filling by columns. + + Note that tree-view and compare view inhibit ls-like view. + +Column view + View columns are described by a comma-separated list of column + descriptions, each of which has the following format + [ '-' ] [ fw ( [ '.' tw ] | '%' ) ] '{' type '}' '.'{0,3} + where fw stands for full width and tw stands for text width. + + So it basically consists of four parts: + 1. Optional alignment specifier + 2. Optional width specifier + 3. Mandatory column name + 4. Optional cropping specifier + + Alignment specifier + + It's an optional minus or asterisk sign as the first symbol of the + string. + + Specifies type of text alignment within a column. Three types are + supported: + + - left align + + set viewcolumns=-{name} + + - right align (default) + + set viewcolumns={name} + + - dynamic align + + It's like left alignment, but when the text is bigger than the + column, the alignment is made at the right (so the part of the field + is always visible). + + set viewcolumns=*{name} + + Width specifier + + It's a number followed by a percent sign, two numbers (second one + should be less than or equal to the first one) separated with a dot or + a single number. + + Specifies column width and its units. There are three size types: + + - absolute size - column width is specified in characters + + set viewcolumns=-100{name},20.15{ext} + + results in two columns with lengths of 100 and 20 and a reserved + space of five characters on the left of second column. + + - relative (percent) size - column width is specified in percents of + view width + + set viewcolumns=-80%{name},15%{ext},5%{mtime} + + results in three columns with lengths of 80/100, 15/100 and 5/100 of + view width. + + - auto size (default) - column width is automatically determined + + set viewcolumns=-{name},{ext},{mtime} + + results in three columns with length of one third of view width. + There is no size adjustment to content, since it will slow down + rendering. + + Columns of different sizing types can be freely mixed in one view. + Though sometimes some of columns can be seen partly or be completely + invisible if there is not enough space to display them. + + Column name + + This is just a sort key surrounded with curly braces or {root}, e.g. + + {name},{ext},{mtime} + + {name} and {iname} keys are the same and present both for consistency + with 'sort' option. + + Following keys don't have corresponding sorting keys: + + - {root} - display name without extension (as a complement for {ext}) + + Empty curly braces ({}) are replaced with the default secondary column + for primary sort key. So after the next command view will be displayed + almost as if 'viewcolumns' is empty, but adding ellipsis for long file + names: + + set viewcolumns=-{name}..,6{}. + + Cropping specifier + + It's from one to three dots after closing curly brace in column format. + + Specifies type of text truncation if it doesn't fit in the column. + Currently three types are supported: + + - truncation - text is truncated + + set viewcolumns=-{name}. + + results in truncation of names that are too long too fit in the + view. + + - adding of ellipsis - ellipsis on the left or right are added when + needed + + set viewcolumns=-{name}.. + + results in that ellipsis are added at the end of too long file + names. + + - none (default) - text can pass column boundaries + + set viewcolumns=-{name}...,{ext} + + results in that long file names can partially be written on the ext + column. + +Color schemes + The color schemes in vifm can be applied in two different ways: + + - as the primary color scheme; + + - as local to a pane color scheme. + + Both types are set using :colorscheme command, but of different forms: + + - :colorscheme color_scheme_name - for the primary color scheme; + + - :colorscheme color_scheme_name directory - for local color schemes. + + Look of different parts of the TUI (Text User Interface) is determined + in this way: + + - Border, TabLine, TabLineSel, TopLineSel, TopLine, CmdLine, + ErrorMsg, StatusLine, JobLine, SuggestBox and WildMenu are always + determined by the primary color scheme; + + - CurrLine, Selected, Directory, Link, BrokenLink, Socket, Device, + Executable, Fifo, CmpMismatch, Win and AuxWin are determined by + primary color scheme and a set of local color schemes, which can be + empty. + + There might be a set of local color schemes because they are structured + hierarchically according to file system structure. For example, having + the following piece of file system: + + ~ + `-- bin + | + `-- my + + Two color schemes: + + # ~/.vifm/colors/for_bin + highlight Win cterm=none ctermfg=white ctermbg=red + highlight CurrLine cterm=none ctermfg=red ctermbg=black + + # ~/.vifm/colors/for_bin_my + highlight CurrLine cterm=none ctermfg=green ctermbg=black + + And these three commands in the vifmrc file: + + colorscheme Default + colorscheme for_bin ~/bin + colorscheme for_bin_my ~/bin/my + + File list will look in the following way for each level: + + - ~/ - Default color scheme + black background + cursor with blue background + + - ~/bin/ - mix of Default and for_bin color schemes + red background + cursor with black background and red foreground + + - ~/bin/my/ - mix of Default, for_bin and for_bin_my color schemes + red background + cursor with black background and green foreground + +Trash directory + vifm has support of trash directory, which is used as temporary storage + for deleted files or files that were cut. Using trash is controlled by + the 'trash' option, and exact path to the trash can be set with + 'trashdir' option. Trash directory in vifm differs from the system- + wide one by default, because of possible incompatibilities of storing + deleted files among different file managers. But one can set + 'trashdir' to "~/.local/share/Trash" to use a "standard" trash + directory. + + There are two scenarios of using trash in vifm: + + 1. As a place for storing files that were cut by "d" and may be + inserted to some other place in file system. + + 2. As a storage of files, that are deleted but not purged yet. + + The first scenario uses deletion ("d") operations to put files to trash + and put ("p") operations to restore files from trash directory. Note + that such operations move files to and from trash directory, which can + be long term operations in case of different partitions or remote + drives mounted locally. + + The second scenario uses deletion ("d") operations for moving files to + trash directory and :empty command-line command to purge all previously + deleted files. + + Deletion and put operations depend on registers, which can point to + files in trash directory. Normally, there are no nonexistent files in + registers, but vifm doesn't keep track of modifications under trash + directory, so one shouldn't expect value of registers to be absolutely + correct if trash directory was modified not by operation that are meant + for it. But this won't lead to any issues with operations, since they + ignore nonexistent files. + +Client-Server + vifm supports remote execution of command-line mode commands, remote + changing of directories and expression evaluation. This is possible + using --remote and --remote-expr command-line arguments. + + To execute a command remotely combine --remote argument with -c + <command> or +<command>. For example: + + vifm --remote -c 'cd /' + vifm --remote '+cd /' + + To change directory not using command-line mode commands one can + specify paths right after --remote argument, like this: + + vifm --remote / + vifm --remote ~ + vifm --remote /usr/bin /tmp + + Evaluating expression remotely might be useful to query information + about an instance, for example its location: + + vifm --remote-expr 'expand("%d")' + + If there are several running instances, the target can be specified + with --server-name option (otherwise, the first one lexicographically + is used): + + vifm --server-name work --remote ~/work/project + + List of names of running instances can be obtained via --server-list + option. Name of the current one is available via v:servername. + + + v:servername + server name of the running vifm instance. Empty if client- + server feature is disabled. + +Plugin + Plugin for using vifm in vim as a file selector. + + Commands: + + :EditVifm select a file or files to open in the current buffer. + :SplitVifm split buffer and select a file or files to open. + :VsplitVifm vertically split buffer and select a file or files to + open. + :DiffVifm select a file or files to compare to the current file + with + :vert diffsplit. + :TabVifm select a file or files to open in tabs. + + Each command accepts up to two arguments: left pane directory and right + pane directory. After arguments are checked, vifm process is spawned + in a special "file-picker" mode. To pick files just open them either + by pressing l, i or Enter keys, or by running :edit command. If no + files are selected, file under the cursor is opened, otherwise whole + selection is passed to the plugin and opened in vim. + + The plugin have only two settings. It's a string variable named + g:vifm_term to let user specify command to run GUI terminal. By + default it's equal to 'xterm -e'. And another string variable named + g:vifm_exec, which equals "vifm" by default and specifies path to + vifm's executable. To pass arguments to vifm use g:vifm_exec_args, + which is empty by default. + + To use the plugin copy the vifm.vim file to either the system wide + vim/plugin directory or into ~/.vim/plugin. + + If you would prefer not to use the plugin and it is in the system wide + plugin directory add + + let loaded_vifm=1 + + to your ~/.vimrc file. + +Reserved + The following command names are reserved and shouldn't be used for user + commands. + + g[lobal] + v[global] + +ENVIRONMENT + VIFM Points to main configuration directory (usually ~/.vifm/). + + MYVIFMRC + Points to main configuration file (usually ~/.vifm/vifmrc). + + These environment variables are valid inside vifm and also can be used + to configure it by setting some of them before running vifm. + + When $MYVIFMRC isn't set, it's made as $VIFM/vifmrc (exception for + Windows: vifmrc in the same directory as vifm.exe has higher priority + than $VIFM/vifmrc). + + See "Startup" section above for more details. + + VIFM_FUSE_FILE + On execution of external commands this variable is set to the + full path of file used to initiate FUSE mount of the closes + mount point from current pane directory up. It's not set when + outside FUSE mount point. When vifm is used inside terminal + multiplexer, it tries to set this variable as well (it doesn't + work this way on its own). + +SEE ALSO + vifm-convert-dircolors(1), vifm-pause(1) + + Website: https://vifm.info/ + Wiki: https://wiki.vifm.info/ + + Esperanto translation of the documentation by Sebastian Cyprych: + http://cyprych.neostrada.pl/tekstoj/komputiloj/vifm-help.eo.html + +AUTHOR + Vifm was written by ksteen <ksteen@users.sourceforge.net> + And currently is developed by xaizek <xaizek@posteo.net> + + + +vifm 0.10 November 11, 2018 VIFM(1) diff --git a/vifm/.vifm/vifmrc b/vifm/.vifm/vifmrc @@ -0,0 +1,143 @@ +"" have a look : https://github.com/xaizek/dotvifm/blob/master/colors/near-default.vifm + +" color scheme +colorscheme Default + +" don't show side borders ('s'), and don't show margins +set tuioptions-=s +set tuioptions-=p + +" vertical border +set fillchars=vborder:" " + +" view columns +set viewcolumns=-{name}..,6{size},11{perms},-12{mtime} + +" line numbers +set number +set relativenumber + +" wildmenu +set wildmenu +set wildstyle=popup + +" hide parent dir, and use right pane for preview +set dotdirs="" +"set millerview +"set milleroptions=lsize:2,csize:5 +fileviewer */,.*/,../ + \ [ -z "$(find %c -maxdepth 0 -empty)" ] + \ && ls --group-directories-first --color %c 2>&1 | sed -e 's/^/ /' + \ || echo -e " empty directory..." +nnoremap w :view<cr> +view + +" set classify "icons" (prefix:class:sufix) +set classify="" + +" highlight files +highlight Directory cterm=bold ctermfg=blue ctermbg=default +highlight Link cterm=none ctermfg=yellow ctermbg=default +highlight BrokenLink cterm=none ctermfg=red ctermbg=default +highlight Socket cterm=none ctermfg=magenta ctermbg=default +highlight Device cterm=none ctermfg=red ctermbg=default +highlight Fifo cterm=none ctermfg=cyan ctermbg=default +highlight Executable cterm=bold ctermfg=10 ctermbg=default +highlight /(.ff.gz|.ff|.bmp|.jpg|.jpeg|.png|,gif|.xpm|.svg)$/ + \ cterm=bold ctermfg=6 ctermbg=default +highlight /(.pdf|.ps)$/ + \ cterm=bold ctermfg=6 ctermbg=default +highlight /(.tar.gz|.tar)$/ + \ cterm=bold ctermfg=red ctermbg=default + +" open images with sxiv (in background) +filextype *.ff,*.ff.gz,*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm + \ sxiv %c & +" open current file in sxiv (TODO :: if %c is not dir, take it's dir) +nnoremap ,p :!sxiv -t %c &<cr> + +" open pdf and ps with zathura (in background) +filextype *.pdf,*.ps + \ zathura %c & + +fileviewer *.tar tar -tf %c | fold -w $((%pw-1)) | sed -e 's/^/ /' +fileviewer *.tar.gz tar -ztf %c | fold -w $((%pw-1)) | sed -e 's/^/ /' + +fileviewer *.pdf + \ vifmimg pdfpreview %px %py %pw %ph %c + \ %pc + \ vifmimg clear +fileviewer *.epub + \ vifmimg epubpreview %px %py %pw %ph %c + \ %pc + \ vifmimg clear +fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, + \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, + \ vifmimg videopreview %px %py %pw %ph %c + \ %pc + \ vifmimg clear +fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm + \ vifmimg draw %px %py %pw %ph %c + \ %pc + \ vifmimg clear +fileviewer *.ff,*.ff.xz,*.ff.gz,*.ff.bz + \ vifmimg drawff %px %py %pw %ph %c + \ %pc + \ vifmimg clear +fileviewer *.gif + \ vifmimg gifpreview %px %py %pw %ph %c + \ %pc + \ vifmimg clear + +" disable preview of binary files (or files not yet handled) +fileviewer * + \ grep -P "[^\x00-\x7F]" %c 2>&1 >/dev/null + \ && echo " binary file:" %c + \ || cat %c | fold -w $((%pw-1)) | sed -e 's/^/ /' + +" time format +set timefmt="%Y-%m-%d %H:%M" + +" ruler +set rulerformat='%2l/%S%[ (+%x)%]' + +" status line +highlight User1 cterm=none ctermfg=14 ctermbg=5 +highlight User2 cterm=none ctermfg=5 ctermbg=14 +let &statusline = "%2* %t" " file name +let &statusline .= " %1* " " left separator +let &statusline .= "%= " " fill the whole status line +let &statusline .= "%1*" " right separator +let &statusline .= " %A " " file attributes +let &statusline .= "%1*" " right separator +let &statusline .= " %7u:%-7g " " user and group owners of the file +let &statusline .= "%1*" " right separator +let &statusline .= " %-5s " " human readable file size +let &statusline .= " %1*%2* " " right separator +let &statusline .= " %d " " file modification date and time + + +" bring up sort menu +nmap s :sort<cr> +nmap w :view<cr> +nmap S :shell<cr> + +" set selected file as wallpaper +nmap ,W :!echo %c:p | set-wallpaper &<cr> + +" fzf integration +command! fzffind + \ :set noquickview + \ | :execute 'goto "'.system('find \( -name ".*" -or -name "*" \) + \ | fzf + \ --layout="reverse-list" + \ --height=100 + \ --preview="grep -sq -P ''[^\x00-\x7F]'' {} + \ && echo binary file: {} + \ || cat {}" + \ --preview-window="right:70%%:wrap" + \ 2>/dev/tty').'"%IU' + \ | :set quickview + \ | redraw +nnoremap <c-f> :fzffind<cr> + diff --git a/vim/.vim/plugins/vim-dfm/vim-dfm.vim b/vim/.vim/plugins/vim-dfm/vim-dfm.vim @@ -0,0 +1,144 @@ +function! s:LoadOffsets() + let l:left_offset = ((winwidth('%')-80)/2) + if l:left_offset > 22 + let l:left_offset = 22 + endif + if l:left_offset <= 10 + let s:numberwidth_offset = l:left_offset + let s:foldcolumn_offset = 0 + else + let s:numberwidth_offset = 10 + let s:foldcolumn_offset = l:left_offset - 10 + endif + let &columns = &columns - l:left_offset + let &colorcolumn = 0 +endfunction + + +" Retrieves the color for a provided scope and swatch in the current context +function! s:LoadColor(scope, swatch) + let l:scopeColor = synIDattr(hlID(a:scope), a:swatch, 'cterm') + return l:scopeColor < 0 ? 'none' : l:scopeColor +endfunction + + +" Generates a highlight command for the provided scope, foreground, and +" background +function! s:Highlight(scope, fg, bg) + return 'highlight ' . a:scope . ' ctermfg=' . a:fg . ' ctermbg=' . a:bg +endfunction + + +" Generate a highlight string that hides the given scope by setting its +" foreground and background to match the normal background +function! s:Hide(scope) + return s:Highlight(a:scope, s:NormalBG, s:NormalBG) +endfunction + + +" Generate a highlight string that restores the given scope to its original +" foreground and background values +function! s:Restore(scope) + return s:Highlight(a:scope, s:[a:scope . 'FG'], s:[a:scope . 'BG']) +endfunction + + +" Execute the given command within each window that is not ignored +function! s:ForEachWindow(cmd) + let l:initialWindow = winnr() + execute 'windo ' . a:cmd + execute l:initialWindow . 'wincmd w' +endfunction + + +" Load all necessary colors and assign them to script-wide variables +function! s:LoadDFMColors() + let s:LineNrFG = s:LoadColor('LineNr', 'fg') + let s:LineNrBG = s:LoadColor('LineNr', 'bg') + let s:CursorLineNrFG = s:LoadColor('CursorLineNr', 'fg') + let s:CursorLineNrBG = s:LoadColor('CursorLineNr', 'bg') + let s:NonTextFG = s:LoadColor('NonText', 'fg') + let s:NonTextBG = s:LoadColor('NonText', 'bg') + let s:FoldColumnFG = s:LoadColor('FoldColumn', 'fg') + let s:FoldColumnBG = s:LoadColor('FoldColumn', 'bg') + let s:TabLineFillFG = s:LoadColor('TabLineFill', 'fg') + let s:TabLineFillBG = s:LoadColor('TabLineFill', 'bg') + + " Allow users to manually specify the color used to hide UI elements + let s:NormalBG = get(g:, 'lite_dfm_normal_bg_cterm', '0') +endfunction + + +" Function to enter DFM +function! LiteDFM() + + " Remember user's default values. + let s:number_default = &number + let s:laststatus_default = &laststatus + let s:tabline_default = &tabline + let s:showtabline_default = &showtabline + let s:colorcolumn_default = &colorcolumn + let s:foldcolumn_default = &foldcolumn + let s:numberwidth_default = &numberwidth + + if !get(s:, 'lite_dfm_on', 0) + call s:LoadDFMColors() + endif + call s:LoadOffsets() + let s:lite_dfm_on = 1 + + set number + set laststatus=0 + set showtabline=2 + set tabline=\ + call s:ForEachWindow('set numberwidth=' . s:numberwidth_offset . ' foldcolumn=' . s:foldcolumn_offset) + + execute s:Hide('LineNr') + execute s:Hide('CursorLineNr') + execute s:Hide('NonText') + execute s:Hide('FoldColumn') + execute s:Hide('TabLineFill') + +endfunction + + +" Function to close DFM +function! LiteDFMClose() + let s:lite_dfm_on = 0 + + let &number = s:number_default + let &laststatus = s:laststatus_default + let &tabline = s:tabline_default + let &showtabline = s:showtabline_default + let &colorcolumn = s:colorcolumn_default + let &columns = system('tput cols') + + call s:ForEachWindow('set numberwidth=' . s:numberwidth_default . ' foldcolumn=' . s:foldcolumn_default) + + try + execute s:Restore('LineNr') + execute s:Restore('CursorLineNr') + execute s:Restore('NonText') + execute s:Restore('FoldColumn') + execute s:Restore('TabLineFill') + catch /.*/ + " swallow the exception + endtry + +endfunction + + +" Function to toggle DFM +function! LiteDFMToggle() + if get(s:, 'lite_dfm_on', 0) + call LiteDFMClose() + else + call LiteDFM() + endif +endfunction + + +" Map function calls to commands +command! LiteDFM call LiteDFM() +command! LiteDFMClose call LiteDFMClose() +command! LiteDFMToggle call LiteDFMToggle() diff --git a/vim/.vim/plugins/vim-status/vim-status.vim b/vim/.vim/plugins/vim-status/vim-status.vim @@ -0,0 +1,71 @@ +set laststatus=2 + +if !exists('g:status_color_dark') + \ | let g:status_color_dark = 'ctermfg=6 ctermbg=5' + \ | endif +if !exists('g:status_color_light') + \ | let g:status_color_light = 'ctermfg=5 ctermbg=6' + \ | endif +if !exists('g:status_color_git') + \ | let g:status_color_git = 'ctermfg=3 ctermbg=5' + \ | endif + +function! SetStatusColorscheme() + exec 'hi User1 ' . g:status_color_dark + exec 'hi User2 ' . g:status_color_light + exec 'hi User3 ' . g:status_color_git +endfunc + +function! SetGitStatusLine() + let g:status_git_status = "" + if expand("%") == "" + return + endif + let isgit = system("git -C '" . expand("%:h") + \ . "' rev-parse")[:-2] + let istracked = system("git -C '" . expand("%:h") + \ . "' ls-files " . expand("%:t"))[:-2] + + if isgit == "" && istracked == expand("%:t") + let stats = system("git -C '" . expand("%:h") + \ . "' diff --numstat -- " . expand("%:t") + \ . " | awk '{printf \"+%d -%d\", $1, $2}'") + let branch = system("git -C '" . expand("%:h") + \ . "' branch | grep \\* | awk '{printf \"%s\", $2}'") + let g:status_git_status = ((stats == "" ? "+0 -0" : stats) + \ . "  " . branch . "  ") + endif +endfunction + +if has('statusline') + call SetStatusColorscheme() + call SetGitStatusLine() + + function! SetStatusLineStyle() + let &stl = "" + let &stl .= "%1* %n" + let &stl .= " %2* " + let &stl .= "%<%F" + let &stl .= "%( [%R%M]%)" + let &stl .= " %1*%1* " + let &stl .= "%3*%{g:status_git_status}" + let &stl .= "%= " + let &stl .= "%1*  " + let &stl .= "%1*%{&fileformat}" + let &stl .= "%1*  " + let &stl .= "%1*%(%{(&fenc!=''?&fenc:&enc)}%)" + let &stl .= "%1*  " + let &stl .= "%1*%(%{&filetype}%)" + let &stl .= " %1*%2* " + let &stl .= "%2*%4.l/%-4.L\ " + let &stl .= "(%-3.p%%)" + let &stl .= "%2* | %-4.c" + let &stl .= "%2*[0x%04B] " + endfunc + + au BufWritePost * call SetGitStatusLine() + au ColorScheme * call SetStatusColorscheme() + au ColorScheme,VimEnter * call SetStatusLineStyle() + nmap _ds :call SetStatusLineStyle()<CR> + call SetStatusLineStyle() +endif diff --git a/vim/.vim/plugins/vim-tabline/vim-tabline.vim b/vim/.vim/plugins/vim-tabline/vim-tabline.vim @@ -0,0 +1,40 @@ +if (exists("g:loaded_tabline_vim") && g:loaded_tabline_vim) || &cp + finish +endif +let g:loaded_tabline_vim = 1 + +function! Tabline() + let s = '' + let d = expand('%:~:h') + let d = pathshorten(d) + for i in range(tabpagenr('$')) + let tab = i + 1 + let winnr = tabpagewinnr(tab) + let buflist = tabpagebuflist(tab) + let bufnr = buflist[winnr - 1] + let bufname = bufname(bufnr) + let bufmodified = getbufvar(bufnr, "&mod") + + let s .= '%' . tab . 'T' + let s .= (tab == tabpagenr() ? '%#TabLineNumSel#' : '%#TabLineNum#') + let s .= ' ' . tab . ' ' + let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#') + let s .= ' ' + let s .= (bufname != '' ? fnamemodify(bufname, ':t') . ' ' : '[No Name] ') + + if bufmodified + let s .= '[+] ' + endif + + let s .= '%#TabLineFill# ' + endfor + + let s .= '%=%999%' + let s .= '%#TabLineSep#' + let s .= '' + let s .= '%#TabLineDir#' + let s .= ' ' . d . ' ' + + return s +endfunction +set tabline=%!Tabline() diff --git a/vim/.vim/syntax/markdown.vim b/vim/.vim/syntax/markdown.vim @@ -0,0 +1,943 @@ +" Vim syntax file +" Language: Markdown +" Maintainer: Gabriele Lana <gabriele.lana@gmail.com> +" Filenames: *.md + +if exists("b:current_syntax") + finish +endif + +if !exists('main_syntax') + let main_syntax = 'markdown' +endif + +if !exists('g:markdown_flavor') + let g:markdown_flavor = 'github' +endif + +if exists('g:markdown_enable_conceal') && g:markdown_enable_conceal + let b:markdown_concealends = 'concealends' + let b:markdown_conceal = 'conceal' + set conceallevel=2 + set concealcursor= +else + let b:markdown_concealends = '' + let b:markdown_conceal = '' +endif + +syn spell toplevel +syn sync fromstart +syn case ignore + + +" {{{ INLINE ELEMENTS + +syn cluster markdownInline contains= + \ markdownItalic,markdownBold,markdownBoldItalic,markdownStrike,markdownInlineCode, + \ markdownPullRequestLinkInText,markdownUrlLinkInText,markdownUserLinkInText, + \ markdownEmailLinkInText,markdownLinkContainer,markdownXmlComment, + \ markdownXmlElement,markdownXmlEmptyElement,markdownXmlEntities + +execute 'syn region markdownItalic matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|_\|^\)\@<=\*\%(\s\|\*\|$\)\@!" end="\%(\s\|\*\)\@<!\*" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends +execute 'syn region markdownItalic matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|\*\|^\)\@<=_\%(\s\|_\|$\)\@!" end="\%(\s\|_\)\@<!_" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends + +execute 'syn region markdownBold matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|__\|^\)\@<=\*\*\%(\s\|\*\|$\)\@!" end="\%(\s\|\*\*\)\@<!\*\*" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends +execute 'syn region markdownBold matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|\*\*\|^\)\@<=__\%(\s\|_\|$\)\@!" end="\%(\s\|__\)\@<!__" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends + +execute 'syn region markdownBoldItalic matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|_\|^\)\@<=\*\*\*\%(\s\|\*\|$\)\@!" end="\%(\s\|\*\)\@<!\*\*\*" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends +execute 'syn region markdownBoldItalic matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|\*\|^\)\@<=___\%(\s\|_\|$\)\@!" end="\%(\s\|_\)\@<!___" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends +execute 'syn region markdownBoldItalic matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|_\|^\)\@<=\*\*_\%(\s\|_\|$\)\@!" end="\%(\s\|_\)\@<!_\*\*" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends +execute 'syn region markdownBoldItalic matchgroup=markdownInlineDelimiter ' + \ . 'start="\%(\s\|\*\|^\)\@<=__\*\%(\s\|\*\|$\)\@!" end="\%(\s\|\*\)\@<!\*__" ' + \ . 'contains=@markdownInline ' + \ . b:markdown_concealends + +syn match markdownStrike /\%(\\\)\@<!\~\~\%(\S\)\@=\_.\{-}\%(\S\)\@<=\~\~/ contains=markdownStrikeDelimiter,@markdownInline +syn match markdownStrikeDelimiter /\~\~/ contained + +" Fenced code blocks in list items must be preceded by an empty line This is +" made this way so that the second rule could eat up something that is not a +" fenced code block like +" +" * This is a list item +" ```ruby +" # this is not a fenced code block but it's a code block +" def ruby; +" ``` +execute 'syn region markdownInlineCode matchgroup=markdownCodeDelimiter start=/\%(`\)\@<!`/ end=/`/ keepend contains=@NoSpell ' . b:markdown_concealends +execute 'syn region markdownInlineCode matchgroup=markdownCodeDelimiter start=/\%(`\)\@<!`\z(`\+\)/ end=/`\z1/ keepend contains=@NoSpell ' . b:markdown_concealends + +" case insensitive +" preceded by something that is not a word +" could be surrounded by angle brackets +" could begin with / or // (path) or the url protocol +" inside the url pairs of balanced parentheses are allowed +" inside the url html entities are allowed +" the end block is different because ?!:,. are not included in the url if they +" appear at the end of the url +let b:markdown_syntax_url = + \ '\c' + \ . '\%(\W\)\@<=' + \ . '<\?' + \ . '\%(' + \ . '\%(\<\%(https\?\|ftp\|file\):\/\/\|www\.\|ftp\.\)' + \ . '\|' + \ . '\/\/\?' + \ . '\)' + \ . '\%(' + \ . '&#\?[0-9A-Za-z]\{1,8};' + \ . '\|' + \ . '\\' + \ . '\|' + \ . '([-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?)' + \ . '\|' + \ . '\[[-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?\]' + \ . '\|' + \ . '{[-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?}' + \ . '\|' + \ . '[-A-Z0-9+&@#/%=~_|$?!:,.]' + \ . '\)*' + \ . '\%(' + \ . '&#\?[0-9A-Za-z]\{1,8};' + \ . '\|' + \ . '\\' + \ . '\|' + \ . '([-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?)' + \ . '\|' + \ . '\[[-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?\]' + \ . '\|' + \ . '{[-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?}' + \ . '\|' + \ . '[-A-Z0-9+&@#/%=~_|$]\+' + \ . '\)' + \ . '>\?' +execute 'syn match markdownUrlLinkInText /' . b:markdown_syntax_url . '/ contains=@NoSpell display' + +syn match markdownPullRequestLinkInText /\%(\w\)\@<!#\d\+/ display +syn match markdownUserLinkInText /\%(\w\)\@<!@[[:alnum:]._\/-]\+/ contains=@NoSpell display +syn match markdownEmailLinkInText /[[:alnum:]._%+-]\+@[[:alnum:].-]\+\.\w\{2,4}/ contains=@NoSpell display + +" something encosed in square brackets +" could not be preceded by a backslash +" could contain pairs of square brackets +" could contain no more than two consecutive newlines +" could contain single square brackets (open or closed) escaped +" could not contain unbalanced square brackets like 'a [ b \] c' +" could not contain nested square brackets +let b:markdown_syntax_allowed_characters_in_square_brackets = '\%([^\[\]]\|\\\[\|\\\]\)*' +let b:markdown_syntax_square_brackets_block = '' + \ . '\%(\\\)\@<!\[' + \ . '\%(' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\|' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\[' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\]' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\)' + \ . '\%(' + \ . '\n\%(\n\)\@!' + \ . '\%(' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\|' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\[' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\]' + \ . b:markdown_syntax_allowed_characters_in_square_brackets + \ . '\)' + \ . '\)*' + \ . '\]' + +" something encosed in round brackets +" could not be preceded by a backslash +" could contain pairs of round brackets +" could contain no more than two consecutive newlines +" could contain single round brackets (open or closed) escaped +" could not contain unbalanced round brackets like 'a ( b \) c' +" could not contain nested round brackets +let b:markdown_syntax_allowed_characters_in_round_brackets = '[^()]*' +let b:markdown_syntax_round_brackets_block = '' + \ . '\%(\\\)\@<!(' + \ . '\%(' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . '\|' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . '(' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . ')' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . '\)' + \ . '\%(' + \ . '\n\%(\n\)\@!' + \ . '\%(' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . '\|' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . '(' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . ')' + \ . b:markdown_syntax_allowed_characters_in_round_brackets + \ . '\)' + \ . '\)*' + \ . ')' + +execute 'syn match markdownLinkContainer ' + \ . 'contains=markdownLinkTextContainer,markdownLinkUrlContainer transparent ' + \ . '/' + \ . '!\?' + \ . b:markdown_syntax_square_brackets_block + \ . '\%(\s*\|\n\%\(\n\)\@!\)' + \ . '\%(' + \ . b:markdown_syntax_round_brackets_block + \ . '\|' + \ . b:markdown_syntax_square_brackets_block + \ . '\)' + \ . '/' + +execute 'syn match markdownLinkTextContainer contained ' + \ . 'contains=markdownLinkText ' + \ . '/' + \ . '!\?' + \ . b:markdown_syntax_square_brackets_block + \ . '/' + +execute 'syn match markdownLinkText contained ' + \ . 'contains=@markdownInline,@NoSpell ' + \ . '/' + \ . '!\?' + \ . b:markdown_syntax_square_brackets_block + \ . '/' + \ . 'hs=s+1,he=e-1' + +execute 'syn match markdownLinkUrlContainer contained ' + \ . 'contains=markdownLinkUrl,markdownLinkTitleSingleQuoted,markdownLinkTitleDoubleQuoted ' + \ . '/' + \ . b:markdown_syntax_round_brackets_block + \ . '/ ' + \ . b:markdown_conceal + +execute 'syn match markdownLinkUrl contained ' + \ . 'contains=@NoSpell ' + \ . '/' + \ . '\%((\)\@<=' + \ . '\%(' + \ . '&#\?[0-9A-Za-z]\{1,8};' + \ . '\|' + \ . '\\' + \ . '\|' + \ . '([-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?)' + \ . '\|' + \ . '\[[-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?\]' + \ . '\|' + \ . '{[-A-Z0-9+&@#/%=~_|$?!:,.]*\\\?}' + \ . '\|' + \ . '[-A-Z0-9+&@#/%=~_|$?!:,.]' + \ . '\|' + \ . '\s' + \ . '\)\+' + \ . '\%(\s\+["'']\|)\|\n\)\@=' + \ . '/' + +execute 'syn region markdownLinkTitleSingleQuoted start=/\s*''/ skip=/\\''/ end=/''\_s*/ display ' + \ . 'keepend contained contains=@markdownInline ' + \ . b:markdown_conceal + +execute 'syn region markdownLinkTitleDoubleQuoted start=/\s*"/ skip=/\\"/ end=/"\_s*/ display ' + \ . 'keepend contained contains=@markdownInline ' + \ . b:markdown_conceal + +syn match markdownXmlComment /\c<\!--\_.\{-}-->/ contains=@NoSpell +syn match markdownXmlElement /\c<\([-A-Z0-9_$?!:,.]\+\)[^>]\{-}>\_.\{-}<\/\1>/ contains=@NoSpell +syn match markdownXmlEmptyElement /\c<\([-A-Z0-9_$?!:,.]\+\)\%(\s\+[^>]\{-}\/>\|\s*\/>\)/ contains=@NoSpell +syn match markdownXmlEntities /&#\?[0-9A-Za-z]\{1,8};/ contains=@NoSpell + +" }}} + + +" {{{ ANCHORED BLOCKS + +syn match markdownRule /^\s*\*\s*\*\s*\*[[:space:]*]*$/ display +syn match markdownRule /^\s*-\s*-\s*-[[:space:]-]*$/ display +syn match markdownRule /^\s*_\s*_\s*_[[:space:]_]*$/ display + +if g:markdown_flavor ==? 'github' + syn region markdownH1 matchgroup=markdownHeadingDelimiter start=/^#\%(\s\+\)\@=/ end=/#*\s*$/ display oneline contains=@markdownInline + syn region markdownH2 matchgroup=markdownHeadingDelimiter start=/^##\%(\s\+\)\@=/ end=/#*\s*$/ display oneline contains=@markdownInline + syn region markdownH3 matchgroup=markdownHeadingDelimiter start=/^###\%(\s\+\)\@=/ end=/#*\s*$/ display oneline contains=@markdownInline + syn region markdownH4 matchgroup=markdownHeadingDelimiter start=/^####\%(\s\+\)\@=/ end=/#*\s*$/ display oneline contains=@markdownInline + syn region markdownH5 matchgroup=markdownHeadingDelimiter start=/^#####\%(\s\+\)\@=/ end=/#*\s*$/ display oneline contains=@markdownInline + syn region markdownH6 matchgroup=markdownHeadingDelimiter start=/^######\%(\s\+\)\@=/ end=/#*\s*$/ display oneline contains=@markdownInline + + syn match markdownH1 /^.\+\n=\+$/ display contains=@markdownInline,markdownHeadingUnderline + syn match markdownH2 /^.\+\n-\+$/ display contains=@markdownInline,markdownHeadingUnderline + syn match markdownHeadingUnderline /^[=-]\+$/ display contained +endif + +if g:markdown_flavor ==? 'kramdown' + syn match markdownHeaderContainer /^#\{1,6}.\+$/ display transparent + \ contains=@markdownInline,markdownHeader,markdownHeaderId,markdownHeadingDelimiter + syn match markdownHeader /\%(^#\+\)\@<=\%([^#]\+\%(#\+\s*\%($\|{\)\)\@=\|[^{]\{-}\%({\)\@=\|#$\)/ + + syn match markdownHeader /^.\+\n=\+$/ display contains=@markdownInline,markdownHeadingUnderline,markdownHeaderId + syn match markdownHeader /^.\+\n-\+$/ display contains=@markdownInline,markdownHeadingUnderline,markdownHeaderId + syn match markdownHeadingUnderline /^[=-]\+$/ display contained + + syn match markdownHeaderId /{[^}]\+}\s*$/ display contained + syn match markdownHeadingDelimiter /#\+\%(.\+\)\@=/ display contained +endif + +execute 'syn match markdownLinkReference ' + \ . 'contains=@NoSpell ' + \ . 'display ' + \ . '/' + \ . '^\s\{,3}' + \ . b:markdown_syntax_square_brackets_block + \ . ':.*' + \ . '\%(\n\%\(\n\)\@!.*$\)*' + \ . '/' + +syn region markdownBlockquote start=/^\s*\%(>\s\?\)\+\%(.\)\@=/ end=/\n\n/ contains=markdownBlockquoteDelimiter,@NoSpell +syn match markdownBlockquoteDelimiter /^\s*\%(>\s\?\)\+/ contained + +syn region markdownFencedCodeBlock matchgroup=markdownCodeDelimiter start=/^\s\{,3}```\%(`*\).*$/ end=/^\s\{,3}```\%(`*\)\s*$/ contains=@NoSpell +syn region markdownFencedCodeBlock matchgroup=markdownCodeDelimiter start=/^\s\{,3}\~\~\~\%(\~*\).*$/ end=/^\s\{,3}\~\~\~\%(\~*\)\s*$/ contains=@NoSpell + +syn match markdownCodeBlock /\%(^\n\)\@<=\%(\%(\s\{4,}\|\t\+\).*\n\)\+$/ contains=@NoSpell + +let s:markdown_table_header_rows_separator = '' + \ . '\%(' + \ . '\s*|\?\%(\s*[-:]-\{1,}[-:]\s*|\)\+\s*[-:]-\{1,}[-:]\s*|\?\s*' + \ . '\|' + \ . '\s*|\s*[-:]-\{1,}[-:]\s*|\s*' + \ . '\|' + \ . '\s*|\s*[-:]-\{1,}[-:]\s*' + \ . '\|' + \ . '\s*[-:]-\{1,}[-:]\s*|\s*' + \ . '\)' +execute 'syn match markdownTable ' + \ . 'transparent contains=markdownTableHeader,markdownTableDelimiter,@markdownInline ' + \ . '/' + \ . '^\s*\n' + \ . '\s*|\?\%([^|]\+|\)*[^|]\+|\?\s*\n' + \ . s:markdown_table_header_rows_separator . '\n' + \ . '\%(' + \ . '\s*|\?\%([^|]\+|\)*[^|]\+|\?\s*\n' + \ . '\)*' + \ . '$' + \ . '/' +syn match markdownTableDelimiter /|/ contained +execute 'syn match markdownTableDelimiter contained ' + \ . '/' . s:markdown_table_header_rows_separator . '/' +execute 'syn match markdownTableHeader contained contains=@markdownInline ' + \ . '/\%(|\?\s*\)\@<=[^|]\+\%(.*\n' . s:markdown_table_header_rows_separator . '\)\@=/' + +" }}} + + +" {{{ NESTED BLOCKS + +for s:level in range(1, 16) + let s:indented_as_content = '\%( \{' . (2*s:level) . '}\|\t\{' . (s:level) . '}\)' + let s:indented_as_container = '\%( \{' . (2*(s:level-1)) . '}\|\t\{' . (s:level-1) . '}\)' + let s:preceded_by_separator = '^\s*\n' + + execute 'syn region markdownListItemAtLevel' . (s:level) . ' ' + \ . 'matchgroup=markdownItemDelimiter ' + \ . (s:level > 1 ? 'contained ' : '') + \ . 'keepend ' + \ . 'contains=' + \ . 'markdownTableInListItemAtLevel' . (s:level) . ',' + \ . 'markdownCodeBlockInListItemAtLevel' . (s:level) . ',' + \ . 'markdownFencedCodeBlockInListItemAtLevel' . (s:level) . ',' + \ . 'markdownH1InListItemAtLevel' . (s:level) . ',' + \ . 'markdownH2InListItemAtLevel' . (s:level) . ',' + \ . 'markdownH3InListItemAtLevel' . (s:level) . ',' + \ . 'markdownH4InListItemAtLevel' . (s:level) . ',' + \ . 'markdownH5InListItemAtLevel' . (s:level) . ',' + \ . 'markdownH6InListItemAtLevel' . (s:level) . ',' + \ . 'markdownRuleInListItemAtLevel' . (s:level) . ',' + \ . 'markdownBlockquoteInListItemAtLevel' . (s:level) . ',' + \ . 'markdownListItemAtLevel' . (s:level+1) . ',' + \ . '@markdownInline ' + \ . 'start=/^' . (s:indented_as_container) . '\%([-*+]\|\d\+\.\)\%(\s\+\[[ x]\]\)\?\s\+/ ' + \ . 'end=' + \ . '/' + \ . '\n\%(\n\n\)\@=' + \ . '\|' + \ . '\n\%(' . (s:indented_as_container) . '\%([-*+]\|\d\+\.\)\s\+\)\@=' + \ . '\|' + \ . '\n\%(\n' . (s:indented_as_container) . '\S\)\@=' + \ . '/' + + " fenced code blocks could have leading spaces after the base level indentation + " so at least it must be indented as content but could be indented more + " there's no upper limit to the indentation because the following rule on + " code blocks is going to take care of that + " TL;DR: don't swap markdownFencedCodeBlockInListItemAtLevel* with + " markdownCodeBlockInListItemAtLevel* :-) + execute 'syn region markdownFencedCodeBlockInListItemAtLevel' . (s:level) . ' ' + \ . 'contained contains=@NoSpell ' + \ . 'matchgroup=markdownFencedCodeBlockInItemDelimiter ' + \ . 'start=' + \ . '/' + \ . (s:preceded_by_separator) + \ . '\z( \{' . (2*s:level) . ',}\|\t\{' . (s:level) . ',}\)*```\%(`*\).*$' + \ . '/ ' + \ . 'end=/^\z1```\%(`*\)\s*$/' + execute 'syn region markdownFencedCodeBlockInListItemAtLevel' . (s:level) . ' ' + \ . 'contained contains=@NoSpell ' + \ . 'matchgroup=markdownFencedCodeBlockInItemDelimiter ' + \ . 'start=' + \ . '/' + \ . (s:preceded_by_separator) + \ . '\z( \{' . (2*s:level) . ',}\|\t\{' . (s:level) . ',}\)*\~\~\~\%(\~*\).*$' + \ . '/ ' + \ . 'end=/^\z1\~\~\~\%(\~*\)\s*$/' + execute 'hi def link markdownFencedCodeBlockInListItemAtLevel' . (s:level) . ' String' + + execute 'syn match markdownCodeBlockInListItemAtLevel' . (s:level) . ' ' + \ . 'contained contains=@NoSpell ' + \ . '/' . (s:preceded_by_separator) . '\%(\%( \{' . (6+2*s:level) . ',}\|\t\{' . (1+s:level) . ',}\).*\n\?\)\+$/' + execute 'hi def link markdownCodeBlockInListItemAtLevel' . (s:level) . ' String' + + execute 'syn region markdownH1InListItemAtLevel' . (s:level) . ' ' + \ . 'contained display oneline ' + \ . 'matchgroup=markdownHeadingDelimiter ' + \ . 'contains=@markdownInline ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '#\%(\s\+\)\@=/ ' + \ . 'end=/#*\s*$/' + execute 'syn region markdownH2InListItemAtLevel' . (s:level) . ' ' + \ . 'contained display oneline ' + \ . 'matchgroup=markdownHeadingDelimiter ' + \ . 'contains=@markdownInline ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '##\%(\s\+\)\@=/ ' + \ . 'end=/#*\s*$/' + execute 'syn region markdownH3InListItemAtLevel' . (s:level) . ' ' + \ . 'contained display oneline ' + \ . 'matchgroup=markdownHeadingDelimiter ' + \ . 'contains=@markdownInline ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '###\%(\s\+\)\@=/ ' + \ . 'end=/#*\s*$/' + execute 'syn region markdownH4InListItemAtLevel' . (s:level) . ' ' + \ . 'contained display oneline ' + \ . 'matchgroup=markdownHeadingDelimiter ' + \ . 'contains=@markdownInline ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '####\%(\s\+\)\@=/ ' + \ . 'end=/#*\s*$/' + execute 'syn region markdownH5InListItemAtLevel' . (s:level) . ' ' + \ . 'contained display oneline ' + \ . 'matchgroup=markdownHeadingDelimiter ' + \ . 'contains=@markdownInline ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '#####\%(\s\+\)\@=/ ' + \ . 'end=/#*\s*$/' + execute 'syn region markdownH6InListItemAtLevel' . (s:level) . ' ' + \ . 'contained display oneline ' + \ . 'matchgroup=markdownHeadingDelimiter ' + \ . 'contains=@markdownInline ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '######\%(\s\+\)\@=/ ' + \ . 'end=/#*\s*$/' + execute 'hi def link markdownH1InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownH2InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownH3InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownH4InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownH5InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownH6InListItemAtLevel' . (s:level) . ' Title' + + execute 'syn match markdownH1InListItemAtLevel' . (s:level) . ' ' + \ . 'display contained contains=@markdownInline,markdownHeadingDelimiterInListItemAtLevel'. (s:level) . ' ' + \ . '/' . (s:preceded_by_separator) . (s:indented_as_content) . '.\+\n' . (s:indented_as_content) . '=\+$/' + execute 'syn match markdownH1InListItemAtLevel' . (s:level) . ' ' + \ . 'display contained contains=@markdownInline,markdownHeadingDelimiterInListItemAtLevel'. (s:level) . ' ' + \ . '/' . (s:preceded_by_separator) . (s:indented_as_content) . '.\+\n' . (s:indented_as_content) . '-\+$/' + execute 'syn match markdownHeadingDelimiterInListItemAtLevel' . (s:level) . ' ' + \ . 'display contained ' + \ . '/^' . (s:indented_as_content) . '\%(-\+\|=\+\)$/' + execute 'hi def link markdownH1InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownH2InListItemAtLevel' . (s:level) . ' Title' + execute 'hi def link markdownHeadingDelimiterInListItemAtLevel' . (s:level) . ' Special' + + execute 'syn match markdownRuleInListItemAtLevel' . (s:level) . ' ' + \ . '/' . (s:preceded_by_separator) . (s:indented_as_content) . '*\*\s*\*\s*\*[[:space:]*]*$/ display' + execute 'syn match markdownRuleInListItemAtLevel' . (s:level) . ' ' + \ . '/' . (s:preceded_by_separator) . (s:indented_as_content) . '-\s*-\s*-[[:space:]-]*$/ display' + execute 'syn match markdownRuleInListItemAtLevel' . (s:level) . ' ' + \ . '/' . (s:preceded_by_separator) . (s:indented_as_content) . '_\s*_\s*_[[:space:]_]*$/ display' + execute 'hi def link markdownRuleInListItemAtLevel' . (s:level) . ' Identifier' + + execute 'syn region markdownBlockquoteInListItemAtLevel' . (s:level) . ' ' + \ . 'contained ' + \ . 'contains=markdownBlockquoteDelimiterInListItemAtLevel' . (s:level) . ',@NoSpell ' + \ . 'start=/' . (s:preceded_by_separator) . (s:indented_as_content) . '\%(>\s\?\)\+\%(.\)\@=/ ' + \ . 'end=/\n\n/' + execute 'syn match markdownBlockquoteDelimiterInListItemAtLevel' . (s:level) . ' ' + \ . 'contained ' + \ . '/^' . (s:indented_as_content) . '\%(>\s\?\)\+/' + execute 'hi def link markdownBlockquoteInListItemAtLevel' . (s:level) . ' Comment' + execute 'hi def link markdownBlockquoteDelimiterInListItemAtLevel' . (s:level) . ' Delimiter' + + " " the only constraint here is that the table begins at least at the same + " " level as the list item's content, se we could reuse the previous syntactic + " " elements, we could do that because tables could have arbitrary indentation + execute 'syn match markdownTableInListItemAtLevel' . (s:level) . ' ' + \ . 'transparent contained contains=markdownTableHeader,markdownTableDelimiter,@markdownInline ' + \ . '/' + \ . '^\s*\n' + \ . (s:indented_as_content) . '\s*|\?\%([^|]\+|\)*[^|]\+|\?\s*\n' + \ . s:markdown_table_header_rows_separator . '\n' + \ . '\%(' + \ . '\s*|\?\%([^|]\+|\)*[^|]\+|\?\s*\n' + \ . '\)*' + \ . '$' + \ . '/' +endfor +hi def link markdownItemDelimiter Special +hi def link markdownFencedCodeBlockInItemDelimiter Special + +" }}} + + +" {{{ EMOTICONS + +syn keyword markdownEmoticonKeyword :bowtie: :smile: :laughing: :blush: :smiley: +syn keyword markdownEmoticonKeyword :bowtie: :smile: :laughing: :blush: :smiley: +syn keyword markdownEmoticonKeyword :relaxed: :smirk: :heart_eyes: :kissing_heart: :kissing_closed_eyes: +syn keyword markdownEmoticonKeyword :flushed: :relieved: :satisfied: :grin: :wink: +syn keyword markdownEmoticonKeyword :stuck_out_tongue_winking_eye: :stuck_out_tongue_closed_eyes: :grinning: :kissing: :kissing_smiling_eyes: +syn keyword markdownEmoticonKeyword :stuck_out_tongue: :sleeping: :worried: :frowning: :anguished: +syn keyword markdownEmoticonKeyword :open_mouth: :grimacing: :confused: :hushed: :expressionless: +syn keyword markdownEmoticonKeyword :unamused: :sweat_smile: :sweat: :disappointed_relieved: :weary: +syn keyword markdownEmoticonKeyword :pensive: :disappointed: :confounded: :fearful: :cold_sweat: +syn keyword markdownEmoticonKeyword :persevere: :cry: :sob: :joy: :astonished: +syn keyword markdownEmoticonKeyword :scream: :neckbeard: :tired_face: :angry: :rage: +syn keyword markdownEmoticonKeyword :triumph: :sleepy: :yum: :mask: :sunglasses: +syn keyword markdownEmoticonKeyword :dizzy_face: :imp: :smiling_imp: :neutral_face: :no_mouth: +syn keyword markdownEmoticonKeyword :innocent: :alien: :yellow_heart: :blue_heart: :purple_heart: +syn keyword markdownEmoticonKeyword :heart: :green_heart: :broken_heart: :heartbeat: :heartpulse: +syn keyword markdownEmoticonKeyword :two_hearts: :revolving_hearts: :cupid: :sparkling_heart: :sparkles: +syn keyword markdownEmoticonKeyword :star: :star2: :dizzy: :boom: :collision: +syn keyword markdownEmoticonKeyword :anger: :exclamation: :question: :grey_exclamation: :grey_question: +syn keyword markdownEmoticonKeyword :zzz: :dash: :sweat_drops: :notes: :musical_note: +syn keyword markdownEmoticonKeyword :fire: :hankey: :poop: :shit: :+1: +syn keyword markdownEmoticonKeyword :thumbsup: :-1: :thumbsdown: :ok_hand: :punch: +syn keyword markdownEmoticonKeyword :facepunch: :fist: :v: :wave: :hand: +syn keyword markdownEmoticonKeyword :raised_hand: :open_hands: :point_up: :point_down: :point_left: +syn keyword markdownEmoticonKeyword :point_right: :raised_hands: :pray: :point_up_2: :clap: +syn keyword markdownEmoticonKeyword :muscle: :metal: :fu: :walking: :runner: +syn keyword markdownEmoticonKeyword :running: :couple: :family: :two_men_holding_hands: :two_women_holding_hands: +syn keyword markdownEmoticonKeyword :dancer: :dancers: :ok_woman: :no_good: :information_desk_person: +syn keyword markdownEmoticonKeyword :raising_hand: :bride_with_veil: :person_with_pouting_face: :person_frowning: :bow: +syn keyword markdownEmoticonKeyword :couplekiss: :couple_with_heart: :massage: :haircut: :nail_care: +syn keyword markdownEmoticonKeyword :boy: :girl: :woman: :man: :baby: +syn keyword markdownEmoticonKeyword :older_woman: :older_man: :person_with_blond_hair: :man_with_gua_pi_mao: :man_with_turban: +syn keyword markdownEmoticonKeyword :construction_worker: :cop: :angel: :princess: :smiley_cat: +syn keyword markdownEmoticonKeyword :smile_cat: :heart_eyes_cat: :kissing_cat: :smirk_cat: :scream_cat: +syn keyword markdownEmoticonKeyword :crying_cat_face: :joy_cat: :pouting_cat: :japanese_ogre: :japanese_goblin: +syn keyword markdownEmoticonKeyword :see_no_evil: :hear_no_evil: :speak_no_evil: :guardsman: :skull: +syn keyword markdownEmoticonKeyword :feet: :lips: :kiss: :droplet: :ear: +syn keyword markdownEmoticonKeyword :eyes: :nose: :tongue: :love_letter: :bust_in_silhouette: +syn keyword markdownEmoticonKeyword :busts_in_silhouette: :speech_balloon: :thought_balloon: :feelsgood: :finnadie: +syn keyword markdownEmoticonKeyword :goberserk: :godmode: :hurtrealbad: :rage1: :rage2: +syn keyword markdownEmoticonKeyword :rage3: :rage4: :suspect: :trollface: :sunny: +syn keyword markdownEmoticonKeyword :umbrella: :cloud: :snowflake: :snowman: :zap: +syn keyword markdownEmoticonKeyword :cyclone: :foggy: :ocean: :cat: :dog: +syn keyword markdownEmoticonKeyword :mouse: :hamster: :rabbit: :wolf: :frog: +syn keyword markdownEmoticonKeyword :tiger: :koala: :bear: :pig: :pig_nose: +syn keyword markdownEmoticonKeyword :cow: :boar: :monkey_face: :monkey: :horse: +syn keyword markdownEmoticonKeyword :racehorse: :camel: :sheep: :elephant: :panda_face: +syn keyword markdownEmoticonKeyword :snake: :bird: :baby_chick: :hatched_chick: :hatching_chick: +syn keyword markdownEmoticonKeyword :chicken: :penguin: :turtle: :bug: :honeybee: +syn keyword markdownEmoticonKeyword :ant: :beetle: :snail: :octopus: :tropical_fish: +syn keyword markdownEmoticonKeyword :fish: :whale: :whale2: :dolphin: :cow2: +syn keyword markdownEmoticonKeyword :ram: :rat: :water_buffalo: :tiger2: :rabbit2: +syn keyword markdownEmoticonKeyword :dragon: :goat: :rooster: :dog2: :pig2: +syn keyword markdownEmoticonKeyword :mouse2: :ox: :dragon_face: :blowfish: :crocodile: +syn keyword markdownEmoticonKeyword :dromedary_camel: :leopard: :cat2: :poodle: :paw_prints: +syn keyword markdownEmoticonKeyword :bouquet: :cherry_blossom: :tulip: :four_leaf_clover: :rose: +syn keyword markdownEmoticonKeyword :sunflower: :hibiscus: :maple_leaf: :leaves: :fallen_leaf: +syn keyword markdownEmoticonKeyword :herb: :mushroom: :cactus: :palm_tree: :evergreen_tree: +syn keyword markdownEmoticonKeyword :deciduous_tree: :chestnut: :seedling: :blossom: :ear_of_rice: +syn keyword markdownEmoticonKeyword :shell: :globe_with_meridians: :sun_with_face: :full_moon_with_face: :new_moon_with_face: +syn keyword markdownEmoticonKeyword :new_moon: :waxing_crescent_moon: :first_quarter_moon: :waxing_gibbous_moon: :full_moon: +syn keyword markdownEmoticonKeyword :waning_gibbous_moon: :last_quarter_moon: :waning_crescent_moon: :last_quarter_moon_with_face: :first_quarter_moon_with_face: +syn keyword markdownEmoticonKeyword :moon: :earth_africa: :earth_americas: :earth_asia: :volcano: +syn keyword markdownEmoticonKeyword :milky_way: :partly_sunny: :octocat: :squirrel: :bamboo: +syn keyword markdownEmoticonKeyword :gift_heart: :dolls: :school_satchel: :mortar_board: :flags: +syn keyword markdownEmoticonKeyword :fireworks: :sparkler: :wind_chime: :rice_scene: :jack_o_lantern: +syn keyword markdownEmoticonKeyword :ghost: :santa: :christmas_tree: :gift: :bell: +syn keyword markdownEmoticonKeyword :no_bell: :tanabata_tree: :tada: :confetti_ball: :balloon: +syn keyword markdownEmoticonKeyword :crystal_ball: :cd: :dvd: :floppy_disk: :camera: +syn keyword markdownEmoticonKeyword :video_camera: :movie_camera: :computer: :tv: :iphone: +syn keyword markdownEmoticonKeyword :phone: :telephone: :telephone_receiver: :pager: :fax: +syn keyword markdownEmoticonKeyword :minidisc: :vhs: :sound: :speaker: :mute: +syn keyword markdownEmoticonKeyword :loudspeaker: :mega: :hourglass: :hourglass_flowing_sand: :alarm_clock: +syn keyword markdownEmoticonKeyword :watch: :radio: :satellite: :loop: :mag: +syn keyword markdownEmoticonKeyword :mag_right: :unlock: :lock: :lock_with_ink_pen: :closed_lock_with_key: +syn keyword markdownEmoticonKeyword :key: :bulb: :flashlight: :high_brightness: :low_brightness: +syn keyword markdownEmoticonKeyword :electric_plug: :battery: :calling: :email: :mailbox: +syn keyword markdownEmoticonKeyword :postbox: :bath: :bathtub: :shower: :toilet: +syn keyword markdownEmoticonKeyword :wrench: :nut_and_bolt: :hammer: :seat: :moneybag: +syn keyword markdownEmoticonKeyword :yen: :dollar: :pound: :euro: :credit_card: +syn keyword markdownEmoticonKeyword :money_with_wings: :e-mail: :inbox_tray: :outbox_tray: :envelope: +syn keyword markdownEmoticonKeyword :incoming_envelope: :postal_horn: :mailbox_closed: :mailbox_with_mail: :mailbox_with_no_mail: +syn keyword markdownEmoticonKeyword :door: :smoking: :bomb: :gun: :hocho: +syn keyword markdownEmoticonKeyword :pill: :syringe: :page_facing_up: :page_with_curl: :bookmark_tabs: +syn keyword markdownEmoticonKeyword :bar_chart: :chart_with_upwards_trend: :chart_with_downwards_trend: :scroll: :clipboard: +syn keyword markdownEmoticonKeyword :calendar: :date: :card_index: :file_folder: :open_file_folder: +syn keyword markdownEmoticonKeyword :scissors: :pushpin: :paperclip: :black_nib: :pencil2: +syn keyword markdownEmoticonKeyword :straight_ruler: :triangular_ruler: :closed_book: :green_book: :blue_book: +syn keyword markdownEmoticonKeyword :orange_book: :notebook: :notebook_with_decorative_cover: :ledger: :books: +syn keyword markdownEmoticonKeyword :bookmark: :name_badge: :microscope: :telescope: :newspaper: +syn keyword markdownEmoticonKeyword :football: :basketball: :soccer: :baseball: :tennis: +syn keyword markdownEmoticonKeyword :8ball: :rugby_football: :bowling: :golf: :mountain_bicyclist: +syn keyword markdownEmoticonKeyword :bicyclist: :horse_racing: :snowboarder: :swimmer: :surfer: +syn keyword markdownEmoticonKeyword :ski: :spades: :hearts: :clubs: :diamonds: +syn keyword markdownEmoticonKeyword :gem: :ring: :trophy: :musical_score: :musical_keyboard: +syn keyword markdownEmoticonKeyword :violin: :space_invader: :video_game: :black_joker: :flower_playing_cards: +syn keyword markdownEmoticonKeyword :game_die: :dart: :mahjong: :clapper: :memo: +syn keyword markdownEmoticonKeyword :pencil: :book: :art: :microphone: :headphones: +syn keyword markdownEmoticonKeyword :trumpet: :saxophone: :guitar: :shoe: :sandal: +syn keyword markdownEmoticonKeyword :high_heel: :lipstick: :boot: :shirt: :tshirt: +syn keyword markdownEmoticonKeyword :necktie: :womans_clothes: :dress: :running_shirt_with_sash: :jeans: +syn keyword markdownEmoticonKeyword :kimono: :bikini: :ribbon: :tophat: :crown: +syn keyword markdownEmoticonKeyword :womans_hat: :mans_shoe: :closed_umbrella: :briefcase: :handbag: +syn keyword markdownEmoticonKeyword :pouch: :purse: :eyeglasses: :fishing_pole_and_fish: :coffee: +syn keyword markdownEmoticonKeyword :tea: :sake: :baby_bottle: :beer: :beers: +syn keyword markdownEmoticonKeyword :cocktail: :tropical_drink: :wine_glass: :fork_and_knife: :pizza: +syn keyword markdownEmoticonKeyword :hamburger: :fries: :poultry_leg: :meat_on_bone: :spaghetti: +syn keyword markdownEmoticonKeyword :curry: :fried_shrimp: :bento: :sushi: :fish_cake: +syn keyword markdownEmoticonKeyword :rice_ball: :rice_cracker: :rice: :ramen: :stew: +syn keyword markdownEmoticonKeyword :oden: :dango: :egg: :bread: :doughnut: +syn keyword markdownEmoticonKeyword :custard: :icecream: :ice_cream: :shaved_ice: :birthday: +syn keyword markdownEmoticonKeyword :cake: :cookie: :chocolate_bar: :candy: :lollipop: +syn keyword markdownEmoticonKeyword :honey_pot: :apple: :green_apple: :tangerine: :lemon: +syn keyword markdownEmoticonKeyword :cherries: :grapes: :watermelon: :strawberry: :peach: +syn keyword markdownEmoticonKeyword :melon: :banana: :pear: :pineapple: :sweet_potato: +syn keyword markdownEmoticonKeyword :eggplant: :tomato: :corn: :house: :house_with_garden: +syn keyword markdownEmoticonKeyword :school: :office: :post_office: :hospital: :bank: +syn keyword markdownEmoticonKeyword :convenience_store: :love_hotel: :hotel: :wedding: :church: +syn keyword markdownEmoticonKeyword :department_store: :european_post_office: :city_sunrise: :city_sunset: :japanese_castle: +syn keyword markdownEmoticonKeyword :european_castle: :tent: :factory: :tokyo_tower: :japan: +syn keyword markdownEmoticonKeyword :mount_fuji: :sunrise_over_mountains: :sunrise: :stars: :statue_of_liberty: +syn keyword markdownEmoticonKeyword :bridge_at_night: :carousel_horse: :rainbow: :ferris_wheel: :fountain: +syn keyword markdownEmoticonKeyword :roller_coaster: :ship: :speedboat: :boat: :sailboat: +syn keyword markdownEmoticonKeyword :rowboat: :anchor: :rocket: :airplane: :helicopter: +syn keyword markdownEmoticonKeyword :steam_locomotive: :tram: :mountain_railway: :bike: :aerial_tramway: +syn keyword markdownEmoticonKeyword :suspension_railway: :mountain_cableway: :tractor: :blue_car: :oncoming_automobile: +syn keyword markdownEmoticonKeyword :car: :red_car: :taxi: :oncoming_taxi: :articulated_lorry: +syn keyword markdownEmoticonKeyword :bus: :oncoming_bus: :rotating_light: :police_car: :oncoming_police_car: +syn keyword markdownEmoticonKeyword :fire_engine: :ambulance: :minibus: :truck: :train: +syn keyword markdownEmoticonKeyword :station: :train2: :bullettrain_front: :bullettrain_side: :light_rail: +syn keyword markdownEmoticonKeyword :monorail: :railway_car: :trolleybus: :ticket: :fuelpump: +syn keyword markdownEmoticonKeyword :vertical_traffic_light: :traffic_light: :warning: :construction: :beginner: +syn keyword markdownEmoticonKeyword :atm: :slot_machine: :busstop: :barber: :hotsprings: +syn keyword markdownEmoticonKeyword :checkered_flag: :crossed_flags: :izakaya_lantern: :moyai: :circus_tent: +syn keyword markdownEmoticonKeyword :performing_arts: :round_pushpin: :triangular_flag_on_post: :jp: :kr: +syn keyword markdownEmoticonKeyword :cn: :us: :fr: :es: :it: +syn keyword markdownEmoticonKeyword :ru: :gb: :uk: :de: :one: +syn keyword markdownEmoticonKeyword :two: :three: :four: :five: :six: +syn keyword markdownEmoticonKeyword :seven: :eight: :nine: :keycap_ten: :1234: +syn keyword markdownEmoticonKeyword :zero: :hash: :symbols: :arrow_backward: :arrow_down: +syn keyword markdownEmoticonKeyword :arrow_forward: :arrow_left: :capital_abcd: :abcd: :abc: +syn keyword markdownEmoticonKeyword :arrow_lower_left: :arrow_lower_right: :arrow_right: :arrow_up: :arrow_upper_left: +syn keyword markdownEmoticonKeyword :arrow_upper_right: :arrow_double_down: :arrow_double_up: :arrow_down_small: :arrow_heading_down: +syn keyword markdownEmoticonKeyword :arrow_heading_up: :leftwards_arrow_with_hook: :arrow_right_hook: :left_right_arrow: :arrow_up_down: +syn keyword markdownEmoticonKeyword :arrow_up_small: :arrows_clockwise: :arrows_counterclockwise: :rewind: :fast_forward: +syn keyword markdownEmoticonKeyword :information_source: :ok: :twisted_rightwards_arrows: :repeat: :repeat_one: +syn keyword markdownEmoticonKeyword :new: :top: :up: :cool: :free: +syn keyword markdownEmoticonKeyword :ng: :cinema: :koko: :signal_strength: :u5272: +syn keyword markdownEmoticonKeyword :u5408: :u55b6: :u6307: :u6708: :u6709: +syn keyword markdownEmoticonKeyword :u6e80: :u7121: :u7533: :u7a7a: :u7981: +syn keyword markdownEmoticonKeyword :sa: :restroom: :mens: :womens: :baby_symbol: +syn keyword markdownEmoticonKeyword :no_smoking: :parking: :wheelchair: :metro: :baggage_claim: +syn keyword markdownEmoticonKeyword :accept: :wc: :potable_water: :put_litter_in_its_place: :secret: +syn keyword markdownEmoticonKeyword :congratulations: :m: :passport_control: :left_luggage: :customs: +syn keyword markdownEmoticonKeyword :ideograph_advantage: :cl: :sos: :id: :no_entry_sign: +syn keyword markdownEmoticonKeyword :underage: :no_mobile_phones: :do_not_litter: :non-potable_water: :no_bicycles: +syn keyword markdownEmoticonKeyword :no_pedestrians: :children_crossing: :no_entry: :eight_spoked_asterisk: :eight_pointed_black_star: +syn keyword markdownEmoticonKeyword :heart_decoration: :vs: :vibration_mode: :mobile_phone_off: :chart: +syn keyword markdownEmoticonKeyword :currency_exchange: :aries: :taurus: :gemini: :cancer: +syn keyword markdownEmoticonKeyword :leo: :virgo: :libra: :scorpius: :sagittarius: +syn keyword markdownEmoticonKeyword :capricorn: :aquarius: :pisces: :ophiuchus: :six_pointed_star: +syn keyword markdownEmoticonKeyword :negative_squared_cross_mark: :a: :b: :ab: :o2: +syn keyword markdownEmoticonKeyword :diamond_shape_with_a_dot_inside: :recycle: :end: :on: :soon: +syn keyword markdownEmoticonKeyword :clock1: :clock130: :clock10: :clock1030: :clock11: +syn keyword markdownEmoticonKeyword :clock1130: :clock12: :clock1230: :clock2: :clock230: +syn keyword markdownEmoticonKeyword :clock3: :clock330: :clock4: :clock430: :clock5: +syn keyword markdownEmoticonKeyword :clock530: :clock6: :clock630: :clock7: :clock730: +syn keyword markdownEmoticonKeyword :clock8: :clock830: :clock9: :clock930: :heavy_dollar_sign: +syn keyword markdownEmoticonKeyword :copyright: :registered: :tm: :x: :heavy_exclamation_mark: +syn keyword markdownEmoticonKeyword :bangbang: :interrobang: :o: :heavy_multiplication_x: :heavy_plus_sign: +syn keyword markdownEmoticonKeyword :heavy_minus_sign: :heavy_division_sign: :white_flower: :100: :heavy_check_mark: +syn keyword markdownEmoticonKeyword :ballot_box_with_check: :radio_button: :link: :curly_loop: :wavy_dash: +syn keyword markdownEmoticonKeyword :part_alternation_mark: :trident: :black_square: :white_square: :white_check_mark: +syn keyword markdownEmoticonKeyword :black_square_button: :white_square_button: :black_circle: :white_circle: :red_circle: +syn keyword markdownEmoticonKeyword :large_blue_circle: :large_blue_diamond: :large_orange_diamond: :small_blue_diamond: :small_orange_diamond: +syn keyword markdownEmoticonKeyword :small_red_triangle: :small_red_triangle_down: :shipit: :relaxed: :smirk: +syn keyword markdownEmoticonKeyword :heart_eyes: :kissing_heart: :kissing_closed_eyes: :flushed: :relieved: +syn keyword markdownEmoticonKeyword :satisfied: :grin: :wink: :stuck_out_tongue_winking_eye: :stuck_out_tongue_closed_eyes: +syn keyword markdownEmoticonKeyword :grinning: :kissing: :kissing_smiling_eyes: :stuck_out_tongue: :sleeping: +syn keyword markdownEmoticonKeyword :worried: :frowning: :anguished: :open_mouth: :grimacing: +syn keyword markdownEmoticonKeyword :confused: :hushed: :expressionless: :unamused: :sweat_smile: +syn keyword markdownEmoticonKeyword :sweat: :disappointed_relieved: :weary: :pensive: :disappointed: +syn keyword markdownEmoticonKeyword :confounded: :fearful: :cold_sweat: :persevere: :cry: +syn keyword markdownEmoticonKeyword :sob: :joy: :astonished: :scream: :neckbeard: +syn keyword markdownEmoticonKeyword :tired_face: :angry: :rage: :triumph: :sleepy: +syn keyword markdownEmoticonKeyword :yum: :mask: :sunglasses: :dizzy_face: :imp: +syn keyword markdownEmoticonKeyword :smiling_imp: :neutral_face: :no_mouth: :innocent: :alien: +syn keyword markdownEmoticonKeyword :yellow_heart: :blue_heart: :purple_heart: :heart: :green_heart: +syn keyword markdownEmoticonKeyword :broken_heart: :heartbeat: :heartpulse: :two_hearts: :revolving_hearts: +syn keyword markdownEmoticonKeyword :cupid: :sparkling_heart: :sparkles: :star: :star2: +syn keyword markdownEmoticonKeyword :dizzy: :boom: :collision: :anger: :exclamation: +syn keyword markdownEmoticonKeyword :question: :grey_exclamation: :grey_question: :zzz: :dash: +syn keyword markdownEmoticonKeyword :sweat_drops: :notes: :musical_note: :fire: :hankey: +syn keyword markdownEmoticonKeyword :poop: :shit: :+1: :thumbsup: :-1: +syn keyword markdownEmoticonKeyword :thumbsdown: :ok_hand: :punch: :facepunch: :fist: +syn keyword markdownEmoticonKeyword :v: :wave: :hand: :raised_hand: :open_hands: +syn keyword markdownEmoticonKeyword :point_up: :point_down: :point_left: :point_right: :raised_hands: +syn keyword markdownEmoticonKeyword :pray: :point_up_2: :clap: :muscle: :metal: +syn keyword markdownEmoticonKeyword :fu: :walking: :runner: :running: :couple: +syn keyword markdownEmoticonKeyword :family: :two_men_holding_hands: :two_women_holding_hands: :dancer: :dancers: +syn keyword markdownEmoticonKeyword :ok_woman: :no_good: :information_desk_person: :raising_hand: :bride_with_veil: +syn keyword markdownEmoticonKeyword :person_with_pouting_face: :person_frowning: :bow: :couplekiss: :couple_with_heart: +syn keyword markdownEmoticonKeyword :massage: :haircut: :nail_care: :boy: :girl: +syn keyword markdownEmoticonKeyword :woman: :man: :baby: :older_woman: :older_man: +syn keyword markdownEmoticonKeyword :person_with_blond_hair: :man_with_gua_pi_mao: :man_with_turban: :construction_worker: :cop: +syn keyword markdownEmoticonKeyword :angel: :princess: :smiley_cat: :smile_cat: :heart_eyes_cat: +syn keyword markdownEmoticonKeyword :kissing_cat: :smirk_cat: :scream_cat: :crying_cat_face: :joy_cat: +syn keyword markdownEmoticonKeyword :pouting_cat: :japanese_ogre: :japanese_goblin: :see_no_evil: :hear_no_evil: +syn keyword markdownEmoticonKeyword :speak_no_evil: :guardsman: :skull: :feet: :lips: +syn keyword markdownEmoticonKeyword :kiss: :droplet: :ear: :eyes: :nose: +syn keyword markdownEmoticonKeyword :tongue: :love_letter: :bust_in_silhouette: :busts_in_silhouette: :speech_balloon: +syn keyword markdownEmoticonKeyword :thought_balloon: :feelsgood: :finnadie: :goberserk: :godmode: +syn keyword markdownEmoticonKeyword :hurtrealbad: :rage1: :rage2: :rage3: :rage4: +syn keyword markdownEmoticonKeyword :suspect: :trollface: :sunny: :umbrella: :cloud: +syn keyword markdownEmoticonKeyword :snowflake: :snowman: :zap: :cyclone: :foggy: +syn keyword markdownEmoticonKeyword :ocean: :cat: :dog: :mouse: :hamster: +syn keyword markdownEmoticonKeyword :rabbit: :wolf: :frog: :tiger: :koala: +syn keyword markdownEmoticonKeyword :bear: :pig: :pig_nose: :cow: :boar: +syn keyword markdownEmoticonKeyword :monkey_face: :monkey: :horse: :racehorse: :camel: +syn keyword markdownEmoticonKeyword :sheep: :elephant: :panda_face: :snake: :bird: +syn keyword markdownEmoticonKeyword :baby_chick: :hatched_chick: :hatching_chick: :chicken: :penguin: +syn keyword markdownEmoticonKeyword :turtle: :bug: :honeybee: :ant: :beetle: +syn keyword markdownEmoticonKeyword :snail: :octopus: :tropical_fish: :fish: :whale: +syn keyword markdownEmoticonKeyword :whale2: :dolphin: :cow2: :ram: :rat: +syn keyword markdownEmoticonKeyword :water_buffalo: :tiger2: :rabbit2: :dragon: :goat: +syn keyword markdownEmoticonKeyword :rooster: :dog2: :pig2: :mouse2: :ox: +syn keyword markdownEmoticonKeyword :dragon_face: :blowfish: :crocodile: :dromedary_camel: :leopard: +syn keyword markdownEmoticonKeyword :cat2: :poodle: :paw_prints: :bouquet: :cherry_blossom: +syn keyword markdownEmoticonKeyword :tulip: :four_leaf_clover: :rose: :sunflower: :hibiscus: +syn keyword markdownEmoticonKeyword :maple_leaf: :leaves: :fallen_leaf: :herb: :mushroom: +syn keyword markdownEmoticonKeyword :cactus: :palm_tree: :evergreen_tree: :deciduous_tree: :chestnut: +syn keyword markdownEmoticonKeyword :seedling: :blossom: :ear_of_rice: :shell: :globe_with_meridians: +syn keyword markdownEmoticonKeyword :sun_with_face: :full_moon_with_face: :new_moon_with_face: :new_moon: :waxing_crescent_moon: +syn keyword markdownEmoticonKeyword :first_quarter_moon: :waxing_gibbous_moon: :full_moon: :waning_gibbous_moon: :last_quarter_moon: +syn keyword markdownEmoticonKeyword :waning_crescent_moon: :last_quarter_moon_with_face: :first_quarter_moon_with_face: :moon: :earth_africa: +syn keyword markdownEmoticonKeyword :earth_americas: :earth_asia: :volcano: :milky_way: :partly_sunny: +syn keyword markdownEmoticonKeyword :octocat: :squirrel: :bamboo: :gift_heart: :dolls: +syn keyword markdownEmoticonKeyword :school_satchel: :mortar_board: :flags: :fireworks: :sparkler: +syn keyword markdownEmoticonKeyword :wind_chime: :rice_scene: :jack_o_lantern: :ghost: :santa: +syn keyword markdownEmoticonKeyword :christmas_tree: :gift: :bell: :no_bell: :tanabata_tree: +syn keyword markdownEmoticonKeyword :tada: :confetti_ball: :balloon: :crystal_ball: :cd: +syn keyword markdownEmoticonKeyword :dvd: :floppy_disk: :camera: :video_camera: :movie_camera: +syn keyword markdownEmoticonKeyword :computer: :tv: :iphone: :phone: :telephone: +syn keyword markdownEmoticonKeyword :telephone_receiver: :pager: :fax: :minidisc: :vhs: +syn keyword markdownEmoticonKeyword :sound: :speaker: :mute: :loudspeaker: :mega: +syn keyword markdownEmoticonKeyword :hourglass: :hourglass_flowing_sand: :alarm_clock: :watch: :radio: +syn keyword markdownEmoticonKeyword :satellite: :loop: :mag: :mag_right: :unlock: +syn keyword markdownEmoticonKeyword :lock: :lock_with_ink_pen: :closed_lock_with_key: :key: :bulb: +syn keyword markdownEmoticonKeyword :flashlight: :high_brightness: :low_brightness: :electric_plug: :battery: +syn keyword markdownEmoticonKeyword :calling: :email: :mailbox: :postbox: :bath: +syn keyword markdownEmoticonKeyword :bathtub: :shower: :toilet: :wrench: :nut_and_bolt: +syn keyword markdownEmoticonKeyword :hammer: :seat: :moneybag: :yen: :dollar: +syn keyword markdownEmoticonKeyword :pound: :euro: :credit_card: :money_with_wings: :e-mail: +syn keyword markdownEmoticonKeyword :inbox_tray: :outbox_tray: :envelope: :incoming_envelope: :postal_horn: +syn keyword markdownEmoticonKeyword :mailbox_closed: :mailbox_with_mail: :mailbox_with_no_mail: :door: :smoking: +syn keyword markdownEmoticonKeyword :bomb: :gun: :hocho: :pill: :syringe: +syn keyword markdownEmoticonKeyword :page_facing_up: :page_with_curl: :bookmark_tabs: :bar_chart: :chart_with_upwards_trend: +syn keyword markdownEmoticonKeyword :chart_with_downwards_trend: :scroll: :clipboard: :calendar: :date: +syn keyword markdownEmoticonKeyword :card_index: :file_folder: :open_file_folder: :scissors: :pushpin: +syn keyword markdownEmoticonKeyword :paperclip: :black_nib: :pencil2: :straight_ruler: :triangular_ruler: +syn keyword markdownEmoticonKeyword :closed_book: :green_book: :blue_book: :orange_book: :notebook: +syn keyword markdownEmoticonKeyword :notebook_with_decorative_cover: :ledger: :books: :bookmark: :name_badge: +syn keyword markdownEmoticonKeyword :microscope: :telescope: :newspaper: :football: :basketball: +syn keyword markdownEmoticonKeyword :soccer: :baseball: :tennis: :8ball: :rugby_football: +syn keyword markdownEmoticonKeyword :bowling: :golf: :mountain_bicyclist: :bicyclist: :horse_racing: +syn keyword markdownEmoticonKeyword :snowboarder: :swimmer: :surfer: :ski: :spades: +syn keyword markdownEmoticonKeyword :hearts: :clubs: :diamonds: :gem: :ring: +syn keyword markdownEmoticonKeyword :trophy: :musical_score: :musical_keyboard: :violin: :space_invader: +syn keyword markdownEmoticonKeyword :video_game: :black_joker: :flower_playing_cards: :game_die: :dart: +syn keyword markdownEmoticonKeyword :mahjong: :clapper: :memo: :pencil: :book: +syn keyword markdownEmoticonKeyword :art: :microphone: :headphones: :trumpet: :saxophone: +syn keyword markdownEmoticonKeyword :guitar: :shoe: :sandal: :high_heel: :lipstick: +syn keyword markdownEmoticonKeyword :boot: :shirt: :tshirt: :necktie: :womans_clothes: +syn keyword markdownEmoticonKeyword :dress: :running_shirt_with_sash: :jeans: :kimono: :bikini: +syn keyword markdownEmoticonKeyword :ribbon: :tophat: :crown: :womans_hat: :mans_shoe: +syn keyword markdownEmoticonKeyword :closed_umbrella: :briefcase: :handbag: :pouch: :purse: +syn keyword markdownEmoticonKeyword :eyeglasses: :fishing_pole_and_fish: :coffee: :tea: :sake: +syn keyword markdownEmoticonKeyword :baby_bottle: :beer: :beers: :cocktail: :tropical_drink: +syn keyword markdownEmoticonKeyword :wine_glass: :fork_and_knife: :pizza: :hamburger: :fries: +syn keyword markdownEmoticonKeyword :poultry_leg: :meat_on_bone: :spaghetti: :curry: :fried_shrimp: +syn keyword markdownEmoticonKeyword :bento: :sushi: :fish_cake: :rice_ball: :rice_cracker: +syn keyword markdownEmoticonKeyword :rice: :ramen: :stew: :oden: :dango: +syn keyword markdownEmoticonKeyword :egg: :bread: :doughnut: :custard: :icecream: +syn keyword markdownEmoticonKeyword :ice_cream: :shaved_ice: :birthday: :cake: :cookie: +syn keyword markdownEmoticonKeyword :chocolate_bar: :candy: :lollipop: :honey_pot: :apple: +syn keyword markdownEmoticonKeyword :green_apple: :tangerine: :lemon: :cherries: :grapes: +syn keyword markdownEmoticonKeyword :watermelon: :strawberry: :peach: :melon: :banana: +syn keyword markdownEmoticonKeyword :pear: :pineapple: :sweet_potato: :eggplant: :tomato: +syn keyword markdownEmoticonKeyword :corn: :house: :house_with_garden: :school: :office: +syn keyword markdownEmoticonKeyword :post_office: :hospital: :bank: :convenience_store: :love_hotel: +syn keyword markdownEmoticonKeyword :hotel: :wedding: :church: :department_store: :european_post_office: +syn keyword markdownEmoticonKeyword :city_sunrise: :city_sunset: :japanese_castle: :european_castle: :tent: +syn keyword markdownEmoticonKeyword :factory: :tokyo_tower: :japan: :mount_fuji: :sunrise_over_mountains: +syn keyword markdownEmoticonKeyword :sunrise: :stars: :statue_of_liberty: :bridge_at_night: :carousel_horse: +syn keyword markdownEmoticonKeyword :rainbow: :ferris_wheel: :fountain: :roller_coaster: :ship: +syn keyword markdownEmoticonKeyword :speedboat: :boat: :sailboat: :rowboat: :anchor: +syn keyword markdownEmoticonKeyword :rocket: :airplane: :helicopter: :steam_locomotive: :tram: +syn keyword markdownEmoticonKeyword :mountain_railway: :bike: :aerial_tramway: :suspension_railway: :mountain_cableway: +syn keyword markdownEmoticonKeyword :tractor: :blue_car: :oncoming_automobile: :car: :red_car: +syn keyword markdownEmoticonKeyword :taxi: :oncoming_taxi: :articulated_lorry: :bus: :oncoming_bus: +syn keyword markdownEmoticonKeyword :rotating_light: :police_car: :oncoming_police_car: :fire_engine: :ambulance: +syn keyword markdownEmoticonKeyword :minibus: :truck: :train: :station: :train2: +syn keyword markdownEmoticonKeyword :bullettrain_front: :bullettrain_side: :light_rail: :monorail: :railway_car: +syn keyword markdownEmoticonKeyword :trolleybus: :ticket: :fuelpump: :vertical_traffic_light: :traffic_light: +syn keyword markdownEmoticonKeyword :warning: :construction: :beginner: :atm: :slot_machine: +syn keyword markdownEmoticonKeyword :busstop: :barber: :hotsprings: :checkered_flag: :crossed_flags: +syn keyword markdownEmoticonKeyword :izakaya_lantern: :moyai: :circus_tent: :performing_arts: :round_pushpin: +syn keyword markdownEmoticonKeyword :triangular_flag_on_post: :jp: :kr: :cn: :us: +syn keyword markdownEmoticonKeyword :fr: :es: :it: :ru: :gb: +syn keyword markdownEmoticonKeyword :uk: :de: :one: :two: :three: +syn keyword markdownEmoticonKeyword :four: :five: :six: :seven: :eight: +syn keyword markdownEmoticonKeyword :nine: :keycap_ten: :1234: :zero: :hash: +syn keyword markdownEmoticonKeyword :symbols: :arrow_backward: :arrow_down: :arrow_forward: :arrow_left: +syn keyword markdownEmoticonKeyword :capital_abcd: :abcd: :abc: :arrow_lower_left: :arrow_lower_right: +syn keyword markdownEmoticonKeyword :arrow_right: :arrow_up: :arrow_upper_left: :arrow_upper_right: :arrow_double_down: +syn keyword markdownEmoticonKeyword :arrow_double_up: :arrow_down_small: :arrow_heading_down: :arrow_heading_up: :leftwards_arrow_with_hook: +syn keyword markdownEmoticonKeyword :arrow_right_hook: :left_right_arrow: :arrow_up_down: :arrow_up_small: :arrows_clockwise: +syn keyword markdownEmoticonKeyword :arrows_counterclockwise: :rewind: :fast_forward: :information_source: :ok: +syn keyword markdownEmoticonKeyword :twisted_rightwards_arrows: :repeat: :repeat_one: :new: :top: +syn keyword markdownEmoticonKeyword :up: :cool: :free: :ng: :cinema: +syn keyword markdownEmoticonKeyword :koko: :signal_strength: :u5272: :u5408: :u55b6: +syn keyword markdownEmoticonKeyword :u6307: :u6708: :u6709: :u6e80: :u7121: +syn keyword markdownEmoticonKeyword :u7533: :u7a7a: :u7981: :sa: :restroom: +syn keyword markdownEmoticonKeyword :mens: :womens: :baby_symbol: :no_smoking: :parking: +syn keyword markdownEmoticonKeyword :wheelchair: :metro: :baggage_claim: :accept: :wc: +syn keyword markdownEmoticonKeyword :potable_water: :put_litter_in_its_place: :secret: :congratulations: :m: +syn keyword markdownEmoticonKeyword :passport_control: :left_luggage: :customs: :ideograph_advantage: :cl: +syn keyword markdownEmoticonKeyword :sos: :id: :no_entry_sign: :underage: :no_mobile_phones: +syn keyword markdownEmoticonKeyword :do_not_litter: :non-potable_water: :no_bicycles: :no_pedestrians: :children_crossing: +syn keyword markdownEmoticonKeyword :no_entry: :eight_spoked_asterisk: :eight_pointed_black_star: :heart_decoration: :vs: +syn keyword markdownEmoticonKeyword :vibration_mode: :mobile_phone_off: :chart: :currency_exchange: :aries: +syn keyword markdownEmoticonKeyword :taurus: :gemini: :cancer: :leo: :virgo: +syn keyword markdownEmoticonKeyword :libra: :scorpius: :sagittarius: :capricorn: :aquarius: +syn keyword markdownEmoticonKeyword :pisces: :ophiuchus: :six_pointed_star: :negative_squared_cross_mark: :a: +syn keyword markdownEmoticonKeyword :b: :ab: :o2: :diamond_shape_with_a_dot_inside: :recycle: +syn keyword markdownEmoticonKeyword :end: :on: :soon: :clock1: :clock130: +syn keyword markdownEmoticonKeyword :clock10: :clock1030: :clock11: :clock1130: :clock12: +syn keyword markdownEmoticonKeyword :clock1230: :clock2: :clock230: :clock3: :clock330: +syn keyword markdownEmoticonKeyword :clock4: :clock430: :clock5: :clock530: :clock6: +syn keyword markdownEmoticonKeyword :clock630: :clock7: :clock730: :clock8: :clock830: +syn keyword markdownEmoticonKeyword :clock9: :clock930: :heavy_dollar_sign: :copyright: :registered: +syn keyword markdownEmoticonKeyword :tm: :x: :heavy_exclamation_mark: :bangbang: :interrobang: +syn keyword markdownEmoticonKeyword :o: :heavy_multiplication_x: :heavy_plus_sign: :heavy_minus_sign: :heavy_division_sign: +syn keyword markdownEmoticonKeyword :white_flower: :100: :heavy_check_mark: :ballot_box_with_check: :radio_button: +syn keyword markdownEmoticonKeyword :link: :curly_loop: :wavy_dash: :part_alternation_mark: :trident: +syn keyword markdownEmoticonKeyword :black_square: :white_square: :white_check_mark: :black_square_button: :white_square_button: +syn keyword markdownEmoticonKeyword :black_circle: :white_circle: :red_circle: :large_blue_circle: :large_blue_diamond: +syn keyword markdownEmoticonKeyword :large_orange_diamond: :small_blue_diamond: :small_orange_diamond: :small_red_triangle: :small_red_triangle_down: +syn keyword markdownEmoticonKeyword :shipit: + +" }}} + + +" {{{ HIGHLIGHT DEFINITION + +hi def Italic term=italic cterm=italic gui=italic +hi def Bold term=bold cterm=bold gui=bold +hi def BoldItalic term=bold,italic cterm=bold,italic gui=bold,italic + +hi def link markdownItalic Italic +hi def link markdownBold Bold +hi def link markdownBoldItalic BoldItalic + +hi def link markdownPullRequestLinkInText Underlined +hi def link markdownUserLinkInText Underlined +hi def link markdownUrlLinkInText Underlined +hi def link markdownEmailLinkInText Underlined + +hi def link markdownLinkText Underlined +hi def link markdownLinkUrl Underlined +hi def link markdownLinkTitleSingleQuoted Bold +hi def link markdownLinkTitleDoubleQuoted Bold +hi def link markdownLinkUrlContainer Delimiter +hi def link markdownLinkTextContainer Delimiter +hi def link markdownLinkReference NonText + +hi def link markdownCodeDelimiter Delimiter +hi def link markdownInlineCode String +hi def link markdownFencedCodeBlock String +hi def link markdownCodeBlock String + +hi def link markdownTableDelimiter Delimiter +hi def link markdownTableHeader Bold + +hi def link markdownStrike NonText +hi def link markdownStrikeDelimiter Delimiter +hi def link markdownBlockquote Comment +hi def link markdownBlockquoteDelimiter Delimiter +hi def link markdownInlineDelimiter Delimiter +hi def link markdownListDelimiter Delimiter + +hi def link markdownHeaderId Delimiter +hi def link markdownHeadingDelimiter Delimiter +hi def link markdownHeadingUnderline Delimiter +hi def link markdownHeader Title +hi def link markdownH1 Title +hi def link markdownH2 Title +hi def link markdownH3 Title +hi def link markdownH4 Title +hi def link markdownH5 Title +hi def link markdownH6 Title + +hi def link markdownEmoticonKeyword Statement +hi def link markdownRule Identifier + +hi def link markdownXmlComment NonText +hi def link markdownXmlElement NonText +hi def link markdownXmlEmptyElement NonText +hi def link markdownXmlEntities Special + +" }}} + + +if !exists('g:markdown_include_jekyll_support') || g:markdown_include_jekyll_support + execute 'runtime! syntax/markdown_jekyll.vim' +endif + +let b:current_syntax = "markdown" +if main_syntax ==# 'markdown' + unlet main_syntax +endif diff --git a/vim/.vimrc b/vim/.vimrc @@ -0,0 +1,234 @@ +" TODO :: +" * some sort of shortcut to 'make' +" * http://www.alexeyshmalko.com/2014/using-vim-as-c-cpp-ide/ +" * http://learnvimscriptthehardway.stevelosh.com/chapters/14.html + +" load plugins {{{ +runtime plugins/vim-status/vim-status.vim +runtime plugins/vim-tabline/vim-tabline.vim +runtime plugins/vim-dfm/vim-dfm.vim +" }}} + +" generic settings {{{ +syntax enable " enable syntax highlighting +let mapleader = "\<Space>" " lead with space +set nocompatible " use more features +set path+=** " search down into subfolders +set wildmenu " display all matches when tab complete +set t_Co=256 " use 256 colors +set number " line numbers +set relativenumber " relative line numbers +set cursorline " colored cursor line +set colorcolumn=80 " color column at 80 characters +set textwidth=79 " set text width to 79 characters +set showcmd " show incomplete commands +set fileformat=unix " use <NL> only like a normal person +set backspace=indent,eol,start " backspace through everything in insert mode +set list lcs=tab:»·,trail:· " highligt tabs and trailing spaces +set formatoptions+=tcrowanl " word and comment wrapping +set encoding=utf-8 " use utf-8 encoding +set title " use 'titlestring' as window title +set viminfo+=n~/.data/viminfo " change location of .viminfo +" }}} + +" colors {{{ +hi Cursor ctermbg=none ctermfg=none cterm=reverse +hi CursorLine ctermbg=5 ctermfg=none cterm=none +hi ColorColumn ctermbg=5 ctermfg=none cterm=none +hi Folded ctermbg=5 ctermfg=2 cterm=none +hi FoldColumn ctermbg=0 ctermfg=2 cterm=none +hi SignColumn ctermbg=0 ctermfg=2 cterm=none +hi StatusLine ctermbg=5 ctermfg=6 cterm=none +hi StatusLineNC ctermbg=5 ctermfg=6 cterm=none +hi WildMenu ctermbg=6 ctermfg=5 cterm=none +hi Visual ctermbg=5 ctermfg=15 cterm=none +hi TabLine ctermbg=5 ctermfg=2 cterm=none +hi TabLineFill ctermbg=0 ctermfg=6 cterm=none +hi TabLineSel ctermbg=5 ctermfg=6 cterm=none +hi TabLineNum ctermbg=2 ctermfg=5 cterm=none +hi TabLineNumSel ctermbg=6 ctermfg=5 cterm=none +hi TabLineSep ctermbg=0 ctermfg=6 cterm=none +hi TabLineDir ctermbg=6 ctermfg=5 cterm=none +hi SpellBad ctermbg=1 ctermfg=15 cterm=italic +hi SpellCap ctermbg=14 ctermfg=15 cterm=italic +hi SpellLocal ctermbg=11 ctermfg=15 cterm=italic +hi SpellRare ctermbg=10 ctermfg=5 cterm=italic +hi SpecialKey ctermbg=5 ctermfg=15 cterm=italic +hi Search ctermbg=5 ctermfg=6 cterm=bold +hi Pmenu ctermbg=5 ctermfg=6 cterm=none +hi PmenuSel ctermbg=6 ctermfg=5 cterm=none +hi PmenuSbar ctermbg=2 ctermfg=none cterm=none +hi PmenuThumb ctermbg=6 ctermfg=none cterm=none +hi LineNr ctermbg=0 ctermfg=2 cterm=none +hi CursorLineNr ctermbg=0 ctermfg=2 cterm=none +hi NonText ctermbg=0 ctermfg=2 cterm=none +hi Constant ctermbg=0 ctermfg=1 cterm=none +hi PreProc ctermbg=0 ctermfg=1 cterm=none +hi Special ctermbg=0 ctermfg=11 cterm=none +hi Title ctermbg=0 ctermfg=11 cterm=none +hi Type ctermbg=0 ctermfg=13 cterm=none +hi Underlined ctermbg=0 ctermfg=11 cterm=underline +" }}} + +" cursor line in insert mode {{{ +autocmd InsertEnter * hi CursorLine ctermbg=none ctermfg=none +autocmd InsertLeave * hi CursorLine ctermbg=5 ctermfg=none +"}}} + +" remember last position {{{ +autocmd BufReadPost * silent! normal! g`"zv +" }}} + +" timeout settings {{{ +set timeout " timeout on mappings +set ttimeout " timeout on sequence +set timeoutlen=3000 " wait 3s to finish left-hand-side of a mapping +set ttimeoutlen=50 " only wait 50ms for a sequence to finish +" }}} + +" tab jumping by mapping alt/meta+n to n+gt {{{ +for i in range(1, 9) + exec "nmap \e" . i . " <M-" . i . ">" + exec "nmap \<M-" . i . "> " . i . "gt" +endfor +" }}} + +" searching {{{ +set hlsearch " highlight matches +set incsearch " incremental searching +set ignorecase " searches are case insensitive... +set smartcase " ...unless containing at least one capital letter +" }}} + +" folding {{{ +set foldmethod=marker +nnoremap <silent> <leader><space> za +"}}} + +" key mappings {{{ +nnoremap B ^ +nnoremap E $ +nnoremap <silent> <leader>f :LiteDFMToggle<CR> +" }}} + +" tab settings {{{ +set tabstop=4 " tab equals 4 spaces +set softtabstop=4 " soft tab equals 4 spaces +set shiftwidth=4 " use 4 spaces for indentations +set expandtab " use spaces instead of tabs +set autoindent " copy indent from current line to next +set shiftround " round indent of multiple of 'shiftwidth' +" }}} + +" autocomplete {{{ +function! Tab_Or_Complete(reverse) + if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' + if (a:reverse) + return "\<C-p>" + else + return "\<C-n>" + endif + else + if (a:reverse) + return "\<C-d>" + else + return "\<Tab>" + elseif + endif +endfunction + +set dictionary+=/usr/share/dict/words +set complete-=k +inoremap <silent> <tab> <C-r>=Tab_Or_Complete(0)<CR> +inoremap <silent> <S-tab> <C-r>=Tab_Or_Complete(1)<CR> +if (&ft=='text' || &ft=='md' || &ft=='') + set complete+=k +endif +" }}} + +" disable editing for read-only files {{{ +function! ReadOnlyNoEdit() + if &readonly == 1 + set nomodifiable + else + set modifiable + endif +endfunction + +autocmd BufRead * call ReadOnlyNoEdit() +" }}} + +" clipboard through xclip {{{ +vnoremap <silent> <leader>y + \ y:call system("xclip -i -selection clipboard", @")<cr> +nnoremap <silent> <leader>p + \ :call setreg(@",system("xclip -o -selection clipboard"))<cr>p +" }}} + +" backup and swap files {{{ +set backupdir=~/.data/vimtmp,. +set dir=~/.data/vimtmp//,. +" }}} + +" filetype specific settings {{{ +filetype detect +if (&ft == 'c' || &ft == 'cpp') + " syntax folding + set foldmethod=syntax + set foldnestmax=10 + set nofoldenable + set foldlevel=2 + + " disable wrapping + set formatoptions-=t + set nowrap +elseif (&ft == '' +\|| &ft == 'sh' +\|| &ft == 'vim' +\|| &ft == 'muttrc' +\|| &ft == 'tmux') + " disable wrapping + set formatoptions-=t +elseif (&ft == 'make') + set formatoptions-=t " disable wrapping + set noexpandtab " make requires tabs as separators +endif +" }}} + +function! ExpandOrEmpty(name) + try + return expand(a:name) + catch + return "" + endtry +endfunction + +"""" Move to separate "plugin" file +function! FZFExec(fnc, input, opt) + let tempfile = tempname() + exe '!' . a:input . ' | fzf ' . a:opt . ' > ' . shellescape(tempfile) + try + let content = readfile(tempfile, '', -1) + if len(content) > 0 + let value = content[0] + if value != "" + exe a:fnc . ' ' . value + endif + endif + catch " do nothing + finally + call delete(tempfile) + endtry +endfunction + +" if expand("%:p:h") !~ '^/tmp' | silent! lcd %:p:h | endif +command! -nargs=1 FZFFile +\ | execute ':silent call FZFExec(' + \ . '<q-args>' + \ . ',"find ' . ExpandOrEmpty("%:p:h") . ' 2>/dev/null"' + \ . ',"--layout=reverse-list"' + \ . ')' +\ | execute ':redraw!' + +nnoremap <F7> :FZFFile open<CR> +nnoremap <F8> :FZFFile tabnew<CR> diff --git a/vimb/.vimb/config b/vimb/.vimb/config @@ -0,0 +1,90 @@ +# Homepage that vimb opens if started without a URI. +set home-page=about:blank + +# Path to the default download directory. If no download directory is set, +# download will be written into current directory. The following pattern will +# be expanded if the download is started '~/', '~user', '$VAR' and '${VAR}'. +set download-path=~/downloads + +# cookies +set cookie-accept=origin + +# Command with placeholder '%s' called if form field is opened with $EDITOR to +# spawn the editor-like `x-terminal-emulator -e vim %s'. To use Gvim as the +# editor, it's necessary to call it with `-f' to run it in the foreground. +set editor-command=st -e vim %s + +# Enable or disable the spell checking feature. +set spell-checking=true + +# Set comma separated list of spell checking languages to be used for +# spell checking. +set spell-checking-languages=en,se + +# While typing a search command, show where the pattern typed so far matches. +set incsearch=true + +# The font family to use as the default for content that does not specify a +# font. +set default-font=Hack + +# The font family used as the default for content using monospace font. +set monospace-font=Hack + +# The font family used as the default for content using sans-serif font. +set sans-serif-font=Hack + +# The font family used as the default for content using serif font. +set serif-font=Hack + +# The default font size used to display text. +set font-size=13 + +# Default font size for the monospace font. +set monospace-font-size=11 + +# Default Full-Content zoom level in percent. Default is 100. +set default-zoom=100 + +# Makes the last 30k websites you visited searchable. +set history-max-items=30000 + +# Choose your own keys for hint titles. I try to stick to the home row. +set hint-keys=jklfds;a123467890 + +# Rebind Back and Forward to something more convenient. +nnoremap H <C-O> +nnoremap L <C-I> + +# Map page zoom in normal mode to keys commonly used across applications +# + (zoom in), - (zoom out), = (zoom reset) +nmap + zI +nmap - zO +nmap = zz + +# I like browsing with Javascript turned off by default. However, if a website +# needs it, can I just hit ! and have the page reload with JS activated. +set scripts=off +nnoremap ! :set scripts!<CR>r +