Compare commits

...

10 Commits

7 changed files with 51 additions and 5 deletions

2
.editorconfig Normal file
View File

@ -0,0 +1,2 @@
[*]
indent_style = tab

View File

@ -1 +1 @@
git checkout $( (git for-each-ref --format='%(refname:short)' refs/heads/* && git tag) | dmenu -l 20 -b) git checkout $( (git for-each-ref --format='%(refname:short)' refs/heads/* && git tag) | fzf)

3
bin/luapath Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
echo "$1/?.lua;$1/?/init.lua"

View File

@ -32,6 +32,7 @@
time = "! TIMEWARRIORDB=$(git rev-parse --show-toplevel)/.git/time timew" time = "! TIMEWARRIORDB=$(git rev-parse --show-toplevel)/.git/time timew"
track = add --intent-to-add track = add --intent-to-add
ts = timeshift ts = timeshift
reword = commit --amend --no-verify
[user] [user]
useConfigOnly = true useConfigOnly = true
[user "darkwiiplayer"] [user "darkwiiplayer"]

View File

@ -1,4 +1,3 @@
alias amend='git commit --amend'
alias bat="batcat" alias bat="batcat"
alias co='checkout' alias co='checkout'
alias e="find-edit" alias e="find-edit"

View File

@ -23,6 +23,7 @@ function Defer(command, ...)
call jobstart(a:command, { call jobstart(a:command, {
\ "out_io": "pipe", \ "out_io": "pipe",
\ "on_stdout": { pipe, text -> extend(l:buffer, text) }, \ "on_stdout": { pipe, text -> extend(l:buffer, text) },
\ "on_stderr": { pipe, text -> extend(l:buffer, text) },
\ "on_exit": { id, code -> <SID>exit(code, l:buffer, l:start, strftime("%s"), l:callbacks) } \ "on_exit": { id, code -> <SID>exit(code, l:buffer, l:start, strftime("%s"), l:callbacks) }
\}) \})
else else
@ -52,6 +53,11 @@ function s:echo(message, ...)
end end
endfun endfun
function s:scratch(result)
new
call nvim_buf_set_lines(0, 0, nvim_buf_line_count(0), 0, a:result["output"])
endfun
function s:notify(message) function s:notify(message)
call Defer('notify-send "Vim" "'.a:message.'"', { b -> 0 }) call Defer('notify-send "Vim" "'.a:message.'"', { b -> 0 })
endfun endfun
@ -59,4 +65,5 @@ endfun
comm -complete=shellcmd -nargs=* Defer call Defer(s:expand(<q-args>)) comm -complete=shellcmd -nargs=* Defer call Defer(s:expand(<q-args>))
comm -complete=shellcmd -nargs=* DeferEcho call Defer(s:expand(<q-args>), { result -> <SID>echo("Deferred job completed (".(result['tend']-result['tstart'])."s): ".s:expand(<q-args>)) }, { result -> <SID>echo("Deferred job errored with ".result['code']." (".(result['tend']-result['tstart'])."s): ".s:expand(<q-args>), 'WarningMsg') }) comm -complete=shellcmd -nargs=* DeferEcho call Defer(s:expand(<q-args>), { result -> <SID>echo("Deferred job completed (".(result['tend']-result['tstart'])."s): ".s:expand(<q-args>)) }, { result -> <SID>echo("Deferred job errored with ".result['code']." (".(result['tend']-result['tstart'])."s): ".s:expand(<q-args>), 'WarningMsg') })
comm -complete=shellcmd -nargs=* DeferNotify call Defer(s:expand(<q-args>), { result -> <SID>notify("Deferred job completed (".(result['tend']-result['tstart'])."s):\n$ ".s:expand(<q-args>)) }, { result -> <SID>notify("Deferred job errored with ".result['code']." (".(result['tend']-result['tstart'])."s):\n$ ".s:expand(<q-args>)) }) comm -complete=shellcmd -nargs=* DeferNotify call Defer(s:expand(<q-args>), { result -> <SID>notify("Deferred job completed (".(result['tend']-result['tstart'])."s):\n$ ".s:expand(<q-args>)) }, { result -> <SID>notify("Deferred job errored with ".result['code']." (".(result['tend']-result['tstart'])."s):\n$ ".s:expand(<q-args>)) })
comm -complete=shellcmd -nargs=* DeferScratch call Defer(s:expand(<q-args>), function("<SID>scratch"))
comm -complete=shellcmd -count=0 -nargs=* DeferBuffer call Defer(s:expand(<q-args>), { result -> <SID>replace(<count>, result['output']) }) comm -complete=shellcmd -count=0 -nargs=* DeferBuffer call Defer(s:expand(<q-args>), { result -> <SID>replace(<count>, result['output']) })

40
zshrc
View File

@ -18,10 +18,43 @@ setopt hist_ignore_space
bindkey -v bindkey -v
prompt='%F{blue}$(if [ "$RANGER_LEVEL" -gt 0 ]; then echo -ne "R."; fi)%(?.%F{green}.%F{red})λ%f ' which task > /dev/null && which jq > /dev/null
export PROMPT_full='%B%F{magenta}%n%F{blue}@%F{magenta}%m%b %F{magenta}%~ run_task_prompt=$?
task_prompt() {
if [ -z $run_task_prompt ]
then
tasks="$(task +ACTIVE export | jq -r '.[].description' | sed 's/^/‣ /')"
if [ -n "$tasks" ]
then
echo "\x1b[30m$tasks\n\x1b[0m"
fi
fi
}
which timew > /dev/null
run_timew_prompt=$?
timew_prompt() {
if [ -z $run_timew_prompt ]
then
if [ $(timew get dom.active) -eq "1" ]
then echo '\x1b[31m●\x1b[0m '
fi
fi
}
ranger_prompt() {
if [ -n "$RANGER_LEVEL" ]
then
for num in $(seq "$RANGER_LEVEL")
do echo -n »
done
fi
}
prompt='$(task_prompt)%(?.%F{green}.%F{red})λ%F{blue}$(ranger_prompt)%f '
export PROMPT_full='%F{red}$(timew_prompt)%B%F{magenta}%n%F{blue}@%F{magenta}%m%b %F{magenta}%~
'"$prompt" '"$prompt"
export PROMPT_gitlong='$(gitprompt && echo -ne " ")%F$(git log --oneline --no-decorate -1 2>/dev/null) export PROMPT_gitlong='%F{red}$(timew_prompt)$(gitprompt && echo -ne " ")%F$(git log --oneline --no-decorate -1 2>/dev/null)
%F{cyan}$(gitpath)'"$prompt" %F{cyan}$(gitpath)'"$prompt"
# export PS1tiny= # export PS1tiny=
# export PS1nano= # export PS1nano=
@ -47,6 +80,7 @@ prompt() {
} }
prompt $PROMPT_set prompt $PROMPT_set
source smartprompt
chpwd() { chpwd() {
source smartprompt source smartprompt
} }