Replace links

This commit is contained in:
Jan Andrle 2024-02-19 16:07:53 +01:00
parent 5ade3e687f
commit 4dfa0bbe38
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB
37 changed files with 5415 additions and 28 deletions

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.XCompose

79
.XCompose Normal file
View File

@ -0,0 +1,79 @@
# jaandrle customizations
include "/usr/share/X11/locale/cs_CZ.UTF-8/Compose"
<Multi_key> <backslash> <space> : "" U202F # thin nonbreaking space
<Multi_key> <bar> <space> : "" U200B
<Multi_key> <8> <8> : "∞" U221E
<Multi_key> <equal> <equal>: "≡"
<Multi_key> <asciitilde> <asciitilde>: "≈"
<Multi_key> <equal> <asciitilde>: "≃"
<Multi_key> <asterisk> <asterisk>: "★"
<Multi_key> <c> <h> <e> <c> <k> : "✓"
<Multi_key> <c> <r> <o> <s> <s> : "✗"
<Multi_key> <a> <minus> <8> : "↑"
<Multi_key> <a> <minus> <6> : "→"
<Multi_key> <a> <minus> <2> : "↓"
<Multi_key> <a> <minus> <4> : "←"
<Multi_key> <a> <minus> <5> : "↔"
<Multi_key> <a> <minus> <7> : "↖"
<Multi_key> <a> <minus> <9> : "↗"
<Multi_key> <a> <minus> <3> : "↘"
<Multi_key> <a> <minus> <1> : "↙"
<Multi_key> <a> <minus> <KP_8> : "↑"
<Multi_key> <a> <minus> <KP_6> : "→"
<Multi_key> <a> <minus> <KP_2> : "↓"
<Multi_key> <a> <minus> <KP_4> : "←"
<Multi_key> <a> <minus> <KP_5> : "↔"
<Multi_key> <a> <minus> <KP_7> : "↖"
<Multi_key> <a> <minus> <KP_9> : "↗"
<Multi_key> <a> <minus> <KP_3> : "↘"
<Multi_key> <a> <minus> <KP_1> : "↙"
<Multi_key> <a> <equal> <8> : "⇑"
<Multi_key> <a> <equal> <6> : "⇒"
<Multi_key> <a> <equal> <2> : "⇓"
<Multi_key> <a> <equal> <4> : "⇐"
<Multi_key> <a> <equal> <5> : "⇔"
<Multi_key> <a> <equal> <KP_8> : "⇑"
<Multi_key> <a> <equal> <KP_6> : "⇒"
<Multi_key> <a> <equal> <KP_2> : "⇓"
<Multi_key> <a> <equal> <KP_4> : "⇐"
<Multi_key> <a> <equal> <KP_5> : "⇔"
# Greek ambiguities: epsilon/eta, theta/tau, pi/phi/psi, omega/omicron
<Multi_key> <g> <a> : "α"
<Multi_key> <g> <b> : "β"
<Multi_key> <g> <g> : "γ"
<Multi_key> <g> <d> : "δ"
<Multi_key> <g> <3> : "ε"
<Multi_key> <g> <z> : "ζ"
<Multi_key> <g> <e> : "η"
<Multi_key> <g> <h> : "θ"
<Multi_key> <g> <i> : "ι"
<Multi_key> <g> <k> : "κ"
<Multi_key> <g> <l> : "λ"
<Multi_key> <g> <m> : "μ"
<Multi_key> <g> <n> : "ν"
<Multi_key> <g> <x> : "ξ"
# note: no omicron
<Multi_key> <g> <p> : "π"
<Multi_key> <g> <p> : "Ϟ"
<Multi_key> <g> <r> : "ρ"
<Multi_key> <g> <s> : "σ"
<Multi_key> <g> <t> : "τ"
<Multi_key> <g> <u> : "ψ"
<Multi_key> <g> <f> : "φ"
<Multi_key> <g> <c> : "χ"
<Multi_key> <g> <o> : "ω"
<Multi_key> <g> <G> : "Γ"
<Multi_key> <g> <D> : "Δ"
<Multi_key> <g> <H> : "Θ"
<Multi_key> <g> <L> : "Λ"
<Multi_key> <g> <X> : "Ξ"
<Multi_key> <g> <P> : "Π"
<Multi_key> <g> <S> : "Σ"
<Multi_key> <g> <F> : "Φ"
<Multi_key> <g> <U> : "Ψ"
<Multi_key> <g> <O> : "Ω"

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.bash_aliases

142
.bash/.bash_aliases Normal file
View File

@ -0,0 +1,142 @@
# Make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias diff='diff --color=auto'
fi
alias §rm='rm -vi'
alias §cp='cp -vi'
alias §mv='mv -vi'
alias §df='df -Th'
§du(){
[[ "$1" == '--help' ]] && echo "§du; §du '../*'" && return 0
du -h -x -s -- ${1:-*} | sort -r -h;
}
alias §xclip-copy='xclip -selection clipboard'
alias §xclip-paste='xclip -o -selection clipboard'
LAST_PWD_PATH="$BASH_DOTFILES/.bash_last_pwd"
[ -f "$LAST_PWD_PATH" ] && OLDPWD=`cat $LAST_PWD_PATH`
cd(){ builtin cd "$@" && echo `pwd` > "$LAST_PWD_PATH"; }
history_clean(){ awk '!seen[$0]++ {print $0}' $HOME/.bash_history; }
history_edit(){ vim $HOME/.bash_history; }
history_cat(){ LC_ALL=C cat ~/.bash_history; }
history_most_used(){ LC_ALL=C cat ~/.bash_history | cut -d ';' -f 2- | §awk 1 | sort | uniq -c | sort -r -n | head -n ${1-10}; }
§(){
[[ -z "$1" ]] && clear && return 0
echo "$ [--help]= clear or [print this text]"
alias | grep "alias §" --color=never
declare -F | grep 'declare -f §' --color=never
ls ~/bin | grep -P "^§" | sed 's/^§/~\/bin\/ §/'
}
alias §ls='ls -pQFh --group-directories-first'
alias §less='less -R -S'
alias §cd.='clear;§ls'
§cd..(){ cd $(eval printf '../'%.0s {1..$1}); }
§cd(){
[[ "$1" == '--help' ]] && echo -e "
Usage: §cd NUMBER|PATH
See: dirs -v
" && return 0
[[ -z "$1" ]] && dirs -v | sed 1d && return 0
[[ $1 =~ ^[0-9]+$ ]] && cd "$(dirs -l +$1)" && dirs -v | sed 1d && return 0
builtin pushd "$1" >/dev/null && pushd .
}
alias cd-vifm='cd `vifm --choose-dir -`'
mkcd(){ mkdir -p -- "$1" && cd -P -- "$1"; }
alias §find.='find . -maxdepth 1'
alias pdftk='java -jar $HOME/bin/pdftk-all.jar'
bw-session(){
bw logout
login=`kwallet-query kdewallet -f accounts -r Bitwarden 2> /dev/null`
export BW_CLIENTSECRET=`echo "$login" | jq -r .secret`
export BW_CLIENTID=`echo "$login" | jq -r .id`
bw login --apikey --raw
export BW_SESSION=`bw unlock --raw $(echo "$login" | jq -r .pass)` && echo "Bitwarden session ON" || echo "Bitwarden session FAILED"
unset BW_CLIENTSECRET
unset BW_CLIENTID
}
alias §psmem_all='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem'
alias §psmem='§psmem_all | head -n 10'
alias §pscpu_all='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu'
alias §pscpu='§pscpu_all | head -n 10'
alias §psnet_all='lsof -P -i -n'
§ping-test(){ # Pings ip address of noip.com and www.google.com.
ping -c 1 -q 8.23.224.107 | grep --color=never -A 1 -i '\---'
ping -c 1 -q www.google.com | grep --color=never -A 1 -i '\---'
}
§whoami(){
[[ "$1" == '--help' ]] && echo '§whoami; §whoami --ip' && return 0
local ip=$(curl -s ifconfig.me)
[[ "$1" == '--ip' ]] && echo "$ip" && return 0
local L=" %s\n"
printf "\n"
printf "$L" "USER: $(echo $USER)"
printf "$L" "IP ADDR: $ip"
printf "$L" "HOSTNAME: $(hostname -f)"
printf "$L" "KERNEL: $(uname -rms)"
printf "\n"
}
§cmdfu(){ curl "https://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }
aai(){
[[ "$1" == '--help' ]] && ai ask --help && return 0;
echo "ai ask \"$*, thanks for your help\""; ai ask "\"$*, thanks for your help\"";
}
eval "$(zoxide init --cmd cd bash)"
alias npx-wca='npx -y web-component-analyzer'
alias npx-qnm='npx -y qnm'
alias npx-hint='npx -y hint'
alias npx-markdown='nohup npx markserv'
alias zfz=fzf-carroarmato0.fzf
§url-curl(){ curl --silent -I "$1" | grep -i location; }
alias bathelp='bat --plain --language=help'
rpg(){
rpg-cli "$@"
if ( [[ "$1" == "cd" ]] || [[ "$1" == "ls" ]] ); then
[[ "$2" == "" ]] && $1 . && return 0
[[ "$2" == ".." ]] && $1 .. && return 0
[[ "-1" != "$(nodejsscript --print "s.ls().findIndex(e=> e==='$2'.replace(/\/$/, ''))")" ]] && $1 "$2" && return 0
fi
return 0
# [[ "$(rpg-cli pwd)" == "$(pwd)" ]] && return 0
# cd "$(rpg-cli pwd)"
}
rpg-dungeon(){
current=$(basename $PWD)
number_re='^[0-9]+$'
if [[ $current =~ $number_re ]]; then
next=$(($current + 1))
command mkdir -p $next && cd $next && rpg ls
elif [[ -d 1 ]] ; then
cd 1 && rpg ls
else
command mkdir -p dungeon/1 && cd dungeon/1 && rpg ls
fi
}
# alias adb-device='adb devices | tail -n +2 | head -n 1 | §awk 1'
# make-completion-wrapper, see https://gdhnotes.blogspot.com/2014/02/alias-bash-completion.html

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.bash_completions

49
.bash/.bash_completions Normal file
View File

@ -0,0 +1,49 @@
eval "$(gh completion -s bash)"
# gh tips: https://gist.github.com/ChristopherA/3cca24936fb2c84786a29f67bacacd3e
# used ectension: heaths/gh-label
[[ $- != *i* ]] && return # dont include rest in Vim
SCRIPT_DIR=$( builtin cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "$SCRIPT_DIR/complete-alias/complete_alias"
complete -F _complete_alias gitdotfiles
alias C--asana='eval "$($HOME/bin/asana.mjs completion_bash)"'
alias C--himalaya='\. "$BASH_DOTFILES/himalaya.completion"'
alias C--uu='eval "$($HOME/bin/uu --completion-bash)"'
alias C--bs='eval "$(bs .completion bash)"'
alias C--jc='eval "$(jc -B)" … newer version needed'
\. "$BASH_DOTFILES/cordova.completion"
eval "$(node --completion-bash)"
eval "$(npm completion)"
eval "$(nodejsscript --completion bash)"
_npx() {
local cur="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD != 1 ]]; then
case "${COMP_WORDS[1]}" in
gulp)
local compls=$(npx gulp --tasks-simple)
if [[ $compls == *"__autocomplete_bash"* ]]; then
compls="$compls $(npx gulp -L __autocomplete_bash --_l=$COMP_CWORD --_c=$cur)"
fi
;;
esac
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
return 0;
fi
local dir=$(pwd -P)
while [[ -n "$dir" ]]; do
if [[ ! -d $dir/node_modules/.bin ]]; then
dir=${dir%/*}
continue
fi
local execs=( `cd $dir/node_modules/.bin; find -L . -type f -executable` )
execs=( ${execs[@]/#.\//} )
COMPREPLY=( $(compgen -W "${execs[*]} serve" -- "$cur" ) )
break
done
}
complete -F _npx npx

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.bash_jaaENV

103
.bash/.bash_jaaENV Normal file
View File

@ -0,0 +1,103 @@
function jaaENV {
if [ "$1" = "--help" ]; then
echo "Utility to combine nvm/sdk/… in one script/config file '.jaaENV'"
echo " ↘ instead of 'nvm use 16 & sdk use …'"
echo ""
echo "Usage:"
echo " jaaENV"
echo " jaaENV [--help|--ls]"
echo " jaaENV --save …to_save (example: jaaENV --save nodejs php)"
echo ""
echo "Description:"
echo " - Without arguments loads infos from '.jaaENV'"
echo " - 'ls' shows supported options to auto load"
echo " - 'save' cerates config file '.jaaENV'"
echo ""
echo "Usage '.jaaENV' files: "
echo " typical: '\nphp=5.6\nnodejs=16.13.0'"
echo " link: '. ../.jaaENV' … use settings from parent folder"
echo " Options:"
echo " 'android_home': Exports 'ANDROID_HOME' (uses 'ANDROID_HOME_BAK') instead of new 'ANDROID_SDK_ROOT'. Value can be anything (use '1')."
echo " 'jdk': Exports 'JAVA_HOME' based on wanted version (currently 11/1.8)"
echo " 'nodejs'|'php': NodeJS/PHP versions"
echo " 'gradle': Cordova uses folder scoped → so unnecesarly"
echo ""
echo "Install: "
echo " gradle ⇒ https://sdkman.io/"
echo " node ⇒ https://github.com/nvm-sh/nvm"
echo " php ⇒ http://jdem.cz/fgyu56 + https://deb.sury.org/"
echo ""
echo "Tips:"
echo " sudo update-alternatives --set php /usr/bin/php\$php"
return 0
fi
if [ "$1" = "--save" ]; then
shift
rm -vi .jaaENV
while test $# -gt 0
do
case "$1" in
nodejs|node)
local nodejs_version=`node --version`
echo "nodejs=${nodejs_version:1}" >> .jaaENV
;;
gradle)
local gradle_version=`gradle --version | head -n 3 | tail -n 1 | §awk 2`
echo "gradle=$gradle_version" >> .jaaENV
;;
php)
local php_version=`php --version | head -n 1 | §awk 2`
echo "php=$php_version" >> .jaaENV
;;
*)
echo "unknown '$1' skipped"
;;
esac
shift
done
return 0
fi
if [ "$1" = "--ls" ]; then
echo ":: nvm ls ::\n"
nvm ls
echo ":: find /usr/bin/ -name php* ::\n"
find /usr/bin/ -name php*
echo ":: sdk ls gradle | cat :: "
sdk ls gradle | cat
return 0
fi
if [ -f "compose.yaml" ]; then
jdk=$(grep -Po 'VERSION_JAVA=\K.*' compose.yaml)
nodejs=$(grep -Po 'VERSION_NODEJS=\K.*' compose.yaml)
else
. ./.jaaENV
fi
if [ ! -z ${android_home+x} ]; then export ANDROID_HOME=$ANDROID_HOME_BAK; echo "\$ANDROID_HOME=$ANDROID_HOME"; else unset ANDROID_HOME; echo "\$ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"; fi
if [ ! -z ${android_home_is_sdk+x} ]; then export ANDROID_HOME=$ANDROID_SDK_ROOT; echo "\$ANDROID_HOME=$ANDROID_HOME"; fi
if [ ! -z ${jdk+x} ]; then
if (( $(echo "$jdk > 9" | bc -l) )); then
export JAVA_HOME_bk=$JAVA_HOME
export JAVA_HOME=/snap/android-studio/current/android-studio/jre;
elif [ ! -z ${JAVA_HOME_bk+x} ]; then
export JAVA_HOME=$JAVA_HOME_bk
fi
echo "\$JAVA_HOME=$JAVA_HOME"
fi
if [ ! -z ${nodejs+x} ]; then nvm use $nodejs; fi
if [ ! -z ${gradle+x} ]; then sdk use gradle $gradle | tr -d '\n'; echo ; fi
if [ ! -z ${php+x} ]; then
local php_local=`php --version | head -n 1 | §awk 2`
if [[ "$php_local" == "$php"* ]]; then
echo "php $php"
else
echo "php $php$php_local"
sudo update-alternatives --set php /usr/bin/php$php
sudo -k
fi
fi
unset android_home
unset nodejs
unset gradle
unset php
}

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.bash_nvm

3
.bash/.bash_nvm Normal file
View File

@ -0,0 +1,3 @@
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.bash_promt

61
.bash/.bash_promt Normal file
View File

@ -0,0 +1,61 @@
function setPromt {
if [ "$color_prompt" != yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
return
fi
case "$TERM" in
xterm*|rxvt*)
;;
*)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
return
;;
esac
PROMPT_COMMAND=updatePromt
PS2="|"
}
function updatePromt {
local prev_exit="$?"
# color_helper_>>color<< (Note: \[\]= escaping)
local chR="\[\e[1;91m\]" #red
local chW="\[\033[00m\]" #white
local chG="\[\033[01;32m\]" #green
local chB="\[\033[0;34m\]" #blue
local chP="\[\033[0;35m\]" #purple
local chY="\[\033[0;33m\]" #yellow
PS1=""
if [ $prev_exit == 0 ]; then
PS1+="$chG$chW"
else
PS1+="$chR$chW"
fi
local jobs="$(jobs | wc -l)"
if [ $jobs != 0 ]; then
PS1+="${chY}$jobs$chW"
fi
PS1+="${debian_chroot:+($debian_chroot)}"
PS1+=" At ${chG}\A${chW}"
PS1+=" by ${chP}\u${chW}"
if sudo -n true 2>/dev/null; then
PS1+="${chR} (sudo)${chW}"
fi
PS1+=" in "
if \git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local branch="$(\git symbolic-ref -q HEAD)"
PS1+="[${branch#refs/heads/}"
local status="$(git for-each-ref --format='%(upstream:trackshort)' refs/heads | awk '!seen[$1]++ {printf $1}')"
status+="$(git status --porcelain | awk '!seen[$1]++ {printf $1}')"
if [ "$statua"s ]; then
PS1+="|$chY$status$chW"
fi
PS1+="] "
fi
PS1+="${chB}\w${chW}"
PS1+="\n:"
history -a
}
setPromt
unset color_prompt
unset -f setPromt
# vim: set filetype=sh tabstop=4 shiftwidth=4 textwidth=250 expandtab :

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.bash_sdkman

3
.bash/.bash_sdkman Normal file
View File

@ -0,0 +1,3 @@
#THIS MUST BE AT THE END OF THE `$HOME/.bashrc` FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/.profile_androidsdk

View File

@ -0,0 +1,7 @@
# IMPORT IN `$HOME/.profile`
export ANDROID_HOME_BAK="$HOME/.local/share/umake/android/android-studio"
export ANDROID_SDK_ROOT="$HOME/.local/share/umake/android/android-studio-sdk"
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/
export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator/

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/cordova.completion

134
.bash/cordova.completion Normal file
View File

@ -0,0 +1,134 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
platforms() {
get_cordova && COMPREPLY=( $(compgen -W "$(${CORDOVA_BIN} platform ls | tr -d "[]',")" -- $1) )
}
plugins() {
get_cordova && COMPREPLY=( $(compgen -W "$(${CORDOVA_BIN} plugin ls | tr -d "[]',")" -- $1) )
}
get_cordova() {
local cordova
if [[ -n "${CORDOVA_BIN}" ]]; then return 0; fi
cordova=$(eval echo ${COMP_WORDS[0]})
if [[ -x $cordova ]]; then CORDOVA_BIN=$cordova; return 0; fi
cordova=$(which cordova)
if [[ $? -eq 0 ]]; then CORDOVA_BIN=$cordova; return 0; fi
return 1
}
get_top_level_dir() {
local path
path=$(pwd)
while [ $path != '/' ]; do
if [ -d $path/.cordova ]; then
echo $path
return 0
fi
path=$(dirname $path)
done
return 1
}
_cordova()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
# Skip over any initial command line switches
local i=1
while [[ $i -lt ${#COMP_WORDS[*]} ]] && [[ "${COMP_WORDS[${i}]}" == -* ]]; do
i=$((i+1));
done
# For the first word, supply all of the valid top-level commands
if [[ ${COMP_CWORD} -eq $i ]]; then
opts="help create info platform plugin prepare compile build clean run emulate serve"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
case "${COMP_WORDS[$i]}" in
create)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
COMPREPLY=( $(compgen -d -- ${cur}) )
return 0
fi
;;
platform)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
opts="add rm remove ls"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
case "${COMP_WORDS[$((i+1))]}" in
add)
opts="ios android wp7 wp8 blackberry www"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0;
;;
rm|remove)
platforms ${cur}
return 0
;;
esac
;;
plugin)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
opts="add rm remove ls"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
case "${COMP_WORDS[$((i+1))]}" in
add)
COMPREPLY=( $(compgen nospace -d -- ${cur}) )
return 0;
;;
rm|remove)
plugins ${cur}
return 0
;;
esac
;;
prepare|compile|emulate)
platforms ${cur}
return 0
;;
build)
platforms ${cur}
COMPREPLY+=( $(compgen -W '--release --debug --help --device --emulator --buildConfig' -- ${cur}) )
return 0
;;
run)
platforms ${cur}
COMPREPLY+=( $(compgen -W '--list --noprepare --nobuild --target --release --debug --help --device --emulator --buildConfig' -- ${cur}) )
return 0
;;
serve)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
platforms ${cur}
return 0
fi
;;
esac
}
complete -F _cordova cordova

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bash/himalaya.completion

2540
.bash/himalaya.completion Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.bashrc

65
.bashrc Normal file
View File

@ -0,0 +1,65 @@
#### BASH Config file
### Jan Andrle
## Info:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) for examples
export EDITOR='vim'
BASH_DOTFILES=$HOME/.bash
[ -f $BASH_DOTFILES/.bash_aliases ] && . $BASH_DOTFILES/.bash_aliases
shopt -s expand_aliases
[ -f $BASH_DOTFILES/.bash_jaaENV ] && . $BASH_DOTFILES/.bash_jaaENV
[ -f $BASH_DOTFILES/.bash_sdkman ] && . $BASH_DOTFILES/.bash_sdkman
[ -f $BASH_DOTFILES/.bash_nvm ] && . $BASH_DOTFILES/.bash_nvm
# Install Ruby Gems to ~/.local/share/gems
export GEM_HOME="$HOME/.local/share/gems"
export PATH="$HOME/.local/share/gems/bin:$HOME/.local/bin:$PATH"
[ -f $BASH_DOTFILES/.bash_completions ] && . $BASH_DOTFILES/.bash_completions # for Vim
[[ $- != *i* ]] && return # If not running interactively, don't do anything
## General
set -o vi # VIM mode for bash
bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'
export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
shopt -s checkwinsize # dynamic columns update after every cmd
## History
export HISTCONTROL=ignoreboth:erasedups # No duplicate entries and started with spaces. See bash(1) for more options
shopt -s histappend cmdhist # saving multiline + append
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
export HSTR_CONFIG=hicolor,prompt-bottom
export HSTR_PROMPT='?: '
## UI/UX
# clors for .inputrc (set colored-stats On)
export LS_COLORS=$LS_COLORS:'tw=01;04;34:ow=01;04;34:'
# set variable identifying the chroot you work in (used in the prompt below)
[ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ] && debian_chroot=$(cat /etc/debian_chroot)
# Set a fancy prompt (non-color, unless we know we "want" color)
[[ $TERM == "xterm-color" ]] || [[ $TERM == *-256color ]] && color_prompt=yes
[ ! -x /usr/bin/tput ] || ! tput setaf 1 >&/dev/null && color_prompt=
[ -f $BASH_DOTFILES/.bash_promt ] && . $BASH_DOTFILES/.bash_promt
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export GPG_TTY=$(tty)
# HSTR configuration - add this to ~/.bashrc
# if this is interactive shell, then bind hstr to Ctrl-space
if [[ $- =~ .*i.* ]]; then bind '"\C-@": "\e^ihstr -- \n"'; fi

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/gh_config.yml

19
.config/gh/config.yml Normal file
View File

@ -0,0 +1,19 @@
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: ssh
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor:
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:
§modules: issue list --label "modules (auxiliary)" --state "closed"
§grepAsana_: '!grep "Issue is synchronized with this \[Asana task\]" | §awk -F "(" 2 | §awk -F ")" 1 | §awk -F "/" 6'
§indigo: api user/orgs -q '.[0].login'
§workflow-test: '!git commit -mWIP .github/workflows/$1 && git push && gh workflow run --ref $(git rev-parse --abbrev-ref HEAD) $@'
# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport.
http_unix_socket:
# What web browser gh should use when opening URLs. If blank, will refer to environment.
browser:
version: "1"

View File

@ -0,0 +1,27 @@
" ph
highlight clear
highlight Win cterm=none ctermfg=248 ctermbg=234
highlight Directory cterm=bold ctermfg=033 ctermbg=234
highlight Link cterm=bold ctermfg=yellow ctermbg=234
highlight BrokenLink cterm=reverse ctermfg=red ctermbg=default
highlight Socket cterm=bold ctermfg=125 ctermbg=default
highlight Device cterm=bold ctermfg=red ctermbg=default
highlight Fifo cterm=bold ctermfg=cyan ctermbg=default
highlight Executable cterm=bold ctermfg=166 ctermbg=default
highlight Selected cterm=bold ctermfg=255 ctermbg=237
highlight CurrLine cterm=bold ctermfg=default ctermbg=237
highlight TopLine cterm=bold ctermfg=black ctermbg=235
highlight TopLineSel cterm=bold ctermfg=black ctermbg=default
highlight StatusLine cterm=bold ctermfg=black ctermbg=235
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Border cterm=none ctermfg=black ctermbg=234
highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white
highlight SuggestBox cterm=bold ctermfg=default ctermbg=default
if $USER == 'root'
highlight Border ctermbg=red
endif

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vifm/vifmrc

373
.config/vifm/vifmrc Normal file
View File

@ -0,0 +1,373 @@
"" VIFM Config file / 2023-03-16 / Jan Andrle
"" #region B Bookmarks
if !has('win')
:bmark! "~/" home
:bmark! "~/Stažené/" downloads
:bmark! "~/Dokumenty/" documents
:bmark! "~/Dokumenty/Projekty/" projects
:bmark! "~/Vzdálené/GitHub/" git github
:bmark! "~/Vzdálené/ftp/" ftp
:bmark! "~/Vzdálené/OneDrive" onedrive
:bmark! "~/.config/vifm/" vifm
:bmark! "~/.chatgpt/notes" chatgpt-notes
:bmark! "/media/jaandrle/" volumes
else
:bmark! "~/" home
:bmark! "C:/Projekty/" projects cordova
:bmark! "~/Documents/GitHub/" projects git github
:bmark! "y:/" qnap
:bmark! "y:/DHL/" qnap dhl
:bmark! "~/Downloads/" downloads
:bmark! "~/Downloads/FTPtemp/" ftp temp
:bmark! "~/AppData/Roaming/Vifm/" vifm
endif
mark b ~/bin/
mark h ~/
"" #endregion B
"" #region G General
" set vicmd=elvis\ -G\ termcap | " set vicmd=vile
set vicmd=vim
"set vimhelp
command! README :!vim ~/Dokumenty/GitHub/dotfiles/vifm/README.md
command! Help :!vim ~/.config/vifm/vifm-help.txt
map <f1> :Help<cr>
cabbrev help Help
if !has('win')
set fusehome=/tmp/vifm_FUSE
set slowfs=curlftpfs
endif
set syscalls norunexec
" Automatically resolve symbolic links on l or Enter.
set nofollowlinks
set trash
nmap dd :!trash %"f<cr>
nmap d? :exe "!clear && echo 'Native system trash (`trash-cli`): use `trash`|`trash-empty`|`trash-list`|`trash-put`|`trash-restore`|`trash-rm`' && trash-list | sort -r" | shell<cr>
set history=100 undolevels=100
" What should be saved automatically between vifm sessions. Drop "savedirs"
" value if you don't want vifm to remember last visited directories for you.
set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
\phistory,fhistory,dirstack,registers,bookmarks,bmarks
cmap  <c-b>
cmap  <c-f>
nmap ; :
nmap š <tab>
nnoremap <c-h> :history<cr>
nnoremap \= :filter !{}<left><left>
" Open console in current directory
if !has('win')
nnoremap Ot :!(exo-open --launch TerminalEmulator --working-directory %d > /dev/null 2>&1) &<cr>
nnoremap Ov :!(exo-open --launch TerminalEmulator --working-directory %d -- -e "vifm ." > /dev/null 2>&1) &<cr>
nnoremap OV :!vim<cr>
else
nnoremap Ot :!start "[Vifm] PowerShell %d" powershell.exe -c "powershell.exe -NoExit -Command Set-Location -LiteralPath '%d'"<cr>
endif
"" #endregion G
"" #region AD Apperance/Default
set quickview
command! SetView :view
set dotfiles
colorscheme codedark
set wildmenu wildstyle=popup
set suggestoptions=normal,visual,view,otherpane,keys,foldsubkeys,marks,registers
set ignorecase smartcase incsearch
set scrolloff=4
highlight User1 cterm=italic
set statusline=" %-E %-d %-A %1*»%-z«%* %= %{&sort} "
" hide side borders + use Unicode ellipsis
set tuioptions-=s
if $TERM != 'linux' | set tuioptions+=u | endif
" change appearance of middle border
" set fillchars=vborder:·
if has('win')
set columns=97
nnoremap <c-L>c :set columns=97<cr>
map <c-L>1 33<c-W>|
map <c-L>2 49<c-W>|
map <c-L>3 66<c-W>|
endif
"" #endregion AD
"" #region AT Apperance/Texts
" Use KiB, MiB, ... instead of KB, MB, ...
set noiec
set tabstop=2
set timefmt=%y-%m-%dT%H:%M
" Customize view columns a bit (enable ellipsis for truncated file names)
set viewcolumns=-{root}..,5.4{ext},-6{}
command! SetViewColumnsDefault :set viewcolumns=-{root}..,5.4{ext},-6{}
command! SetViewColumnsShort :set viewcolumns=-{name}..,{}
command! SetWrap :set wrap!
"" #endregion AT
"" #region AS Apperance/Sorting+Numbers
set sortnumbers sort=+iname
command! SetSortAll :sort
command! SetSort
\ :if &sort == '-size,+name'
\ | set sort=-mtime
\ | echo 'Sorted by modification date (from latest)'
\ |elseif &sort == '-size,+iname'
\ | set sort=-mtime
\ | echo 'Sorted by modification date (from latest)'
\ |elseif &sort == '+iname'
\ | set sort=-size
\ | echo 'Sorted by size'
\ |else
\ | set sort=+iname
\ | echo 'Sorted by name'
\ |endif
set number
command! SetNumber
\ :if &relativenumber
\ | set norelativenumber
\ | set number
\ | echo 'Numbers showned'
\ |elseif &number
\ | set nonumber
\ | echo 'No Numbers'
\ |else
\ | set relativenumber
\ | echo 'Relative numbers showned'
\ |endif
"" #endregion AS
"" #region C Commands
cnoremap <c-b> <a-b>
cnoremap <c-f> <a-f>
cnoremap <> <><left>
cnoremap () ()<left>
cnoremap {} {}<left>
cnoremap "" ""<left>
cnoremap '' ''<left>
" #region :com[mand][!] command_name action
" The following macros can be used in a command
" %a is replaced with the user arguments.
" %c the current file under the cursor.
" %C the current file under the cursor in the other directory.
" %f the current selected file, or files.
" %F the current selected file, or files in the other directory.
" %b same as %f %F.
" %d the current directory name.
" %D the other window directory name.
" %m run the command in a menu window
" #endregion
if has('win')
command! meld "C:\Program Files (x86)\Meld\Meld.exe" %"f %"F &
command! zipAll powershell Compress-Archive -Path %"c/* -CompressionLevel Fastest -DestinationPath %c:r.zip
command! isrunnig %m tasklist /FI "IMAGENAME eq %a" 2>NUL | find /I /N "%a"
else
command! onedrive xfce4-terminal -x bash -c 'echo Microsoft Onedrive Log:; onedrive --synchronize &
command! meld meld %"f %"F 2> /dev/null &
command! zipAll zip -r "%c:r.zip" ./*
command! terminal !(exo-open --launch TerminalEmulator > /dev/null 2>&1) &
nmap \t :terminal<cr>
endif
if !has('win')
command! volumes :cd /media/jaandrle/
endif
command! df df -h %m 2> /dev/null
command! diff vim -d %f %F
command! vim vim %"f
command! make !!make %a
command! mkcd :mkdir %a | cd %a
command! vgrep vim "+grep %a"
command! reload :write | restart
command! run !! ./%f
command! runGUI !! ./%f &
nmap or :runGUI<cr>
nmap oR :run<cr>
"" #endregion C
" #region F Filetypes
nnoremap ov :!vim %"f<cr>
nnoremap oo :file &<cr>l
nnoremap oO :file &<cr>/[#$]<cr>l
nnoremap on :file &<cr>/xdg-open<cr>l
" #region Farch Archives
if has('win')
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt,
\*.docx,*.pptx,*.xmlx,*.epub
\ tar -tf %c
else
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt,
\*.docx,*.pptx,*.xmlx,*.epub
\ zip -sf %c
endif
filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg,
\*.docx,*.pptx,*.xmlx,
\*.epub,*.eml
\ {Mount with fuse-zip}
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
\ {View contents}
\ zip -sf %c | less,
\ {Extract here}
\ §extract %"f
filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
\ {Mount with archivemount}
\ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
\ {Extract here}
\ §extract %"f
fileviewer *.tgz,*.tar.gz tar -tzf %c
fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
fileviewer *.tar.txz,*.txz xz --list %c
fileviewer *.tar tar -tf %c
filetype *.rar {Mount with rar2fs}
\ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
\ {Extract here}
\ §extract %"f
fileviewer *.rar unrar v %c
filetype *.iso {Mount with fuseiso}
\ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
\ {Extract here}
\ §extract %"f
filetype *.7z {Mount with fuse-7z}
\ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
\ {Extract here}
\ §extract %"f
fileviewer *.7z 7z l %c
" #endregion Farch
filetype *.ftp {Mount with curlftpfs}
\ FUSE_MOUNT2|curlftpfs -o disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND %CLEAR,
"\ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND %CLEAR,
filetype *.ssh {Mount with sshfs}
\ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
if has('win')
" filetype * start, explorer
filetype *
\ {File Explorer}
\ explorer %"c:p &,
\ {Total Commander}
\ "C:\Program Files (x86)\totalcmd\TOTALCMD.EXE" /O %"c:p &,
\ {Notepad++}
\ "C:\Program Files\Notepad++\notepad++.exe" %"c:p &
filextype *.txt {Open with Notepad} start notepad.exe %f
else
filetype * {Native Open} xdg-open > /dev/null 2>&1 &
endif
" #region Futils Utils (eg. hashs checks)
filetype *.torrent ktorrent %f &
fileviewer *.torrent dumptorrent -v %c
" Object
filetype *.o nm %f | less
" Man page
filetype *.[1-8] man ./%c
fileviewer *.[1-8] man ./%c | col -b
" MD5 SHA1 SHA256 SHA512 GPG signature
filetype *.md5 {Check MD5 hash sum}
\ md5sum -c %f %S,
filetype *.sha1 {Check SHA1 hash sum}
\ sha1sum -c %f %S,
filetype *.sha256 {Check SHA256 hash sum}
\ sha256sum -c %f %S,
filetype *.sha512 {Check SHA512 hash sum}
\ sha512sum -c %f %S,
filetype *.asc {Check signature}
\ !!gpg --verify %c,
" #endregion Futils
" #region FmediaBin
if has('win')
fileviewer
\*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
\*.exe,*.epub,*.doc,*.docx
\*.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus,
\*.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\*.as[fx]
" \ powershell New-Object System.IO.FileInfo(\"%c:p\")
\ forfiles /M %"c /C "cmd /c (echo @path && echo . . . && echo Last modification: @fdate @ftime)" && echo . . . && type %"c
else
fileviewer
\*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
\ env -u COLORTERM viu-image-viewer.viu %"c -w %pw -t &&
\ echo $(file -b %f)
\ %pc
fileviewer
\*.exe,*.doc,
\*.svg,
\ echo $(file -b %f) && echo — && echo $(ls -lh %f)&& echo — && echo $(head %f | tr -d '\0')
fileviewer *.pdf pdftotext -nopgbrk %c -
fileviewer <video/*>,<audio/*> mediainfo %c
endif
" #endregion FmediaBin
fileviewer .*/,*/ tree %c -L 3 &
fileviewer ../ tree %c -L 1 &
fileviewer *.js,*.mjs,*.ts,*.sh,
\*.css,*.scss,
\*.php,
\*.md,*.html,
\*.json,*.xml
\ env -uCOLORTERM bat --color always --theme 'Visual Studio Dark+' --wrap never --pager never --tabs 2 %c -p
fileviewer <text/x-*>,<application/*> env -uCOLORTERM bat --color always --theme 'Visual Studio Dark+' --wrap never --pager never --tabs 2 %c -p
" #endregion F
" #region S sS keys
nnoremap sf :file &
nnoremap sjj :cd ./
nnoremap sjh :cd ~/
nnoremap sjg :cd ~/Vzdálené/GitHub/
nnoremap sjp :cd ~/Dokumenty/Projekty/
nnoremap sb :bmg
nnoremap sS :Set
nnoremap SS :<up><cr>
" #endregion S
" #region Y Copy files/names/…
nmap ycc :clone <cr>
" copy/move files to the opposite pane
nmap yp :copy <cr>
nmap yP :move <cr>
" Interaction with system clipboard (yank directory path/curr.file path/filename)
if has('win')
nnoremap ycp :!echo %"d:gs!\!/! %i | clip<cr>:echo expand('%"d') "is yanked to clipboard"<cr>
nnoremap ycf :!echo %"c:gs!\!/! %i | clip<cr>:echo expand('%"c:p') "is yanked to clipboard"<cr>
nnoremap ycn :!echo %"c %i | clip<cr>:echo expand('%"c') "is yanked to clipboard"<cr>
elseif executable('xclip')
nnoremap ycd :!echo -n %d | xclip -selection clipboard %i<cr>:echo expand('%"d') "is yanked to clipboard"<cr>
nnoremap ycf :!echo -n %c:p | xclip -selection clipboard %i<cr>:echo expand('%"c:p') "is yanked to clipboard"<cr>
nnoremap ycn :!echo -n %c | xclip -selection clipboard %i<cr>:echo expand('%"c') "is yanked to clipboard"<cr>
elseif executable('xsel')
nnoremap ycd :!echo -n %d | xsel --input --primary %i && echo -n %d | xsel --clipboard --input %i<cr>:echo expand('%"d') "is yanked to clipboard"<cr>
nnoremap ycf :!echo -n %c:p | xsel --input --primary %i && echo -n %c:p | xsel --clipboard --input %i<cr>:echo expand('%"c:p') "is yanked to clipboard"<cr>
nnoremap ycn :!echo -n %c | xsel --input --primary %i && echo -n %c | xsel --clipboard --input %i<cr>:echo expand('%"c') "is yanked to clipboard"<cr>
endif
" #endregion Y
"" #region N Notes
"Filter-out build and temporary files
" windo filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/
" Example of standard two-panel file managers mappings
" nnoremap <f3> :!less %f<cr>
" nnoremap <f4> :edit<cr>
" nnoremap <f5> :copy<cr>
" nnoremap <f6> :move<cr>
" nnoremap <f7> :mkdir<space>
" nnoremap <f8> :delete<cr>
" ------------------------------------------------------------------------------
" Various customization examples
" Use ag (the silver searcher) instead of grep
"
" set grepprg=ag\ --line-numbers\ %i\ %a\ %s
" Add additional place to look for executables
"
" let $PATH = $HOME.'/bin/fuse:'.$PATH
" Block particular shortcut
"
" nnoremap <left> <nop>
" Export IPC name of current instance as environment variable and use it to
" communicate with the instance later.
"
" It can be used in some shell script that gets run from inside vifm, for
" example, like this:
" vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
"
" let $VIFM_SERVER_NAME = v:servername
" #endregion N
" vim: set filetype=vifm tabstop=4 shiftwidth=4 textwidth=250 noexpandtab :
" vim>60: set foldmethod=marker foldmarker=#region,#endregion :

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.gitconfig

79
.gitconfig Normal file
View File

@ -0,0 +1,79 @@
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = Jan Andrle
email = andrle.jan@centrum.cz
signingkey = B3A25AED155AFFAB
[credential]
# see https://stackoverflow.com/questions/5343068/is-there-a-way-to-cache-https-credentials-for-pushing-commits/18362082#18362082
helper = /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
[alias]
# * replaced by git-extras
aliases = !git config -l | grep ^alias | cut -c 7- | sort # List all aliases. Stolen from here: https://twitter.com/TrevorBramble/status/774292970681937920
checkout-default= !git checkout `git branch-default`
checkout-default--= !git checkout-default && git branch --delete @{-1} --verbose
branch-default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
branches = for-each-ref --sort=-committerdate refs --format=\"%(authordate:iso8601)\t%(color:blue)%(refname:short)%(HEAD)\t%(if:notequals="")%(upstream:short)%(then)→ %(upstream:short)%(color:reset)%(else)%(color:yellow)%(objectname:short)%(color:reset)\t%(contents:subject)%(end)\"
tags = tag -l --sort=-creatordate --format='%(refname:short): [%(creatordate:short)] %(subject)'
# * authors: log-authors = shortlog -ns
log-list = log --color --graph --pretty=format:'%Cred%h%Creset %Cgreen[%ad] -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset'
log-list-nocolors = log --graph --pretty=format:'%h [%ad] -%d %s <%an>'
status--= !git fetch && git status && echo && echo Commits unpushed: && git log @{push}..HEAD && echo
commit--= !clear && git status -sb | grep -v -e '^ M' & git commit --interactive -v
stashpush = !git stash && git pull && git push && git stash pop
unstage = reset HEAD --
undoall = reset --soft HEAD^
diff-dirs = diff --dirstat --find-copies --find-renames --histogram --color
status-submodule = !git submodule --quiet foreach 'git fetch' && git submodule foreach 'git status && echo'
# * delete-submodule: rm-submodule = !git submodule deinit -f $1 && rm -rf .git/modules/$1 && git rm -rf $1
update-submodule = submodule update --remote --merge
pull-submodule = submodule foreach 'git pull'
diff-submodule = submodule foreach 'git diff'
set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
push-new=!git push -u origin `git rev-parse --abbrev-ref HEAD`
[core]
editor = vim
pager = delta
whitespace = -trailing-space,-space-before-tab
[diff]
tool = vimdiff
colorMoved = default
[merge]
tool = vimdiff
conflictstyle = diff3
[log]
date=iso
[interactive]
diffFilter = delta --color-only
[delta] # [dandavison/delta: A syntax-highlighting pager for git, diff, and grep output](https://github.com/dandavison/delta)
syntax-theme= Visual Studio Dark+
navigate = true
side-by-side = true
line-numbers = true
[gc]
reflogExpire = 200
reflogExpireUnreachable = 90
[push]
autoSetupRemote = true
[init]
defaultBranch = main
[commit]
gpgsign = true
[rerere]
enabled = true
[credential "https://github.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[credential "https://git.dhl.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[maintenance]
repo = /home/jaandrle/Vzdálené/GitHub/dcp-fe-container-certifedpassport
repo = /home/jaandrle/Vzdálené/GitHub/DHLC-Internet-Networking-old
repo = /home/jaandrle/Vzdálené/GitHub/DGF-Certified-Supervisory-Academy

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.inputrc

86
.inputrc Normal file
View File

@ -0,0 +1,86 @@
$include /etc/inputrc
# Use Vi, not Emacs, style editing
set editing-mode vi
# Keymaps for when we're in command mode (e.g., after hitting ESC)
set keymap vi-command
set keymap vi-insert
# Show vim mode indicators
set show-mode-in-prompt on
set vi-ins-mode-string ">_"
set vi-cmd-mode-string "$_"
# aka set wildmode=longest:full:list,full
TAB: menu-complete
"\e[Z": menu-complete-backward
set show-all-if-ambiguous on
set menu-complete-display-prefix on
# aka vim cmd up/down
"\e[A":history-search-backward
"\e[B":history-search-forward
"\e\C-e": history-and-alias-expand-line
set colored-stats On
"":"\C-W"
$if mode=vi
set keymap vi-command
"daw": "lbdW"
"yaw": "lbyW"
"caw": "lbcW"
"diw": "lbdw"
"yiw": "lbyw"
"ciw": "lbcw"
"da\"": "lF\"df\""
"di\"": "lF\"lmtf\"d`t"
"ci\"": "di\"i"
"ca\"": "da\"i"
"da'": "lF'df'"
"di'": "lF'lmtf'd`t"
"ci'": "di'i"
"ca'": "da'i"
"da`": "lF\`df\`"
"di`": "lF\`lmtf\`d`t"
"ci`": "di`i"
"ca`": "da`i"
"da(": "lF(df)"
"di(": "lF(lmtf)d`t"
"ci(": "di(i"
"ca(": "da(i"
"da)": "lF(df)"
"di)": "lF(lmtf)d`t"
"ci)": "di(i"
"ca)": "da(i"
"da{": "lF{df}"
"di{": "lF{lmtf}d`t"
"ci{": "di{i"
"ca{": "da{i"
"da}": "lF{df}"
"di}": "lF{lmtf}d`t"
"ci}": "di}i"
"ca}": "da}i"
"da[": "lF[df]"
"di[": "lF[lmtf]d`t"
"ci[": "di[i"
"ca[": "da[i"
"da]": "lF[df]"
"di]": "lF[lmtf]d`t"
"ci]": "di]i"
"ca]": "da]i"
"da<": "lF<df>"
"di<": "lF<lmtf>d`t"
"ci<": "di<i"
"ca<": "da<i"
"da>": "lF<df>"
"di>": "lF<lmtf>d`t"
"ci>": "di>i"
"ca>": "da>i"
"da/": "lF/df/"
"di/": "lF/lmtf/d`t"
"ci/": "di/i"
"ca/": "da/i"
"da:": "lF:df:"
"di:": "lF:lmtf:d`t"
"ci:": "di:i"
"ca:": "da:i"
# esc+* = https://superuser.com/a/216169
$endif

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.newsboat/config

59
.newsboat/config Normal file
View File

@ -0,0 +1,59 @@
# for inspiration https://github.com/gpakosz/.newsboat/blob/master/config
auto-reload yes
reload-time 90
reload-threads 11
always-display-description true
error-log "~/.newsboat/error.log"
keep-articles-days 30
prepopulate-query-feeds yes
# confirm-mark-all-feeds-read no
player vlc
browser "xdg-open"
macro p set browser "vlc %u" ; open-in-browser ; set browser "xdg-open"
macro e set browser "vim ~/.newsboat/config" ; open-in-browser ; set browser "xdg-open"
color background color8 default bold
color info default color234
color listnormal default default
color listfocus color188 color234
color listnormal_unread color187 default
color listfocus_unread color179 default
search-highlight-colors color179 default
highlight article "^(Feed|Author|Title|Date|Link): .*$" color117 default
highlight articlelist "/date .\{4\}-.\{2\}-.\{2\} .\{2\}:.\{2\}" color43 default
highlight articlelist "/size \[^ \]*" color64 default
highlight articlelist "/feed .*$" color151 default
highlight-article "age > 1 and unread == \"no\"" color245 default
feedlist-format ":%-4i %-5U %?T?↓ &?%t"
articlelist-format ":%-4i %f %?T?%-3T|?%t /date %D /size %-4L %?T?/feed %T?%"
text-width 90
datetime-format "%Y-%m-%d %H:%M"
bind-key ; cmdline
unbind-key q
bind-key j down
bind-key k up
bind-key J next-feed articlelist
bind-key K prev-feed articlelist
bind-key h quit
bind-key LEFT quit
bind-key l open
bind-key RIGHT open
bind-key g home
bind-key G end
bind-key a toggle-article-read
bind-key n next-unread
unbind-key p
bind-key N prev-unread
bind-key s sort
bind-key S rev-sort
bind-key U show-urls
unbind-key ^B
bind-key m bookmark
bookmark-cmd "~/bin/pocket-sh-add.sh"
bookmark-autopilot yes
# vim: ft=apachestyle cms=#\ %s :

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.newsboat/html2rss-streamCZ.mjs

22
.newsboat/html2rss-streamCZ.mjs Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
import { html2rss } from './html2rss.mjs';
/** @typedef {import('./html2rss.mjs').T_RSSITEM} T_RSSITEM */
html2rss($[1], $[2], articles)
.then(pipe( echo, $.exit.bind(null, 0)));
/**
* @param {string} response
* @returns {T_RSSITEM[]}
* */
function articles(response){
const links= Array.from(response.matchAll(/vcard__link" href="([^"]*)"/g)).map(pluckFound);
const dates= Array.from(response.matchAll(/vcard__publish[^>]*>([^<]*)</g)).map(pluckFound).map(toISO);
return Array.from(response.matchAll(/<h3[^>]*>([^<]*)</g))
.map(pluckFound)
.filter(Boolean)
.map(function(title, i){ return { title, link: links[i], date: dates[i] }; });
/** @param {string} date */
function toISO(date){ return date.split(". ").reverse().map(d=> d.padStart(2, "0")).join("-")+"T00:00:00.000Z"; }
function pluckFound([ _, found]){ return found; }
}

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.newsboat/html2rss.mjs

39
.newsboat/html2rss.mjs Normal file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
/**
* @typedef T_RSSITEM
* @type {{ title: string, link: string, date: string }}
* */
/**
* @param {string} title
* @param {string} url
* @param {(response: string)=> T_RSSITEM[]} parseItems
* @returns {Promise<string>}
* */
export function html2rss(title, url, parseItems){
return fetch(url)
.then(response=> response.text())
.then(pipe( parseItems, toRSS ));
function toRSS(items){
const articles_rss= items.map(function({ title, date, link }){
return [
"<item>",
"<title>"+title+"</title>",
"<link>"+link+"</link>",
"<updated>"+date+"</updated>",
"</item>"
].join("\n");
});
return [
`<?xml version="1.0" encoding="UTF-8" ?>`,
`<rss version="2.0">`,
"<channel>",
`<title>${title}</title>`,
`<link>${url}</link>`,
...articles_rss,
"</channel>",
"</rss>"
].join("\n");
}
}

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.newsboat/urls

225
.newsboat/urls Normal file
View File

@ -0,0 +1,225 @@
https://www.youtube.com/feeds/videos.xml?channel_id=UCMiyV_Ib77XLpzHPQH_q0qQ video
https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg video
https://www.youtube.com/feeds/videos.xml?channel_id=UCACJQqtYw6sASWAHXWkBWpw ! video
https://www.youtube.com/feeds/videos.xml?playlist_id=PLanJ0JNOqYbysIbQ3KnHkWeotmTEWXCTA ! video
https://www.youtube.com/feeds/videos.xml?playlist_id=PLCKZKxlikAKzhux_uS3BZgejHhYk8yOYO ! video
https://www.youtube.com/feeds/videos.xml?channel_id=UCPeHT7xKjaw_-8hHW0GEXLg ! video
https://www.youtube.com/feeds/videos.xml?channel_id=UCD9L1HvpYpmZ8rrXABARCRQ ! video
https://www.youtube.com/feeds/videos.xml?channel_id=UCONH73CdRXUjlh3-DdLGCPw ! video
https://herohero.co/services/functions/rss-feed?token=eyJhbGciOiJSUzI1NiJ9.eyJ1IjoiYWpzbHV6YnlsdXh1dnlueSIsImMiOiJuYXBvdGl0a3V6d3VhdWhvZCIsInQiOjE2ODU2MDk1ODl9.LfJHvtdm4fPq25NCfoC5ZU6cPmZLRjXO2Xhl6fcG78j-8tjatznyBDQdKwKiMfdQMKK9peOkYAKyIXTBvjBBN9XJ9CKoOnAfIyHiBlyo200TWeG3Ll37U8LRN7So4npT4-Qr_FzZGSMYO_ispVL6Gj2HYfwYORq6-1t78v9k5Ke7up-w4aM4-jUXD3_Zdsu70jJV5-fEAM11pgkfh8HydW9vm_MvkZ1q1DSIRlZR8jQNQZgGWeYMjzF9owD00TQGUGsXGNH0lit-IhFX9_VFqG5so5i6ugv8AyCJK7g3B59YV6TsWVANtWN5NB_B3f-TXSE4Cs7tOZrU0riVxI-4Ew ! video
https://www.youtube.com/feeds/videos.xml?channel_id=UCKlOmM_eB0nzTNiDFZibSSA !
"query:Sakitech Note/Update:title =~ \"(Note|Phones|phones)\" and title !~ \"(Wallpaper|wallpaper)\" and rssurl == \"https://www.youtube.com/feeds/videos.xml?channel_id=UCKlOmM_eB0nzTNiDFZibSSA\"" video
"exec:~/.newsboat/html2rss-streamCZ.mjs 'Kokoti na neděli' 'https://www.stream.cz/kokoti-na-nedeli'" ! video
"exec:~/.newsboat/html2rss-streamCZ.mjs 'Šťastné pondělí' 'https://www.stream.cz/stastne-pondeli'" !
"query:Šťastné pondělí:title =~ \"Šťastné pondělí\" and feedtitle == \"Šťastné pondělí\"" video
https://www.mall.tv/rssfeed/mikyrova-uzasna-pout-internetem ! video
"query:📹:tags # \"video\""
https://nitter.cz/spreadmastodon/rss
https://www.mfcr.cz/cs/rss/vydali-jsme-k-hospodareni-statu ! stát
https://www.sporicidluhopisycr.cz/cs/rss/aktuality ! stát
https://nitter.cz/gov_cz/rss ! stát
https://www.ceskezajmy.eu/feed/ ! stát
https://poladprahu.cz/category/novinky/feed/ ! stát
https://sdilenedomy.cz/feed/ ! stát
"query:📒:tags # \"stát\""
https://www.irozhlas.cz/rss/irozhlas ! news
https://denikn.cz/feed?ref=inc ! news
https://www.investigace.cz/feed/ ! news
"query:📰👋:tags # \"news\""
https://denikn.cz/veda/feed?ref=inc ! news/science
"query:Petr Koubský:author = \"Petr Koubský\"" news/science
https://vedator.org/feed/ ! news/science
http://feeds.feedburner.com/Backreaction ! news/science
https://www.osel.cz/rss/rss.php ! news/science
https://news.mit.edu/rss/feed ! news/science
https://news.mit.edu/rss/research ! news/science
https://nautil.us/feed/ ! news/science
https://nitter.cz/PatrikKorenar/rss ! news/science
"query:📰🔬:tags # \"news/science\""
https://www.lupa.cz/rss/clanky/ ! news/tech
https://www.root.cz/rss/zpravicky/ ! news/tech
https://www.root.cz/rss/clanky/ ! news/tech
"query: Root Softwarová sklizeň:title =~ \"^Softwarová sklizeň\" and rssurl == \"https://www.root.cz/rss/clanky/\"" news/tech
https://zdrojak.cz/feed/ ! news/tech
https://www.vzhurudolu.cz/rss ! news/tech
https://anuradha.hashnode.dev/rss.xml ! news/tech
https://lea.verou.me/feed.xml ! news/tech
https://developer.mozilla.org/en-US/blog/rss.xml ! news/tech
https://www.omgubuntu.co.uk/feed ! news/tech
https://servis.idnes.cz/rss.aspx?c=technet ! news/tech
"query:📰💻💡:tags # \"news/tech\""
https://news.ycombinator.com/rss "~📰👋💻💡 Hackernews"
https://lemmy.kde.social/feeds/c/kde.xml?sort=Active ! lemmy
https://beehaw.org/feeds/c/science.xml?sort=Active ! lemmy
https://lemmy.ml/feeds/c/firefox.xml?sort=Active ! lemmy
https://lemmy.ml/feeds/c/vim.xml?sort=Active ! lemmy
https://lemmy.ml/feeds/c/css.xml?sort=Active ! lemmy
https://lemmy.ml/feeds/c/javascript.xml?sort=Active ! lemmy
https://lemmy.ml/feeds/c/kde.xml?sort=Active ! lemmy
"query:📰👋💻💡 Lemmy:tags # \"lemmy\""
https://github.com/jordwalke.atom ! twitter/α
# https://nitter.cz/ell2cz/rss ! twitter/α
# https://nitter.cz/fieldsofmoab/rss ! twitter/α
# https://nitter.cz/cztomsik/rss ! twitter/α
# https://nitter.cz/sw_samuraj/rss ! twitter/α
# https://nitter.cz/AndroidDev/rss ! twitter/α
# https://nitter.cz/EduardStula/rss ! twitter/α
# https://nitter.cz/ubuntu_unity/rss ! twitter/α → ?https://ubuntuunity.org/blog/
https://blog.neon.kde.org/feed/ ! twitter/α
https://undinealmani.com/feed/ ! twitter/α
# https://nitter.cz/erikengheim/rss ! twitter/α
# https://nitter.cz/LeaVerou/rss ! twitter/α
# https://nitter.cz/jpschroeder/rss ! twitter/α
# https://nitter.cz/machal/rss ! twitter/α
# https://nitter.cz/devgirlFL/rss ! twitter/α
# https://nitter.cz/maxiorel/rss ! twitter/α
# https://nitter.cz/firt/rss ! twitter/α
https://princiya.com/newblog/feeds/all.atom.xml ! twitter/α
https://davidwalsh.name/feed ! twitter/α
# https://nitter.cz/jakubvrana/rss ! twitter/α
https://jecas.cz/rss ! twitter/α
# JanKoWeb geekovo zdrojak
"query:📰👋💻💡 Twitter/α:tags # \"twitter/α\""
# https://nitter.cz/Zeptej_se_vedce/rss ! twitter/mixed
# https://nitter.cz/Olinium42/rss ! twitter/mixed
#
https://nitter.cz/narodnitymzen/rss ! twitter/mixed
# https://nitter.cz/Julianne_SF/rss ! twitter/α
#!
https://nitter.cz/_Case/rss ! twitter/α
#!
https://nitter.cz/olgarichterova/rss ! twitter/mixed
# https://nitter.cz/eicul/rss ! twitter/mixed
# https://nitter.cz/CO2IN/rss ! twitter/mixed
#
https://nitter.cz/Iluminator_cz/rss ! twitter/mixed
https://faktaoklimatu.cz/feed.xml ! twitter/mixed
#?
https://nitter.cz/anna_gumplova/rss ! twitter/mixed
#?
https://nitter.cz/DearAbbyHansen/rss ! twitter/mixed
# https://nitter.cz/FZU_AVCR/rss ! twitter/mixed
#!
https://nitter.cz/_A_d_e_l_k_a_/rss ! twitter/mixed
#!
https://nitter.cz/TGuthJarkovsky/rss ! twitter/mixed
# https://nitter.cz/ClaireAccendit/rss ! twitter/mixed
# https://nitter.cz/PavlaHub/rss ! twitter/mixed
# https://nitter.cz/laurencikova_k/rss ! twitter/mixed
# https://popculturedetective.tumblr.com/rss twitter/mixed
#!
https://nitter.cz/dan_prokop/rss ! twitter/mixed
https://www.paqresearch.cz/blog-feed.xml ! twitter/mixed
#!
https://nitter.cz/danusenerudova/rss ! twitter/mixed
#!
https://nitter.cz/Akademie_ved_CR/rss ! twitter/mixed
#!
https://nitter.cz/glacier_ecology/rss ! twitter/mixed
https://archetypal.cz/feed/ ! twitter/mixed
# https://nitter.cz/MarieHermanova/rss ! twitter/mixed
# https://nitter.cz/NKC_CZ/rss ! twitter/mixed
#!
https://nitter.cz/lkristoufek/rss ! twitter/mixed
# https://nitter.cz/OSAliance/rss ! twitter/mixed
# https://nitter.cz/Madla_G/rss ! twitter/mixed
# https://nitter.cz/matfyz/rss ! twitter/mixed
#!
https://nitter.cz/Mitokochan/rss twitter/mixed
https://www.mimoagendu.cz/rss/ ! twitter/mixed
# https://nitter.cz/malyvedec/rss ! twitter/mixed
#!
https://nitter.cz/kasikp/rss ! twitter/mixed
# https://nitter.cz/CERN/rss ! twitter/mixed
# https://nitter.cz/josefslerka/rss ! twitter/mixed
# https://nitter.cz/hassmanm/rss ! twitter/mixed
#!
https://nitter.cz/marenamat/rss ! twitter/mixed
# https://nitter.cz/traintravels42/rss ! twitter/mixed
https://nitter.cz/JulieMontek/rss ! twitter/mixed
#
https://nitter.cz/bara_soukup/rss ! twitter/mixed
# PulseofEuropeCZ KohoVolitEU
"query:📰👋💻💡 Twitter/mixed:tags # \"twitter/mixed\""
https://us8.campaign-archive.com/feed?u=5ec4c91d59d1b26aefb919e61&id=2ebe3120ac ! newsletters
https://kill-the-newsletter.com/feeds/mx8wi1fifxu6scj8.xml ! newsletters
https://kill-the-newsletter.com/feeds/9l096daq56dxjw3z.xml ! newsletters
https://denikn.cz/autor/toman/feed/ ! newsletters
https://denikn.cz/tag/vylety-n/feed/ ! newsletters
https://denikn.cz/tag/evropska-unie/feed/ ! newsletters
"query:🗞️📰💡 Newsletters:tags # \"newsletters\""
# https://nitter.cz/randomMDN/rss dev/servises
# "exec:randomMDN rss --limit 3" dev/servises
https://botsin.space/@randomMDN.rss dev/servises
https://github.com/evanw/esbuild/releases.atom ! dev/servises
https://bun.sh/rss.xml ! dev/servises
https://www.githubstatus.com/history.rss ! dev/servises
# https://nitter.cz/GitHubSecurity/rss ! dev/servises
https://developer.apple.com/news/rss/news.rss "~Apple Dev News" dev/servises
# https://nitter.cz/JetBrains_Fleet/rss ! dev/servises → ?https://blog.jetbrains.com/feed/
# https://nitter.cz/NativeScript/rss ! dev/servises
# https://nitter.cz/sveltejs/rss ! dev/servises
# https://nitter.cz/github/rss ! dev/servises
https://cordova.apache.org/feed.xml ! twitter/α
https://www.mozilla.cz/feed/ ! twitter/α
#! https://nitter.cz/janovsky/rss ! twitter/α
# https://www.githubstatus.com/history.rss ! dev/servises
"query:⌨🖱:tags # \"dev/servises\""
https://github.com/mdn.atom ! dev/github
https://github.com/LeaVerou.atom ! dev/github
https://github.com/susieward/witchly-js/commits/main.atom ! dev/github
https://github.com/staltz.atom ! dev/github
https://github.com/jensimmons.atom ! dev/github
https://github.com/mirisuzanne.atom ! dev/github
# https://www.smashingmagazine.com/feed/
"query:⌨🖱:tags # \"dev/github\""
https://www.informacnigramotnost.cz/feed/ ! desinfo
https://demagog.cz/rss/index.atom ! desinfo
https://www.fakticke.info/feed/ ! desinfo
https://manipulatori.cz/feed/ ! desinfo
"query:🤔:tags # \"desinfo\""
https://n3wjack.net/feed/ ! blogs
https://boundedlyrational.substack.com/feed ! blogs
https://blog.eischmann.cz/feed/ ! blogs
https://www.zoonpolitikon.cz/feed/ ! blogs
https://blog.zvestov.cz/feed.xml ! blogs
https://www.pirati.cz/feed.xml ! blogs
https://www.kdu.cz/system/rss ! blogs
https://80000hours.org/feed/ ! glogs
http://tapolitika.cz/feed/ ! glogs
"query:🤓:tags # \"blogs\""
https://mobilmania.zive.cz/rss/sc-47/default.aspx ! news/info
https://feeds.feedburner.com/penize?format=xml ! news/info
https://www.mesec.cz/rss/clanky/ ! news/info
https://www.mesec.cz/rss/aktuality/ ! news/info
https://www.edna.cz/doctor-who/rss/ ! news/info
"query:🗞 💰📱:tags # \"news/info\""
http://feeds.bbci.co.uk/news/world/rss.xml ! news/rest
# https://feeds.a.dj.com/rss/RSSWorldNews.xml ! news/rest news/rest-wsj
# https://feeds.a.dj.com/rss/RSSWSJD.xml ! news/rest news/rest-wsj
https://domaci.hn.cz/?m=rss ! news/rest
https://ekonom.cz/?m=rss ! news/rest
https://vikend.hn.cz/?m=rss ! news/rest
https://procne.hn.cz/?m=rss ! news/rest
http://casopisargument.cz/?feed=rss2 ! news/rest
"query:↓ The Wall Street Journal:tags # \"news/rest-wsj\""
"query:🗞 🌐⏩:tags # \"news/rest\""
https://www.seznamzpravy.cz/rss ! rest
"query:🗞 💤:tags # \"rest\""

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/bash/.profile

37
.profile Normal file
View File

@ -0,0 +1,37 @@
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export APPMENU_DISPLAY_BOTH=1
if [ -z "$UBUNTU_MENUPROXY" ]
then
UBUNTU_MENUPROXY=1
fi
export GTK_MODULES
export UBUNTU_MENUPROXY
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
# Ubuntu make installation of Ubuntu Make binary symlink
PATH=/home/jaandrle/.local/share/umake/bin:$PATH
[ -f /home/jaandrle/.bash/.profile_androidsdk ] && . /home/jaandrle/.bash/.profile_androidsdk

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/ubuntu/.ssh/README.md

8
.ssh/README.md Normal file
View File

@ -0,0 +1,8 @@
# SSH
## Related files
- [./\*](./)
## jaandrle@github
- [How to connect to GitHub with SSH - Easy Explanation - LinuxForDevices](https://www.linuxfordevices.com/tutorials/linux/connect-to-github-with-ssh)
- [KDE Plasma & ssh keys - DEV Community](https://dev.to/manekenpix/kde-plasma-ssh-keys-111e)

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/firefox/.tridactylrc

115
.tridactylrc Normal file
View File

@ -0,0 +1,115 @@
""" Tridactyl config file | Jan Andrle | 2022-01-25
" General Settings 
set configversion 2.0
set theme dark
set modeindicatorshowkeys true
set modeindicatormodes.ignore false
set modeindicator true
set hintfiltermode simple
set hintchars fsahjklgyuiopqwertnmzxcvb
set smoothscroll true
unbind zI
unbind zM
unbind zO
unbind zR
unbind zi
unbind zm
unbind zo
unbind zr
unbind zz
bind zt hint -z
bind zz composite hint -z ; scrollpage -0.5
bind zb composite hint -z ; scrollpage -0.95
bind gm scrollto 42.5 x
bind gM scrollto 42.5 x
bind zo0 zoom 1
bind zo+ zoom 0.1 true
bind zo- zoom -0.1 true
bind zO+ zoom 0.5 true
bind zO- zoom -0.5 true
" /?*# … search collising with native ui + another problems
" https://gist.github.com/BurntSushi/393546a65db38d57cedcfd72c6d89bf3#file-tridactylrc-L18
unbind <c-f> " pgdown for scrolling
bind gi hint -Jc input,textarea,[contenteditable="true"]
unbindurl ^https://www.youtube.com/* >>
unbindurl ^https://www.youtube.com/* <<
" see https://gist.github.com/jaandrle/031198ab5130deb903065138532cc066
bindurl ^https://www.youtube.com/* ss fillcmdline open B: YT
bindurl ^https://www.o2tv.cz/* ss fillcmdline open B: O2
bindurl ^https://chat.openai.com/* ss fillcmdline open B: OPENAI
command pauseVideos js Array.from(document.querySelectorAll("video")).forEach(el=> ( location.hostname!=="www.o2tv.cz" ? el.pause() : [ "Pauza" ].map(l=> document.querySelector(`[aria-label=${l}]`)).find(Boolean)?.dispatchEvent(new Event("click")) ))
tri.controller.acceptExCmd(`tabopen -c pracovní https://gist.github.com/jaandrle/ff1de72c500557f401e190b4ec05aa62#${document.title.replace(/["':|\.,\?\!_]/g, '').replace(/ /g, '-').toLowerCase()}`)
bind ůp js (v=> { if(!v) return; v.paused ? v.play() : tri.controller.acceptExCmd("pauseVideos"); })(document.querySelector("video"))
bind ůP js (v=> { if(!v) return; v.playbackRate ? (v.playbackRate= 0) : (v.playbackRate= 1); })(document.querySelector("video"))
bind ůl js (v=> { if(!v) return; v.currentTime+= 15 })(document.querySelector("video"))
bind ůh js (v=> { if(!v) return; v.currentTime-= 15 })(document.querySelector("video"))
bind ůL fillcmdline_notrail js document.querySelector("video").currentTime+= 15*30
bind ůůl fillcmdline_notrail js document.querySelector("video").currentTime+= 15*30
bind ůk js (v=> { if(!v) return; v.playbackRate+= 0.25 })(document.querySelector("video"))
bind ůj js (v=> { if(!v) return; v.playbackRate-= 0.25 })(document.querySelector("video"))
bind ů= js (v=> { if(!v) return; v.playbackRate= 1 })(document.querySelector("video"))
bind ůG js (v=> { if(!v) return; v.play(); v.currentTime= v.duration-10; setTimeout(()=> tri.controller.acceptExCmd("pauseVideos"), 5000); })(document.querySelector("video"))
unbind --mode=normal d
bind dd tabclose
unbind --mode=normal s
bind st fillcmdline_notrail tab
" h keyboardlayoutoverrides … https://gistpreview.github.io/?324119c773fac31651f6422087b36804
" set keyboardlayoutoverrides "Digit2: ;, Backquote: :"
set keytranslatemap {"ě":";",";":":"}
bindurl ^https://mail.centrum.cz/* ;; composite hint_focus ; js document.activeElement.dispatchEvent(new CustomEvent("mouseover"))
bind --mode=normal ;gt hint -c [tabindex]
bind š tab #
bind sš fillcmdline tab
" b→t→n to make more consistent with gn*
unbind --mode=normal b
unbind --mode=normal B
bind --mode=normal t fillcmdline tab
bind --mode=normal T fillcmdline taball
bind --mode=normal n fillcmdline tabopen
bind --mode=normal N current_url tabopen
bind -c fillcmdline recontain
bind sc fillcmdline_notrail container
bind --mode=visual \t composite js "https://libretranslate.com/?source=auto&target=cs&q="+encodeURI(document.getSelection().toString()) | tabopen
bind --mode=visual \T composite js "https://translate.google.com/?sl=auto&tl=cs&op=translate&text="+encodeURI(document.getSelection().toString()) | tabopen
bind --mode=normal \t composite js "http://translate.google.com/translate?js=n&tl=cs&u="+encodeURI(location.href) | tabopen
bind gnk tabopen -c osobní https://keep.google.com/u/0/#NOTE/1UXE_BEihe2EexHwZqEYA2oSdILLxF74SPcaLFMStfIpMkWPnStWJDQqH5C1TryJld_dC
bind gok open -c osobní https://keep.google.com/u/0/#NOTE/1UXE_BEihe2EexHwZqEYA2oSdILLxF74SPcaLFMStfIpMkWPnStWJDQqH5C1TryJld_dC
bind gwk winopen -c osobní https://keep.google.com/u/0/#NOTE/1UXE_BEihe2EexHwZqEYA2oSdILLxF74SPcaLFMStfIpMkWPnStWJDQqH5C1TryJld_dC
bind gnC tabopen -c osobní https://calendar.google.com
bind goC open -c osobní https://calendar.google.com
bind gwC winopen -c osobní https://calendar.google.com
" Sites (mails) notes using Github Gists
bind sn js tri.controller.acceptExCmd(`tabopen -c pracovní https://gist.github.com/jaandrle/ff1de72c500557f401e190b4ec05aa62#${document.title.replace(/["':|\.,\?\!_]/g, '').replace(/ /g, '-').toLowerCase()}`)
bind sN composite clipboard yankmd ; tabopen -c pracovní https://gist.github.com/jaandrle/ff1de72c500557f401e190b4ec05aa62/edit
bindurl ^https://mail.centrum.cz/* sn js tri.controller.acceptExCmd(`tabopen -c pracovní https://gist.github.com/jaandrle/ff1de72c500557f401e190b4ec05aa62#${(new URLSearchParams(window.location.search)).get("msg")}`)
bindurl ^https://mail.centrum.cz/* sN composite js tri.controller.acceptExCmd(`clipboard yank [${(new URLSearchParams(window.location.search)).get("msg")}](https://mail.centrum.cz/?msg=${(new URLSearchParams(window.location.search)).get("msg")})`) ; tabopen -c pracovní https://gist.github.com/jaandrle/ff1de72c500557f401e190b4ec05aa62/edit
alias hint_focus hint -;
quickmark c moz-extension://616498c0-3916-4f0b-b0a9-ce01ecf2298d/popup.html
command mastodonUncoverAll composite hint_focus .scrollable ; js (onclick=document.createEvent("Events"), onclick.initEvent("click", true, false), Array.from(document.activeElement.getElementsByClassName("status__content__spoiler-link")).forEach(el=> el.dispatchEvent(onclick)))
command mastodonRedirectHome js const parts = location.pathname.split('/'); if(parts.length===2) location.href= `https://fosstodon.org/${parts[1]}@${location.host}`; else location.href= `https://fosstodon.org/authorize_interaction?uri=${location.href}`;
bind sm fillcmdline_notrail mastodon
command data_delall composite hint_focus * ; js document.activeElement.querySelectorAll("input").forEach(el=> el.checked=false)
command scrollblur js tri.scrolling.setCurrentFocus(document.documentElement || document.body)
autocmd DocLoad https://user.centrum.cz/?url=http%3A%2F%2Fmail.centrum.cz open https://mail.centrum.cz/?fld=-666
" For syntax highlighting see https://github.com/tridactyl/vim-tridactyl
" vim: set filetype=tridactyl
" vim: set ft=vim :

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vim/.vim/after

View File

@ -0,0 +1,6 @@
nmap <leader>vd /diff --git<cr> 0vG$
command! AIcommit ALTredir !§ai-commit.mjs
command! AIcommitConventional ALTredir !§ai-commit.mjs --format conventional
command! AIcommitGitmoji ALTredir !§ai-commit.mjs --format gitmoji
command! AIcommitGit3moji ALTredir !§ai-commit.mjs --format git3moji
nmap <leader><f1> :AIcommitOP

View File

@ -0,0 +1,113 @@
" Fold expressions {{{1
function! StackedMarkdownFolds()
let line = getline(v:lnum)
let prevline = getline(v:lnum - 1)
let nextline = getline(v:lnum + 1)
" fenced block
if line =~ '^```.*$' && prevline =~ '^\s*$' " start of a fenced block
return ">2"
elseif line =~ '^```$' && nextline =~ '^\s*$' " end of a fenced block
return "<2"
endif
" headers
if s:HeadingDepth(v:lnum)
return ">1"
endif
" frontmatter
if line =~ '^----*$'
return v:lnum == 1 ? ">1" : '<1'
endif
return '='
endfunction
" Helpers {{{1
function! s:SID()
return matchstr(expand('<sfile>'), '<SNR>\d\+_')
endfunction
function! s:HeadingDepth(lnum)
if s:LineIsFenced(a:lnum) | return 0 | endif
let thisline = getline(a:lnum)
if thisline =~ '^#\+\s\+'
return len(matchstr(thisline, '^#\{1,6}'))
else
if thisline != ''
let prevline = getline(a:lnum - 1)
let nextline = getline(a:lnum + 1)
if (nextline =~ '^=\+$') && (prevline =~ '^\s*$')
return 1
elseif (nextline =~ '^-\+$') && (prevline =~ '^\s*$')
return 2
endif
endif
return 0
endfunction
function! s:LineIsFenced(lnum)
if exists("b:current_syntax") && b:current_syntax ==# 'markdown' || &filetype ==# 'markdown'
" It's cheap to check if the current line has 'markdownCode' syntax group
return s:HasSyntaxGroup(a:lnum, '\vmarkdown(Code|Highlight)')
else
" Using searchpairpos() is expensive, so only do it if syntax highlighting
" is not enabled
return s:HasSurroundingFencemarks(a:lnum)
endif
endfunction
function! s:HasSyntaxGroup(lnum, targetGroup)
let syntaxGroup = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
for value in syntaxGroup
if value =~ a:targetGroup
return 1
endif
endfor
endfunction
function! s:HasSurroundingFencemarks(lnum)
let cursorPosition = [line("."), col(".")]
call cursor(a:lnum, 1)
let startFence = '\%^```\|^\n\zs```'
let endFence = '```\n^$'
let fenceEndPosition = searchpairpos(startFence,'',endFence,'W')
call cursor(cursorPosition)
return fenceEndPosition != [0,0]
endfunction
function! s:FoldText()
if getline(v:foldstart) =~ '^----*$'
let title= ''
let i= v:foldstart+1
let I= v:foldend
while i<I && title !~ '^title'
let title= getline(i)
let i+= 1
endwhile
if title !~ '^title'
let title= 'Front Matter'
endif
return title
endif
let indent = repeat('#', s:HeadingDepth(v:foldstart))
let title = substitute(getline(v:foldstart), '^#\+\s\+', '', '')
let foldsize = (v:foldend - v:foldstart)
let linecount = '['.foldsize.' line'.(foldsize>1?'s':'').']'
return indent.' '.title.' '.linecount.' '
endfunction
function! FoldMarkdownToggle()
if &l:foldexpr ==# 'StackedMarkdownFolds()'
setlocal foldmethod< foldtext< foldexpr<
else
setlocal foldmethod=expr
let &l:foldtext = s:SID().'FoldText()'
let &l:foldexpr = 'StackedMarkdownFolds()'
endif
endfunction
" Teardown {{{1
if !exists("b:undo_ftplugin") | let b:undo_ftplugin = '' | endif
let b:undo_ftplugin .= '
\ | setlocal foldmethod< foldtext< foldexpr<
\ '
" vim:set fdm=marker:

View File

@ -0,0 +1,3 @@
execute "source ".system("mdexpr-agenda vim 2> /dev/null")
command MDEXPRclose lclose | lexpr []
call scommands#map('m', 'MDEXPR', "n")

View File

@ -0,0 +1,3 @@
unlet b:current_syntax
syntax include @Yaml syntax/yaml.vim
syntax region yamlFrontmatter start=/\%^---$/ end=/^---$/ keepend contains=@Yaml

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vim/.vim/compiler

5
.vim/compiler/jshint.vim Normal file
View File

@ -0,0 +1,5 @@
" npm install -g jshint
CompilerSet makeprg=jshint
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m
" vim: set sts=4 sw=4 expandtab ff=unix fdm=syntax :

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vim/.vim/spell

1
.vim/spell/cs.utf-8.add Normal file
View File

@ -0,0 +1 @@
off

BIN
.vim/spell/cs.utf-8.spl Normal file

Binary file not shown.

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vim/.vim/syntax

495
.vim/syntax/vifm.vim Normal file
View File

@ -0,0 +1,495 @@
" vifm syntax file
" Maintainer: xaizek <xaizek@posteo.net>
" Last Change: October 5, 2021
" Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr.
if exists('b:current_syntax')
finish
endif
let b:current_syntax = 'vifm'
let s:cpo_save = &cpo
set cpo-=C
" General commands
syntax keyword vifmCommand contained
\ alink apropos bmark bmarks bmgo cds change chmod chown clone compare
\ cope[n] co[py] cq[uit] d[elete] delbmarks delm[arks] delsession di[splay]
\ dirs e[dit] el[se] empty en[dif] exi[t] file fin[d] fini[sh] go[to] gr[ep]
\ h[elp] hideui histnext his[tory] histprev jobs locate ls lstrash marks
\ media mes[sages] mkdir m[ove] noh[lsearch] on[ly] plugin plugins popd
\ pushd pu[t] pw[d] qa[ll] q[uit] redr[aw] reg[isters] regular rename
\ restart restore rlink screen sh[ell] siblnext siblprev sor[t] sp[lit]
\ st[op] s[ubstitute] tabc[lose] tabm[ove] tabname tabnew tabn[ext]
\ tabo[nly] tabp[revious] touch tr trashes tree session sync undol[ist]
\ ve[rsion] vie[w] vifm vs[plit] winc[md] w[rite] wq wqa[ll] xa[ll] x[it]
\ y[ank]
\ nextgroup=vifmArgs
syntax keyword vifmCommandCN contained
\ alink apropos bmark bmarks bmgo cds change chmod chown clone compare
\ cope[n] co[py] cq[uit] d[elete] delbmarks delm[arks] delsession di[splay]
\ dirs e[dit] el[se] empty en[dif] exi[t] file fin[d] fini[sh] go[to] gr[ep]
\ h[elp] hideui histnext his[tory] histprev jobs locate ls lstrash marks
\ media mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd pu[t] pw[d]
\ qa[ll] q[uit] redr[aw] reg[isters] regular rename restart restore rlink
\ screen sh[ell] siblnext siblprev sor[t] sp[lit] s[ubstitute] tabc[lose]
\ tabm[ove] tabname tabnew tabn[ext] tabo[nly] tabp[revious] touch tr
\ trashes tree session sync undol[ist] ve[rsion] vie[w] vifm vs[plit]
\ winc[md] w[rite] wq wqa[ll] xa[ll] x[it] y[ank]
\ nextgroup=vifmArgsCN
" commands that might be prepended to a command without changing everything else
syntax keyword vifmPrefixCommands contained windo winrun
" Map commands
syntax keyword vifmMap contained dm[ap] dn[oremap] du[nmap] map mm[ap]
\ mn[oremap] mu[nmap] nm[ap] nn[oremap] no[remap] nun[map] qm[ap] qn[oremap]
\ qun[map] unm[ap] vm[ap] vn[oremap] vu[nmap]
\ skipwhite nextgroup=vifmMapArgs
syntax keyword vifmCMapAbbr contained ca[bbrev] cm[ap] cnorea[bbrev] cno[remap]
\ cuna[bbrev] cu[nmap]
\ skipwhite nextgroup=vifmCMapArgs
" Other commands
syntax keyword vifmAutocmdCommand contained au[tocmd] nextgroup=vifmAutoEvent
syntax keyword vifmCdCommand contained cd
syntax keyword vifmCmdCommand contained com[mand] nextgroup=vifmCmdCommandName
syntax keyword vifmColoCommand contained colo[rscheme]
syntax keyword vifmHiCommand contained hi[ghlight]
syntax keyword vifmInvertCommand contained invert
syntax keyword vifmLetCommand contained let
syntax keyword vifmUnletCommand contained unl[et]
syntax keyword vifmSetCommand contained se[t] setl[ocal] setg[lobal]
syntax keyword vifmSoCommand contained so[urce]
syntax keyword vifmMarkCommand contained ma[rk]
syntax keyword vifmFtCommand contained filet[ype] filex[type] filev[iewer]
syntax keyword vifmExprCommand contained if ec[ho] elsei[f] exe[cute]
syntax keyword vifmNormalCommand contained norm[al]
\ nextgroup=vifmColonSubcommand
syntax match vifmPatternCommands contained /\<\(filter\(!\|\>\)\|select\(!\|\>\)\|unselect\>\)/ skipwhite
\ nextgroup=vifmPatterns
" List of event names for autocommands (case insensitive)
syntax case ignore
syntax keyword vifmAutoEvent contained DirEnter nextgroup=vifmStatementC
syntax case match
" Builtin functions
syntax match vifmBuiltinFunction
\ '\(chooseopt\|expand\|executable\|extcached\|filetype\|fnameescape\|getpanetype\|has\|layoutis\|paneisat\|system\|tabpagenr\|term\)\ze('
" Operators
syntax match vifmOperator "\(==\|!=\|>=\?\|<=\?\|\.\|-\|+\|&&\|||\)" skipwhite
" Highlight groups
syntax keyword vifmHiArgs contained cterm ctermfg ctermbg gui guifg guibg
syntax case ignore
syntax keyword vifmHiGroups contained WildMenu Border Win CmdLine CurrLine
\ OtherLine Directory Link Socket Device Executable Selected BrokenLink
\ TopLine TopLineSel StatusLine JobLine SuggestBox Fifo ErrorMsg CmpMismatch
\ AuxWin OtherWin TabLine TabLineSel HardLink LineNr OddLine
\ User1 User2 User3 User4 User5 User6 User7 User8 User9
syntax keyword vifmHiStyles contained
\ bold underline reverse inverse standout italic combine none
syntax keyword vifmHiColors contained black red green yellow blue magenta cyan
\ white default lightblack lightred lightgreen lightyellow lightblue
\ lightmagenta lightcyan lightwhite Grey0 NavyBlue DarkBlue Blue3 Blue3_2
\ Blue1 DarkGreen DeepSkyBlue4 DeepSkyBlue4_2 DeepSkyBlue4_3 DodgerBlue3
\ DodgerBlue2 Green4 SpringGreen4 Turquoise4 DeepSkyBlue3 DeepSkyBlue3_2
\ DodgerBlue1 Green3 SpringGreen3 DarkCyan LightSeaGreen DeepSkyBlue2
\ DeepSkyBlue1 Green3_2 SpringGreen3_2 SpringGreen2 Cyan3 DarkTurquoise
\ Turquoise2 Green1 SpringGreen2_2 SpringGreen1 MediumSpringGreen Cyan2
\ Cyan1 DarkRed DeepPink4 Purple4 Purple4_2 Purple3 BlueViolet Orange4
\ Grey37 MediumPurple4 SlateBlue3 SlateBlue3_2 RoyalBlue1 Chartreuse4
\ DarkSeaGreen4 PaleTurquoise4 SteelBlue SteelBlue3 CornflowerBlue
\ Chartreuse3 DarkSeaGreen4_2 CadetBlue CadetBlue_2 SkyBlue3 SteelBlue1
\ Chartreuse3_2 PaleGreen3 SeaGreen3 Aquamarine3 MediumTurquoise
\ SteelBlue1_2 Chartreuse2 SeaGreen2 SeaGreen1 SeaGreen1_2 Aquamarine1
\ DarkSlateGray2 DarkRed_2 DeepPink4_2 DarkMagenta DarkMagenta_2 DarkViolet
\ Purple Orange4_2 LightPink4 Plum4 MediumPurple3 MediumPurple3_2 SlateBlue1
\ Yellow4 Wheat4 Grey53 LightSlateGrey MediumPurple LightSlateBlue Yellow4_2
\ DarkOliveGreen3 DarkSeaGreen LightSkyBlue3 LightSkyBlue3_2 SkyBlue2
\ Chartreuse2_2 DarkOliveGreen3_2 PaleGreen3_2 DarkSeaGreen3 DarkSlateGray3
\ SkyBlue1 Chartreuse1 LightGreen_2 LightGreen_3 PaleGreen1 Aquamarine1_2
\ DarkSlateGray1 Red3 DeepPink4_3 MediumVioletRed Magenta3 DarkViolet_2
\ Purple_2 DarkOrange3 IndianRed HotPink3 MediumOrchid3 MediumOrchid
\ MediumPurple2 DarkGoldenrod LightSalmon3 RosyBrown Grey63 MediumPurple2_2
\ MediumPurple1 Gold3 DarkKhaki NavajoWhite3 Grey69 LightSteelBlue3
\ LightSteelBlue Yellow3 DarkOliveGreen3_3 DarkSeaGreen3_2 DarkSeaGreen2
\ LightCyan3 LightSkyBlue1 GreenYellow DarkOliveGreen2 PaleGreen1_2
\ DarkSeaGreen2_2 DarkSeaGreen1 PaleTurquoise1 Red3_2 DeepPink3 DeepPink3_2
\ Magenta3_2 Magenta3_3 Magenta2 DarkOrange3_2 IndianRed_2 HotPink3_2
\ HotPink2 Orchid MediumOrchid1 Orange3 LightSalmon3_2 LightPink3 Pink3
\ Plum3 Violet Gold3_2 LightGoldenrod3 Tan MistyRose3 Thistle3 Plum2
\ Yellow3_2 Khaki3 LightGoldenrod2 LightYellow3 Grey84 LightSteelBlue1
\ Yellow2 DarkOliveGreen1 DarkOliveGreen1_2 DarkSeaGreen1_2 Honeydew2
\ LightCyan1 Red1 DeepPink2 DeepPink1 DeepPink1_2 Magenta2_2 Magenta1
\ OrangeRed1 IndianRed1 IndianRed1_2 HotPink HotPink_2 MediumOrchid1_2
\ DarkOrange Salmon1 LightCoral PaleVioletRed1 Orchid2 Orchid1 Orange1
\ SandyBrown LightSalmon1 LightPink1 Pink1 Plum1 Gold1 LightGoldenrod2_2
\ LightGoldenrod2_3 NavajoWhite1 MistyRose1 Thistle1 Yellow1 LightGoldenrod1
\ Khaki1 Wheat1 Cornsilk1 Grey100 Grey3 Grey7 Grey11 Grey15 Grey19 Grey23
\ Grey27 Grey30 Grey35 Grey39 Grey42 Grey46 Grey50 Grey54 Grey58 Grey62
\ Grey66 Grey70 Grey74 Grey78 Grey82 Grey85 Grey89 Grey93
syntax case match
" Options
syntax keyword vifmOption contained aproposprg autocd autochpos caseoptions
\ cdpath cd chaselinks classify columns co confirm cf cpoptions cpo
\ cvoptions deleteprg dotdirs dotfiles dirsize fastrun fillchars fcs findprg
\ followlinks fusehome gdefault grepprg histcursor history hi hlsearch hls
\ iec ignorecase ic iooptions incsearch is laststatus lines locateprg ls
\ lsoptions lsview mediaprg milleroptions millerview mintimeoutlen number nu
\ numberwidth nuw previewoptions previewprg quickview relativenumber rnu
\ rulerformat ruf runexec scrollbind scb scrolloff sessionoptions ssop so
\ sort sortgroups sortorder sortnumbers shell sh shellflagcmd shcf shortmess
\ shm showtabline stal sizefmt slowfs smartcase scs statusline stl
\ suggestoptions syncregs syscalls tablabel tabprefix tabscope tabstop
\ tabsuffix timefmt timeoutlen title tm trash trashdir ts tuioptions to
\ undolevels ul vicmd viewcolumns vifminfo vimhelp vixcmd wildmenu wmnu
\ wildstyle wordchars wrap wrapscan ws
" Disabled boolean options
syntax keyword vifmOption contained noautocd noautochpos nocf nochaselinks
\ nodotfiles nofastrun nofollowlinks nohlsearch nohls noiec noignorecase
\ noic noincsearch nois nolaststatus nols nolsview nomillerview nonumber
\ nonu noquickview norelativenumber nornu noscrollbind noscb norunexec
\ nosmartcase noscs nosortnumbers nosyscalls notitle notrash novimhelp
\ nowildmenu nowmnu nowrap nowrapscan nows
" Inverted boolean options
syntax keyword vifmOption contained invautocd invautochpos invcf invchaselinks
\ invdotfiles invfastrun invfollowlinks invhlsearch invhls inviec
\ invignorecase invic invincsearch invis invlaststatus invls invlsview
\ invmillerview invnumber invnu invquickview invrelativenumber invrnu
\ invscrollbind invscb invrunexec invsmartcase invscs invsortnumbers
\ invsyscalls invtitle invtrash invvimhelp invwildmenu invwmnu invwrap
\ invwrapscan invws
" Expressions
syntax region vifmStatement start='^\(\s\|:\)*'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend
\ contains=vifmCommand,vifmCmdCommand,vifmCmdCommandSt,vifmMarkCommandSt
\,vifmFtCommandSt,vifmCMapAbbr,vifmMap,vifmMapSt,vifmCMapSt,vifmExecute
\,vifmComment,vifmInlineComment,vifmNotComment,vifmExprCommandSt,vifmNormalCommandSt
\,vifmCdCommandSt,vifmSet,vifmArgument,vifmSoCommandSt,vifmPrefixCommands
\,vifmAutocmdCommand,vifmAutoEvent,vifmPatternCommands
" Contained statement with highlighting of angle-brace notation.
syntax region vifmStatementCN start='\(\s\|:\)*'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend contained
\ contains=vifmCommandCN,vifmCmdCommand,vifmCmdCommandSt,vifmMarkCommandSt
\,vifmFtCommandStN,vifmCMapAbbr,vifmMap,vifmMapSt,vifmCMapSt,vifmExecute
\,vifmComment,vifmInlineComment,vifmNotComment,vifmExprCommandSt,vifmNormalCommandSt
\,vifmNotation,vifmCdCommandStN,vifmSetN,vifmArgument,vifmSoCommand
\,vifmSoCommandStN,vifmInvertCommand,vifmInvertCommandStN,vifmPrefixCommands
\,vifmLetCN
" Contained statement without highlighting of angle-brace notation.
syntax region vifmStatementC start='\(\s\|:\)*'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend contained
\ contains=vifmCommand,vifmCmdCommand,vifmCmdCommandSt,vifmMarkCommandSt
\,vifmFtCommandSt,vifmCMapAbbr,vifmMap,vifmMapSt,vifmCMapSt,vifmExecute
\,vifmComment,vifmInlineComment,vifmNotComment,vifmExprCommandSt,vifmNormalCommandSt
\,vifmCdCommandSt,vifmSet,vifmArgument,vifmSoCommand,vifmSoCommandSt
\,vifmInvertCommand,vifmInvertCommandSt,vifmPrefixCommands
\,vifmAutocmdCommand,vifmAutoEvent,vifmPatternCommands,vifmLetC,vifmUnletC
syntax region vifmCmdCommandSt start='^\(\s\|:\)*com\%[mand]\>'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend
\ contains=vifmCmdCommand,vifmComment,vifmInlineComment,vifmNotComment
syntax region vifmCmdCommandName contained start='!\?\s\+[a-zA-Z]\+' end='\ze\s'
\ skip='\(\s*\\\)\|\(\s*".*$\)'
\ nextgroup=vifmCmdArgs
syntax region vifmCmdArgs start='\(\s*\n\s*\\\)\?\s*\S\+'
\ end='\s' skip='\(\n\s*\\\)\|\(\n\s*".*$\)'
\ contained
\ contains=vifmColonSubcommand,vifmComment
syntax region vifmColoCommandSt start='^\(\s\|:\)*colo\%[rscheme]\>' end='$'
\ keepend oneline contains=vifmColoCommand
syntax region vifmInvertCommandSt start='\(\s\|:\)*invert\>' end='$\||'
\ keepend oneline contains=vifmInvertCommand
syntax region vifmInvertCommandStN start='\(\s\|:\)*invert\>' end='$\||'
\ contained keepend oneline contains=vifmInvertCommand,vifmNotation
syntax region vifmSoCommandSt start='\(\s\|:\)*so\%[urce]\>' end='$\||'
\ keepend oneline contains=vifmSoCommand,vifmEnvVar,vifmStringInExpr
syntax region vifmSoCommandStN start='\(\s\|:\)*so\%[urce]\>' end='$\||'
\ contained keepend oneline
\ contains=vifmSoCommand,vifmEnvVar,vifmNotation,vifmStringInExpr
syntax region vifmMarkCommandSt start='^\(\s\|:\)*ma\%[rk]\>' end='$' keepend
\ oneline contains=vifmMarkCommand
syntax region vifmCdCommandSt start='\(\s\|:\)*cd\>' end='$\||' keepend oneline
\ contains=vifmCdCommand,vifmEnvVar,vifmStringInExpr
" Highlight for :cd command with highlighting of angle-brace notation.
syntax region vifmCdCommandStN start='\(\s\|:\)*cd\>' end='$\||' keepend oneline
\ contained
\ contains=vifmCdCommand,vifmEnvVar,vifmNotation,vifmStringInExpr
syntax region vifmFtCommandSt start='\(\s\|:\)*file[tvx]'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend
\ contained
\ contains=vifmFtBeginning,vifmComment
syntax region vifmFtCommandStN start='\(\s\|:\)*file[tvx]'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$\|\(<[cC][rR]>\)' keepend
\ contained
\ contains=vifmComment,vifmNotation,vifmFtBeginning
syntax region vifmMapSt start='^\(\s\|:\)*\(map\|mm\%[ap]\|mn\%[oremap]\|mu\%[nmap]\|nm\%[ap]\|nn\%[oremap]\|no\%[remap]\|nun\%[map]\|qm\%[ap]\|qn\%[oremap]\|qun\%[map]\|unm\%[ap]\|vm\%[ap]\|vn\%[oremap]\|vu\%[nmap]\)'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend
\ contains=vifmMap
syntax region vifmCMapSt
\ start='^\(\s\|:\)*\(cm\%[ap]\|cno\%[remap]\|cu\%[nmap]\)'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend
\ contains=vifmCMapAbbr
syntax region vifmExprCommandSt
\ start='\<\(if\|ec\%[ho]\|elsei\%[f]\|exe\%[cute]\)\>'
\ end='$\||'
\ contains=vifmExprCommand,vifmString,vifmStringInExpr,vifmBuiltinFunction
\,vifmOperator,vifmEnvVar,vifmNumber
syntax region vifmNormalCommandSt start='\(\s\|:\)*norm\%[al]\>' end='$' keepend
\ oneline
\ contains=vifmNormalCommand,vifmComment
syntax region vifmExecute start='!' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$'
\ keepend
\ contains=vifmNotation,vifmComment
syntax region vifmMapArgs start='\ze\S\+'
\ end='\ze.' skip='\(\n\s*\\\)\|\(\n\s*".*$\)'
\ contained
\ nextgroup=vifmMapArgList
syntax region vifmCMapArgs start='\S\+'
\ end='\n\s*\\' skip='\(\n\s*\\\)\|\(\n\s*".*$\)'
\ contained
\ contains=vifmMapLhs,vifmMapCRhs
syntax region vifmMapLhs start='\S\+'
\ end='\ze\s' skip='\(\s*\\\)\|\(\s*".*$\)'
\ contained
\ contains=vifmNotation,vifmComment
\ nextgroup=vifmMapRhs
syntax region vifmMapRhs start='.'
\ end='\ze<[cC][rR]>' skip='\(\s*\\\)\|\(\s*".*$\)'
\ contained keepend
\ contains=vifmNotation,vifmComment,vifmColonSubcommandN
\ nextgroup=vifmMapRhs
syntax region vifmMapCRhs start='\s'
\ end='<[cC][rR]>' skip='\(\s*\\\)\|\(\s*".*$\)'
\ contained keepend
\ contains=vifmNotation,vifmComment,vifmSubcommandN
syntax region vifmColonSubcommand start='\s*\(\s*\n\s*\\\)\?:\s*\S\+'
\ end='$' skip='\s*\n\(\s*\\\)\|\(\s*".*$\)'
\ contained
\ contains=vifmStatementC
" Contained sub command with highlighting of angle-brace notation.
syntax region vifmColonSubcommandN start='\s*\(\s*\n\s*\\\)\?:\s*\S\+'
\ end='\ze<[cC][rR]>\|$' skip='\s*\n\(\s*\\\)\|\(\s*".*$\)' keepend
\ contained
\ contains=vifmStatementCN
syntax region vifmSubcommandN start='\s*\(\s*\n\s*\\\)\?:\?\s*\S\+'
\ end='\ze<[cC][rR]>\|$' skip='\s*\n\(\s*\\\)\|\(\s*".*$\)' keepend
\ contained
\ contains=vifmStatementCN
" Non-empty pattern or form [!][{]{*.ext,*.e}[}], [!][/]/regex/[/][iI] or
" <mime-type-globs>, possibly multi-line.
" [!]/regexp/[iI]*
syntax region vifmPattern contained
\ start='!\?/\ze\(\n\s*\\\|\n\s*".*$\|[^/]\|\\/\)\+/'
\ skip='\\/\|\(\n\s*\\\)\|\(\n\s*".*$\)' end='/[iI]*\ze\|/\ze\S\+' keepend
\ contains=vifmComment,vifmInlineComment,vifmNotComment,vifmNotPattern
" [!]//regexp//[iI]*
syntax region vifmPattern contained
\ start='!\?//\ze\(/[^/]\|\n\s*\\\|\n\s*".*$\|[^/]\|\\/\)\+//'
\ skip='/[^/]\|\(\n\s*\\\)\|\(\n\s*".*$\)' end='//[iI]*' keepend
\ contains=vifmComment,vifmInlineComment,vifmNotComment,vifmNotPattern
" [!]{regexp}
syntax region vifmPattern contained
\ start='!\?{[^}]' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='}' keepend
\ contains=vifmComment,vifmInlineComment,vifmNotComment,vifmNotPattern
" [!]{{regexp}}
syntax region vifmPattern contained
\ start='!\?{{\ze.\{-}}}' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='}}' keepend
\ contains=vifmComment,vifmInlineComment,vifmNotComment,vifmNotPattern
" [!]<regexp>
syntax region vifmPattern contained
\ start='!\?<[^>]' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='>' keepend
\ contains=vifmComment,vifmInlineComment,vifmNotComment,vifmNotPattern
syntax region vifmPatterns contained
\ start='\(^\|\s\)\zs[/{<!]'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)'
\ end='\(/[a-zA-Z]\{,4}\|[}>iI]\)\(\s\)' keepend
\ contains=vifmPattern,vifmComment
syntax match vifmNotPattern contained '!\?\({{}}\|\<//\>\|////\)'
syntax region vifmHi
\ start='^\(\s\|:\)*\<hi\%[ghlight]\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)'
\ end='$' keepend
\ contains=vifmHiCommand,vifmHiArgs,vifmHiGroups,vifmHiStyles,vifmHiColors
\,vifmNumber,vifmComment,vifmInlineComment,vifmNotComment,vifmHiClear
\,vifmPatterns,vifmHexColor
syntax region vifmFtBeginning contained
\ start='\<\(filet\%[ype]\|filext\%[ype]\|filev\%[iewer]\)\>\s\+\S'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)'
\ end='\(\S\zs\s\)' keepend
\ contains=vifmFtCommand,vifmPatterns,vifmComment
" common highlight for :command arguments without highlighting of angle-bracket
" notation
syntax region vifmArgs start='!\?\zs\(\s*\S\+\|[^a-zA-Z]\)'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='|\|$'
\ contained
\ contains=vifmStringInExpr,vifmComment
" common highlight for :command arguments with highlighting of angle-bracket
" notation
syntax region vifmArgsCN start='!\?\zs\(\s*\S\+\|[^a-zA-Z]\)'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='|\|$'
\ contained
\ contains=vifmStringInExpr,vifmNotation
syntax region vifmSet
\ start='\(\s\|:\)*\<\(se\%[t]\|setg\%[lobal]\|setl\%[ocal]\)\>'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$'
\ keepend
\ contains=vifmSetCommand,vifmOption,vifmSetAssignSQS,vifmSetAssignDQS
\,vifmSetAssignNS,vifmComment,vifmInlineComment,vifmNotComment
syntax region vifmSetN
\ start='\(\s\|:\)*\<\(se\%[t]\|setg\%[lobal]\|setl\%[ocal]\)\>'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$'
\ keepend
\ contains=vifmSetCommand,vifmOption,vifmSetAssignSQS,vifmSetAssignDQS
\,vifmSetAssignNSN,vifmComment,vifmInlineComment,vifmNotComment,vifmNotation
syntax region vifmSet2 contained
\ start='^\(\s\|:\)*\<\(se\%[t]\|setg\%[lobal]\|setl\%[ocal]\)\>'
\ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$'
\ keepend
\ contains=vifmSetCommand,vifmOption,vifmSetAssignSQS,vifmSetAssignDQS
\,vifmSetAssignNSN,vifmComment,vifmInlineComment,vifmNotComment,vifmNotation
" Highlight for =value part of :set arguments of form option=value
" For single quoted string (check that it starts with =')
syntax region vifmSetAssignSQS contained
\ start="='" skip=+\\\\\|\\'+ end=+'+ keepend
\ contains=vifmString
" For double quoted string (check that it starts with =")
syntax region vifmSetAssignDQS contained
\ start='="' skip=+\\\\\|\\"+ end=+"+ keepend
\ contains=vifmString
" For not strings (check that it doesn't start with either =' or =")
syntax region vifmSetAssignNS contained
\ start='=[^"'' ]' skip='\(\n\s*\\\)\|\(\n\s*".*$\)\|^.*\S.*\\\s' end='^\s*\\\s\|[^\\]\s\|$'
\ extend
\ contains=vifmNumber,vifmComment,vifmInlineComment
" For not strings (check that it doesn't start with either =' or =")
syntax region vifmSetAssignNSN contained
\ start='=[^"'' ]' skip='\(\n\s*\\\)\|\(\n\s*".*$\)\|^.*\S.*\\\s' end='^\s*\\\s\|[^\\]\s\|$'
\ extend
\ contains=vifmNumber,vifmComment,vifmInlineComment,vifmNotation
" :let command with highlighting of angle-brace notation.
syntax region vifmLet
\ start='^\(\s\|:\)*\<let\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$'
\ keepend
\ contains=vifmLetCommand,vifmEnvVar,vifmString,vifmStringInExpr,vifmComment
\,vifmInlineComment,vifmNotComment
" Contained :let command without highlighting of angle-brace notation.
syntax region vifmLetC
\ start='\<let\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$\||'
\ keepend
\ contains=vifmLetCommand,vifmEnvVar,vifmString,vifmStringInExpr,vifmComment
\,vifmInlineComment,vifmNotComment,vifmBuiltinFunction
" Contained :let command with highlighting of angle-brace notation.
syntax region vifmLetCN
\ start='\<let\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$\||'
\ keepend
\ contains=vifmLetCommand,vifmEnvVar,vifmString,vifmStringInExpr,vifmComment
\,vifmInlineComment,vifmNotComment,vifmBuiltinFunction,vifmNotation
syntax region vifmUnlet
\ start='^\(\s\|:\)*\<unl\%[et]\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$'
\ keepend
\ contains=vifmUnletCommand,vifmEnvVar,vifmComment,vifmInlineComment,vifmNotComment
syntax region vifmUnletC
\ start='\<unl\%[et]\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$\||'
\ keepend
\ contains=vifmUnletCommand,vifmEnvVar,vifmComment,vifmInlineComment,vifmNotComment
syntax region vifmString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+
syntax region vifmString contained start=+='+hs=s+1 skip=+\\\\\|\\'+ end=+'+
syntax region vifmStringInExpr contained start=+=\@<="+hs=s+1 skip=+\\\\\|\\"+
\ end=+"+
syntax region vifmStringInExpr contained start=+=\@<='+hs=s+1
\ skip=+\\\\\|\\'\|''+ end=+'+
syntax region vifmStringInExpr contained start=+[.( ]"+hs=s+1 skip=+\\\\\|\\"+
\ end=+"+
syntax region vifmStringInExpr contained start=+[.( ]'+hs=s+1
\ skip=+\\\\\|\\'\|''+ end=+'+
syntax region vifmArgument contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syntax region vifmArgument contained start=+'+ skip=+\\\\\|\\'\|''+ end=+'+
syntax match vifmEnvVar contained /\$[0-9a-zA-Z_]\+/
syntax match vifmNumber contained /\d\+/
syntax match vifmHexColor contained /#[0-9a-fA-F]\{6}/
" Optional map arguments right after command name
syntax match vifmMapArgList '\(<\(silent\|wait\)>\s*\)*' contained
\ nextgroup=vifmMapLhs
" Ange-bracket notation
syntax case ignore
syntax match vifmNotation '<\(esc\|cr\|space\|del\|nop\|\(s-\)\?tab\|home\|end\|left\|right\|up\|down\|bs\|delete\|insert\|pageup\|pagedown\|\([acms]-\)\?f\d\{1,2\}\|c-s-[a-z[\]^_]\|s-c-[a-z[\]^_]\|c-[a-z[\]^_@]\|[am]-c-[a-z]\|c-[am]-[a-z]\|[am]-[a-z]\)>'
syntax case match
" Whole line comment
syntax region vifmComment contained extend
\ contains=@Spell start='^\(\s\|:\)*"' end='$'
" Comment at the end of a line
syntax match vifmInlineComment contained contains=@Spell '\s"[^"]*$'
" This prevents highlighting non-first line of multi-line command
syntax match vifmNotComment contained '\s"[^"]*\(\n\s*\(\\\|"\)\)\@='
" Empty line
syntax match vifmEmpty /^\s*$/
" :highlight clear
syntax match vifmHiClear contained /\s*\<clear\>\s*/
" Check spelling only in syntax elements marked with @Spell
syntax spell notoplevel
" Highlight
highlight link vifmAutocmdCommand Statement
highlight link vifmPatternCommands Statement
highlight link vifmComment Comment
highlight link vifmInlineComment Comment
highlight link vifmCommand Statement
highlight link vifmCommandCN Statement
highlight link vifmPrefixCommands Statement
highlight link vifmCdCommand Statement
highlight link vifmCmdCommand Statement
highlight link vifmColoCommand Statement
highlight link vifmHiCommand Statement
highlight link vifmHiClear Statement
highlight link vifmInvertCommand Statement
highlight link vifmMarkCommand Statement
highlight link vifmFtCommand Statement
highlight link vifmExprCommand Statement
highlight link vifmNormalCommand Statement
highlight link vifmLetCommand Statement
highlight link vifmUnletCommand Statement
highlight link vifmSetCommand Statement
highlight link vifmSoCommand Statement
highlight link vifmBuiltinFunction Function
highlight link vifmOperator Operator
highlight link vifmMap Statement
highlight link vifmCMapAbbr Statement
highlight link vifmHiArgs Type
highlight link vifmAutoEvent Type
highlight link vifmHiGroups Identifier
highlight link vifmPattern String
highlight link vifmHiStyles PreProc
highlight link vifmHiColors Special
highlight link vifmOption PreProc
highlight link vifmNotation Special
highlight link vifmMapArgList Special
highlight link vifmString String
highlight link vifmStringInExpr String
highlight link vifmEnvVar PreProc
highlight link vifmNumber Number
highlight link vifmHexColor Number
let &cpo = s:cpo_save
let &commentstring = '"%s'
unlet s:cpo_save
" vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 :

View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vim/.vim/user_tips.vim

50
.vim/user_tips.vim Normal file
View File

@ -0,0 +1,50 @@
let g:user_tips_list= [
\ ':vebose ★ * … ★: eg. map/set/…',
\ ':clist+:cc :+cc :-cc :copen :cwindow :cclose',
\ ':undolist :earlier :later',
\ 'git mergetool → vimdiff3 → https://stackoverflow.com/a/163659',
\ ':llist+:ll :+ll :-ll :lopen :lwindow :lclose',
\ ':m ''>+1 … :m ''<-2',
\ 'QuickList → :set ma+edit+;w ;s … ;q',
\ ':set foldopen-=search',
\ 'Buffer info → <c-g> g<c-g> … :map <buffer><tab>',
\ 'Rename file → :saveas * | :silent !rm # | :bw #',
\ 'packadd cfilter',
\ 'Next word location → ]I [I ]<c-I> [<c-I> … <leader>]I <leader>[I',
\ ':w !sudo tee > /dev/null %',
\ '`0·`"·`.·`` … last exit·edit·change·pre-jump … also g''*',
\ 'q: q? q/ … @: ?<cr> /<cr> :&<cr> , ;',
\ '<c-n><c-p> <c-x><c-l> <c-x><c-f> … :h ins-completion',
\ ':split +N … open cur. file in N line … :split +/pattern',
\ 'vim can edit zip files',
\ ':set nowrapscan (cycle search)',
\ '<c-x>= <c-v>',
\ 'silent! %s/[\\r \\t]\+$//',
\ ':ilist pattern … :ijump pattern',
\ 'Replace mode → R',
\ 'J gJ K gwip g~ ~',
\ 'Folds → zm za zi zj zk (zfG/zd) zc zC zo zO … :*fold<tab>',
\ '<c-]> (`ž`) <c-t>',
\ 'Macro defs. → ]D [D ]<c-D> [<c-D> … :dlist string … :djump string',
\ ':update | edit ++ff=dos | setlocal ff=unix',
\ 'Shift-V and then type gq → put "overflowed" text on new lines',
\ ':set scrollbind (`scb`) … :diffthis :diffoff :diff*<tab>',
\ ":let i=10 | 'a,'bg/Abc/s/yy/\=i/ |let i=i+1 # convert yy to 10,11,12 etc",
\ 'use \zs \ze \c inside `?`|`/`',
\ 'v_* :%s//replacement',
\ ':5,10norm! @a … :g/pattern/norm! @a',
\ '`textwidth` → n_gq* v_gq',
\ 'File encryption → :X … vim -x filename',
\ ':sort /,/',
\ 'zz zb zt zL zH gm gM',
\ '<c-a> <c-x> g<c-a>…',
\ ':set spell :spell<tab> … z= zg zug ]s [s',
\ ':lhistory :lolder :lnewer',
\ ':[m]ove :[co]py (:t) :p :#',
\ ':help i_CTRL-<tab> … i_CTRL-Y … i<c-u>',
\ '*grep onchange -r . --include=*.\{js,md\} …or http://jdem.cz/fgytv8',
\ '%bdelete|edit #|normal `"',
\ ':diffget :diffput c] [c',
\ ':chistory :colder :cnewer',
\ 'Repeat substitution(s) & g& :& :&& :~ … :help :s_flags'
\ ]

1
.vimrc
View File

@ -1 +0,0 @@
/home/jaandrle/Vzdálené/GitHub/dotfiles/vim/.vimrc

464
.vimrc Normal file
View File

@ -0,0 +1,464 @@
""" VIM config file | Jan Andrle | 2024-02-07 (VIM >=8.1)
"" #region B Base
scriptencoding utf-8 | set encoding=utf-8
let $BASH_ENV = "~/.bashrc"
set runtimepath^=~/.vim/bundle/*
packadd! matchit
set hidden
set title
colorscheme codedark
set updatetime=300 lazyredraw ttyfast " Having longer updatetime (default is 4s) leads to noticeable delays and poor user experience. Also reduce redraw frequency and fast terminal typing
set noerrorbells novisualbell
set belloff=esc
set confirm
set guioptions-=T
cabbrev <expr> %PWD% execute('pwd')
cabbrev <expr> %CD% fnameescape(expand('%:p:h'))
cabbrev <expr> %CS% mini_enhancement#selectedText()
cabbrev <expr> %CW% expand('<cword>')
let mapleader = "\\"
" better for my keyboard, but maybe use `:help keymap`?
nnoremap § @
nnoremap §§ @@
nnoremap ů ;
nnoremap ; :
nnoremap <leader>u U
nnoremap U <c-r>
nnoremap ž <c-]>
nnoremap <c-up> <c-y>
nnoremap <c-down> <c-e>
" <c-bs>
imap  <c-w>
cmap  <c-w>
if has("patch-8.1.0360")
set diffopt+=algorithm:patience,indent-heuristic | endif
set diffopt+=iwhite
augroup vimrc_help
autocmd!
autocmd BufEnter *.txt if &buftype == 'help' | wincmd L | vertical resize 90 | endif
augroup END
""" #region BB Build-in plugins
" https://github.com/rbtnn/vim-gloaded/blob/master/plugin/gloaded.vim
let g:loaded_vimballPlugin = 1 " :h pi_vimball … for plugin creators
let g:vifm_replace_netrw= 1 | let g:loaded_netrw= 1 | let g:loaded_netrwPlugin= 1 " this line needs to be commented to let vim dowmload spelllangs!!! … see http://jdem.cz/fgyw25
""" #endregion BB
"" #endregion B
"" #region H Helpers + remap 'sS' (primary ss, see `vim-scommands`)
nmap sh :execute 'ALTredir :map s \<bar> map '.mapleader.' \<bar> map § \<bar> map ů \<bar> map ; \<bar> map U \<bar> map ž'<cr>:g/^$/d<cr>:g/^v s/m$<cr>úgg
call scommands#map('s', 'CL', "n,v")
command! -nargs=? CLscratch 10split | enew | setlocal buftype=nofile bufhidden=wipe noswapfile nobuflisted | if <q-args>!='' | execute 'normal "'.<q-args>.'p' | endif | nnoremap <buffer> ;q :q<cr>
call scommands#map('S', 'SET', "n,v")
call scommands#map('a', 'ALT', "n,V")
cabbrev ALTR ALTredrawSyntax
set grepprg=LC_ALL=C\ grep\ -nrsH
command! -nargs=0
\ ALTredrawSyntax edit | exec 'normal `"' | exec 'set ft='.&ft
command! -complete=command -bar -range -nargs=+
\ ALTredir call jaandrle_utils#redir(0, <q-args>, <range>, <line1>, <line2>)
command! -nargs=+ -complete=file_in_path -bar
\ ALTgrep cgetexpr jaandrle_utils#grep(<f-args>) | call setqflist([], 'a', {'title': ':' . g:jaandrle_utils#last_command})
command! -nargs=+ -complete=file_in_path -bar
\ ALTlgrep lgetexpr jaandrle_utils#grep(<f-args>) | call setloclist(0, [], 'a', {'title': ':' . g:jaandrle_utils#last_command})
command! -nargs=0
\ ALTargsBWQA execute 'argdo bw' | %argdelete
let g:quickfix_len= 0
function! QuickFixStatus() abort
hi! link User1 StatusLine
if !g:quickfix_len | return 'Ø' | endif
if g:quickfix_len>0 | return g:quickfix_len | endif
let type= &termguicolors ? 'gui' : 'cterm'
execute 'hi! User1 '.type.'bg='.synIDattr(synIDtrans(hlID('StatusLine')), 'bg').
\' '.type.'fg='.synIDattr(synIDtrans(hlID('WarningMsg')), 'fg')
return -g:quickfix_len
endfunction
function! s:QuickFixCmdPost() abort
let q_len= len(getqflist())
let g:quickfix_len= q_len ? -q_len : len(getloclist(0))
endfunction
augroup quickfix
autocmd!
autocmd QuickFixCmdPost * call <sid>QuickFixCmdPost()
autocmd filetype qf
\ if filter(getwininfo(), {i,v -> v.winnr == winnr()})[0].loclist
\| nnoremap <buffer> ;q :lclose<cr>
\| nnoremap <buffer> ;w :lgetbuffer<CR>:lclose<CR>:lopen<CR>
\| nnoremap <buffer> ;s :ldo s///gc \| update<c-left><c-left><c-left><right><right>
\| else
\| nnoremap <buffer> ;q :cclose<cr>
\| nnoremap <buffer> ;w :cgetbuffer<CR>:cclose<CR>:copen<CR>
\| nnoremap <buffer> ;s :cdo s///gc \| update<c-left><c-left><c-left><right><right>
\| endif
augroup END
"" #endregion H
"" #region SLH Status Line + Command Line + History (general) + Sessions + File Update, …
set showcmd cmdheight=2 showmode
set wildmenu wildoptions=pum
"" wildmode=list:longest,list:full " Tab autocomplete in command mode
cabbrev wbw w<bar>bw
set sessionoptions-=options
command! -nargs=1
\ CLSESSIONcreate :call mini_sessions#create(<f-args>)
command! -nargs=0
\ CLSESSIONconfig :call mini_sessions#sessionConfig()
command! -nargs=1 -complete=customlist,mini_sessions#complete
\ CLSESSIONload :call mini_sessions#load(<f-args>)
command! -nargs=0
\ Scd :call mini_sessions#recoverPwd()
if !has("gui_running")
execute 'hi! User2 ctermbg='.synIDattr(synIDtrans(hlID('StatusLine')), 'bg').' ctermfg=grey' | endif
set laststatus=2 " Show status line on startup
set statusline+=··%1*≡·%{QuickFixStatus()}%*··%2*»·%{user_tips#current()}%*··%=
set statusline+=%<%f%R\%M··▶·%{&fileformat}·%{&fileencoding?&fileencoding:&encoding}·%{&filetype}··∷·%{mini_sessions#name('')}·· 
set history=500 " How many lines of (cmd) history has to remember
set nobackup nowritebackup noswapfile " …there is issue #649 (for servers) and Im using git/system backups
try
set undodir=~/.vim/undodir undofile | catch | endtry
command! CLundotree UndotreeToggle | echo 'Use also :undolist :earlier :later' | UndotreeFocus
command! SETundoClear let old_undolevels=&undolevels | set undolevels=-1 | exe "normal a \<BS>\<Esc>" | let &undolevels=old_undolevels | unlet old_undolevels | write
"" #endregion SLH
"" #region LLW Left Column + Line + Wrap + Scrolling
if has("nvim-0.5.0") || has("patch-8.1.1564") " Recently vim can merge signcolumn and number column into one
set signcolumn=number | else | set signcolumn=yes | endif " show always to prevent shifting when diagnosticappears
set cursorline cursorcolumn " Always show current position
set number foldcolumn=2 " enable line numbers and add a bit extra margin to the left
set colorcolumn=+1 " …marker visual
command -nargs=? SETtextwidth if <q-args> | let &textwidth=<q-args> | let &colorcolumn='<args>,120,240' | else | let &textwidth=250 | let &colorcolumn='120,240' | endif
SETtextwidth " wraping lines and show two lines
set nowrap " Don't wrap long lines by default
set breakindent breakindentopt=shift:2 showbreak=
set scrolloff=5 sidescrolloff=10 " offset for lines/columns when scrolling
"" #endregion LLW
"" #region CN Clipboard + Navigation throught Buffers + Windows + … (CtrlP)
set pastetoggle=<F2> | nnoremap <F2> :set invpaste paste?<CR>
nnoremap <silent> <leader>" :call jaandrle_utils#copyRegister()<cr>
nmap <expr> š buffer_number("#")==-1 ? "sš<cr>" : "\<c-^>"
nmap s3 :buffers<cr>:b<space>
nmap :CtrlPBuffer<cr>
nmap č
let g:ctrlp_map = 'ě'
command! -nargs=? SETctrlp execute 'nnoremap '.g:ctrlp_map.' :CtrlP <args><cr>'
call scommands#map(g:ctrlp_map, 'CtrlP', "n")
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_prompt_mappings= {
\ 'ToggleType(1)': ['<c-up>'],
\ 'ToggleType(-1)': ['<c-down>'],
\ 'PrtCurStart()': ['<c-b>'],
\}
"" #endregion CN
"" #region FOS File(s) + Openning + Saving
set autowrite autoread | autocmd FocusGained,BufEnter *.* checktime
set modeline
command! -nargs=?
\ CLmodeline :call jaandrle_utils#AppendModeline(<q-args>=='basic' ? 0 : 1)
set path+=src/**,app/**,build/** " File matching for `:find`
for ignore in [ '.git', '.npm', 'node_modules' ]
exec ':set wildignore+=**'.ignore.'**'
exec ':set wildignore+=**/'.ignore.'/**'
endfor
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png,*.ico
set wildignore+=*.pdf,*.psd
nmap <leader>e :Vifm<cr>
call scommands#map('e', 'Vifm', "n")
nnoremap gx :silent exec "!xdg-open '".shellescape(substitute(expand('<cfile>'), '?', '\\?', ''), 1)."'" \| redraw!<cr>
vnoremap gx :silent exec "!xdg-open '".shellescape(substitute(mini_enhancement#selectedText(), '?', '\\?', ''), 1)."'" \| redraw!<cr>
"" #endregion FOS
"" #region EN Editor navigation + search
set hlsearch incsearch " highlight search, start when typing
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <c-l> :nohlsearch<c-r>=has('diff')?'<bar>diffupdate':''<cr><cr><c-l> | endif
call scommands#map('n', 'NAV', "n")
command! NAVjumps call jaandrle_utils#gotoJumpChange('jump')
command! NAVchanges call jaandrle_utils#gotoJumpChange('change')
command! NAVmarks call jaandrle_utils#gotoMarks()
let g:markbar_persist_mark_names = v:false
nmap <Leader>m <Plug>ToggleMarkbar
"" #endregion EN
"" #region EA Editing adjustment + Syntax + White chars + Folds
" use <c-v>§ for §
inoremap § <esc>
set nrformats-=octal
command! -nargs=1 SETTOGGLEnrformats if &nf=~<q-args> | set nf-=<args> | else | set nf+=<args> | endif
let g:htl_css_templates=1
let g:markdown_fenced_languages= [ 'javascript', 'js=javascript', 'json', 'html', 'php', 'bash', 'vim', 'vimscript=javascript', 'sass' ]
augroup conceal
autocmd!
au FileType markdown
\ syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained conceal
\| syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart concealends
au FileType markdown,json
\ setlocal conceallevel=2
augroup END
augroup convenient
autocmd FileType markdown,text setlocal keywordprg=dict
autocmd FileType git,gitcommit setlocal foldmethod=syntax foldlevel=1
augroup END
" PARENTHESES plugin junegunn/rainbow_parentheses.vim
let g:rainbow#pairs= [['(', ')'], ['[', ']'], [ '{', '}' ]]
let g:rainbow#blacklist = [203,9]
autocmd VimEnter * try
\| call rainbow_parentheses#toggle() | catch | endtry
command! SETTOGGLErainbowParentheses call rainbow_parentheses#toggle()
" HIGHLIGHT&YANK plugins machakann/vim-highlightedyank & cwordhi.vim
let g:highlightedyank_highlight_duration= 250
let g:cwordhi#autoload= 1
set showmatch " Quick highlight oppening bracket/… for currently writted
set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape TAB
if v:version > 703 || v:version == 703 && has("patch541")
set formatoptions+=j | endif " Delete comment character when joining commented lines
set smarttab
command! -nargs=1 SETtab let &shiftwidth=<q-args> | let &tabstop=<q-args> | let &softtabstop=<q-args>
SETtab 4
set backspace=indent,eol,start " Allow cursor keys in insert mode: http://vi.stackexchange.com/a/2163
set shiftround autoindent " round diff shifts to the base of n*shiftwidth, https://stackoverflow.com/a/18415867
filetype plugin indent on
" SYNTAX&COLORS
if ($TERM =~ '256' && has("termguicolors"))
set termguicolors | endif
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
syntax on | endif
set list listchars=tab:»·,trail,extends:#,nbsp:~,space" Highlight spec. chars / Display extra whitespace
augroup syntax_sync_min_lines
autocmd!
autocmd Syntax * syn sync minlines=2000
augroup END
let g:vim_vue_plugin_config = { 'foldexpr': 1, 'attribute': 1, 'keyword': 1 }
" SPELL
if !has("gui_running")
hi clear SpellBad | hi SpellBad cterm=underline,italic | endif
command! -nargs=? SETspell if <q-args>==&spelllang || <q-args>=='' | set spell! | else | set spell | set spelllang=<args> | endif | if &spell | set spelllang | endif
" EDIT HEPERS
nnoremap <leader>o o<space><bs><esc>
nnoremap <leader>O O<space><bs><esc>
nnoremap <s-k> a<cr><esc>
for l in [ 'y', 'p', 'P', 'd' ] | for m in [ 'n', 'v' ]
execute m.'noremap <leader>'.l.' "+'.l | endfor | endfor
" ik ak (last change pseudo-text objects) src: https://www.reddit.com/r/vim/comments/ypt6uf/comment/ivl68xu/?utm_source=share&utm_medium=web2x&context=3
xnoremap ik `]o`[
onoremap ik :<C-u>normal vik<cr>
onoremap ak :<C-u>normal vikV<cr>
" FOLDS
command! -nargs=0 SETFOLDregions set foldmethod=marker
command! -nargs=1 SETFOLDindent set foldmethod=indent | let &foldlevel=<q-args> | let &foldnestmax=<q-args>+1
command! -nargs=* SETFOLDindents set foldmethod=indent | let &foldlevel=split(<q-args>, ' ')[0] | let &foldnestmax=split(<q-args>, ' ')[1]
set foldmarker=#region,#endregion
" SAVE VIEW
set viewoptions=cursor,folds
augroup remember__view
autocmd!
autocmd BufWinLeave *.* if &buflisted | mkview | endif
autocmd BufWinEnter *.* silent! loadview
augroup END
"" #endregion EA
"" #region GIT
call scommands#map('g', 'GIT', "n,V")
function s:gitCompletion(_, CmdLine, __)
let l:cmd= a:CmdLine->split()
let l:cmd_start= l:cmd[0]
\ ->substitute('GIThub', 'gh', '')
\ ->substitute('GIT', 'git ', '')->trim()->split(' ')
return bash#complete((l:cmd_start+l:cmd[1:])->join())
endfunction
function s:gitCmd(candidate)
execute '!clear && echo ":: git '.a:candidate->escape('"').' ::" && git '.a:candidate
endfunction
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GIT call <sid>gitCmd(<q-args>)
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITstatus !git status-- <args>
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITcommit !git commit-- <args>
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITpush !git push <args>
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GITdiff if <q-args>=='' | execute '!clear && git diff %:p' | else | silent! execute '!git diff <args>' | endif
command! -nargs=*
\ GITrestore execute '!clear && git status '.(<q-args>=='.' ? '%:p':'<args>').' -bs & git restore '.(<q-args>=='' ? '%:p':'<args>').' --patch'
command! -nargs=* -complete=customlist,<sid>gitCompletion
\ GIThub execute '!clear && echo ":: gh '.<q-args>->escape('"').' ::" && gh '.<q-args>
command! -nargs=?
\ GIThubIssue execute '!clear && gh issue view '.expand('<cword>').' '.<q-args>
let g:git_messenger_no_default_mappings= v:true
let g:git_messenger_date_format= '%Y-%m-%d (%c)'
let g:git_messenger_always_into_popup= v:true
augroup git_messenger_help
autocmd!
autocmd FileType gitmessengerpopup setlocal keywordprg=git\ show
augroup END
command! -nargs=0
\ GITblameThis GitMessenger
"" #endregion GIT
"" #region COC COC and so on, compilers, code/commands completions
let g:coc_global_extensions= ['coc-css', 'coc-docthis', 'coc-emmet', 'coc-emoji', 'coc-eslint', 'coc-gitmoji', 'coc-html', 'coc-json', 'coc-marketplace', 'coc-phpls', 'coc-sh', 'coc-snippets', 'coc-styled-components', 'coc-svg', 'coc-tabnine', 'coc-tsserver']
" https://github.com/antonk52/cssmodules-language-server
call coc#config('languageserver.cssmodules', {
\ "command": "cssmodules-language-server",
\ "initializationOptions": {"camelCase": "dashes"},
\ "filetypes": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
\ "requireRootPattern": 0,
\ "settings": {}
\ })
autocmd FileType scss setl iskeyword+=@-@
command -nargs=? ALTmake if &filetype=='javascript' | compiler jshint | elseif &filetype=='php' | compiler php | endif
\| if <q-args>!='' | silent make <args> | else | silent make '%' | endif | checktime | silent redraw! " …prev line, hotfix (filetype detection doest works)
function <sid>ToggleALTmakeOnWrite()
if exists('#ALTmake_auto#BufWritePost')
augroup ALTmake_auto
autocmd!
augroup END
else
augroup ALTmake_auto
autocmd!
autocmd BufWritePost *.{php,js,mjs} execute 'ALTmake' | call <sid>QuickFixCmdPost()
augroup END
endif
endfunction
command! ALTmakeOnWrite call <sid>ToggleALTmakeOnWrite()
function! CustomKeyWord(word)
if(a:word=="gulp_place")
highlight link gulp_place ErrorMsg
syntax match gulp_place "gulp_place"
augroup gulp_place
autocmd!
autocmd BufEnter *.{js,html} syntax match gulp_place "gulp_place"
augroup END
return 0
endif
endfunction
set completeopt=menuone,preview,noinsert,noselect
inoremap <silent><expr> <F1> coc#pum#visible() ? coc#pum#confirm() : coc#refresh()
set wildcharm=<f1>
inoremap <silent><expr> <tab> coc#pum#visible() ? coc#pum#next(1) : <sid>check_back_space() ? "\<tab>" : coc#refresh()
inoremap <silent><expr> <s-tab> coc#pum#visible() ? coc#pum#prev(1) : "\<c-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
nmap <silent> gd <Plug>(coc-definition)
nmap <leader>/ :CocSearch
nmap <leader>? <leader>/
command! -bang NAVdiagnostic call CocActionAsync('diagnostic'.( "<bang>" == '!' ? 'Previous' : 'Next' ))
command! NAVdefinition call CocActionAsync('jumpDefinition')
command! NAVtype call CocActionAsync('jumpTypeDefinition')
command! NAVimplementation call CocActionAsync('jumpImplementation')
command! NAVreferences call CocActionAsync('jumpReferences')
" navigate diagnostics, use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nnoremap <silent> gh :call <sid>show_documentation(expand("<cword>"))<cr>
vnoremap <silent> gh :<c-u>call <sid>show_documentation(mini_enhancement#selectedText())<cr>
nnoremap <leader>gf :let g:ctrlp_default_input=expand("<cword>") <bar> execute 'CtrlP' <bar> unlet g:ctrlp_default_input <cr>
vnoremap <leader>gf :<c-u>let g:ctrlp_default_input=mini_enhancement#selectedText() <bar> execute 'CtrlP' <bar> unlet g:ctrlp_default_input <cr>
""" #region COCP Coc popups scroll (Remap <C-f> and <C-b> for scroll float windows/popups.)
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
""" #endregion COCP
command! -nargs=? SETFOLDcoc :call CocAction('fold', <f-args>)
call scommands#map('C', 'Coc', "n,v")
nmap sc :CocList lists<cr>
nmap Sc :CocListResume<cr>
nnoremap <c-g> :CLwhereami<cr>
command! CLwhereami :call popup_notification([
\expand('%:t').( coc#status() != "" ? '/'.CocAction("getCurrentFunctionSymbol")."\t…\t".coc#status() : '' ),
\" ",
\"Line:\t".line('.').' / '.line('$'),
\"Column:\t".col('.').' / '.col('$'),
\"Path:\t".expand('%:p:h')
\], #{ line: &lines-3, pos: 'botleft', moved: 'any', close: 'button', time: 3000 })
command! CLhelpCocPlug call feedkeys(':<c-u>help <Plug>(coc ', 'tn')
command! CLhelpCocAction call feedkeys(':<c-u>help CocAction('' ', 'tn')
command! CLrename call CocActionAsync('rename')
command! CLrenameFile exec 'CocCommand workspace.renameCurrentFile'
command! -nargs=? -bang
\ CLreplace call feedkeys(':<c-u>'.(<q-args>==''?'.':<q-args>).'s/'.("<bang>"=='!'?mini_enhancement#selectedText():expand('<cword>')).'//cgODODOD', 'tn')
command! CLrepeatLastChange call feedkeys('/\V<C-r>"<CR>cgn<C-a><Esc>', 'tn')
command! CLjsdoc exec 'CocCommand docthis.documentThis'
command! CLjshintGlobal normal yiwmm?\/\* global<cr><c-l>f*hi, p`m
command! CLcodeactionCursor call CocActionAsync('codeAction', 'cursor')
command! CLfixCodeQuick call CocActionAsync('doQuickfix')
function! AIcodeFn(range, ...) range abort
let l:instruction = 'Hi, can you help me with ' . &filetype . 'code? Thanks in advance. I would like to: '
if a:0
let l:instruction = l:instruction . a:1
endif
if a:range
'<,'>call vim_ai#AIRun(a:range, {}, l:instruction)
else
call vim_ai#AIRun(a:range, {}, l:instruction)
endif
endfunction
command! -range -nargs=? AIcode <line1>,<line2>call AIcodeFn(<range>, <f-args>)
vnoremap <f1> :AI<f1>
nnoremap <f1> :AI<f1>
command! -nargs=?
\ CLcheat call cheat_copilot#open(<q-args>==''?&filetype:<q-args>)
function! s:show_documentation(word)
if (index(['vim', 'help'], &filetype) >= 0)
" inspired by https://github.com/tpope/vim-scriptease/blob/74bd5bf46a63b982b100466f9fd47d2d0597fcdd/autoload/scriptease.vim#L737
let syn= get(reverse(map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")')), 0, '')
if syn ==# 'vimFuncName' | return <sid>show_documentation_vim('h '.a:word.'()')
elseif syn ==# 'vimOption' | return <sid>show_documentation_vim("h '".a:word."'")
elseif syn ==# 'vimUserAttrbKey' | return <sid>show_documentation_vim('h :command-'.a:word)
endif
let col= col('.') - 1
while col && getline('.')[col] =~# '\k' | let col-= 1 | endwhile
let pre= col == 0 ? '' : getline('.')[0 : col]
let col= col('.') - 1
while col && getline('.')[col] =~# '\k' | let col+= 1 | endwhile
if pre =~# '^\s*:\=$' | return <sid>show_documentation_vim('h :'.a:word)
elseif pre =~# '\<v:$' | return <sid>show_documentation_vim('h v:'.a:word)
endif
let post= getline('.')[col : -0]
if a:word ==# 'v' && post =~# ':\w\+' | return <sid>show_documentation_vim('h v'.matchstr(post, ':\w\+')) | endif
return <sid>show_documentation_vim('h '.a:word)
endif
if (!CocAction('hasProvider', 'hover'))
return feedkeys('K', 'in')
endif
if &filetype=='html' && coc#source#custom_elements#hover(a:word)!=0
return 0
endif
return CocActionAsync('doHover')
endfunction
function! s:show_documentation_vim(cmd)
call execute(a:cmd) | call histadd("cmd", a:cmd)
endfunction
"" #endregion COC
let g:codeium_disable_bindings = 1
imap <script><silent><nowait><expr> <f3><f3> codeium#Accept()
imap <f3>n <Cmd>call codeium#CycleCompletions(1)<CR>
imap <f3>N <Cmd>call codeium#CycleCompletions(-1)<CR>
imap <f3>d <Cmd>call codeium#Clear()<CR>
imap <f3>! <Cmd>call codeium#Complete()<CR>
" vim: set textwidth=250 :
" vim>60: set foldmethod=marker foldmarker=#region,#endregion :