2

When I'm not in vim, how do I go to the beginning of a line in something like Firefox search bar or Google Docs with a keyboard shortcut? How would I replicate macOS's command + arrow keybind.

I'm in 20.04.

antoine
  • 147
  • 1
  • 6

2 Answers2

8

Generally use the Home key to move to the beginning of input field and End key to move to the end.

You can also use Ctrl + arrow key to move direction one word at a time. For example Ctrl + Left Arrow to move to previous word.

WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
  • It surprises me that there are still people unaware of this. These keys have been on keyboards for like 30 years, haven't they? To add to this answer: In case OP is using one of those compact keyboards without Home and End keys, he can still use Ctrl + UP and Ctrl + DOWN to go to the end and start of the textfield respectively. (Note that this only works on single-line textboxes and not multiline fields like the ones used on SO) – Opifex Sep 13 '21 at 10:32
  • @Opifex The OP knows how to do it on a MAC or VIM which I don't know how to. I couldn't find an on-line source in Ubuntu or Gnome for `Home` and `End` keys. Microsoft has on-line documentation that incorectly states `Home` moves to the end of the line: https://support.microsoft.com/en-us/windows/using-your-keyboard-18b2efc1-9e32-ba5a-0896-676f9f3b994f – WinEunuuchs2Unix Sep 13 '21 at 11:43
  • Ever wondered a lot of keyboards these days don't have a `home` and `end` key? You might wanna updated your answer referring this -> https://askubuntu.com/a/1363505/703469 – Daksh Gargas Jan 11 '23 at 05:43
1

In most applications you can use Emacs-style cursor motion commands:

  • beginning-of-line = Control-a
  • end-of-line = Control-e
Barmar
  • 241
  • 1
  • 7
  • Not only that -- you can also use system-wide tweaks for this to work by default in many places, e.g., https://askubuntu.com/questions/245746/emacs-like-keybindings-system-wide – phipsgabler Sep 13 '21 at 13:58