Balance Out

Поделиться
HTML-код
  • Опубликовано: 22 апр 2021
  • 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,2 тыс.

  • @aguynamedandre350
    @aguynamedandre350 3 года назад +10549

    Bruh. I can’t freaking believe. You just added 7 more years to my lifespan.

    • @al-thaidi
      @al-thaidi 3 года назад +98

      LOL

    • @chizuru1999
      @chizuru1999 3 года назад +41

      Bruh wtf 😂 I am assuming you are a free lancer? Cause no company uses "vscode" for development Lol

    • @masamaeda9217
      @masamaeda9217 3 года назад +283

      @@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-vr8rj
      @MM-vr8rj 3 года назад +13

      @@chizuru1999 what else lol

    • @chizuru1999
      @chizuru1999 3 года назад +9

      @@masamaeda9217 Whatever sails your boat or videos you watch on RUclips to learn. Reality is often different. 🤷‍♂️

  • @jeltehoekstra2952
    @jeltehoekstra2952 3 года назад +3871

    There’s also a addon called “rainbow brackets” it gives brackets different colors based on how deep its nested

    • @Jakob3xD
      @Jakob3xD 3 года назад +63

      This

    • @chevycamaro-rp6tr
      @chevycamaro-rp6tr 3 года назад +196

      Yay a fellow 🌈 brackets user!

    • @nomad4253
      @nomad4253 3 года назад +22

      I’ll try it out. Thanks for this. Small visual aids help me out a lot

    • @avii___7
      @avii___7 3 года назад +2

      @@jeltehoekstra2952 😂

    • @redtaileddolphin1875
      @redtaileddolphin1875 3 года назад +42

      @@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

  • @KinSlay1337
    @KinSlay1337 3 года назад +2617

    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

  • @deltawastaken
    @deltawastaken 3 года назад +1578

    I love you. No more scrolling for hours and putting my thumb to the screen to hold my place in the line!

    • @manofvulture
      @manofvulture 3 года назад +28

      or you could just use the cursor instead of your thumb

    • @deltawastaken
      @deltawastaken 3 года назад +58

      @@manofvulture I’d accidentally move the cursor when scrolling and have to redo it

    • @manofvulture
      @manofvulture 3 года назад +47

      @@deltawastaken clumsy fella

    • @AkamiChannel
      @AkamiChannel 3 года назад +5

      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

    • @Harmxn
      @Harmxn 3 года назад +6

      I just click the tag and follow the striped line down.

  • @surya5077
    @surya5077 3 года назад +606

    I wish this was a thing for Reddit. Can’t find who that one guy is replying to

    • @ChrisD__
      @ChrisD__ 3 года назад +42

      It isn't, but thread/block/bracket collapsing has been a thing in text editors and Reddit for years to solve this exact problem.

    • @tacokoneko
      @tacokoneko 3 года назад +10

      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

    • @kibe2134
      @kibe2134 3 года назад

      Same

    • @sknfer
      @sknfer 2 года назад

      XD

    • @alooydaboss9262
      @alooydaboss9262 2 года назад +1

      TRUE

  • @dopeenough7069
    @dopeenough7069 3 года назад +49

    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.

    • @adamhassan5528
      @adamhassan5528 3 года назад

      exactly was just gonna say that

    • @Xd4LEM4ObX
      @Xd4LEM4ObX 3 года назад

      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
      @wickedtorpedo75 Год назад

      it's cool but your way don't work on vs code, in vs code mark disappear while selecting

  • @divine203
    @divine203 3 года назад +52

    The most educative short video I've watched...my life as a developer has become a lot easier 🙏❤️

  • @peteyy_cz
    @peteyy_cz 3 года назад +310

    Wait till he discovers vim.

    • @pubgbankclan
      @pubgbankclan 3 года назад +2

      Ha

    • @zigabahoric2047
      @zigabahoric2047 3 года назад +2

      this

    • @mymoomin0952
      @mymoomin0952 3 года назад +42

      More like wait until he discovers the vim-keybinds vscode extension

    • @KhalidJ
      @KhalidJ 3 года назад +25

      @@mymoomin0952 Yeah, this is more likely. But vim (or neovim for me) works much better than any extension

    • @ChrisD__
      @ChrisD__ 3 года назад +51

      Vim is very good at robbing me by tricking me into thinking I'll save a lot of time, lol.

  • @FlorianEagox
    @FlorianEagox 3 года назад +10

    I usually just collapse the div and select it that way, but this is pretty nifty

  • @branthebrave
    @branthebrave 3 года назад +73

    Jetbrains has this by default, I think it's Ctrl w and Ctrl shift w

    • @VladyYakovenko
      @VladyYakovenko 3 года назад +3

      Try ~

    • @jarretta2656
      @jarretta2656 3 года назад +8

      Quite literally the most used key on my keyboard

    • @branthebrave
      @branthebrave 3 года назад +3

      @@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

    • @heylittleguy26
      @heylittleguy26 3 года назад +12

      @@branthebrave I used to be part of the Eclipse cult. As soon as I found IntelliJ, I never looked back..

    • @branthebrave
      @branthebrave 3 года назад

      @@heylittleguy26 Exactly the same here.

  • @jphearson
    @jphearson Год назад +1

    Man, I'm just a beginner in HTML, but y'all doing some jewels in here for vs code. I love it.

  • @chefaku
    @chefaku 2 года назад +2

    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

  • @whatawordsalad
    @whatawordsalad 2 года назад +16

    Nice, I usually just fold/collape the element I want and select it that way, but this is probably better :)

  • @mayawarrier6564
    @mayawarrier6564 3 года назад +35

    Pretty neat! visual studio has something like this (to highlight a scope) but it's more mouse-involved

  • @warriorlord4052
    @warriorlord4052 2 года назад +1

    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.

  • @steamcode4441
    @steamcode4441 2 года назад +1

    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

  • @PaulSebastianM
    @PaulSebastianM 3 года назад +5

    Theres also expand selection (to scope). There're similar commands in all IDEs. Mostly called expand something.

    • @kristofkallo
      @kristofkallo 2 года назад +2

      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.

  • @justadev____7232
    @justadev____7232 3 года назад +9

    Mind blown!!!!! I was literally doing this the other day and was wondering if there was something like this. Super useful thank you!

  • @musikid_official
    @musikid_official Год назад +1

    As a beginner HTML coder, can say working with layered DIVs is difficult. Genius solution, and I already use VSCode.

  • @srijanvarma9406
    @srijanvarma9406 3 года назад +1

    That's actually really helpful, you don't usually get this much value from these short content videos

  • @RedBlueProductions1
    @RedBlueProductions1 3 года назад +24

    in vim, this can be done with vit
    visual inside tag

    • @zombiekiller7101
      @zombiekiller7101 3 года назад +1

      @Maksim Verkhoturov vscode is noice

    • @randomsoul294
      @randomsoul294 2 года назад +1

      Exactly my thoughts during the video

    • @duruiz
      @duruiz 2 года назад +1

      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) ✨✨✨

    • @sukhmandersingh4306
      @sukhmandersingh4306 2 года назад +1

      @@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

    • @duruiz
      @duruiz 2 года назад

      @@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 :)

  • @scifregizmoguy
    @scifregizmoguy 3 года назад +19

    This already exists in vim. Its three keystrokes: vat

  • @arishkumar
    @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

  • @redflag6056
    @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 💪🏾

  • @isymfs
    @isymfs 3 года назад +10

    Fun fact: I have no idea why anyone would subject themselves to coding, but I appreciate you guys because you make the internet possible.

    • @tacokoneko
      @tacokoneko 3 года назад +6

      we do it because its fun to make the computer do what you want

    • @IkeVoodoo
      @IkeVoodoo 3 года назад +2

      @@tacokoneko this, and because you can make the craziest stuff you can imagine

    • @cinderblocktreehouse
      @cinderblocktreehouse 3 года назад

      Yes and yes

    • @dipanjanghosal1662
      @dipanjanghosal1662 2 года назад +2

      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.

    • @yourlocalhuman3526
      @yourlocalhuman3526 22 дня назад

      @@dipanjanghosal1662 how is it going for you? I started in decemeber 2023 because of the exact same reason as you

  • @aidenbagshaw5573
    @aidenbagshaw5573 3 года назад +5

    This is by far the most useful thing I’ve ever had recommended on RUclips. Not that that’s saying much, but still.

  • @caseymccray3861
    @caseymccray3861 3 года назад +1

    I was looking for this since my entire life. I HAVE FOUND IT. THANK YOU

  • @ichbrauchmehrkaffee5785
    @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

  • @jaiv
    @jaiv 3 года назад +4

    Or just press % in vim...

    • @snailed
      @snailed Год назад +1

      vit to select inside of tags

  • @yondonjamtsganzorig7417
    @yondonjamtsganzorig7417 3 года назад +7

    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

    • @xanri7673
      @xanri7673 2 года назад +2

      Or shift+V and then %, when your cursor is inside the tag.

    • @lostguy362
      @lostguy362 2 года назад

      Use Emacs

    • @yondonjamtsganzorig7417
      @yondonjamtsganzorig7417 2 года назад

      @@lostguy362 I've tried to use it during my college years, and it was lot harder to learn than VIM :P

    • @lostguy362
      @lostguy362 2 года назад

      @@yondonjamtsganzorig7417 yeah I can understand
      There is a lot to remember in emacs

  • @kurushimee
    @kurushimee 2 года назад +1

    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

  • @PenguinjitsuX
    @PenguinjitsuX 3 года назад +2

    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

  • @Gelato__33
    @Gelato__33 2 года назад +2

    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! 👍

  • @ocsanik502
    @ocsanik502 3 года назад

    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.

  • @GabrielGamesYTG
    @GabrielGamesYTG 3 месяца назад

    I just love that I follow this page and learn this stuff

  • @krombopuloslincler4849
    @krombopuloslincler4849 3 года назад +2

    If you are using VIM just press "dat"

  • @akifimran9780
    @akifimran9780 2 года назад

    Working with react native i really needed this thanks.

  • @MT-cd7cs
    @MT-cd7cs 23 дня назад

    Amazing. I’ve spent my week doing this on a project to add JS to a SPA! Thank you.

  • @David-qz6yj
    @David-qz6yj Год назад

    I like the standard way of clicking the carrot on the left to collapse parent element and select it afterwards

  • @Waltuh7862
    @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

  • @martiananomaly
    @martiananomaly 2 года назад

    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.

  • @ilmansalt
    @ilmansalt Год назад

    Programmers: I hate nesting
    Meanwhile HTML programmers:

  • @calebcadainoo
    @calebcadainoo 3 года назад +1

    Amazing 😂 I mostly comment the beginning and the end to help me navigate... This very helpful

  • @danimunf
    @danimunf 3 года назад +1

    BRO THANK YOU, YOU JUST SAVED MY ENTIRE WEEKEND

  • @arahd
    @arahd Год назад +1

    This is a cool 👌🏾 function, thanks for highlighting it

  • @bmejia220
    @bmejia220 2 года назад

    Nice tip! So useful and will save considerable time working in files

  • @lawrencedoliveiro9104
    @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.

  • @JSCHM
    @JSCHM 3 года назад

    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 ^^

  • @Artist19
    @Artist19 2 года назад

    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.

  • @saurovrc
    @saurovrc Год назад +1

    Holy Moly 🎉 this is fire 🔥 .. my life is now fulfilled

  • @IlyaZub
    @IlyaZub 2 года назад

    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.

  • @TheRealAnsontp
    @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!

  • @Rodrick.
    @Rodrick. Год назад

    I use a rainbow tag extension, it pairs open/close tags with colors

  • @ScaredHelmet
    @ScaredHelmet Год назад

    You could also use a proper IDE which includes collapse and expand features.

  • @Ivan-dt9mc
    @Ivan-dt9mc 2 года назад +1

    Another way of doing it is to just click on the div and follow the indentation line to the other div

  • @zrebec
    @zrebec 2 года назад

    WOW. This is Very useful for me. VS Code is a really wizard. And your work as well ❤️

  • @aymanmihidine210
    @aymanmihidine210 Год назад +1

    I truly needed this

  • @abdulqader2467
    @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

  • @mirwaishashimi7151
    @mirwaishashimi7151 3 года назад

    Loved the trick and also the satisfying sound of your keyboard 👌🏻😍

  • @victorcallender1311
    @victorcallender1311 2 года назад

    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.

  • @justnate-4810
    @justnate-4810 3 года назад +2

    Thank you so much 🙏🏾

  • @samsonmayeem8409
    @samsonmayeem8409 2 года назад

    Collapsing is also cool. Because having a small screen might disturb vision of highlighted

  • @raj_drummer
    @raj_drummer 2 года назад

    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’

  • @matthewlui1004
    @matthewlui1004 Год назад

    I just click once, follow the line, then shift click. But this works too.

  • @twocsies
    @twocsies 2 года назад

    Interesting trick. I usually just use the code folding "-" sign to collapse the div and then copy it from there.

  • @TheDownhillSpecialist
    @TheDownhillSpecialist 3 года назад

    Before this I used to collapse a tag, select it in collapsed state then expand it

  • @mushyclicks2028
    @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.

  • @ShiloBuff
    @ShiloBuff Год назад

    Cool command! But you can also collapse the div and then highlight the 2 collapsed lines.

  • @roxgabrielrox
    @roxgabrielrox Год назад

    you can retract the div section and select it as well

  • @Xynic48
    @Xynic48 Год назад

    I suggest also adding a feature where it highlights the line only instead of selecting if it that isnt a thing already.

  • @sid98geek
    @sid98geek 2 года назад +1

    I can imagine that fifteen years ago, people who were writing HTML tags on Notepad would rage quit and smash their computers.

  • @JP-vi9mw
    @JP-vi9mw 2 года назад

    the original way is click at the begining of the opening tag, any language, the line will turn white so look for the closing and hold shift and click, done

  • @thewelder3538
    @thewelder3538 3 года назад

    You've got the collapse method, or the PowerTools option which draws vertical lines between the opening and closing brace/div.

  • @FadingWerewolfTiger
    @FadingWerewolfTiger 2 года назад

    I don't even code and I feel relieved

  • @gtdmg489
    @gtdmg489 2 года назад

    I do code folding. This way I won't have to see the content of the selection. Much easier to the eyes. Very useful for this kind of occasion.

  • @AdamDymitruk
    @AdamDymitruk 2 года назад

    In intellij and other jerbrains IDEs you can +/- collapse entire areas or expand selection with CTRL-W or contract it with CTRL-SHFT-W

  • @jeanrakotoarison902
    @jeanrakotoarison902 3 года назад

    Thanks, it really helps

  • @noahmunz3201
    @noahmunz3201 2 года назад

    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)

  • @jonasschade
    @jonasschade 3 года назад

    My mind is blown 🤯
    Thanks a lot for the tip. ❤️

  • @mskzzz
    @mskzzz Год назад

    There’s also something called separation of concerns and components which will avoid having that much html in a file for no reason

  • @krishcapital6071
    @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

  • @4eyedfranc606
    @4eyedfranc606 2 года назад

    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.

  • @ZikyFranky
    @ZikyFranky 3 года назад

    I just click the drop down next to the line number which shortens the line, and then I select😂😂. Thanks for this too

  • @iRant4u
    @iRant4u Год назад

    Every day I'm reminded that half of my worth as a developer is just VS code

  • @ChrisD__
    @ChrisD__ 3 года назад

    Neat, I've just been using the collapse thingy in the side bar for years.

    • @hodev632
      @hodev632 3 года назад

      Doesn't work for cut or delete because its only affects first line

  • @jackwright517
    @jackwright517 7 месяцев назад

    I hold ALT + SHIFT while using left and right to select more or less blocks of code

  • @Xaddre
    @Xaddre 3 года назад

    When I learned about this trick for the first time I felt happy and mad that I didn’t know it sooner.

  • @SnappyScience
    @SnappyScience Год назад

    Saved my life. Amazing.

  • @MusaFaila
    @MusaFaila 2 года назад

    Really helpful man 👍, thanks

  • @JeanDidier
    @JeanDidier 2 года назад

    Very helpful. Thanks 🙏

  • @arjaylumibotmalaga226
    @arjaylumibotmalaga226 24 дня назад

    Omggg I need this fr 😭

  • @Tekay37
    @Tekay37 Год назад

    You could also bind that to Ctrl+W and Ctrl+Shift+W to get proper IntelliJ keybinds in vscode

  • @snowpower18
    @snowpower18 Год назад

    So cool! I was looking for a feature like this, since I was used to using it in Intellij IDEA

  • @PrabowoMurti
    @PrabowoMurti 2 года назад

    I am happy just to hear this man’s keyboard sound.

  • @omaewamoushindeiru1108
    @omaewamoushindeiru1108 3 года назад

    that's why I'm using component for group tags

  • @mohammadjavadaghazadehfard7873
    @mohammadjavadaghazadehfard7873 2 года назад

    Hi, Thank you. It's very cool. It's great. Please make more videos like this. Best of luck.

  • @joaovitorpessoa520
    @joaovitorpessoa520 Год назад

    you can install a extension on vscode named "backet select" that does this and more

  • @mohameddhabib8249
    @mohameddhabib8249 2 года назад

    Really learning while sleeping big thanks sir

  • @VishKnew
    @VishKnew 3 года назад

    What the hell? You just blown my mind and saved a lot of time 😂❤️ thankuuuu

  • @gailius.m
    @gailius.m Год назад

    Eva theme gives you a line that goes from the starter tag to the closing one (upon clicking)