Compare commits

...

7 commits

Author SHA1 Message Date
4dadcd5f9f
scripts: Refactor py script
Made detection and setup a little more stable, will still have its kinks since
it is rather hastily put together but should work for detecting kernels,
invoking the right python repl and letting you set it manually with `py -c`.
2023-12-12 12:23:21 +01:00
029b38f368
jrnl: Update jrnl version 2023-12-12 12:22:16 +01:00
8c9a233a8b
vifm: Improve file preview for tabular data
Slightly improved display of csv files and added tsv to same preview.
Added nice previews for json and excel files.
2023-12-12 12:21:59 +01:00
b0bcb9dd60
qutebrowser: Remove wikipedia redirects
These are the redirects that made the most trouble for me, and honestly I
do not think wikipedia really belongs in the same category of 'necessary
to redirect' surveillance pages like reddit,instagram or twitter.
2023-12-12 12:21:01 +01:00
b6687145bd
git: Make git diff termcolor aware
Added simple light/dark distinction for git diffs using delta.
Will use the TERM_DARK env variable which is set in the base
module functionality on opening a new term.

This means unfortunately git diffs will have the wrong color
when terms recently changed between light-dark but on opening
a new one the error is gone and it automatically adapts again
to the terminal background color.
2023-12-12 12:19:41 +01:00
62ec2799c8
git: Add side-by-side diff
Added a simple alteration of diff viewing to also be feasible side-by-side in
addition to the default (delta) diff viewing mode.
Use aliases `gdd` (and `gdds` for staged) to enable.
2023-12-12 12:17:19 +01:00
13c87f365d
git: Add difftastic syntax diffing
If difft command is installed we can git diff on syntactic changes only
using `gdy` (or `gdys` for staged) which will spit out a (treesitter)
syntax-aware side by side comparison.
Really nice for refactoring diffs.
2023-12-12 12:15:51 +01:00
6 changed files with 95 additions and 59 deletions

View file

@ -5,15 +5,17 @@
[init] [init]
defaultBranch = main defaultBranch = main
[core] [core]
pager = delta pager = git delta
[pager]
difftool = true
[interactive] [interactive]
diffFilter = delta --color-only diffFilter = git delta --color-only
[merge] [merge]
conflictstyle = diff3 conflictstyle = diff3
[delta] [delta]
navigate = true navigate = true
line-numbers = true line-numbers = true
syntax-theme = base16 syntax-theme = base16
[sendemail] [sendemail]
smtpserver = "/usr/bin/msmtp" smtpserver = "/usr/bin/msmtp"
annotate = yes annotate = yes
@ -23,6 +25,9 @@
pushall = "!git remote | xargs -I R git push R" # push to all connected remotes pushall = "!git remote | xargs -I R git push R" # push to all connected remotes
fetchall = "!git remote | xargs -I R git fetch R" # fetch from all connected remotes fetchall = "!git remote | xargs -I R git fetch R" # fetch from all connected remotes
diffword = "!git diff --word-diff=color --word-diff-regex='[0-9A-Za-z_]+'" # word-wise diff, good for prose diffword = "!git diff --word-diff=color --word-diff-regex='[0-9A-Za-z_]+'" # word-wise diff, good for prose
diffsyn = "!git difftool --tool difftastic" # add syntax-driven diff using treesitter
diffside = "!DELTA_FEATURES='+side-by-side' git diff" # add side-by-side diffing
delta = "![ $TERM_DARK=false ] && delta --light || delta" # Take care that we always display right color scheme
[commit] [commit]
gpgsign = true # sign commits as me gpgsign = true # sign commits as me
verbose = true # Always show diff when preparing commit message verbose = true # Always show diff when preparing commit message
@ -32,6 +37,10 @@
rebase = true # always rebase on pulling, obviates merge commits rebase = true # always rebase on pulling, obviates merge commits
[diff] [diff]
colorMoved = zebra # also color stuff that has simply been moved, in a classy zebra-color colorMoved = zebra # also color stuff that has simply been moved, in a classy zebra-color
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[color.diff] [color.diff]
meta = "9" meta = "9"
frag = "magenta bold" frag = "magenta bold"

View file

@ -31,19 +31,32 @@ else
fi fi
alias gco='git checkout' alias gco='git checkout'
alias gd='git diff'
alias gdd='git diffword'
alias gds='git diff --staged'
alias gdds='git diffword --staged'
alias gi='git ignore' alias gi='git ignore'
# normal diff
alias gd='git diff'
alias gds='git diff --staged'
# word-based diff (with custom word regex)
alias gdw='git diffword'
alias gdws='git diffword --staged'
# side-by-side diff
alias gdd='git diffside'
alias gdds='git diffside --staged'
# syntax-based diff
if exist difft; then
alias gdy='git diffsyn'
alias gdys='git diffsyn --staged'
fi
alias gdd='git diffside'
alias gdds='git diffside --staged'
# show last committed content # show last committed content
alias gll='git last' alias gdl='git last'
# show quick log overview # show quick log overview
alias glg='git log --oneline --decorate --graph' alias glg='git log --oneline --decorate --graph'
alias glgd="git log --graph --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'"
alias glga='git log --oneline --decorate --graph --remotes --all' alias glga='git log --oneline --decorate --graph --remotes --all'
# show quick log overview - with dates
alias glgd="git log --graph --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'"
alias glgad="git log --graph --remotes --all --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'" alias glgad="git log --graph --remotes --all --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'"
# show detailed log overview # show detailed log overview
alias glog='git log --stat' alias glog='git log --stat'

View file

@ -183,21 +183,6 @@ redirects = {
"whoogle.dcs0.hu", "whoogle.dcs0.hu",
], ],
}, },
"wiki-en": {
"source": ["en.wikipedia.org"],
"target": [
"wiki.slipfox.xyz",
"wikiless.funami.tech",
"wikiless.org",
"wikiless.tiekoetter.com",
],
},
"wiki-de": {
"source": ["de.wikipedia.org"],
"target": [
"wiki.adminforge.de",
],
},
} }

View file

@ -5,39 +5,64 @@ cur_dir=$(pwd)
search_dir="${molten_session_dir}${cur_dir}" search_dir="${molten_session_dir}${cur_dir}"
if [ "$1" == "-c" ]; then if [ "$1" == "-c" ]; then
cmd=$(echo -e "euporie-console\njupyter-console\nptipython\nipython\npython" | fzf) cmd_explicit=$(echo -e "euporie-console\njupyter-console\nptipython\nipython\npython" | fzf)
fi
# set normal command first
if [ -z "$cmd" ]; then
if exist ptipython; then
cmd=ptipython
elif exist ipython; then
cmd=ipython
elif exist python; then
cmd=python
else
echo "No python found on system, please install." 1>&2
exit 1
fi
fi fi
# search for molten session for current dir # search for molten session for current dir
if [ -n "$(ls -A "${search_dir}" 2>/dev/null)" ]; then if [ -n "$(ls -A "${search_dir}" 2>/dev/null)" ]; then
res=$(find "$search_dir" -maxdepth 1 -type f -name "*.json") session=$(find "$search_dir" -maxdepth 1 -type f -name "*.json")
if [ "$(echo "$res" | wc -l)" -gt 1 ]; then if [ "$(echo "$session" | wc -l)" -gt 1 ]; then
session=$(echo "$res" | fzf --prompt "Molten session> ") session=$(echo "$session" | fzf --prompt "Molten session> ")
fi fi
fi
if [ -n "$cmd_explicit" ] && not exist "$cmd_explicit"; then
echo "Command $cmd_explicit not found."
exit 1
elif [ "$cmd_explicit" == "euporie-console" ]; then
if [ -n "$session" ]; then
euporie-console --edit-mode vi --connection-file "$session"
else
echo "Starting euporie without a session to attach to."
euporie-console --edit-mode vi
fi
exit 0
elif [ "$cmd_explicit" == "jupyter-console" ]; then
if [ -n "$session" ]; then
jupyter-console --existing "$session"
else
echo "Starting jupyter console without a session to attach to."
jupyter-console
fi
exit 0
elif [ -n "$cmd_explicit" ]; then
"$cmd_explicit"
exit 0
fi
# set normal command first
if [ -z "$cmd" ]; then
if exist ptipython; then
cmd=ptipython
elif exist ipython; then
cmd=ipython
elif exist python; then
cmd=python
else
echo "No python found on system, please install." 1>&2
exit 1
fi
fi fi
# attach to kernel # attach to kernel
if [ -n "${session}" ]; then if [ -n "${session}" ]; then
if exist euporie-console || [ "$cmd" == "euporie-console" ]; then if exist euporie-console; then
euporie-console --edit-mode vi --connection-file "$session" euporie-console --edit-mode vi --connection-file "$session"
elif exist jupyter-console || [ "$cmd" == "jupyter-console" ]; then exit 0
jupyter-console --existing "$session" elif exist jupyter-console; then
fi jupyter-console --existing "$session"
# or just run normal python exit 0
else fi
$cmd
fi fi
# or just run normal python
$cmd

View file

@ -215,7 +215,7 @@ set viewcolumns=-{name}..,6{}.
" Filter-out build and temporary files " Filter-out build and temporary files
" "
" filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/ filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/
" }}} " }}}
" Mappings {{{ " Mappings {{{
@ -471,13 +471,17 @@ filetype *.sqlite,*.db
\ sqlite3 %f, \ sqlite3 %f,
" tabular data " tabular data
filextype *.csv filextype *.csv, *.xlsx, *.tsv, *.json
\ {Open with visidata} \ {Open with visidata}
\ vd %f, \ vd %f,
fileviewer *.csv fileviewer *.tsv,*.csv
\ tidy-viewer \ tidy-viewer --color-always --title %c
" \ xsv sample 100 %c | xsv table -c8 -p1 -w1, " \ xsv sample 100 %c | xsv table -c8 -p1 -w1,
" \ {cat %c | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S; } " \ {cat %c | sed -e 's/,,/, ,/g' | column -s, -t | less -#5 -N -S; }
fileviewer *.xlsx
\ xlsx2csv %c | tidy-viewer --color-always --title %c
fileviewer *.json
\ jq '.' --color-output %c
" Mindmap " Mindmap
filextype *.vym filextype *.vym

View file

@ -16,4 +16,4 @@ linewrap: 79
tagsymbols: '#@' tagsymbols: '#@'
template: false template: false
timeformat: '%F %r' timeformat: '%F %r'
version: v4.0.1 version: v4.1