Exactly the way I use it. Intuitively this is how I was expecting it to work in the first place. I think this should be the new default, and the older version should be either added to the settings to enable or be mapped to a different shortcut. I'm sure 99% of developers will appreciate.
Yeah, but it's the little things that add up. Using keyboard shortcuts wherever possible rather than clicking with the mouse will greatly increase your efficiency.
It's not only about the time. It's just incredibly annoying to pick up the mouse and click on the button so many times a day. Having shortcuts for things that are used frequently is great.
I have been years using VS Code. But, I don't know that I can do create a file or even create a file inside folder even faster with this keybinding. Damn!
There is a way to always create the file on the root path of the project? Note: When you are on a file that it is inside of a directory, vs code, will try to create the new file inside of this directory
I have the file utils extension, so I use that, but if i’m using the native way, I just do ctrl n, type the name, ctrl s, enter, and delete the name. it’s faster than it sounds
You can also double click in the file hierarchy side panel in VS Code, name your file and hit enter. Bonus tip: If you want your file(s) in a folder, you can simply just write the name of the folder followed by a slash (this method can be used to dig into sub-folders, too) then followed by the file name plus extension at the very end, and VS Code will save it in that folder. If the folder(s) is/are yet to exist, it’ll create the folder(s) for you first and then save the file in the spot you specified.
You can use the shortcut in the video for folders as well. For example, if you want to create a folder named public with css in it, you can use the same shortcut and name the file public/style.css and it will create that folder with the file.
Exactly the way I use it. Intuitively this is how I was expecting it to work in the first place. I think this should be the new default, and the older version should be either added to the settings to enable or be mapped to a different shortcut. I'm sure 99% of developers will appreciate.
Sometimes you just want new file but not saved it. That's the default behavior of every text editor.
@@selimkaraca549 people seems to forgot that vscode is a text editor. Not an IDE.
exactly this way - this should be the default behavior
This saved me 150ms instead of clicking the new file button and now I’m a multi-billionaire.
😂 😂 😂 😂 😂
Yeah, but it's the little things that add up. Using keyboard shortcuts wherever possible rather than clicking with the mouse will greatly increase your efficiency.
@@selimkaraca549 not in this case.
per Day 30-40files -> right-hand way to the mouse is more than 150ms PLUS you need the way back to the keyboard!
It's not only about the time. It's just incredibly annoying to pick up the mouse and click on the button so many times a day. Having shortcuts for things that are used frequently is great.
Bonus tipp: if you add slashes in the name it will automatically add the folder hierarchy with it
OP tip
For those who don't like to click on the small new file icon, you can also click twice on the empty space on the files explorer panel.
Nice shortcut. A lot of times I want to create a new file for notes, scratch, etc that I don’t want to save into the current project.
really recommend obsidian for notes
@@8koi245 which is better, obsidian or notion
@@gjones4383 comparing apples or oranges
I do like this:
Open terminal and run the command: code
The file opens in the editor and just hit ctrl-S to save
But Ctrl+Shift+N opens a new Code instance!! I use that more often than creating new files via VS Code 😂
Thank you for this tip. The default behaviour is quite horrendous
Really nice. Keeps them coming
I did this at the very beginning
Another tip
Add a shortcut to create a new folder
I did this as ctrl + alt + l
I have been years using VS Code. But, I don't know that I can do create a file or even create a file inside folder even faster with this keybinding. Damn!
This is really useful!, thanks a lot.
There is even better way, just install the extension "advanced-new-file", It will give you option to choose path as well.
This is what I was looking for! Thanks!
Thanks buddy!!
Soooo useful!! Tyyyy
The only thing this cuts out is the ctrl-s/cmd-s shortcut. Are you so busy creating new files that this matters?
There is a way to always create the file on the root path of the project?
Note: When you are on a file that it is inside of a directory, vs code, will try to create the new file inside of this directory
What you ask is key and it makes the difference. I used to create files from root in JetBrains IDEs but I can't find a way to do the same with VSCode.
you could do ctrl + shift + e, esc, ctrl + n
great now I am around 100 file creations behind in time
Haha. Better late than never!
if i have to program tweak my ide like this i would have switched to neovim already
its so hard to just right-click on the file explorer and click "new file"
It's a mater of personal taste, I think. But imho the mouse way of doing takes some time and breaks ur mental flow
I have the file utils extension, so I use that, but if i’m using the native way, I just do ctrl n, type the name, ctrl s, enter, and delete the name. it’s faster than it sounds
This should be default behaviour
People created extensions for this and you destroyed them in 15 seconds. Thank you for video)
and how do i create that file in a specific folder?
Wow, thank you very much!
I use an extension named advanced new file, it finds the directory by fuzzy match and I can create folders as well
If @code are saying this why are you not just implementing this as default??
Thanks bro this trick save my lot of time 😊😊
Creating features for the sole purpose of creating features
What would you do for the amount of times you saved??
Or just do touch myfile.txt in the command line
Shift+Cmd+P (not N)
Thanks!!
I think you meant: "new files this way".
question: I added it... but still getting default action...
come on, Linus! you can code the feature in 10 sec.
@@kurdishfreeman7568 I followed the same steps… but keybinding not happening :(
@@linustorvalds306 sad :(
this is too simple to be made into a short haha
Or just use advanced-new-file extension that will create files anywhere in your workspace
Why on earth is this not the default? FUCK!
Nyc
Thanks bro
thanks
You can also double click in the file hierarchy side panel in VS Code, name your file and hit enter.
Bonus tip:
If you want your file(s) in a folder, you can simply just write the name of the folder followed by a slash (this method can be used to dig into sub-folders, too) then followed by the file name plus extension at the very end, and VS Code will save it in that folder. If the folder(s) is/are yet to exist, it’ll create the folder(s) for you first and then save the file in the spot you specified.
You da best!
How do I even get to command thing
Nice
how to add shortcut for new folder creation?
You can use the shortcut in the video for folders as well. For example, if you want to create a folder named public with css in it, you can use the same shortcut and name the file public/style.css and it will create that folder with the file.
What if your in react and need to switch .Dir before creating a file?
CTRL+SHIFT+E (focus explorer)
Arrow keys to move up/down or open/close directories
CTRL+N (new file)
💤
Or you just touch file.js. 🤷♂️
It couldn’t be any easier than that! Except that VS Code doesn’t work that way out of the box 😒 So typical of MS
Literally the only step he cut from his own list was the Ctrl+S to save. This is the dumbest tip ever
useful