• NostraDavid@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    The first two options (autocd and cdspell) have been a lifesaver in fixing my frustrations with the default bash settings (and even lets me stick with bash, instead of feeling I should move to zsh or any other shell.

    I can just type a foldername, tabcomplete it and press enter to go there. It’s great.

    # == shopts ==
    # https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
    shopt -s autocd         # cd into folder without cd, so 'dotfiles' will cd into the folder
    shopt -s cdspell        # attempt spelling correcting on folders
    shopt -s direxpand      # expand a partial dir name
    shopt -s checkjobs      # stop shell from exit when there's jobs running
    shopt -s dirspell       # attempt spelling correcting on folders
    shopt -s expand_aliases # aliases are expanded
    shopt -s histappend     # append to the history file, don't overwrite it
    shopt -s histreedit     # lets your re-edit old executed command
    shopt -s histverify     # I'm confused.
    shopt -s hostcomplete   # performs completion when a word contains an '@'
    shopt -s cmdhist        # save multiple-line command in single history entry
    shopt -u lithist        # multi-lines are saved with embedded newlines rather than semicolons; explictly unset
    shopt -s checkwinsize # update LINES and COLUMNS to fit output