Skip to main content

I got confused with not being able to use the Home and End keys to move the cursor to the beginning and end of lines as the default functionality jumps to the beginning and end of the file. I missed this for quickly moving the cursor around, as well as selecting lines of code.

To fix this I added custom key bindings to my Sublime Text preferences.

Sublime Text Home/End keys default functionality jumps to the beginning and end of the file.

Fix Home and End keys to move the cursor to the beginning and end of lines.

Preferences > Key Bindings - User

If you don’t see Preferences menu, press ⌘ + ⇧ + P then search for Key Bindings:

Adding the following to the array:

{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }


You can now use the following combinations:

  • Go to beginning of line: Home
  • Go to end of line: End
  • Select from cursor position to beginning of line: ⇧ + Home
  • Select from the cursor position to end of line: ⇧ + End

Source: Fix Sublime Text Home and End key usage on Mac OSX

------Brings to you with ♥️ by vietnamtutor.com
Việt Nam Tutor

Xin chào, tôi là Anthony Nguyễn, một lập trình viên Full Stack với nhiều năm kinh nghiệm trong ngành công nghệ thông tin. Tôi tận dụng kiến thức và kỹ năng của mình để tạo ra các giải pháp công nghệ đột phá và đáp ứng những bài toán thách thức, phức tạp.Tôi luôn sẵn sàng để kết nối và học hỏi từ cộng đồng, cũng như chia sẻ những kiến thức và thông tin hữu ích. Với tôi, việc xây dựng kiến thức là như xây dựng một tòa nhà - cần có sự kiên nhẫn, kiến thức vững chắc, và sự cống hiến để tạo nên sự thành công.Nếu bạn có câu hỏi, ý kiến, hoặc muốn kết nối với tôi để thảo luận về công nghệ, đừng ngần ngại liên hệ tôi. Rất mong được nhận gạch đá từ các bạn!

Leave a Reply