Compare commits

..

7 Commits

Author SHA1 Message Date
Talia 67477adc1b Make :GitDiff vim command disable list 2023-10-24 16:45:58 +02:00
Talia ed3f9a26ec Remove broken GitCompare vim function
:GitDiff should be used instead
2023-10-24 16:44:17 +02:00
Talia 1545c6ad6a Disable conflicting vim keybinding 2023-10-16 16:41:47 +02:00
Talia b6d5a3423a Add vim Ctrl+J Ctrl+K in visual mode 2023-10-16 16:37:40 +02:00
Talia 29ad47e394 Make gfc ignore untracked files by default 2023-10-13 10:23:49 +02:00
Talia c7fa78c3a4 Make luapath script return the whole export
So it can now be called as $(luapath .) in the shell
2023-10-09 10:00:54 +02:00
Talia de09d79b1f Update prompt with task counter 2023-09-26 09:52:42 +02:00
8 changed files with 36 additions and 12 deletions

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
echo "$1/?.lua;$1/?/init.lua" echo 'export LUA_PATH="'"$1/?.lua;$1/?/init.lua;;"'"'

7
bin/xls2csv Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
for sheet in $(in2csv --names "$1")
do
basename=$(echo $1 | sed -e 's/\.[^\.]\+$//')
in2csv --sheet "$sheet" "$1" | csvformat -D \; > "$basename-$sheet.csv"
done

View File

@ -20,7 +20,8 @@
[alias] [alias]
adog = log --all --decorate --oneline --graph --date-order adog = log --all --decorate --oneline --graph --date-order
dog = log --decorate --oneline --graph --date-order dog = log --decorate --oneline --graph --date-order
fadd = "! git status --porcelain | sed 's/^...//' | fzf -m --layout=reverse-list | xargs --open-tty git add" fadd = "! git status --porcelain | sed -e '/^??/d' -e 's/^...//' | fzf -m --layout=reverse-list | xargs --open-tty git add"
faddall = "! git status --porcelain | sed 's/^...//' | fzf -m --layout=reverse-list | xargs --open-tty git add"
fixup = "!git commit --patch --no-edit --amend $(git diff --name-only HEAD~1..HEAD)" fixup = "!git commit --patch --no-edit --amend $(git diff --name-only HEAD~1..HEAD)"
h = log -1 --format=%h h = log -1 --format=%h
hash = log -1 --format=%H hash = log -1 --format=%H

View File

@ -24,17 +24,19 @@ pp() {
} }
gfc() { gfc() {
command="fadd"
unset patch unset patch
while test $# != 0 while test $# != 0
do do
case "$1" in case "$1" in
--patch | -p) patch="--patch" ;; --patch | -p) patch="--patch" ;;
--untracked | -u) command="faddall" ;;
--) shift; break ;; --) shift; break ;;
*) break ;; *) break ;;
esac esac
shift shift
done done
git fadd $patch && git commit $@ git $command $patch && git commit $@
} }
# Funny # Funny

View File

@ -11,7 +11,7 @@ return function(_, bufnr)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) --vim.keymap.set('v', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)

View File

@ -265,17 +265,12 @@ command! GitFirst call <sid>git_first() | call s:git_info()
command! GitLast call <sid>git_last() | call s:git_info() command! GitLast call <sid>git_last() | call s:git_info()
command! GitInfo call <sid>git_info() command! GitInfo call <sid>git_info()
command! -nargs=1 GitCheckout call <sid>file_at_revision(<f-args>) command! -nargs=1 GitCheckout call <sid>file_at_revision(<f-args>)
command! -nargs=? GitCompare try
\| call s:gitroot() | call <sid>git_diff(<f-args>)
\| catch
\| echo 'Not a git repo!'
\| endtry
command! GitRoot call <SID>cd_git_root('%') command! GitRoot call <SID>cd_git_root('%')
command! GitOrig exec 'e '.b:git_original_file command! GitOrig exec 'e '.b:git_original_file
command! ShowGitRoot try command! ShowGitRoot try
\| echo <sid>gitroot() \| echo <sid>gitroot()
\| catch | echo 'Not a git repository' \| catch | echo 'Not a git repository'
\| endtry \| endtry
command! GitDiff diffthis | vert bel split | exec "silent GitPrev" | diffthis command! GitDiff set nolist | diffthis | vert bel split | exec "silent GitPrev" | set nolist | diffthis
augroup END augroup END

View File

@ -529,6 +529,8 @@ exec 'noremap gk '.g:jmp_dist.'k'
nnoremap <C-k> ddkP nnoremap <C-k> ddkP
nnoremap <C-j> ddp nnoremap <C-j> ddp
vnoremap <C-k> :m '<-2<CR>gv
vnoremap <C-j> :m '>+1<CR>gv
nnoremap <C-h> b nnoremap <C-h> b
nnoremap <C-l> e nnoremap <C-l> e

21
zshrc
View File

@ -30,6 +30,23 @@ task_prompt() {
fi fi
fi fi
} }
due_soon_prompt() {
if [ $run_task_prompt -eq 0 ]
then
if [ "$(task +PENDING due.before:30min count)" -gt 0 ]; then
echo "%F{red}%B$(task +PENDING +DUE count)%b "; return
fi
if [ "$(task +PENDING due.before:1h count)" -gt 0 ]; then
echo "%F{yellow}%B$(task +PENDING +DUE count)%b "; return
fi
if [ "$(task +PENDING due.before:3h count)" -gt 0 ]; then
echo "%F{green}%B$(task +PENDING +DUE count)%b "; return
fi
if [ "$(task +PENDING due.before:tomorrow count)" -gt 0 ]; then
echo "%F{black}%B$(task +PENDING +DUE count)%b "; return
fi
fi
}
which timew > /dev/null which timew > /dev/null
run_timew_prompt=$? run_timew_prompt=$?
@ -52,9 +69,9 @@ ranger_prompt() {
} }
prompt='$(task_prompt)%(?.%F{green}.%F{red})λ%F{blue}$(ranger_prompt)%f ' prompt='$(task_prompt)%(?.%F{green}.%F{red})λ%F{blue}$(ranger_prompt)%f '
export PROMPT_full='$(timew_prompt)%B%F{magenta}%n%F{blue}@%F{magenta}%m%b %F{magenta}%~ export PROMPT_full='$(due_soon_prompt)%B%F{magenta}%n%F{blue}@%F{magenta}%m%b %F{magenta}%~
'"$prompt" '"$prompt"
export PROMPT_gitlong='%F{red}$(timew_prompt)$(gitprompt && echo -ne " ")%F$(git log --oneline --no-decorate -1 2>/dev/null) export PROMPT_gitlong='$(due_soon_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=