CodeCabbie
CodeCabbie

Reputation: 3484

VSCode: Automatically open .html files in one window and .ts in the other

I'm writing Angular2 in VSCode. I split the editor window in two and keep all .html files on the right and all .ts files on the left.

It would be great to automate this, so that when I double click in the file browser the file is opened in the 'type appropriate' window split.

How can I configure or extend VSCode to do this?

enter image description here

Upvotes: 12

Views: 2717

Answers (4)

Saiteja Samala
Saiteja Samala

Reputation: 121

If are working on angular+.net core then below extension is must have to switch.

https://marketplace.visualstudio.com/items?itemName=adrianwilczynski.switcher

Upvotes: 0

Simon_Weaver
Simon_Weaver

Reputation: 146208

I couldn't live without the extension angular2-switcher which adds the following navigations

  • Alt + U - Go to .ts
  • Alt + I - Go to .css
  • Alt + O - Go to .html
  • Alt + P - Go to .spec.ts

* Hold Shift on mac

Hopefully someday it'll support split screen too

Upvotes: 11

RoundRock
RoundRock

Reputation: 31

You can link auto html opening for component ts file in the settings menu like this:

settings example

Upvotes: 1

alefragnani
alefragnani

Reputation: 3313

You can't do that today, unless you create a new extension.

But, with file-ext-switcher extension you can open the related file using a keybinding, which is great. It worth take a look.

Upvotes: 1

Related Questions