This is the repo for my collections of useful Vim shortcuts and bindings for VSCode.
My goal is to keep it as simple as possible, so we can stick with Vim Motions for the most part.
But of course, I have added some of my preferences for VSCode.
-
settings.json: This is forPreferences: Open User Settings (JSON) -
keybindings.json: This is forPreferences: Open Keyboard Shortcuts (JSON)
There are 2 guides:
-
For some references, I practiced Vim by doing
vimtutoron Mac Terminal. I think this exists on Windows too. -
I also watch some parts of the series
Vim as your editoron Youtube byThePrimeagen
-
Vim: Vim emulation for VSCode
-
For cool themes:
- Bearded Theme
- Kanagawa
- Catpuccin
-
Material Icon Theme: For icon themes
-
Bookmarks: For bookmarks
-
Codeium: Free AI coding autocomplete
-
Markdown All in One: For better support for markdown file editing
To maximize productivity with VS Code, I use the following layout:
Primary Side Baris on therightSecondary Side Baris on theleft- I drag
Open EditorsandOutlinetoSecondary Side Bar - I also hide
FiltersinExplorer
This is totally optional as it is my preference
-
Do these before pulling or cloning anything
git config --global core.autocrlf false
git config --global core.eol lf- If you already have previous projects, you can manually fix line endings like below strategies
- Then you can install
prettierglobally - Run
prettier --write .with this.prettierrcto fix all files/folders in the current directory
{
"endOfLine": "lf"
}- But
prettiercan sometimes not work out of box for some file types unless you install extra plugins with it
- So we can also use
dos2unix
Get-ChildItem -Recurse -File | ForEach-Object { dos2unix $_.FullName }- To avoid stuff in gitignore
# Read .gitignore and create an array of ignored patterns
$gitignorePath = ".gitignore"
$ignoredPatterns = Get-Content $gitignorePath | Where-Object { $_ -notmatch "^#|^$" }
# Function to check if a file matches any ignored pattern
function IsIgnored($filePath) {
foreach ($pattern in $ignoredPatterns) {
if ($filePath -like $pattern) {
return $true
}
}
return $false
}
# Recursively find all files and convert them to LF line endings
Get-ChildItem -Recurse -File | ForEach-Object {
$relativePath = $_.FullName.Substring((Get-Location).Path.Length + 1)
if (-not (IsIgnored $relativePath)) {
dos2unix $_.FullName
}
}