Skip to content

Commit

Permalink
feat: modify repo filter to prepend instead of replace
Browse files Browse the repository at this point in the history
update deps in .pre-commit-config.yaml
  • Loading branch information
LangLangBart committed Dec 14, 2024
1 parent 80eac30 commit 543b3d5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
rev: v1.28.3
hooks:
- id: typos
args: [--format, brief, --write-changes, --force-exclude]
- repo: https://github.com/tcort/markdown-link-check
rev: v3.12.2
rev: v3.13.6
hooks:
- id: markdown-link-check
name: markdown link check
Expand All @@ -23,7 +23,7 @@ repos:
- id: shellcheck
args: [--external-source, --norc]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.9.0-1
rev: v3.10.0-2
hooks:
- id: shfmt
args: [--simplify, --indent, '0', --case-indent, --write]
Expand All @@ -32,7 +32,7 @@ repos:
hooks:
- id: yamlfix
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
rev: v1.28.3
hooks:
- id: typos
name: detect typos in commit message
Expand All @@ -46,7 +46,7 @@ repos:
args: [--ignore, body-is-missing, --msg-filename]
stages: [commit-msg]
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.1
rev: v4.1.0
hooks:
- id: commitizen
name: check commit message structure
Expand Down
6 changes: 3 additions & 3 deletions gh-find-code
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ ${WHITE_BOLD}Hotkeys${COLOR_RESET}
${GREEN_NORMAL}? ${COLOR_RESET} toggle help
${GREEN_NORMAL}${GHFC_OPEN_BROWSER_KEY} ${COLOR_RESET} open the file in the browser
${GREEN_NORMAL}${GHFC_OPEN_EDITOR_KEY} ${COLOR_RESET} open the file content in the editor
${GREEN_NORMAL}${GHFC_FILTER_BY_REPO_KEY} ${COLOR_RESET} replace query with "repo:owner/name"
${GREEN_NORMAL}${GHFC_FILTER_BY_REPO_KEY} ${COLOR_RESET} prepend "repo:{owner/name}" to the query
${GREEN_NORMAL}${GHFC_RELOAD_KEY} ${COLOR_RESET} reload with up to 100 results
${GREEN_NORMAL}${GHFC_TOGGLE_HISTORY_KEY}${COLOR_RESET} toggle command history
${GREEN_NORMAL}${GHFC_TOGGLE_FUZZY_SEARCH_KEY} ${COLOR_RESET} toggle between Code and Fuzzy search
Expand Down Expand Up @@ -1015,7 +1015,7 @@ main() {
# solution is needed to address this complexity.
fzf_basic_style \
--bind "change:first+reload:command sleep 0.5; gh_query" \
--bind "resize:transform:preview_transformer" \
--bind "resize:transform(preview_transformer)+refresh-preview" \
--bind "start:reload:gh_query" \
--bind "?:transform:[[ ! \$FZF_PROMPT =~ \"$fzf_prompt_helpABC\" ]] &&
echo 'change-prompt($fzf_prompt_helpABC)+change-preview-window(~0:+1)+change-preview:print_help_text' ||
Expand All @@ -1024,7 +1024,7 @@ main() {
--bind "${GHFC_OPEN_EDITOR_KEY}:transform:[[ \$FZF_MATCH_COUNT -ge 1 && \${EDITOR##*/} =~ ^(code|codium)$ ]] &&
echo 'execute-silent:open_in_editor=true \view_contents \{}' ||
echo 'execute:open_in_editor=true \view_contents \{}'" \
--bind "${GHFC_FILTER_BY_REPO_KEY}:transform-query:echo repo:{4}" \
--bind "${GHFC_FILTER_BY_REPO_KEY}:transform-query:echo repo:{4} \$FZF_QUERY" \
--bind "${GHFC_RELOAD_KEY}:reload:gh_user_limit=100 gh_query" \
--bind "${GHFC_TOGGLE_HISTORY_KEY}:execute:view_history_commands" \
--bind "${GHFC_TOGGLE_FUZZY_SEARCH_KEY}:transform:[[ ! \$FZF_PROMPT == \"$fzf_prompt_fuzzyAB\" ]] &&
Expand Down
48 changes: 24 additions & 24 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ gh find-code [Flags] [Search query]
| `-l` | limit the number of listed results (default 30, max 100) |
| `-h` | help |

| Key Bindings fzf | Description |
| ------------------------------- | ------------------------------------ |
| <kbd>?</kbd> | toggle help |
| <kbd>ctrl</kbd><kbd>b</kbd> | open the file in the browser |
| <kbd>ctrl</kbd><kbd>o</kbd> | open the file content in the editor |
| <kbd>ctrl</kbd><kbd>p</kbd> | replace query with "repo:owner/name" |
| <kbd>ctrl</kbd><kbd>r</kbd> | reload with up to 100 results |
| <kbd>ctrl</kbd><kbd>space</kbd> | toggle command history |
| <kbd>ctrl</kbd><kbd>t</kbd> | toggle between Code and Fuzzy search |
| <kbd>ctrl</kbd><kbd>x</kbd> | open the search query in the browser |
| <kbd>enter</kbd> | open the file in the pager |
| <kbd>tab</kbd> | toggle the file preview |
| <kbd>esc</kbd> | quit |
| Key Bindings fzf | Description |
| ------------------------------- | ---------------------------------------- |
| <kbd>?</kbd> | toggle help |
| <kbd>ctrl</kbd><kbd>b</kbd> | open the file in the browser |
| <kbd>ctrl</kbd><kbd>o</kbd> | open the file content in the editor |
| <kbd>ctrl</kbd><kbd>p</kbd> | prepend "repo:{owner/name}" to the query |
| <kbd>ctrl</kbd><kbd>r</kbd> | reload with up to 100 results |
| <kbd>ctrl</kbd><kbd>space</kbd> | toggle command history |
| <kbd>ctrl</kbd><kbd>t</kbd> | toggle between Code and Fuzzy search |
| <kbd>ctrl</kbd><kbd>x</kbd> | open the search query in the browser |
| <kbd>enter</kbd> | open the file in the pager |
| <kbd>tab</kbd> | toggle the file preview |
| <kbd>esc</kbd> | quit |

---

Expand Down Expand Up @@ -114,17 +114,17 @@ GHFC_FILTER_BY_REPO_KEY="ctrl-u" gh find-code
> man fzf | less --pattern "AVAILABLE KEYS"
> ```
| Variable | Purpose | Default |
| ------------------------------ | ------------------------------------ | ------------ |
| `GHFC_OPEN_BROWSER_KEY` | open the file in the browser | `ctrl-b` |
| `GHFC_OPEN_EDITOR_KEY` | open the file content in the editor | `ctrl-o` |
| `GHFC_FILTER_BY_REPO_KEY` | replace query with "repo:owner/name" | `ctrl-p` |
| `GHFC_RELOAD_KEY` | reload with up to 100 results | `ctrl-r` |
| `GHFC_TOGGLE_HISTORY_KEY` | toggle command history | `ctrl-space` |
| `GHFC_TOGGLE_FUZZY_SEARCH_KEY` | toggle between Code and Fuzzy search | `ctrl-t` |
| `GHFC_OPEN_BROWSER_QUERY_KEY` | open the search query in the browser | `ctrl-x` |
| `GHFC_VIEW_CONTENTS_KEY` | open the file in the pager | `enter` |
| `GHFC_TOGGLE_PREVIEW_KEY` | toggle the file preview | `tab` |
| Variable | Purpose | Default |
| ------------------------------ | ---------------------------------------- | ------------ |
| `GHFC_OPEN_BROWSER_KEY` | open the file in the browser | `ctrl-b` |
| `GHFC_OPEN_EDITOR_KEY` | open the file content in the editor | `ctrl-o` |
| `GHFC_FILTER_BY_REPO_KEY` | prepend "repo:{owner/name}" to the query | `ctrl-p` |
| `GHFC_RELOAD_KEY` | reload with up to 100 results | `ctrl-r` |
| `GHFC_TOGGLE_HISTORY_KEY` | toggle command history | `ctrl-space` |
| `GHFC_TOGGLE_FUZZY_SEARCH_KEY` | toggle between Code and Fuzzy search | `ctrl-t` |
| `GHFC_OPEN_BROWSER_QUERY_KEY` | open the search query in the browser | `ctrl-x` |
| `GHFC_VIEW_CONTENTS_KEY` | open the file in the pager | `enter` |
| `GHFC_TOGGLE_PREVIEW_KEY` | toggle the file preview | `tab` |
---
Expand Down

0 comments on commit 543b3d5

Please sign in to comment.