18

I've been searching the other posts for an answer to this but they all have been slightly different than what I am looking for.

I am used to developing in OS X where the simple keyboard shortcut Command+ goes to the end of line.

Is there a way to wire up this command on Ubuntu? I have a Mac Book with Ubuntu so I don't have an End key.

I've tried the Custom Shortcuts in the Keyboard settings but can't get the command to work for end of line.

Any suggestions?

4 Answers 4

11
  1. Install xdotool : sudo apt-get install xdotool
  2. Go to system connections -> keyboard -> shortcuts -> custom
  3. Create new shortcut, binding bash -c "xdotool getactivewindow key End" command to some key combination
7
  • That is perfect, thank you! For a bonus, how could I do command shift right arrow to highlight to end of line?
    – tyelford
    Commented Apr 3, 2016 at 11:16
  • @tyelford sorry , i don't have a mac, what's the command +shift + right-arrow does ? Commented Apr 3, 2016 at 11:19
  • 1
    Ah . . . well , same idea, make a shortcut for it , but use xdotool getactivewindow key Shift+End as a comman. Also . . .try to get out of the Mac mode of thinking - there's no command key on Ubuntu. There is super key, which acts more like Window's key Commented Apr 3, 2016 at 11:26
  • 1
    Thank you again, I nearly had it but forgot the plus between the Shift and End. Yes I know the super key is like the windows key but that particular shortcut is so handy because my left thumb is can reach the super key perfectly.
    – tyelford
    Commented Apr 3, 2016 at 11:30
  • 1
    This is so true. I'm sorely missing Ctrl-A and Ctrl-E for Home and End. The home and end keys on a PC keyboard are placed too far away. You want these shortcuts immediately available whilst your typing code.
    – forgetso
    Commented Nov 22, 2018 at 11:26
11

On a Mac keyboard (running Ubuntu), the

function (fn) key + left/right arrow
key seems to be equivalent to the
command +left/right arrow
functionality seen native Mac environment.

3
  • Thanks! worked on my MacBook Pro running Lubuntu
    – Miguel
    Commented Sep 24, 2019 at 4:39
  • That also worked on my Dell Inspiron keyboard running Ubuntu. Commented Jul 2, 2020 at 2:03
  • Worked on RedHat accessed remotely using a Macbook Pro
    – irene
    Commented Jun 16, 2022 at 3:59
1

If you are using a mac keyboard, simply use function+left for home and function+right to end of the line. We don't need to install any other software.

0

On my keyboard (msi), function (fn) key + left/right arrow is used for changing the volume function (fn) key + Page Up/Page down (⇟/⇞) gets me to the beginning/end of line respec.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .