Compare commits

...

7 Commits

6 changed files with 36 additions and 9 deletions

View File

@ -25,6 +25,8 @@ else
set -x EDITOR "vim -u ~/.config/vim/vimrc"
end
alias datenow="date '+%Y-%m-%d'"
function please
@ -88,7 +90,9 @@ if status --is-interactive
alias g="git"
mkdir -p ~/.local
if [ (expr (date '+%s') - (cat "$HOME/.local/last_shell" 2>/dev/null || echo 0)) -gt "28800" ]
set time_diff (expr (date '+%s') - (cat "$HOME/.local/last_shell" 2>/dev/null || echo 0))
if [ "$time_diff" -gt "28800" ]
[ -d "$HOME/tmp" ] && rm -rf "$HOME/tmp/*"
timeout 5 git sit && date '+%s' > "$HOME/.local/last_shell"
echo ""
end

View File

@ -1,7 +1,7 @@
[init]
defaultBranch = main
[user]
name = Sam Greytalon
name = Sam Talonborn
email = sam@oaktal.com
[pull]
rebase = false

View File

@ -1,6 +1,5 @@
nnoremap gf :let @a='../'.expand('%')<CR>vi>y<Esc>:tabnew <C-R>"<CR>:let @"=@a
vnoremap gf y<Esc>:let @a='../'.expand('%')<CR>:tabnew <C-R>"<CR>:let @"=@a
nnoremap mf viwc[]<Esc>hpla(<>)<Left><Left><C-R>=expand('%')<CR><Esc>F/l"_dt>hpa.md<Esc>
vnoremap mf c[]<Esc>hpla(<>)<Left><Left><C-R>=expand('%')<CR><Esc>F/l"_dt>hpa.md<Esc>
nnoremap ml :r!grep -Rl '' .<Left><Left><Left>
vnoremap ml y<Esc>:execute 'r!grep -Rl '.shellescape(@", 1).' .'<CR>
nnoremap gl vi)y<Esc>:tabnew <C-R>"<CR>
vnoremap gl y<Esc>:tabnew <C-R>"<CR>
nnoremap ml viwc[]<Esc>hpla()<Esc>hpa.md<Esc>
vnoremap ml c[]<Esc>hpla()<Esc>hpa.md<Esc>

View File

@ -6,6 +6,10 @@ autocmd FileType markdown set columns=80
autocmd FileType markdown set linebreak
autocmd FileType markdown setlocal comments+=">"
autocmd FileType gemtext setlocal wrap
autocmd FileType gemtext setlocal linebreak
autocmd FileType gemtext setlocal columns=80
autocmd FileType text setlocal textwidth=120
autocmd FileType text setlocal formatoptions=tcroqawn
autocmd FileType text,markdown,gemtext set spell

View File

@ -7,7 +7,7 @@ dest="$3"
root="$(pwd)"
rm -r "$dest"
cp -r "$src" "$dest"
rsync -a --exclude '.*' "$src" "$dest"
files="$(find "$dest" -type f)"

View File

@ -36,6 +36,20 @@ while [ $# -ne 0 ]; do
echo "$time $file"
done | sort -k 1,1 | awk '{ $1="" }1')"
;;
TITLE)
files="$(echo "$files" | while read -r file; do
path="$(echo "$file" | awk '{ print $1 }')"
title="$(cat "$file" | sed '1!d')"
echo "$path $title"
done | sort -k 2 | awk '{ print $1 }')"
;;
SUBTITLE)
files="$(echo "$files" | while read -r file; do
path="$(echo "$file" | awk '{ print $1 }')"
subtitle="$(cat "$file" | sed '2!d')"
echo "$path $subtitle"
done | sort -k 2 | awk '{ print $1 }')"
;;
esac
shift
@ -75,6 +89,12 @@ while [ $# -ne 0 ]; do
echo "$file $(head -n1 "$path" 2> /dev/null | sed 's/^#//g' | sed 's/^ //g')"
done)"
;;
SUBTITLE)
files="$(echo "$files" | while read -r file; do
[ "$file" = "" ] && continue
path="$(echo "$file" | awk '{ print $1 }')"
echo "$file $(cat "$path" 2> /dev/null | sed '2!d' | sed 's/^##//g' | sed 's/^ //g')"
done)"
esac
shift