function git_write_keyword --description 'Write git in terminal prompt' set -l cmd (commandline -po) set -l cursor (commandline -C) if test "$cmd[1]" != git commandline -C 0 commandline -i "git " commandline -C (math $cursor + 4) else commandline -r (string sub --start=5 (commandline -p)) commandline -C -- (math $cursor - 4) end end