George Armhold
George Armhold

Reputation: 31064

Sublime Text 2: how to position cursor at begin/end of buffer?

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.

Upvotes: 40

Views: 20217

Answers (6)

Deepak Lamichhane
Deepak Lamichhane

Reputation: 22644

In windows you can use

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

Upvotes: 46

Ankur Agarwal
Ankur Agarwal

Reputation: 24768

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

Upvotes: 0

andrewchan2022
andrewchan2022

Reputation: 5300

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 } },

Upvotes: 17

Martijn Pieters
Martijn Pieters

Reputation: 1121962

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.

Upvotes: 56

rafayama
rafayama

Reputation: 7

See if this works

beginning » CMD + left arrow

end » CMD + Right arrow

Upvotes: -2

George Armhold
George Armhold

Reputation: 31064

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.

Upvotes: 0

Related Questions