Getting Started with Vim in Visual Studio Code

Ғылым және технология

In this developer productivity video, I go over why you should use Vim commands in VS Code and help you get started with the Vim extension. I also go over my Vim coding workflow.
📖 Code - github.com/SuboptimalEng/dotf...
🐦 Twitter - / suboptimaleng
💻 GitHub - github.com/SuboptimalEng
🌎 Website - suboptimaleng.com
== [ Timestamps ] ==
00:00 Intro
00:47 Why Vim?
01:25 Vim Use Case
03:54 Normal Mode Philosophy
04:30 Vim Setup in VS Code
07:30 Outro
== [ Tags ] ==
#suboptimal #vscode #vim

Пікірлер: 256

  • @SuboptimalEng
    @SuboptimalEng2 жыл бұрын

    Hello friends, I'm now on Twitter 🐦 twitter.com/SuboptimalEng

  • @Tantandev
    @Tantandev3 жыл бұрын

    When you learn Vim you never want to edit code without it, it's so incredibly efficient and ergonomic

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    ❌ Impossible 🔥 Vimpossible

  • @Tantandev

    @Tantandev

    3 жыл бұрын

    @@SuboptimalEng haha never heard that one :)

  • @Dorbellprod

    @Dorbellprod

    2 жыл бұрын

    Tantan... real??

  • @Tantandev

    @Tantandev

    2 жыл бұрын

    @@Dorbellprod it's a me! Hi Dorbell!

  • @RawkHawkRockin
    @RawkHawkRockin2 жыл бұрын

    I've been wanting to improve my workflow for a while now and reduce the mouse and the arrow keys usage within VSCode. I've always known about vim but never tried to learn. There's for sure a lot of material online, one can easily get lost, but I think I have found the perfect channel for productivity and workflow tips, to get me jump started. I have already watched some of your vids and will do more, you explain in a clear way and showcase common use cases where ergonomics can be optimized, thanks for sharing :)

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Appreciate the comment Hawk! Glad my style of videos helped you get started with Vim ☺️

  • @BrianGwaltney
    @BrianGwaltney Жыл бұрын

    Another simpler way to enable tabs: Go to the normal keybinding as you show in the video and right click on it. Select the "Change When Expression" and remove the !editorReadonly option. Same for outdent and shift tab.

  • @atalatal

    @atalatal

    Жыл бұрын

    Won't that interfere with other things. Like reading a git change.

  • @sanyamjha5796
    @sanyamjha57962 жыл бұрын

    Having switched from mac to pc, it takes a lot of effort to map all the keys and commands, especially with the home, end, page up and down keys. So having keybindings like Vim is quite "universal" and definitely helps.

  • @Ikram-Hussain

    @Ikram-Hussain

    Жыл бұрын

    do you know which theme he used?

  • @liggodoggo998

    @liggodoggo998

    Жыл бұрын

    ​@@Ikram-Hussainlooks like gruvbox

  • @Mersal-uj5nh
    @Mersal-uj5nh3 жыл бұрын

    Your channel looks great for frontend developers. Productivity+Tailwind+Vue=🔥❤️

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    I’m slowly getting into TypeScript (and GraphQL) as well 😛

  • @RahulPandeyrkp
    @RahulPandeyrkp3 жыл бұрын

    Sounds like setting up Vim is pretty straightforward, I'll need to try it. The defaults are just so ingrained though...

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Do it for the ergonomics 👀

  • @hemanthkotagiri8865
    @hemanthkotagiri88653 жыл бұрын

    5:35 "The only way you can enter vim mode is by pressing escape". I don't understand why you call it the vim mode rather than normal mode, but you can enter into normal mode from insert mode using ctrl + c (C_c) or even ctrl + [. I use these two all the time.

  • @klimmesil9585

    @klimmesil9585

    2 жыл бұрын

    Most vim users use escape on caps lock. I use it and now I yell very hard and high when someone doesn't bind caps lock onto escape (my information source is my teacher, and stack overflow so don't take it for granted haha)

  • @hemanthkotagiri8865

    @hemanthkotagiri8865

    2 жыл бұрын

    @@klimmesil9585 i bound escape to jk. No kidding, there's a tone of people who do this their own way. But, my comment was originally intended to clarify that "escape key is not the only way you enter into normal mode" - as the dude states otherwise in his video.

  • @nekusakuraba4000

    @nekusakuraba4000

    2 жыл бұрын

    Yeah! I use have Caps lock bound to LCtrl, so I can just press "Caps + [" and I can enter normal mode

  • @jabuxas

    @jabuxas

    Жыл бұрын

    @@klimmesil9585 how did you set caps in vim.insertModeKeyBindings? I use caps instead of Esc in my regular config of vim but don't know how I should set it here

  • @immeatom
    @immeatom3 жыл бұрын

    Just found this channel. So cool!

  • @diggee172
    @diggee172 Жыл бұрын

    Great video. Good information with explanations at a nice pace. Too many KZread “so-called tutorials” simply show stuff without adequate explanations.

  • @SuboptimalEng

    @SuboptimalEng

    Жыл бұрын

    Thanks, I’m glad you appreciate the “why vim” explanation!

  • @jcruz6888
    @jcruz68882 жыл бұрын

    Very good point about the ergonomics

  • @GoogleUser-uv9bo
    @GoogleUser-uv9bo11 ай бұрын

    Vim helped me to relieve my wrist pain alot. && it also follows atomic habits temptation bundling!!!

  • @sophiaonyoutube
    @sophiaonyoutube11 ай бұрын

    this is very helpful. thank you!

  • @hemanthkotagiri8865
    @hemanthkotagiri88653 жыл бұрын

    It's not the case that Vim doesn't have the tab to indent feature, it's just that the keybinding is different. Visually select some text and Use the ">" or "

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Oh interesting, I did not know that. Thanks for explaining!

  • @SisiraSomaratne

    @SisiraSomaratne

    3 жыл бұрын

    That's very nice! But how can we do 2 or 3 tabs? In that way after one tab selection disappears.

  • @hemanthkotagiri8865

    @hemanthkotagiri8865

    3 жыл бұрын

    @@SisiraSomaratne There's a neat little trick for that. Say, you know how many tab overs you want to have. You can simply do n> or n or

  • @SisiraSomaratne

    @SisiraSomaratne

    3 жыл бұрын

    @@hemanthkotagiri8865 Oh! Again the Vim basic! Thanks.

  • @DragonKidPlaysMC

    @DragonKidPlaysMC

    3 жыл бұрын

    It doesn’t work for me. However pressing shift before pressing does the trick

  • @codewithtonny8176
    @codewithtonny81763 жыл бұрын

    hello thank you so much for this it actually incresed my productivity

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    🦾

  • @opossummx8763
    @opossummx87633 жыл бұрын

    Great video! Subscribed.

  • @shawnbeans7389
    @shawnbeans73892 жыл бұрын

    thanks for leaving your configuration in the description

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    How else can I up my stars on GitHub 😉

  • @shawnbeans7389

    @shawnbeans7389

    2 жыл бұрын

    @@SuboptimalEng lol i forgot to do that ill go do it rn :)

  • @RTCDigitalS
    @RTCDigitalS Жыл бұрын

    nice vid, also learned outro was a thing!

  • @dominikm1457
    @dominikm14573 жыл бұрын

    Hi, just found your channel today! Really like your videos, subscribed.

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    More videos coming out 🔜

  • @dominikm1457

    @dominikm1457

    3 жыл бұрын

    @@SuboptimalEng Awesome, looking forward to it!

  • @channalbert
    @channalbert3 жыл бұрын

    I don't know if this will work for everyone, but if you really want fluidity between normal and insert mode, the fastest thing is probably to remap (through iOS, Linux or Windows config files) the keys "Esc" to "Caps Lock" and vice versa (since most of us don't really use Caps Lock not even once a month but Esc is one of the most used keys if you use vim keystrokes)

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    I remapped Caps Lock to CTRL for that utility 🦾

  • @channalbert

    @channalbert

    3 жыл бұрын

    @@SuboptimalEng Oh, I see, emacs style 👍 #respect

  • @leondu

    @leondu

    2 жыл бұрын

    @@SuboptimalEng FWIW, I switched `Esc` and `CapLock`, `Win` and `Ctrl`, and things are working quite smoothly.

  • @LocalTrashyt

    @LocalTrashyt

    Жыл бұрын

    I was thinking the same but I can seem to right caps lock the right way to do it

  • @conradmbugua9098

    @conradmbugua9098

    10 ай бұрын

    I remapped mine to "jk"

  • @s1dev
    @s1dev3 жыл бұрын

    Could you make a video on your vim setup? (more vim related content) I think its really good, as you have a better experience with vim.

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    I definitely plan to do more videos related to Vim and VSCode next year 💪

  • @thehaptiK
    @thehaptiK2 жыл бұрын

    this got me going. thanks.

  • @anshul9856
    @anshul98563 жыл бұрын

    Thanks a lot for this video

  • @HeyNoah
    @HeyNoah2 жыл бұрын

    Thanks for the vid! Super cool! Curious, what syntax theme are you using?

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Thanks Noah! I usually switch between GitHub dark, Gruvbox, and Gruvbox material themes.

  • @literallyshane4306
    @literallyshane4306 Жыл бұрын

    great video, thanks mate

  • @joenguyen8204
    @joenguyen82043 жыл бұрын

    Thanks, we need another video please more on vim tutorial

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Will do, in 2021!

  • @bennedictbyy
    @bennedictbyy3 жыл бұрын

    Great video. May I ask what key stroke overlay are you using?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Thanks! I’m using KeyCastr 🦾

  • @sylvanfranklin6904
    @sylvanfranklin69043 жыл бұрын

    keep up the work small coding channel

  • @drftls
    @drftls Жыл бұрын

    Great vid, thanks

  • @Lyrik-Klinge
    @Lyrik-Klinge2 жыл бұрын

    Great and THANKS!

  • @sainathsingineedi2922
    @sainathsingineedi29223 жыл бұрын

    I remapped ii to esc and thanks for that tip.

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    🔥

  • @isaacdouglas1119
    @isaacdouglas11193 жыл бұрын

    This was helpful for me, thank you. Personally, I prefer to not add tabs in normal mode because I prefer that only insert mode has the potential to augment the code.

  • @nihancj

    @nihancj

    2 жыл бұрын

    I don't want to edit my code in normal mode but I do want to add/remove tabs on multiple lines when I'm on visual mode. The only way to do this is by enabling the option to use tabs in normal mode.

  • @Yuna_Maxwell

    @Yuna_Maxwell

    2 жыл бұрын

    @@nihancj just do ">"

  • @ignaciofernandezquesada2782
    @ignaciofernandezquesada27822 жыл бұрын

    Thanks dude!!

  • @ArkFreestyle
    @ArkFreestyle2 жыл бұрын

    Thanks for sharing that tabbing in normal mode fix! How did you even figure that out? I noticed it stops tab from working with vscode snippets though, so disabling it :(

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Thanks! What is your issue with VS Code snippets? I put cmd j/k as keybindings to traverse VS Code suggestions.

  • @ArkFreestyle

    @ArkFreestyle

    2 жыл бұрын

    @@SuboptimalEng ah, didn't realize I needed an additional keybinding. The issue was just that I could no longer tab through the snippets. Thanks for the quick response! I'll give it a shot.

  • @akashno3542
    @akashno3542 Жыл бұрын

    what plugin do you use for the screencast while typing . i mean the key's showing the monitor when you type something

  • @Hengul
    @Hengul2 жыл бұрын

    Loved it

  • @rudranarayanboitei6332
    @rudranarayanboitei63323 ай бұрын

    Liked and subscribed ❤

  • @bryanstark324
    @bryanstark3243 жыл бұрын

    I like the subject here but the where did you find the "keybindings.json" and can you share your settings with us?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Cmd + Shift + P -> start typing keybindings and you should see it appear My settings are on my Github under the Dotfiles repository 😇

  • @ayoolao.5865
    @ayoolao.58652 жыл бұрын

    In vscodevim, You know whenever you go to a line and hit ci' you delete whatever is inside the single quotes and you are left into insert mode. This works regardless of your cursor position on the row. Well how can I do the same with parentheses or curly brackets because currently, this works only if my cursor it at the opening bracket or between both. Example: a = (1234,123) If I want to change inside the parentheses I would go to the line, f(ci( Whereas if it was surrounded by quotes it would work from any column on the row. How can I do it with other text objects without remapping keys? Thanks

  • @Sovralin
    @Sovralin5 ай бұрын

    Installed Vim today; let's see how much time before I learn it well enough. Gratitude.

  • @SuboptimalEng

    @SuboptimalEng

    5 ай бұрын

    You have started on a great journey 🎯

  • @eaman11
    @eaman11 Жыл бұрын

    Usually you remap in your OS [CAPS LOCK] to [TAB]: you use TAB so much that pretty soon the TAB key is broken, also CAPS LOCK is more comfortable as it's on the main key line.

  • @drewberchtolzthofen886
    @drewberchtolzthofen88611 күн бұрын

    vim is essential for keeping yourself in focus, while typing

  • @MrJesterboi
    @MrJesterboi Жыл бұрын

    Hi does anyone know how to get to the vim settings json or were those vim settings manually added there? Thanks!

  • @wesleytaylor-rendal5648
    @wesleytaylor-rendal56482 жыл бұрын

    suboptimal is the right name. When you didnt use %. I died inside

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    😂

  • @DesertEagleNV
    @DesertEagleNV3 жыл бұрын

    I set my keybindings in VS Code to that of WebStorm (migrated from WS), plus installed a few extensions that boost coding and code navigation. Is Vim much better than all the most popular code-snippet extensions in the Marketplace?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Never tried the WebStorm keybindings so idk. Would def recommend giving Vim keybindings a shot tho!

  • @DesertEagleNV

    @DesertEagleNV

    3 жыл бұрын

    @@SuboptimalEng Thanks for your quick reply. Watching a few videos about Vim navigation right now to see if it can beat my current setup.

  • @xsfh1203
    @xsfh12032 жыл бұрын

    Can you remap the "caps lock" key to escape instead of using "k", "j"? if so whats the string of the key?

  • @DavidGarcia-sb9kc
    @DavidGarcia-sb9kc3 ай бұрын

    Thank you for this informative video! I'm trying to figure out how to change the "vim.insertModeKeyBindings" to use k,j. I'm new to using VSC and also VIM. Any help would be appreciated!

  • @yogxoth1959
    @yogxoth19593 жыл бұрын

    Hey man, hoping you can help me. Do you know how I can quickly navigate the CTRL+SHIFT+F "search in files" mode with VSCodeVim? And also how to go back to the editor window from there? Thank you.

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    You can press CTRL+b to close the left file search section. I still haven’t found a way to explore file search with Vim in VS Code unfortunately 🥲

  • @yogxoth1959

    @yogxoth1959

    3 жыл бұрын

    @@SuboptimalEng Well, luckily I found a way to do it just an hour ago! Put this in your keybindings.json: { "key": "ctrl+j", "command": "search.action.focusNextSearchResult", "when": "hasSearchResult || inSearchEditor" }, { "key": "ctrl+k", "command": "search.action.focusPreviousSearchResult", "when": "hasSearchResult || inSearchEditor" }, { "key": "ctrl+e", "command": "workbench.action.focusActiveEditorGroup", "when": "!editorFocus" } Then you can use CTRL+J or K for going up and down the search results, and CTRL+E for focusing the editor again. Have a nice weekend! 😊

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    @@yogxoth1959 OMG nice! (Pinned the comment for others.)

  • @goncaloazevedo9822

    @goncaloazevedo9822

    2 жыл бұрын

    @@SuboptimalEng i used f and it works wonders. Those are the defaults from telescope plugin in nivm. So handy and doesnt clash with any default keynaps. The leader key open up a new section for keymaps!! Edit: oh, in VSCode since there is no distinction between normal and insert mode this might be kind of a pain for escape characters actually :/

  • @NatePerdomo
    @NatePerdomo4 ай бұрын

    Copy the JSON additions below. To access settings.json: CMD + Shift + P then type "Open User Settings (JSON)" To access keybindings.json: Open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. or CMD + Shift + P then type "Open Keyboard Shortcuts (JSON)" settings.json: "vim.insertModeKeyBindings": [ { "before": ["k", "j"], "after":[""] } ], ~~~~~~~~~~~~~~~~~~~~~ keybindings.json: { "key": "tab", "command": "tab", "when": "editorTextFocus && !editorTabMovesFocus" }, { "key": "shift+tab", "command": "outdent", "when": "editorTextFocus && !editorTabMovesFocus" }

  • @SuboptimalEng

    @SuboptimalEng

    4 ай бұрын

    Thanks for this!

  • @yogitgarg9644
    @yogitgarg96442 жыл бұрын

    NIce video! Just to make it easy, you can toggle screencast mode in visual studio code rather than using another software for that. It's really good try it!

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Thanks for the tip Yogit!

  • @diggee172
    @diggee172 Жыл бұрын

    Thanks!

  • @SuboptimalEng

    @SuboptimalEng

    Жыл бұрын

    Glad you found the video helpful!

  • @MariusSemeonOrtiz
    @MariusSemeonOrtiz2 жыл бұрын

    Anyone else unable to see colon commands as a status bar at the bottom using the vim extension in vscode?

  • @Swedishnbkongu
    @Swedishnbkongu3 жыл бұрын

    Comment for the algorithm

  • @nevil2151
    @nevil2151 Жыл бұрын

    how did you do the multi-cursor thing at 0:27 ?

  • @SajadJalilian
    @SajadJalilian Жыл бұрын

    You can swap your caps-lock with escape in your preferred OS. It saves alo of distance

  • @SuboptimalEng

    @SuboptimalEng

    Жыл бұрын

    That’s a good choice as well!

  • @beingwarrior
    @beingwarrior Жыл бұрын

    thanks

  • @cccccc864
    @cccccc8642 жыл бұрын

    Do you have a way to use Cmd-D with vim installed? Also, how did you make it so when keep pressing j or k it repeats? If I do that in my Mac it will move just once.

  • @shynsky

    @shynsky

    Жыл бұрын

    for key repeats, write this in terminal: defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

  • @Ken_Machine-iu8je
    @Ken_Machine-iu8jeАй бұрын

    Having mapped k j to esc to enter normal mode from insert mode, then how do u type k j as characters in insert mode?

  • @SuboptimalEng

    @SuboptimalEng

    Ай бұрын

    You can set a time limit so that if you type the characters together slowly, the command does not get run and instead the characters get written.

  • @tomaszgora4353

    @tomaszgora4353

    12 күн бұрын

    You can apply when conditions to bindings in the json. Read the docs i.e "when": "inputFocus && vim.mode == 'Normal'". I have bindings remapped and conditioned per mode i.e leader leader to enter visual line (V). Currently building new profile to fit new workflows trained on nvim :)

  • @kkrizzz
    @kkrizzz8 ай бұрын

    Commet for the algo, thanks for the content!

  • @joem8251
    @joem82513 жыл бұрын

    If I remap Tab I can't use it for intellisense. Is there a way to only remap Tab based on if intellisense is active or another solution to that issue?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    You can also select intellisense suggestions with the enter key.

  • @tinymurky7329
    @tinymurky73293 жыл бұрын

    Thx you

  • @leoblack8497
    @leoblack8497 Жыл бұрын

    how is this extension any different from neovim extension , apart from not being an emulation ?

  • @workingguy3166
    @workingguy316610 ай бұрын

    i'm using a 60% keyboard and it compromises on the arrow keys, i can switch my alt command /? and ctrl key out with the up down left right arrow keys, with vim i don't need to sacrifice on that and best part is i can now access the ~ key, before i can only do `

  • @NewBlueType
    @NewBlueType2 жыл бұрын

    I can't find the vim settings inside the settings.json file

  • @RobertAlexanderRM
    @RobertAlexanderRM7 ай бұрын

    Thank you very much. Would be great if you could provide somewhere to copy those text settings and copy them in out files.

  • @SuboptimalEng

    @SuboptimalEng

    7 ай бұрын

    Good to hear the video was helpful. I have these settings on my GitHub dotfiles repository.

  • @RobertAlexanderRM

    @RobertAlexanderRM

    7 ай бұрын

    @@SuboptimalEng That is great! Thanks a lot. I am a vi veteran and sometimes pop out of VSCode just to be eiting more "naturally" and also sometimes pepper my vanilla VSCode with :x and related stuff :) Thanks a lot

  • @jongeduard
    @jongeduard Жыл бұрын

    3:10 I was really hoping you were going to type: dat Does exactly wat you did. Deletes the entire XML tag in 3 very simple key presses. It is a text object in Vim.

  • @danielratiu4318
    @danielratiu431823 күн бұрын

    As for using Esc to enter visual, I think some default key binding should not change because one might connect to some remote machines, and access vim there and that would make work a hell ( because of muscle memory ). My 2 cents.

  • @SuboptimalEng

    @SuboptimalEng

    23 күн бұрын

    That’s an interesting point. It’s possible that in some cases, keeping it as ESC is better.

  • @user-pj4iq5nl1m
    @user-pj4iq5nl1m10 ай бұрын

    Hey, would you mind telling us what VSCode theme that is

  • @s1dev
    @s1dev3 жыл бұрын

    How do I navigate around my files? creating files and folders?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    You should be able to traverse the project directory using vim commands `jkhl` As for making files/folders - I still do it manually

  • @s1dev

    @s1dev

    3 жыл бұрын

    @@SuboptimalEng How do you close the explorer? (it can be opened by pressing ctrl + shift + e) can you open the file as a split screen (when opening with jl)? EDIT: closing the explorer was ctrl + b

  • @shaileshsundram

    @shaileshsundram

    3 жыл бұрын

    @@SuboptimalEng @S1DEV You can use advanced-new-file extension for VS Code to create files as well as folders just using your keyboard.

  • @janetech6058
    @janetech60583 жыл бұрын

    What theme are you using? and how to set them up?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    The theme is Gruvbox! I made a video going over how to set it up called "Watch this before you install VS Code".

  • @zeppelin0110
    @zeppelin01102 жыл бұрын

    I think the best approach to entering normal mode from insert mode is to remap CAPS LOCK to Escape and the other way around.

  • @muhammadraza7231

    @muhammadraza7231

    Жыл бұрын

    Yeah i do that with the help of karabiner :)

  • @sandeepnegi4939
    @sandeepnegi49392 жыл бұрын

    cool man

  • @wlqpqpqlqmwnhssisjw6055
    @wlqpqpqlqmwnhssisjw6055 Жыл бұрын

    cool video

  • @ahmedghallab5342
    @ahmedghallab5342 Жыл бұрын

    شكرا thanks

  • @Byynx
    @Byynx2 ай бұрын

    Do you know how to change the text caret to steady block?

  • @SuboptimalEng

    @SuboptimalEng

    2 ай бұрын

    It’s a setting in VS Code.

  • @alinemansur3824
    @alinemansur38242 жыл бұрын

    Hi! I was delighted with your video and would like to know what color scheme was used in this example. Amazing.

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Thanks Aline! I was using Gruvbox theme in the video.

  • @mertgenc9890
    @mertgenc98902 жыл бұрын

    there is a problem with vscode. while i coding react or jsx syntax, sometimes vim crashing. is there anyone encountering this issue?

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Never had this problem before, can’t help you there unfortunately

  • @MiroredImage
    @MiroredImage3 жыл бұрын

    I've set up VSCode like this but the only (pretty big) issue I've run into is with code folds. Whenever I fold my code in VSCode Vim, it becomes extremely difficult to scroll the screen past that fold. Ctrl+E, Ctrl+D, Ctrl+F, they all become powerless against a single code fold lol. It might seem small but it makes the whole experience so constantly awkward that I have to either not fold any of my code and jump across a bunch of lines all the time, or just not use VSCode Vim at all.

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    that's unfortunate 🥲

  • @ibgib

    @ibgib

    2 жыл бұрын

    I also have this issue a bit, and I use code folding a lot. However I love using vscodevim and use three code fold keyboard commands extensively: 1) cmd + k, cmd + j - unfold all. 2) cmd + k, cmd + 2/3/4 - folds to level N. (most scoping inside for me is inside 2/3/4 levels.) 3) cmd + k, cmd + [ - fold at the current position. (All three chords are done without letting up on the cmd key with the left hand, so they are extremely quick.) So I fold to N scope usually when trying to scan through code. If I need to navigate down, I use [N]j/k, with quote-quote to go back if necessary. An _extremely_ quick jump down is 33,j or 44,j, with an optional z,z, which acts like ctrl+F without the need for the emac-like chording. Also, if you don't have it, I recommend setting relative line numbers to make navigation easier. But tastes differ!

  • @MiroredImage

    @MiroredImage

    2 жыл бұрын

    @@ibgib I think you are onto something. I haven't though about this sort of quick-folding and unfolding since writing that comment months ago. These days when using VSCodeVim I just don't fold my code, but I think this technique of quickly folding for an overview and navigating with just cursor movements could be very helpful. I also like the idea of shift + l/h to quickly get the cursor to the bottom/top of the screen to start scrolling with the cursor. Thank you very much for the advice!

  • @ibgib

    @ibgib

    2 жыл бұрын

    @@MiroredImage Shift High & Low! Some of my least-remembered commands. Interesting that Shift + L seems to scroll despite code folding which I'm sure will come in handy from now on. (H doesn't seem to do the trick.)

  • @ibgib

    @ibgib

    2 жыл бұрын

    @@MiroredImage Oh I just had to respond one more thing...I had forgotten that I solved my scrolling with cmd + up/down arrow keys. Not HOME hardcore-vim blasphemy I'm sure, but I like to have different physical posture "modes" (helps like crop rotation, only it's muscle groups). To reproduce this default scrolling behavior, I include the following binding (also of course its down dual): ``` { "key": "cmd+up", "command": "editorScroll", "when": "textInputFocus", "args": { "to": "up", "value": 4, "revealCursor": true, "by": "line" } }, ``` (Maybe one day, YT will format code blocks! I wonder if it's today...)

  • @sanjarsaidov9765
    @sanjarsaidov97652 жыл бұрын

    like you got it bro

  • @evilcorp.7288
    @evilcorp.72883 жыл бұрын

    where i can open this setting.json for vim keybinding changes............... i tried but cannot find it plz help

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Run "cmd + shift + p" and start typing "settings". You should be able to select "Preferences: Open Settings (JSON)". Note: I think it's "ctrl + shift + p" on windows.

  • @AllexChyu
    @AllexChyu2 жыл бұрын

    can you use fzf and ripgrep ?

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    VS Code has those two features built-in, though they are named differently. Go to file, and find all (I believe).

  • @gubby740
    @gubby7403 жыл бұрын

    at 5:08, how did you open that top search bar

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    mac: cmd + shift + p windows: ctrl + shift + p (i think)

  • @amritborah2773
    @amritborah27733 жыл бұрын

    lucky me i learnt shift+v to select line exists from this video otherwise i use to just use visual mode

  • @mrdwsk6779
    @mrdwsk67793 жыл бұрын

    can you drop that tab command here. and also can you tell how to remap caps into esc ...

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    The tab command is in my GitHub Dotfiles repository. To remap Cap to ESC, you will need to do so in the Mac Keyboard settings. It’s not something specific to VS Code. Def recommended because I’ve only ever pressed the Caps Lock key by accident 😇

  • @koishikisskogasa
    @koishikisskogasa2 жыл бұрын

    WHAT IS THE BUTTON TO OPEN THAT TOP SCREEN AND TYPE THE VIM

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    What top screen?

  • @phantombeing3015
    @phantombeing30152 жыл бұрын

    What is cmd in cmd + key in "key" in keybindings?

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    It’s the Mac command key.

  • @phantombeing3015

    @phantombeing3015

    2 жыл бұрын

    @@SuboptimalEng what should I do it in Linux laptop? can I do super key here? And what suggestion extension do you recommend? i am trying to use tabnine. And, I want to add shortcut to close the suggestion pop up if I don't find good one. Esc works but it is too far. I want to map it to some key. What is the name to do that in keybindngs?

  • @Eddie-um6cw
    @Eddie-um6cw2 жыл бұрын

    ummm bro can you have me, when i go to preferences setting (JSON) im not see vim or any key binding like that, how can i change key ?? :

  • @Eddie-um6cw

    @Eddie-um6cw

    2 жыл бұрын

    It's like there is no vim setting, just theme setting and other setting not vim setting help me pls ;-;

  • @kamalchan9756
    @kamalchan97562 жыл бұрын

    i use ;; to switch to ESC mode this is so faster i use vim-gtk3 and i use space with y to copy content from vim to clipboard and space p to paste from clipboard there are lot of nice thing you can do with vim ppl who want to custom keys search from map and remap keys in vim

  • @Ikram-Hussain
    @Ikram-Hussain Жыл бұрын

    how are you displaying you keystrockes?

  • @SuboptimalEng

    @SuboptimalEng

    Жыл бұрын

    You can display keyboard clicks in VS Code by enabling it in your settings.json file.

  • @Ikram-Hussain

    @Ikram-Hussain

    Жыл бұрын

    @@SuboptimalEng btw I forgot to ask which theme u used in here 0:04

  • @chatreeK
    @chatreeK Жыл бұрын

    I cannot open setting like you 😢 why do it not work? 😂 I only see “Preferences: Open Settings(UI)”

  • @lifeless9768
    @lifeless97683 жыл бұрын

    This plugin does make vscode noticeably slower

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Oh interesting, I never noticed any performance issues with the Vim plugin. I'm no expert, but I've heard (unconfirmed rumors) that the Neovim plugin is a little faster so maybe that would help your case.

  • @nodidog

    @nodidog

    3 жыл бұрын

    You'll probably end up going full vim once you've dipped your toes in the water though, and then everything will be light speed

  • @lifeless9768

    @lifeless9768

    3 жыл бұрын

    @@nodidog I do like vscode because of the integration with cmake. So it will be hard to switch.

  • @nodidog

    @nodidog

    3 жыл бұрын

    @@lifeless9768 That makes sense, whatever works for you 👍 There is a good selection of cmake integration plugins out there that you may find useful though, cmake4vim, language servers for code completion etc.

  • @GigaMarou
    @GigaMarou Жыл бұрын

    why would you insert tabs in read only?

  • @SuboptimalEng

    @SuboptimalEng

    Жыл бұрын

    I think I'm just used to it at this point.

  • @marshzhou7794
    @marshzhou7794 Жыл бұрын

    what theme are you using?

  • @SuboptimalEng

    @SuboptimalEng

    Жыл бұрын

    Gruvbox dark

  • @Srednicki123
    @Srednicki1232 жыл бұрын

    Where do I find the settings file???

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    You can find them on my GitHub under the Dotfiles repository 👍🏾

  • @chandradithyak.g460
    @chandradithyak.g4603 жыл бұрын

    what theme are u using?

  • @SuboptimalEng

    @SuboptimalEng

    3 жыл бұрын

    Gruvbox

  • @vor946
    @vor9462 жыл бұрын

    i dont see why tab not working in visual mode is an issue? but very nice video

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Thanks! I got used to pressing tabs and I assumed most people were as well

  • @joshbasnet3014
    @joshbasnet30142 жыл бұрын

    thank you for the video but i would never name my child Suboptimal Engineer .

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Maybe Optimal Engineer then?

  • @EDS432
    @EDS4322 жыл бұрын

    why command + shift + x when you just move your mouse 1cm to the left....

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    Because using the mouse is suboptimal

  • @EDS432

    @EDS432

    2 жыл бұрын

    @@SuboptimalEng no its not. Its like: Hey, instead of moving your mouse 1cm, just Press CTRL + V + X + F2 + Tab + K + L Why? because moving mouse is suboptimal, then you are not a good programmer

  • @programacion3694
    @programacion36942 ай бұрын

    interesnate

  • @valorant.mp4413
    @valorant.mp44132 жыл бұрын

    can you share the settings.json file?

  • @SuboptimalEng

    @SuboptimalEng

    2 жыл бұрын

    It’s on my GitHub dotfiles repository

Келесі