Это видео недоступно.
Сожалеем об этом.
Top 20 VS Code Shortcuts
HTML-код
- Опубликовано: 15 авг 2024
- In this video, we will look at 20 helpful shortcuts to improve your coding experience
James Q Quick RUclips:
/ jamesqquick
Auth0 RUclips:
/ @auth0
Timestamps:
0:00 - Intro
1:59 - Toggle Side Bar
2:32 - Toggle Built-in Terminal
3:03 - Open User Settings
3:45 - Quick Open a File
4:36 - Tab Through Open Files
5:32 - Move File to Split Windows
6:29 - Close File
6:52 - Search/Replace in File
7:56 - Global Search Replace
8:30 - Open Command Palette
9:16 - Toggle Comment a Line
10:14 - Navigating Text
11:25 - Copy, Cut, and Paste
12:27 - Duplicate Line
12:53 - Multiple Cursors
13:32 - Select Word
13:59 - Select All Instances of a Word
14:52 - Rename Symbol
15:26 - Jump to Function Definition
15:57 - Zen Mode
1. Toggle sidebar: ctrl/cmd + B
2. Toggle Terminal: ctrl/cmd + `
3. Open settings: ctrl/cmd + ,
4. Quick open a file: ctrl/cmd + P
5. Tab through open files: ctrl + tab
6. Move file to split window: Ctrl/cmd + \
7. Close file: Ctrl/cmd + W
8. Search/Replace file: Ctrl/cmd + F
9. Global search/ Replace: Ctrl/cmd + Shift + F
10. Open command pallete: Ctrl/cmd + Shift + P
11. Toggle comments: Ctrl/cmd + /
12. Navigate Text: Hold down alt/ctrl
13. Copy, cut and paste: ctrl+c, ctrl+v, ctrl+x (for a whole line, just keep the cursor on the line)
14. Duplicate line: Shift+option+up/down; Shift+alt+up/down
15. Mutiple cursors: Ctrl+cmd + click
16. Select word: Ctrl/cmd + D
17. Select all instance of a selected word: Ctrl/cmd + Shift + L
18. Rename symbol: F2
19. Jump to funciton defination: ctrl/cmd + click
20. Zen mode: ctl/cmd + K Z
Thank me later 😎
Thanks man, You saved 17 minutes from my life ;)
Good work
6 should be
Ctrl/cmd + \
TYSM !!! :)
@@jooblets Thanks, updated!
My favorite short cut is Alt + F4 and go to sleep when I break my head after hours of debugging...💖
lol
lmao xD
Imao 😃
My man
Every day of my coding life. A year of confusion.
1:59 Toggle Side Bar = CTRL + B
2:32 Toggle Built-in Terminal = CTRL + `
3:03 Open User Settings = CTRL + ,
3:45 Quick Open a File = CTRL + P
4:36 Tab Through Open Files = CTRL + Tab
5:32 Move File to Split Windows = CTRL + \
6:29 Close File = CTRL + W
6:52 Search/Replace in File = CTRL + F
7:56 Global Search Replace = CTRL + SHIFT + F
8:30 Open Command Palette = CTRL + SHIFT + P
9:16 Toggle Comment a Line = CTRL + /
10:14 Navigating Text = Hold down ALT when moving left and right through text to move faster
11:25 Copy, Cut, and Paste
12:27 Duplicate Line = SHIFT + ALT + UP/DOWN
12:53 Multiple Cursors = CTRL + CLICK
13:32 Select Word = CTRL + D
13:59 Select All Instances of a Word = CTRL + SHIFT + L
14:52 Rename Symbol = F2
15:26 Jump to Function Definition = CTRL + CLICK
15:57 Zen Mode = CTRL + K Z
For Mac, replace CTRL with CMD and ALT with OPTION
Thanks so much, I will add to the description for click points as well :)
Using the Visual Studio keyboard extension I like using Ctrl + d to duplicate current line, then alt+up/down to move lines. Sometimes for configuration changes I move lines up/down out of code blocks.
@@AdamsTaiwan what doest CTRL + CLICK?what buttom is click in kebord?
Bro, how to make the go back button in VSCode, please?
ALT + UP or DOWN. It moves a line of code. It's really useful. Thanks James :) don't stop making videos
how do you move multiple lines up or down?
@@jumbo999614 just select the nos of line uh wanna shift and then operate same with Alt+ up or down
i like it
Another great one is Alt+Shift+Right / Left to expand / shrink the selection _as code_ instead of as text. For instance in JS, if the cursor is in the middle of a parameter of a function, repeatedly hitting Alt+Shift+Right will expand the selection to: the parameter, all parameters, the function signature, the function definition, the parent scope, etc. Alt+Shift+Left will go in the reverse order. This also works in JSON, HTML, CSS, and any language it understands.
Cool, this is called smart selection, similar to Ctrl+W in intelij
Thanks for your great sort of info.
If you want to switch quickly between code (working space ) and terminal follow (in Ubuntu):
1. ctrl+shift+p
2. type/choose: open keyboard shortcuts (JSON)
3. open this JSON
4. paste and save below text
keybindings.json
[
// Toggle between terminal and editor focus
{ "key": "ctrl+shift+t", "command": "workbench.action.terminal.focus"},
{ "key": "ctrl+shift+t", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"}
]
Using CTRL+SHIFT+t we can switch between code (working space ) and terminal
Not mean to brag, but knew everything here (hoping to learn more)... And I think it's because many of these are just normal OS shortcuts... Close file, Search, Toggle comment, Navigating text, copy, cut, paste! Come on... But I DO think the other ones are very useful. And many people won't know about them, so good job for newbies in VSCode/Sublime
**My MOST used shortcuts are:**
- CTRL+R and type function name, it will only display list of functions, classes in that document,
- CTRL+P (open file in project by name),
- CTRL+SHIFT+F to find all occurances of text (can be filtered to exclude some types of folders/files),
- CTRL+SHIFT+P command pallet,
- CTRL+D like every minute, all the time,
- - - I like it with connection CTRL+D (select), CTRL+F (predefined selected), ALT+ENTER (select ALL in document) then I begin to write.
- CTRL+SHIFT+UP / DOWN to move lines UP or DOWN,
- CTRL+SHIFT+D to duplicate line,
- CTRL+SHIFT+K to delete a line where I have cursor (don't have to be selected, just cursor anywhere),
- F5 build and run,
- F10, F11 in Debugging to go line by line,
- SHIFT+F5 to stop debugging,
- CTRL+SHIFT+L after selecting multiple lines to split selections on each line,
- CTRL+K U to do UPPERCASE on selected words,
- CTRL+K L to LOWERCASE,
- CTRL+SHIFT+T to reopen closed file,
well, that's about it.
There is an alternative shortcut for 5:55 : ctrl+alt+left/right 😁
Thank you so much for this tutorial!
Love, love this.. I need to watch this a few dozen times to get everything down. But I'm definitely going to do my best to internalize everything from this video. Thank you so much
Some of my favorites:
Ctrl+Shift+K -> Removes one line or multiple selected lines. You don't have to select everything in the lines, just make sure your selection is in the lines that you want to remove. I usually pair this shortcut with Shift+Up/Down to select the lines I want to remove.
Alt+Up/Down -> Moves one line or multiple selected lines up or down. Just like the shortcut above, you don't have to select everything. Just make sure your selection is in the lines that you want to move. I also pair this shortcut with Shift+Up/Down to select the lines I want to move. It sometimes breaks the indentation of the moved lines so make sure you have a code formatter (e.g. Prettier) ready.
15:40 You can actually go to the function definition by just hitting F12
And Shift+F12 for the reverse; it finds all references to a function
I love Vim. It isn't nearly as hard as seemingly everybody says. Just pick up the basics first and you can slowly improve your skills as you go. You don't need to master it to really see improvements in your workflow. With that said, the sooner you start that journey the sooner you'll be thanking yourself and wondering why you let yourself be so intimidated by it.
Hi, do you use pure vim or VS code with vim extension?
Just wanted to add one: Ctrl/Cmd + Shift + K deletes the line you are currently at. Please note that the same can be done by Ctrl/Cmd + X as well but if you don't want to clutter your clipboard like me, you can use this.
Not the episode we searched for, but the episode we needed
haha that's cool to hear!
Learnt a lot of short cuts.
Thank you
Ctrl + shift + 5 = split new terminal window
Ctrl + k (release) + s = save all tabs. Thing trick works for other similar shortcut to do on multiple tabs.
Moving through your open tabs, CTRL + TAB works but it's easier to use ALT + LEFT/RIGHT
To select current word is CTRL + D, but to select subsequent same words just hit CTRL + D again. This is very handy because you often don't want to select all occurrences.
CTRL + D is wonderful for editing as you can jump to a word with CTRL + LEFT/RIGHT then select it with CTRL + D and start typing your replacement.
my favorite one... thanks
I hope 2021 roadmap is coming soon ❤️
Road map to hell, ya
@@dgcp354 oh we all already know that
@@greenshaheen6716 lets survive 2020 and then worry about 2021
@@dgcp354 ok so this rule also apply on a day first survive a day then think about tomorrow. Come on man. Do u only buy food or cloths for only one day ?
I have started it. It probably won't be ready until around Christmas time
Thanks for the reminders! May I add that for 20., to not get stuck with Zen mode --> ESC twice...
ctrl/cmd + Z (undo) Always useful :)
And ctrl/ cmd + y to redo
Thanks for this video! Learned some new shortcuts. I also like Command + K to clear the terminal
ohh nice one!
great review of common shortcut of VSCode ... It is my go-to editor tool on daily basis ....
Awesome videos brother 👍 Keep 'em comin ;)
Zen mode is amazing! I I came to this video because I want to figure out how to navigate text better like I want to be able to go down 10 lines at a time. Jumping around lines is still kind of difficult for me.
ctrl + up or down to swap lines with line above or below.
ctrl + k to delete a line.
shift + home or end to select upto front or end of line.
ctrl shift + left or right to select a word.
Nice share!
*I also set up to toggle btw code window and terminal by ctr+g,ctrl+h*
that's hell lot useful
highly agree with you brother
It's pretty mind blowing just how much time keyboard shortcuts can save you, like you said, it can save you hours when you add it up over the course of a year or something, pretty crazy when you think about it
for fast replacing all instances of a word after selecting it hit Alt + enter, VSC will select all instances and put a curser after each instance
he: "by using only your keyboard, you will become very efficient and can save up to hours a year"
me: opening reddit and youtube only using my keyboard.
Ctrl 1 or Ctrl 2 or so on for switching panes is one I use a lot too. And ctrl alt 1,2,3... for switching terminals.
This was a great collection. I use almost all of all of them. Ctrl D was one I wasn't aware of ... Its super useful.
this is just what I needed.....will help tremendously....awesome! 👍
On Mac:
option + up arrow key - will move a line of code up one line
option + down arrow key - moves a line of code down one line
This shortcut never fails to impress me even when I don't need to use it :)
I'm kinda new to development and stuffs, but I also fond of shortcuts, I knew almost all shortcuts. Btw nice video
while your cursor is touching a word, you can press ctrl+d to select it, and if you press it again, you also select the next one with a cursor so you can edit both at the same time, and if you press it multiple times, it will select the next instance of that word... but I would love to know how to select the previous word
and if you are highlighting a word, and you press ctrl+k+d (first ctrl, then k, then d) it will jump to the next instance of that word without multiplying the cursor. I would also love how to get to the previous.
Not sure there is a way to do reverse ctrl k d but you can do the other one. Its just not bound to a key by default. The bind command is Add Selection to Previous Find Match.
thanks alot brad and james, u guys are a great help!
My favorite shortcut it ctrl+shift .
It’s really amazing
What is that for?
@@JamesQQuick honestly I don’t know how to explain, basically it take you from .class to another
ctrl + shift . Press bottom and up arrow ⬆️
Awesome, I've been waiting for a video like this
You can also Tab Through Files with Ctrl + pg up/down or Cmd + pg up/down
One thing you did miss is emmet! It is not VScode specific but it is a must to include in any 'Keyboard tricks video'
haha fair enough. It's in its own category in my mind but I agree, it's amazing!
ctrl + K + D = compare current file to saved.
For my productivity as a new developer and thanks to Traversy Media
I love using shortcuts in VS Code, but in my opinion one of the best things in there are user snippets. You can write code so much faster when you can write long blocks of code just with a shortcut.
Snippets for everything except HTML, use emmet there. The other thing i'd recommend giving the TabNine extension a look.
@@marble_wraith Yeah I use TabNine as well
Great james , but you should've put those shortcuts in a text file and probably you should've put it in the description.
thx for the video! Really appreciate about zen mode, replace with ctrl+h, and more tips )
James again here on Brad's channel! VS Code shortcuts 😮WOW
Yaa!
James this video is really great no complaints but one suggestion that from next time filming these kinds of video please use key stroke capture plugin/software so that the experience will be great..
I've experimented with that before and gotten mixed results. Thanks for the feedback though!
@@JamesQQuick thanks for reverting. I highly appreciate it 😊
6:00 It's really great that the file stays open on the other pane, for example when working with Vue, on one file you have access to the template and then the script on the other.
thanks great video!
or any ways we can move cursor more widely like jump to the middle of the code or something?
I needed this video, shortcuts are the best.
Hope it helped!
When navigating tabs there's actually another convenient way to do this by Command/Ctrl + Option/Alt + Left/Right Arrow
If I didn't watch this tutorial, I would regret this!!
Multiple cursors is Alt+click
I really love VS Code, now I love it more
Glad to hear it!
Thank you❤️
thanks for the content . and sorry if i ask you this question what is the project that you are working on with react i think it's a really big project
How do you delete the rest of the word, meaning from the cursor to the end of the word?
Awesome video. Extremely helpful and detailed! 🙏🏼
super helpful
i have one question .how i can manage same time by shortcat when I write my code vscode more div
?
I am curious how much time you spend coding in Zen Mode?
Good one James 👍🏾
Thanks a lot
Thanks man , useful 🙏
my javaScript does not working console is running but Dom is not working what should I do?please give a solutio
Gold, thank you!
great video even tough a lot of windows shortcuts are not exact
It's more convenient to use Vim extension or Visual Studio shortcuts?
are equally fast during development?
put the paper in the basket, i meant thank you very much for making this interesting video keep going sir.
I'm surprised you didn't mention how Ctrl + D also is used to select the next instance of whatever's highlighted.
Nice one. The multiple cursor doesn't work on my Opensuse, but on my other computer with Fedora it actually does 😵
try alt
Thanks , very useful.
How to make the go back button in VSCode, please?
Thank you so much!!!!!! It really motivates us to meet with new developers all around the world. This Traversy Media Channel is just out of this world......🥰💻🖥🖱⌨❣
which extension you're using for vs code terminal that highlights folders and branch-name?
soo helpful. thank you.
what about going from top to bottom of scope with like cntrl alt \ or something. or the highlight text and cntl c for commenting? even alt down is ok
🌟thanks man
epic thanks dude
Hey mate! Thanks for the tips! What is the name of the font used in this tutorial! It looks awesome
Awesome man thanks 😊🥰
Hey ,I am using vscode with integrated git bash .Now i want to use mingw but there is a problem in program compilation . I can run the code powershell but I want to run code with git in vscode. So can you provide any solution regarding this.
Thanks for the video man, btw what font do you use? Looks awesome.
UPD: Found at 3:23, Cascadia code. :)
Yep that's right :)
thanks very helpful.
A video I didn't know I needed.
Indubitably 💯.. me either
haha glad to hear it!
ctrl+shift+? to comment the code
I love "Ctrl + Shift + o"
13:20 You could want to give a class to each of the li's instead of change it to a p tag, it's more reasonable, furthermore, it helps a lot to make things quick :P
Please make a video on atom editor shortcuts
To move a line/selection: Alt + up/down in windows
My most useful shortcut 😅
Yes, that's a great one!
My thing is that when I write an element it always puts the ending element too, then i have to arrow over to delete it - or copy and paste, etc. Thanks for the helpful video.
On windows:
SHIFT + Suppr (Delete) will cut the line your cursor is on and remove the empty line left off
Suppr ?
@@jahanzebawan1396 i guess with an english keyboard it must be 'del'
Great video for experts and noobies alike.
Glad you enjoyed it :)
Hey traversey! actually you'r bringing teachers/developers for demos which one we like we subsribe his /her youtube channels.
Do we have the duplicate line shortcut like in Intellij Ide?
Shift+Alt+Down arrow key
waited for a new video
Hi there, which extention do you use for your git?
Come on, Brad! Programmers need you to do more videos.