convert lazygit function to widget
This commit is contained in:
parent
af3d3a6480
commit
e1fd61e0fa
|
@ -87,17 +87,13 @@ bindkey '^o' _lfcd
|
||||||
|
|
||||||
# bind lazygit to ctrl-g
|
# bind lazygit to ctrl-g
|
||||||
lg () {
|
lg () {
|
||||||
lazygit
|
[ ! -d "$(pwd)/.git" ] && [[ $(read -ek "?Not in a git repository. Create a new git repository? (y/n): ") =~ ^[Yy]$ ]] && git init
|
||||||
tput cuu1;tput el
|
[ -d "$(pwd)/.git" ] && lazygit -p $(pwd)
|
||||||
|
zle reset-prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
_lazygit () {
|
zle -N lg{,}
|
||||||
BUFFER="lg"
|
bindkey '^g' lg
|
||||||
zle accept-line
|
|
||||||
}
|
|
||||||
|
|
||||||
zle -N _lazygit
|
|
||||||
bindkey '^g' _lazygit
|
|
||||||
|
|
||||||
# Edit line in vim with ctrl-e:
|
# Edit line in vim with ctrl-e:
|
||||||
autoload edit-command-line; zle -N edit-command-line
|
autoload edit-command-line; zle -N edit-command-line
|
||||||
|
|
Loading…
Reference in New Issue