Sublime Forum

Couple of simple questions, but Idk... lol

#1

Hi,

I have a couple of probably more than simple questions for you guys. But I am not exactly sure how to go about figuring them out. I would greatly appreciate any help you can provide.

  1. Say I have a file open, just for example say I have a file named “style.css” currently open, and say I want to open another file named “app.css” how would I make it so that “app.css” file opens in the already opened Sublime text editor? As of now, it opens an entirely new Sublime text editor. I just want a newly opened file to open in an already running sublime text editor as a new tab. Like google chrome for example.
    “I probably way over explained that question lol, sorry.”

  2. How do I create a Hotkey for the View option Word Wrap?

Thank you all,
Jon

0 Likes

#2

Welcome to the community!

I’m not sure about the answer to your first question without knowing what operating system you’re running Sublime with. As far as I know it works the way you want it right out of the box, but I’ve only ever started it that way on Windows, so I don’t know if that is the case for the other supported operating systems.

For your second question, the steps to do that would be:

  1. Use the Preferences > Key Bindings - User menu item to open up the file that stores your own personal keyboard bindings (under MacOS the Preferences menu is under the Sublime Text part of the menu bar).
  2. Add text like the following to it. The text below shows what the file should look like if this is the only custom key binding in it. If you already have some other key bindings, then you want to pull just the line with the key binding out and paste it into your current file (remember that all of the bindings need to be separated with a comma).
[
    { "keys": ["shift+ctrl+alt+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
]

Of course, you would probably pick your own key combination to do this. :wink:

As a side effect of this, the menu option for View > Word Wrap will automatically show you the key combination you set, to remind you what it is.

1 Like

#3
  1. Are you using a Mac by any chance? It looks like there is a default preference that applies only on OSX: "open_files_in_new_window": true,. Setting this to false in your user preferences should ensure that files are opened in a new tab in the same window.
  2. You need to create a keybinding for the toggle_setting command, with arguments: {"setting": "word_wrap"}. Key bindings are defined in JSON format in the Preferences menu -> Key Bindings - User file. You can check the Key Bindings - Default file for examples.
1 Like