Aleksander Alekseev
Aleksander Alekseev

Reputation: 1894

Sublime Text 3: how to show line numbers and bookmarks in distraction free mode?

It's quite easy to show/hide tabs or minimap in distruction free mode using View menu (Alt+V) or Ctr+Shift+P. Is it possible to do the same for line numbers and bookmark arrows?

Or maybe center whole text in a fullscreen mode? It would have the same effect.

Upvotes: 25

Views: 26758

Answers (4)

Scott Martin
Scott Martin

Reputation: 1367

Following the comment on the question by Keith Hall, you can do it by creating a custom keybinding. Open Key Bindings from the Preferences menu and add the following to your user keymap.

[
    {
        "keys": [ "ctrl+k", "ctrl+l" ],
        "command": "toggle_setting",
        "args": { "setting": "line_numbers" }
    }
]

I chose ctrl-k, ctrl+l as the binding to match with the existing binding that hides the sidebar (ctrl-k, ctrl+b), but obviously it can be whatever you like. Search through the list of existing bindings to avoid a clash.

Upvotes: 5

Kiran K Telukunta
Kiran K Telukunta

Reputation: 2234

for line and column number open the setting file: (Preferences -> Settings-More -> Distraction Free-User)

{
    "line_numbers": true,
    "gutter": true,
    "column_number": true,
}

Upvotes: 2

Shulyk Volodymyr
Shulyk Volodymyr

Reputation: 795

It is not default behavior (keybinding). You can get line numbers, centering etc. only by modifying user config (Preferences -> Settings-More -> Distraction Free-User). Add for example this:

{
    "gutter": true,
    "line_numbers": true
}

to get line numbers.

P.S. I was also looking for some shortcut for this. No luck. This is the only way I found for now.

Upvotes: 43

Aleksander Alekseev
Aleksander Alekseev

Reputation: 1894

OK, here is a solution ( ~/.config/sublime-text-3/Packages/User/Preferences.sublime-settings ):

{
  "always_show_minimap_viewport": true,
  "draw_centered": true,
  "word_wrap": true,
  "wrap_width": 80,
  "font_size": 10,
  "rulers":
  [
    80
  ]
}

Upvotes: 0

Related Questions