This post is going to be a collection of VIM And Visual Studio Code tips that I use daily. And it will be updated frequently. So stay tuned. You can follow me here or on twitter @muhajirdev if you want. I'd really really love to hear your feedback here
Installed Extenstion in Visual Studio Code:
Delete In Tag
Delete Surrounding Tag
Update June 30th, 2019
Change single quote to double quote
Update July 4th, 2019
Change Tag with Emmet
Note that you need to set the keyboard shortcut first. Press cmd+shift+p
Then write Preferences: Open Keyboard Shortcuts (JSON)
. And add the following
[
...
{
"key": "shift+cmd+n",
"command": "editor.emmet.action.updateTag",
"when": "editorTextFocus"
},
...
]
My full keyboard shortcuts can be seen on my github dotfiles
Update July 11th, 2019
Go to matching tag with Emmet
Similar to tips above. I use cmd+m
as the shortcut here. You can check the keyboard shortcut file on my github dotfiles.
Copy And Paste with VIM
Update
I have created VSCode.xyz as vscode tips and tricks portal. Check it out.
This post will be updated with more tips and tricks. Stay tuned.
Like and share if you found it useful.
If you have additional tips. You can put it on the comment below. I might can include it too in this post :)
Top comments (15)
Inspired by your 3rd tip, when inside an HTML/JSX tag:
Using
cs<div>
can change your current tag to a<div>
tag. Of course, that is applicable to all other types of HTML tags out there.<div>
was just for an example.Cool
Did I miss something? How does this work? Is there a shortcut key combination to make this work?
Hi stuart,
Did you manage to get it working?
First of all you need to install github.com/VSCodeVim/Vim . And you can learn some vim basic here openvim.com .
After that, all those tips & tricks should be usable
Yeah, I'm feeling quite confused and stupid right now...
Ah, my bad. Should have said that we're using VSCode Vim extension. I'll update the post. Thanks for noticing
Yeah. We're using VSCode VIM extension like mentioned by @firozansari . I'll update the post. Thanks for noticing
Worth pointing out that
cs
relies on (vim-surround)[github.com/tpope/vim-surround] in actual Vim.Yeah, it's awesome. Thanks for adding the information David :)
Here is more evidence bad things come in threes.
😂😂
I am not sure but look like you are using VS Code Vim Extension.
Right I am using that extension
Update
I have launched vscode.xyz for this purpose. Check it out
Oh why I didn't see this article before. Always used auto rename tag ext cuz have no alternatives