I am using macOS Monterey 12.5 on M1 hardware. In case this can be relevant, I am using an American keyboard with Brazilian Portuguese (ABNT2) as input.

Also, I am using a cool software Karabiner Elements to configure my keybindings. I have made a special effort to create an Emacs UX in macOS. This is my config file.

In addition, I am using bash and this is my .bash_profile file:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

export TFR_RELEASE="xx-xx"
export TFR_DEV="xx-xx"

export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
export PATH="/usr/local/bin:$PATH"
eval "$(/opt/homebrew/bin/brew shellenv)"

When I am on the terminal, I can use commands such as C-a (beginning of line), C-k (kill line), C-f (character forward), C-b (character backward), and others such as C-u.

The point that really annoys me is that M-f and M-b to move around words do not work on the terminal. They do work in other parts, such as the bard address of browsers and, obviously, in Emacs.

M-f generates this (integral, apparently) "∫" character. And M-b generates this (unknowns named for me) "đ" character. Also, C-M-b and C-M-b do not work either to generate this movement around words. I believe they were the default on macOS to generate this movement.

Considering this and this question, I thought it would default to have M-f and M-b keybindings to move forward and backward around words.

How can I solve this?

  • 1
    There’s a lot going on here. If you make a brand new user account with zero modifications, are you able to sort out if Apple keybindings are in play? I would check zsh in addition to bash if possible.
    – bmike
    Commented Sep 4, 2022 at 2:57
  • 1
    bash uses readline. If you want certain keybindings, you need to configure them in ~/.inputrc. Commented Sep 4, 2022 at 14:42
  • I do not have such a file. Should I create one? Commented Sep 4, 2022 at 14:48
  • 1
    If you want to configure keybindings in bash, yes. Commented Sep 4, 2022 at 17:45


You must log in to answer this question.

Browse other questions tagged .