Skip to content

Commit

Permalink
feat: set -ixon in shell config so we can use Ctrl+S search
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmkerr committed Jun 22, 2021
1 parent 8553e0a commit f865598
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions samples/dotfiles/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ VISUAL=vi
# done
# unset editor preferred_editors

# Allow us to use Ctrl+S to perform forward search, by disabling the start and
# stop output control signals, which are not needed on modern systems.
stty -ixon

# Set a shell option but don't fail if it doesn't exist!
safe_set() { shopt -s "$1" >/dev/null 2>&1 || true; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ In this method we specify an array of editors, go through each one, check to see

You'll notice that in the _~/effective-shell/dotfiles/shell.sh_ folder I `unset` every shell variable after I use it. This is just to clean up after myself and try to leave the environment as pristine as possible after sourcing the file.

Another useful option to set is `stty -ixon`:

```sh
# Allow us to use Ctrl+S to perform forward search, by disabling the start and
# stop output control signals, which are not needed on modern systems.
stty -ixon
```

This command tells the terminal driver that we don't need to control transmission with the Ctrl+Q and Ctrl+S commands, meaning we can instead use Ctrl+S to perform a forward search.

Now let's set some sensible settings for working with folders:

```sh
Expand Down

0 comments on commit f865598

Please sign in to comment.