init commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import csv
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from talon import Context, Module, actions, resource
|
||||
|
||||
mod = Module()
|
||||
ctx = Context()
|
||||
|
||||
mod.list("git_command", desc="Git commands.")
|
||||
mod.list("git_argument", desc="Command-line git options and arguments.")
|
||||
|
||||
|
||||
@mod.capture(rule="{user.git_argument}+")
|
||||
def git_arguments(m) -> str:
|
||||
"""A non-empty sequence of git command arguments, preceded by a space."""
|
||||
return " " + " ".join(m.git_argument_list)
|
||||
@@ -0,0 +1,51 @@
|
||||
tag: terminal
|
||||
and tag: user.git
|
||||
-
|
||||
git {user.git_command} [<user.git_arguments>]:
|
||||
args = git_arguments or ""
|
||||
"git {git_command}{args} "
|
||||
git commit [<user.git_arguments>] message [<user.prose>]:
|
||||
args = git_arguments or ""
|
||||
message = prose or ""
|
||||
user.insert_between('git commit{args} --message "{message}', '"')
|
||||
git stash [push] [<user.git_arguments>] message [<user.prose>]:
|
||||
args = git_arguments or ""
|
||||
message = prose or ""
|
||||
user.insert_between('git stash push{args} --message "{message}', '"')
|
||||
|
||||
# Optimistic execution for frequently used commands that are harmless (don't
|
||||
# change repository or index state).
|
||||
git status$: "git status\n"
|
||||
git add patch$: "git add --patch\n"
|
||||
git show head$: "git show HEAD\n"
|
||||
git diff$: "git diff\n"
|
||||
git diff (cached | cashed)$: "git diff --cached\n"
|
||||
|
||||
# Convenience
|
||||
git clone clipboard:
|
||||
insert("git clone ")
|
||||
edit.paste()
|
||||
key(enter)
|
||||
git diff highlighted:
|
||||
edit.copy()
|
||||
insert("git diff ")
|
||||
edit.paste()
|
||||
key(enter)
|
||||
git diff clipboard:
|
||||
insert("git diff ")
|
||||
edit.paste()
|
||||
key(enter)
|
||||
git add highlighted:
|
||||
edit.copy()
|
||||
insert("git add ")
|
||||
edit.paste()
|
||||
key(enter)
|
||||
git add clipboard:
|
||||
insert("git add ")
|
||||
edit.paste()
|
||||
key(enter)
|
||||
git commit highlighted:
|
||||
edit.copy()
|
||||
insert("git add ")
|
||||
edit.paste()
|
||||
insert("\ngit commit\n")
|
||||
@@ -0,0 +1,19 @@
|
||||
tag: terminal
|
||||
and tag: user.git
|
||||
title: /git add .*\-p/
|
||||
-
|
||||
yank:
|
||||
key(y)
|
||||
key(enter)
|
||||
near:
|
||||
key(n)
|
||||
key(enter)
|
||||
quench:
|
||||
key(q)
|
||||
key(enter)
|
||||
drum:
|
||||
key(d)
|
||||
key(enter)
|
||||
air:
|
||||
key(a)
|
||||
key(enter)
|
||||
@@ -0,0 +1,69 @@
|
||||
list: user.git_argument
|
||||
-
|
||||
abort: --abort
|
||||
all: --all
|
||||
allow empty: --allow-empty
|
||||
amend: --amend
|
||||
cached: --cached
|
||||
cashed: --cached
|
||||
color words: --color-words
|
||||
colour words: --color-words
|
||||
continue: --continue
|
||||
copy: --copy
|
||||
create: --create
|
||||
delete: --delete
|
||||
detach: --detach
|
||||
dir diff: --dir-diff
|
||||
directory diff: --dir-diff
|
||||
dry run: --dry-run
|
||||
edit: --edit
|
||||
fast forward only: --ff-only
|
||||
force: --force
|
||||
force create: --force-create
|
||||
force with lease: --force-with-lease
|
||||
global: --global
|
||||
global: --global
|
||||
hard: --hard
|
||||
ignore case: --ignore-case
|
||||
include untracked: --include-untracked
|
||||
interactive: --interactive
|
||||
keep index: --keep-index
|
||||
list: --list
|
||||
local: --local
|
||||
mixed: --mixed
|
||||
move: --move
|
||||
no edit: --no-edit
|
||||
no keep index: --no-keep-index
|
||||
no rebase: --no-rebase
|
||||
no track: --no-track
|
||||
no verify: --no-verify
|
||||
orphan: --orphan
|
||||
patch: --patch
|
||||
prune: --prune
|
||||
quiet: --quiet
|
||||
quit: --quit
|
||||
rebase: --rebase
|
||||
remote: --remote
|
||||
set up stream: --set-upstream
|
||||
set up stream to: --set-upstream-to
|
||||
short: --short
|
||||
short stat: --shortstat
|
||||
skip: --skip
|
||||
soft: --soft
|
||||
staged: --staged
|
||||
stat: --stat
|
||||
system: --system
|
||||
track: --track
|
||||
update: --update
|
||||
verbose: --verbose
|
||||
branch: -b
|
||||
combined: -c
|
||||
deep: -d
|
||||
very verbose: -vv
|
||||
HEAD
|
||||
main
|
||||
master
|
||||
origin
|
||||
upstream
|
||||
origin main: origin/main
|
||||
origin master: origin/master
|
||||
@@ -0,0 +1,71 @@
|
||||
list: user.git_command
|
||||
-
|
||||
add
|
||||
archive
|
||||
bisect
|
||||
blame
|
||||
branch
|
||||
checkout
|
||||
cherry pick: cherry-pick
|
||||
clean
|
||||
clone
|
||||
commit
|
||||
config
|
||||
diff
|
||||
diff tool: difftool
|
||||
fetch
|
||||
gc
|
||||
grep
|
||||
help
|
||||
in it: init
|
||||
log
|
||||
ls files: ls-files
|
||||
merge
|
||||
merge tool: mergetool
|
||||
move: mv
|
||||
pull
|
||||
push
|
||||
range diff: range-diff
|
||||
rebase
|
||||
ref log: reflog
|
||||
remote
|
||||
remote add
|
||||
remote remove
|
||||
remote rename
|
||||
remote set url: remote set-url
|
||||
remote set you are el: remote set-url
|
||||
remote show
|
||||
rerere
|
||||
rerere diff
|
||||
rerere status
|
||||
reset
|
||||
restore
|
||||
revert
|
||||
remove: rm
|
||||
short log: shortlog
|
||||
show
|
||||
sparse checkout: sparse-checkout
|
||||
stash
|
||||
stash apply
|
||||
stash list
|
||||
stash pop
|
||||
stash push
|
||||
stash show
|
||||
stash save
|
||||
status
|
||||
submodule
|
||||
submodule add
|
||||
submodule in it: submodule init
|
||||
submodule status
|
||||
submodule update
|
||||
switch
|
||||
tag
|
||||
worktree
|
||||
worktree add
|
||||
worktree list
|
||||
worktree lock
|
||||
worktree move
|
||||
worktree prune
|
||||
worktree remove
|
||||
worktree repair
|
||||
worktree unlock
|
||||
Reference in New Issue
Block a user