Last active
December 23, 2025 19:52
-
-
Save Falconiere/98ff1afe1897147c39d71cf9825ba58d to your computer and use it in GitHub Desktop.
Fish shell config with macOS-style selection keybindings
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 backward-word-and-select | |
| if not set -q __fish_selecting | |
| set -g __fish_selecting 1 | |
| commandline -f begin-selection | |
| end | |
| commandline -f backward-word | |
| end |
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
| # Arrow keys (clears selection) | |
| bind \e\[C 'set -e __fish_selecting; commandline -f end-selection forward-char' | |
| bind \e\[D 'set -e __fish_selecting; commandline -f end-selection backward-char' | |
| # Ctrl+Arrow for word navigation (clears selection) | |
| bind \e\[1\;5C 'set -e __fish_selecting; commandline -f end-selection forward-word' | |
| bind \e\[1\;5D 'set -e __fish_selecting; commandline -f end-selection backward-word' | |
| # Cmd+Shift+Arrow for line selection | |
| bind \e\[1\;10C begin-selection end-of-line | |
| bind \e\[1\;10D begin-selection beginning-of-line | |
| # Option+Shift+Arrow for word selection | |
| bind \e\[1\;4C forward-word-and-select | |
| bind \e\[1\;4D backward-word-and-select | |
| # Delete selection with backspace/delete | |
| bind backspace 'set -e __fish_selecting; commandline -f kill-selection end-selection backward-delete-char' | |
| bind delete 'set -e __fish_selecting; commandline -f kill-selection end-selection delete-char' |
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 forward-word-and-select | |
| if not set -q __fish_selecting | |
| set -g __fish_selecting 1 | |
| commandline -f begin-selection | |
| end | |
| commandline -f forward-word | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment