简体   繁体   English

Sublime Text 2:如何将光标定位在缓冲区的开始/结尾?

[英]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: 我已经用Google搜索了很多,并且检查了Default(OSX).sublime-keymap文件,但是我不知道:

How can I make the cursor jump to the beginning/end of the current buffer in Sublime2 on OSX? 如何使光标跳到OSX上Sublime2中当前缓冲区的开始/结尾?

Home/End scroll to the top/bottom respectively, but they do not position the cursor at the begin/end of the buffer. Home / End分别滚动到顶部/底部,但是它们不会将光标定位在缓冲区的开始/结尾。

Surely there is a way to do this. 当然,有一种方法可以做到这一点。 Some apps (eg Intellij) use CMD+Home/End for this, but that doesn't work either. 某些应用程序(例如Intellij)为此使用CMD + Home / End,但这也不起作用。

These work for me (Sublime Text 2 v2.0.1 on OS X 10.7.5) 这些对我有用(OS X 10.7.5上的Sublime Text 2 v2.0.1)

  • ⌘-↑ : 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. CMD上和下组合键是移动到OS X上文本缓冲区的开始和结束的默认快捷方式。例如,它们在Safari文本区域中也起作用。 As such, they are not listed in the keymap file. 因此,它们不会在键盘映射文件中列出。

In windows you can use 在Windows中,您可以使用

Ctrl + Home -> to the beginning of the file Ctrl + Home- >到文件的开头
Ctrl + End -> to the end of the file Ctrl + End- >到文件末尾

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

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. 一种“几乎”的解决方案:按照标准的OSX键盘绑定, shift + home/end将光标从当前位置移动到home/end ,并在中间选择文本。 A side effect of this is that the cursor is positioned at home/end . 这样做的副作用是光标位于home/end

I would still like to know how to do this without selecting the intermediate text. 我仍然想知道如何在不选择中间文本的情况下执行此操作。

Darwin abcmacbook.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:06 PDT 2015; Darwin abcmacbook.local 14.3.0 Darwin Kernel版本14.3.0:2015年3月23日星期一13:59:06 PDT; root:xnu-2782.20.48~5/DEVELOPMENT_X86_64 x86_64 根目录:xnu-2782.20.48〜5 / DEVELOPMENT_X86_64 x86_64

OSX Yosemite Version: 10.10.3 (14D136) OSX优胜美地版本:10.10.3(14D136)

In Sublime Text Stable Channel build 3083: 在Sublime Text稳定频道版本3083中:

Command + down arrow takes me to end of buffer Command +向下箭头将我带到缓冲区结尾

Command + up arrow takes me to beginning of buffer Command +向上箭头将我带到缓冲区的开始

See if this works 看看是否可行

beginning » CMD + left arrow 开始»CMD +左箭头

end » CMD + Right arrow 结束»CMD +右箭头

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Visual Studio Code 中将 cursor 跳转到文本选择的开头或结尾? - How to jump the cursor to beginning or end of a text selection in Visual Studio Code? Sublime Text:如何设置行首/行尾快捷方式以匹配 shell? - Sublime Text: How to set up begining of line/end of line shortcuts to match the shell? 如何在崇高文本2中录制宏? - How to record a macro in sublime text 2? 如何在Mac OS X上找到当前聚焦的文本可编辑元素的光标位置? - How to find cursor position of a currently focused text editable element on Mac OS X? 如何在Mac OSX应用程序(如OSK)上的另一个应用程序的光标位置插入文本? - How to insert text at cursor position of another application on Mac OSX Application (like OSK)? 如何将插入符号(光标)移动到可可中的行尾 - How to move caret (cursor) to the end of the line in cocoa 如何在Github中存储Sublime Text首选项 - How to store Sublime Text preferences in Github 如何在Mac上的Sublime Text 2上运行C ++? - How to run C++ on sublime text 2 on a mac? 如何使用 sublime text mac OSX 构建 kivy - How to build kivy with sublime text mac OSX 如何阻止 Sublime Text 2 在启动时崩溃 - How to stop Sublime Text 2 crashing on startup
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM