The most annoying thing about HTML.... #shorts Learn to code with VS Code: aka.ms/vscodelive/learn Download VS Code: aka.ms/vscodelive/download
Пікірлер: 1 200
@aguynamedandre3503 жыл бұрын
Bruh. I can’t freaking believe. You just added 7 more years to my lifespan.
@al-thaidi3 жыл бұрын
LOL
@chizuru19993 жыл бұрын
Bruh wtf 😂 I am assuming you are a free lancer? Cause no company uses "vscode" for development Lol
@masamaeda92173 жыл бұрын
@@chizuru1999 maybe not super old and bureaucratic companies. But most companies don’t impose an editor for you to use. Especially in web development.
@MM-vr8rj3 жыл бұрын
@@chizuru1999 what else lol
@chizuru19993 жыл бұрын
@@masamaeda9217 Whatever sails your boat or videos you watch on KZbin to learn. Reality is often different. 🤷♂️
@jeltehoekstra29523 жыл бұрын
There’s also a addon called “rainbow brackets” it gives brackets different colors based on how deep its nested
@Jakob3xD3 жыл бұрын
This
@chevycamaro-rp6tr3 жыл бұрын
Yay a fellow 🌈 brackets user!
@nomad42533 жыл бұрын
I’ll try it out. Thanks for this. Small visual aids help me out a lot
@avii___73 жыл бұрын
@@jeltehoekstra2952 😂
@redtaileddolphin18753 жыл бұрын
@@sem6045 straight up this comment would be positive somewhere like tumblr. my brain is so tuned to that site I saw gay brackets and was like hell yeah
@KinSlay13373 жыл бұрын
You can also collapse that div from its opening tag and than copy it by highlighting the line and the start of the next line
@sevtianferdian42143 жыл бұрын
Yep, i think it's easier for me
@DarkKnight-ree3 жыл бұрын
This
@xanderhere16333 жыл бұрын
That's what I do
@haixirtcrack31183 жыл бұрын
Yes
@hermit413 жыл бұрын
This, i always do this when i work on long long html like this one
@deltawastaken3 жыл бұрын
I love you. No more scrolling for hours and putting my thumb to the screen to hold my place in the line!
@manofvulture3 жыл бұрын
or you could just use the cursor instead of your thumb
@deltawastaken3 жыл бұрын
@@manofvulture I’d accidentally move the cursor when scrolling and have to redo it
@manofvulture3 жыл бұрын
@@deltawastaken clumsy fella
@AkamiChannel3 жыл бұрын
Idk for html tags but most modern text editors have something for matching the parenthesis or curly bracket. In sublime text I think it's ctrl-m
@Harmxn3 жыл бұрын
I just click the tag and follow the striped line down.
@surya50773 жыл бұрын
I wish this was a thing for Reddit. Can’t find who that one guy is replying to
@ChrisD__3 жыл бұрын
It isn't, but thread/block/bracket collapsing has been a thing in text editors and Reddit for years to solve this exact problem.
@tacokoneko3 жыл бұрын
i use old reddit which highlights it when you click the area to the left of the reply. i have never used new reddit so i dont know what happens there
@kibe21342 жыл бұрын
Same
@sknfer2 жыл бұрын
XD
@alooydaboss92622 жыл бұрын
TRUE
@dopeenough70693 жыл бұрын
It's a more simpler way to do that. You can just click any where to opening tag and select it.Closing tag will automatically be marked.
@adamhassan55283 жыл бұрын
exactly was just gonna say that
@Xd4LEM4ObX3 жыл бұрын
That's the way i do, but i liked how he put it in a keyboard shortcut, it makes it easier, since i mostly use the keyboard to everything
@wickedtorpedo75 Жыл бұрын
it's cool but your way don't work on vs code, in vs code mark disappear while selecting
@divine2033 жыл бұрын
The most educative short video I've watched...my life as a developer has become a lot easier 🙏❤️
@branthebrave3 жыл бұрын
Jetbrains has this by default, I think it's Ctrl w and Ctrl shift w
@VladyYakovenko3 жыл бұрын
Try ~
@jarretta26563 жыл бұрын
Quite literally the most used key on my keyboard
@branthebrave3 жыл бұрын
@@leonie9248 They simply haven't tried it 😆. One person I saw said they don't like it because it was "too complicated" or too hard to learn, which just means to me that they are just lazy
@heylittleguy263 жыл бұрын
@@branthebrave I used to be part of the Eclipse cult. As soon as I found IntelliJ, I never looked back..
@branthebrave3 жыл бұрын
@@heylittleguy26 Exactly the same here.
@FlorianEagox3 жыл бұрын
I usually just collapse the div and select it that way, but this is pretty nifty
@peteyy_cz3 жыл бұрын
Wait till he discovers vim.
@pubgbankclan3 жыл бұрын
Ha
@zigabahoric20473 жыл бұрын
this
@mymoomin09523 жыл бұрын
More like wait until he discovers the vim-keybinds vscode extension
@KhalidJ3 жыл бұрын
@@mymoomin0952 Yeah, this is more likely. But vim (or neovim for me) works much better than any extension
@ChrisD__3 жыл бұрын
Vim is very good at robbing me by tricking me into thinking I'll save a lot of time, lol.
@mayawarrier65643 жыл бұрын
Pretty neat! visual studio has something like this (to highlight a scope) but it's more mouse-involved
@jphearson Жыл бұрын
Man, I'm just a beginner in HTML, but y'all doing some jewels in here for vs code. I love it.
@PaulSebastianM3 жыл бұрын
Theres also expand selection (to scope). There're similar commands in all IDEs. Mostly called expand something.
@kristofkallo2 жыл бұрын
By default, it is Alt + Shift + Right/Left for expand/shrink selection. It is extremely useful especially when you have deep nested stuff. You don't need to put effort into finding precisely the start and end of an expression.
@whatawordsalad2 жыл бұрын
Nice, I usually just fold/collape the element I want and select it that way, but this is probably better :)
@warriorlord40522 жыл бұрын
We can use an extension called brackets or something like that to do that too. When you select the div it gets selected in a color and you can check it out at the bottom of the page to see which is the actual div selected.
@arishkumar Жыл бұрын
I also think there is a shortcut "shift+alt+right arrow key" which lets to select items with the same indentation, its hard to explain with text but if you try it out its super useful for any language
@justadev____72323 жыл бұрын
Mind blown!!!!! I was literally doing this the other day and was wondering if there was something like this. Super useful thank you!
@RedBlueProductions13 жыл бұрын
in vim, this can be done with vit visual inside tag
@zombiekiller71013 жыл бұрын
@Maksim Verkhoturov vscode is noice
@randomsoul2942 жыл бұрын
Exactly my thoughts during the video
@duruiz2 жыл бұрын
and for people that are curious about it, if you are gonna copy the text for example, you don't even need to select it, you can simply yit and you have (y)anked what is (i)inside the (t)ag... yank "is the same" as copy in vim, gonna delete it? delete what is inside the tag (dit) ✨✨✨
@sukhmandersingh43062 жыл бұрын
@@duruiz also cit for changing tag you can also sorround with another tag using vim-surround i have mapped that to ysit. Vim bindings imo are way more intuitive
@duruiz2 жыл бұрын
@@sukhmandersingh4306 yep! I've been using nvim/vim for years and I'm always learning some new stuff. recently I've migrated to native lsp and I'm moving my plugins to lua alternative ones, everything is faster :)
@srijanvarma94063 жыл бұрын
That's actually really helpful, you don't usually get this much value from these short content videos
@steamcode44412 жыл бұрын
Wow, this is amazing. There are so many features in VSC that I didn't even know I needed but will definitely help me out
@isymfs3 жыл бұрын
Fun fact: I have no idea why anyone would subject themselves to coding, but I appreciate you guys because you make the internet possible.
@tacokoneko3 жыл бұрын
we do it because its fun to make the computer do what you want
@IkeVoodoo3 жыл бұрын
@@tacokoneko this, and because you can make the craziest stuff you can imagine
@cinderblocktreehouse3 жыл бұрын
Yes and yes
@dipanjanghosal16622 жыл бұрын
Well I'm just starting to learn web developement and the prospect of making stuff for the web really seems like something I would enjoy, and I think other people enjoy that too.
@yourlocalhuman352616 күн бұрын
@@dipanjanghosal1662 how is it going for you? I started in decemeber 2023 because of the exact same reason as you
@scifregizmoguy3 жыл бұрын
This already exists in vim. Its three keystrokes: vat
@timwaite48847 ай бұрын
This
@redflag6056 Жыл бұрын
I’m learning html now and I just started learning about div ‘s ,,, I think this is definitely gonna help me out in the future when I get more advanced 💪🏾
@kurushimee2 жыл бұрын
There is an extension/built-in feature for colored brackets, so that your dive and shiz will be colored and you can just see what div is it closing by color yea
@yondonjamtsganzorig74173 жыл бұрын
It might be easier on vim. You just have to press 3 key vat Boom and it's selected whole tag. But getting familiar to vim is the real problem at the beginning
@xanri76732 жыл бұрын
Or shift+V and then %, when your cursor is inside the tag.
@lostguy3622 жыл бұрын
Use Emacs
@yondonjamtsganzorig74172 жыл бұрын
@@lostguy362 I've tried to use it during my college years, and it was lot harder to learn than VIM :P
@lostguy3622 жыл бұрын
@@yondonjamtsganzorig7417 yeah I can understand There is a lot to remember in emacs
@aidenbagshaw55733 жыл бұрын
This is by far the most useful thing I’ve ever had recommended on KZbin. Not that that’s saying much, but still.
@musikid_official Жыл бұрын
As a beginner HTML coder, can say working with layered DIVs is difficult. Genius solution, and I already use VSCode.
@ichbrauchmehrkaffee5785 Жыл бұрын
alternatively, there's a small arrow on the left side, where the line-numbers are located, each arrow indicates another indent. You can collaps each arrow, thus collapsing the entire indented section and selecting it, thus selecting everything inside
@jaiv3 жыл бұрын
Or just press % in vim...
@snailed Жыл бұрын
vit to select inside of tags
@chefaku2 жыл бұрын
Default Keyboard Shortcuts for basic editing: Fold (collapse) all regions | Ctrl+K Ctrl+0 | editor.foldAll Unfold (uncollapse) all regions | Ctrl+K Ctrl+J | editor.unfoldAll
@David-qz6yj Жыл бұрын
I like the standard way of clicking the carrot on the left to collapse parent element and select it afterwards
@PenguinjitsuX3 жыл бұрын
Dude you guys have to make a compilation video of every single one of these awesome tips on your channel Or some sort of a cheat sheet that people can use
@caseymccray38613 жыл бұрын
I was looking for this since my entire life. I HAVE FOUND IT. THANK YOU
@Waltuh7862Ай бұрын
You can also just click or highlight the opening div tag and VS code will highlight the closing one that the tag is attached to after a couple seconds
@Rodrick. Жыл бұрын
I use a rainbow tag extension, it pairs open/close tags with colors
@lawrencedoliveiro9104 Жыл бұрын
In Emacs I have custom commands defined to jump between lines with matching indentation. That works independently of the language the code is written in.
@Gelato__332 жыл бұрын
I know nothing of web development, but seeing how many people were genuinely helped by this video is enough to earn my like and sub! 👍
@krombopuloslincler48493 жыл бұрын
If you are using VIM just press "dat"
@MT-cd7cs17 күн бұрын
Amazing. I’ve spent my week doing this on a project to add JS to a SPA! Thank you.
@marvellousadeogun9110 Жыл бұрын
There's this arrow on the left just after the numbers, it collapses entire tags. Hides the content and shows only the opening and closing tags. Quick way to get to the end of a div and fantastic if you're sharing your screen but you wanna hide some things.
@samsonmayeem84092 жыл бұрын
Collapsing is also cool. Because having a small screen might disturb vision of highlighted
@JSCHM3 жыл бұрын
I think the shortcut is "shift" + "alt" + "arrow left/right" - it is also useful when you want to copy a method/class from a file and don't feel like using the mouse ^^
@martiananomaly2 жыл бұрын
You could also just collapse the div completely by hovering on the left of the div near the vertical number line and clicking on the 'v' shaped icon which appears. After that just copy the ... and it'll select everything inside the div element.
@Artist192 жыл бұрын
You can also click on the opening div and closing tag will be highlighted I think this is either a core feature or one of prettier extension.
@TheRealAnsontp Жыл бұрын
Dude, you just saved my marriage- I have been struggling so much trying to work around a large HTML, you don’t know just how much that helped me!
@GabrielGamesYTG3 ай бұрын
I just love that I follow this page and learn this stuff
@IlyaZub2 жыл бұрын
Thanks! Btw, Sublime Text since v2 can expand selection to scope by default. And it works for strings, arrays, and objects. Ctrl+Shift+Space, if I remember correctly.
@abdulqader2467 Жыл бұрын
you can click next to the line number(where the div starts) and it will minimize the div and you can copy it (it will copy the entire div
@Xynic48 Жыл бұрын
I suggest also adding a feature where it highlights the line only instead of selecting if it that isnt a thing already.
@thewelder35383 жыл бұрын
You've got the collapse method, or the PowerTools option which draws vertical lines between the opening and closing brace/div.
@roxgabrielrox Жыл бұрын
you can retract the div section and select it as well
@akifimran97802 жыл бұрын
Working with react native i really needed this thanks.
@ilmansalt Жыл бұрын
Programmers: I hate nesting Meanwhile HTML programmers:
@jackwright5177 ай бұрын
I hold ALT + SHIFT while using left and right to select more or less blocks of code
@danimunf3 жыл бұрын
BRO THANK YOU, YOU JUST SAVED MY ENTIRE WEEKEND
@ocsanik5023 жыл бұрын
Thank you, You're a life saver. Now I don't have to spend an hour scrolling to move large sections of code for organization.
@Ivan-dt9mc2 жыл бұрын
Another way of doing it is to just click on the div and follow the indentation line to the other div
@ScaredHelmet Жыл бұрын
You could also use a proper IDE which includes collapse and expand features.
@AacidD13 жыл бұрын
Before this I used to collapse a tag, select it in collapsed state then expand it
@victorcallender13112 жыл бұрын
You can see the closing tag right there, it's "", but if you are talking about the div tags... well yea. Just do your counting and struggle with your eye muscles. You are correct about that balance thing though.
@arahd11 ай бұрын
This is a cool 👌🏾 function, thanks for highlighting it
@noahmunz32012 жыл бұрын
There are thousands of plugins to actually lightly colorize brackets / different sections of your code so that you can remember which level goes with what. (Even tho it works better with actual programming languages like C or Java)
@twocsies2 жыл бұрын
Interesting trick. I usually just use the code folding "-" sign to collapse the div and then copy it from there.
@mskzzz Жыл бұрын
There’s also something called separation of concerns and components which will avoid having that much html in a file for no reason
@yurisoares25962 жыл бұрын
I was suffering this when a section (not SECTION guys) of my website started to have too many items, every time I had to change at least 3 to 4 html files just because of i18n, then again there were times I added more then one item in the section. Then I fliped out and decided to make everything(not EVERYTHING) as Observer Pattern, every item being dinamicaly added from a json with clear pattern, now I just change my JSON. 😬
@ShiloBuff Жыл бұрын
Cool command! But you can also collapse the div and then highlight the 2 collapsed lines.
@densecop6992 жыл бұрын
Can u make a video on your vscode extension and configurations
@bmejia2202 жыл бұрын
Nice tip! So useful and will save considerable time working in files
@ChrisD__3 жыл бұрын
Neat, I've just been using the collapse thingy in the side bar for years.
@hodev6323 жыл бұрын
Doesn't work for cut or delete because its only affects first line
@calebcadainoo3 жыл бұрын
Amazing 😂 I mostly comment the beginning and the end to help me navigate... This very helpful
@mushyclicks2028 Жыл бұрын
In vim its easier. Just go to any opening/closing tag and hit '%'. It will automatically take u to the other end. What more is that this also works for curly braces, double quotes etc. So if you have a function and wants to copy the whole thing, go the opening braces and hit 'v%y'and u r done.
@mirwaishashimi71513 жыл бұрын
Loved the trick and also the satisfying sound of your keyboard 👌🏻😍
@Tekay37 Жыл бұрын
You could also bind that to Ctrl+W and Ctrl+Shift+W to get proper IntelliJ keybinds in vscode
@sid98geek2 жыл бұрын
I can imagine that fifteen years ago, people who were writing HTML tags on Notepad would rage quit and smash their computers.
@matthewlui1004 Жыл бұрын
I just click once, follow the line, then shift click. But this works too.
@joaovitorpessoa520 Жыл бұрын
you can install a extension on vscode named "backet select" that does this and more
@gailius.m Жыл бұрын
Eva theme gives you a line that goes from the starter tag to the closing one (upon clicking)
@sharvenhubbard8030 Жыл бұрын
I mean there is a line pointing to the closing bracket if you click on a opening one but this is pretty cool tho
@Bilugagamer2 жыл бұрын
usually Im closing the tag with the arrow down icon on the left, and selecting the closed tag, but thats much easier
@4eyedfranc6062 жыл бұрын
You could just easily click the line number for the div. It'll wrap the div and it's content and you can do whatever you want with it.
@Kelz_3695 ай бұрын
There are collapsible arrows for each block of code on the left side numbered column. I just simply collapse and highlight.
@raj_drummer2 жыл бұрын
I use the VIM extension for vscode. So i just need to place the cursor on the main div and type ‘yit’ to copy all the child or ‘vit’ to select them. And if you want to delete them it ‘dit’
@CryptoWealthyChannel Жыл бұрын
what do you press to activate the search bar before typing balance out. Kindly make your toturials more beginner friendly
@neoxfr91142 жыл бұрын
This is so useful, but, why we used so many divs? Section, article, list, etc, there are so many ways to reduce div tags and improve our semantic structure
@omaewamoushindeiru11083 жыл бұрын
that's why I'm using component for group tags
@zrebec2 жыл бұрын
WOW. This is Very useful for me. VS Code is a really wizard. And your work as well ❤️
@LielAlmog Жыл бұрын
What is the difference between these and the "ctrl + alt + left / right" shortcut. It basically does the same thing with an extra press and more flexibility as it works with actual code and functions and not only HTML
@AdamDymitruk2 жыл бұрын
In intellij and other jerbrains IDEs you can +/- collapse entire areas or expand selection with CTRL-W or contract it with CTRL-SHFT-W
@WulfgangGott Жыл бұрын
damnit I wish I could save these videos into a playlist as a reminder
@CHRŌMVS Жыл бұрын
You can
@krishcapital6071 Жыл бұрын
I like keep the cursor on the end of the first open and press ctrl+shift + [ , it collapses the div, much easier to copy that way
@FadingWerewolfTiger2 жыл бұрын
I don't even code and I feel relieved
@blinded6502 Жыл бұрын
I just put a cursor where one bracket starts, and the scroll until it aligns with where it ends
@rayt3384 Жыл бұрын
That’s cool. You could also collapse them which is even better because it brings the closing tag close to the opening tag and you don’t have to scroll. In reality these things get very long vertical wise and when you balance in/out you can’t see where it actually ends because it’s scrolls of the page. So… collapse Ctrl K + Ctrl [ to collapse a node.
@iRant4u Жыл бұрын
Every day I'm reminded that half of my worth as a developer is just VS code
@SXsoft99 Жыл бұрын
Have you ever tried collapsing the div and then just selecting from the start line to the end? Other IDEs also have collapse from the end tag but i guess its too much of a feature for VSCode
@mikoajflorczak49662 жыл бұрын
You can also download a template that colour every single pair of divs for different colors
@_eagleofsuger_4631 Жыл бұрын
Isn’t there an accordion button right beside the respective branch? This works for functions as well
@RossWasTaken Жыл бұрын
Would it be possible to have it bound to triple clicking on the div? Would be really convenient imo
@tresvecesno70713 ай бұрын
Interesting! Thanks! I use the "expand selection" and shrink selection to get the same results =D One question, there is a way to select with shortcuts the content inside the tags of HTML/JSX? Thanks!
@lian1238 Жыл бұрын
With the vim plugin, you can do dat (delete around tag) or cat or vat.