Last active
May 29, 2025 02:03
-
-
Save takoeight0821/1f54a5c1d5c53ae07ed792be9eae1dc6 to your computer and use it in GitHub Desktop.
ripgrepの結果を下にVSCodeを開くコマンドと、shift shiftでターミナルにフォーカスするショートカット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fzf-code() { | |
| local file | |
| local line | |
| local query="${LBUFFER:-.}" | |
| read -r file line <<<"$(rg --no-heading --line-number $query | fzf -0 -1 | awk -F: '{print $1, $2}')" | |
| if [[ -n $file ]] | |
| then | |
| BUFFER="code --goto '$file:$line'" | |
| zle accept-line | |
| fi | |
| zle -R -c | |
| } | |
| zle -N fzf-code | |
| bindkey -M viins '^f' fzf-code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| { | |
| "key": "shift shift", | |
| "command": "terminal.focus", | |
| "when": "editorTextFocus" | |
| }, | |
| { | |
| "key": "shift shift", | |
| "command": "workbench.action.focusActiveEditorGroup", | |
| "when": "terminalFocus" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment