40

I feel silly having to ask what seems like a basic question. I've Googled plenty, and I've examined the Default(OSX).sublime-keymap file, but I can't figure out:

How can I make the cursor jump to the beginning/end of the current buffer in Sublime2 on OSX?

Home/End scroll to the top/bottom respectively, but they do not position the cursor at the begin/end of the buffer.

Surely there is a way to do this. Some apps (e.g. Intellij) use CMD+Home/End for this, but that doesn't work either.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
George Armhold
  • 30,824
  • 50
  • 153
  • 232

6 Answers6

57

These work for me (Sublime Text 2 v2.0.1 on OS X 10.7.5)

  • ⌘-↑: start of buffer
  • ⌘-↓: end of buffer

The CMD-up and -down combos are the default shortcut for moving to the start and end of text buffers on OS X. They work in Safari text areas, too, for example. As such, they are not listed in the keymap file.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
46

In windows you can use

Ctrl + Home -> to the beginning of the file
Ctrl + End -> to the end of the file

Frank Tan
  • 4,234
  • 2
  • 19
  • 29
Deepak Lamichhane
  • 19,076
  • 4
  • 30
  • 42
  • 19
    Worked on Linux for me. @Jimbob, answers aren't just for the original person but for anyone else who might end up here via search, like me :D – MalcolmOcean Jan 30 '15 at 15:21
17

to customize short cut for "move to beginning of file" and "move to end of file"

{ "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof"} },
{ "keys": ["ctrl+end"], "command": "move_to", "args": {"to": "eof"} },
{ "keys": ["ctrl+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} },
{ "keys": ["ctrl+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true } },
andrewchan2022
  • 4,953
  • 45
  • 48
0

An "almost" solution: as per standard OSX keybindings, shift + home/end will move the cursor from the current position to home/end, and select the text in-between. A side effect of this is that the cursor is positioned at home/end.

I would still like to know how to do this without selecting the intermediate text.

George Armhold
  • 30,824
  • 50
  • 153
  • 232
0

Darwin abcmacbook.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:06 PDT 2015; root:xnu-2782.20.48~5/DEVELOPMENT_X86_64 x86_64

OSX Yosemite Version: 10.10.3 (14D136)

In Sublime Text Stable Channel build 3083:

Command + down arrow takes me to end of buffer

Command + up arrow takes me to beginning of buffer

Ankur Agarwal
  • 23,692
  • 41
  • 137
  • 208
-2

See if this works

beginning » CMD + left arrow

end » CMD + Right arrow

rafayama
  • 7
  • 2
  • 2
    Is this a guess, or based on actual knowledge/experience? Either a link to documentation, or a statement that it works for you with such-and-such a version/setup, would be very helpful. – Andrzej Doyle Oct 29 '12 at 17:52
  • 2
    Did you mean `up` and `down` instead? – Martijn Pieters Oct 29 '12 at 17:52
  • I was researching this, this morning actually... in my case I had the cursor in multiple lines and I needed to edit the beginning and the end of each line... works for me --Version 2.0.1 Mac OSX 10.7.3 – rafayama Oct 29 '12 at 19:28
  • On the Mac, Command + left arrow takes you to the beginning of the line and Command + right arrow to the end of the line. Command + up arrow seems to jump to the beginning of the file and Command + down arrow to the end of the file, but then I'm not sure if this differs in a huge file. – Roger_S Sep 12 '13 at 23:16