0% found this document useful (0 votes)
14 views

Week 4 Vim Vscode

Uploaded by

nuraf9607
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Week 4 Vim Vscode

Uploaded by

nuraf9607
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Vim and VSCode

⬡ SmashLab
⬡ Tmux + even more on Vim
⬡ Course Feedback
(Virtual) Pet Tax
Vim
Vim Recap
Normal mode for commands
Insert mode for editing text

Undo u

Redo :redo OR ctrl-R

Save + Exit :wq OR :x

⬡ ctrl not command on mac!


More Modes

Visual Visual Visual


Mode Line Block
v (lowercase v) V (capital V) ctrl-v
select text select whole line select rectangle

⬡ ctrl not command on mac!


Text Objects
<number><command><text object or motion>
2d w
⬡ <number>
⬡ <command>
⬡ <text object or motion>
More Text Objects
“ci}” “da(”
c i { d a
i }
insert mode
( ) a




Substitutions
Find and Replace, but with Vim and regex!
:s/<find>/<replace>/<flags>
⬡ In normal mode
⬡ Specify ranges before the s
current line: s
⬡ :10,30s/foo/bar
whole file: %s
⬡ :%s/foo/bar/g lines a-b: a,bs
⬡ Example flags line a to end: a,$s
⬡ g = every occurrence selected
region: ‘<, ’>s
⬡ c = confirm before applying

⬡ regex = regular expression / pattern that matches against certain strings


Vim
VSCode
VSCode

Lightweight, streamlined version of Visual Studio


Highly configurable + customizable
Install here
Major Features

IntelliSense Run + Debug Built-in Git Integration Extensions

Get Started with VSCode here


Extensions
⬡ Make VSCode more powerful!
⬡ Thousands of extensions
○ Language support
○ Workflow tools
○ Productivity
○ Appearance
⬡ Find the VSCode Extension Marketplace here
Remote - SSH Extension
⬡ Allows you to work on a remote machine while taking advantage of VSCode
features
⬡ Super useful for classes that require you to work on the andrew machines
⬡ Frees you from the limitations of Vim

Install/Get Started here


The Best of Both Worlds: Vim + VSCode
⬡ Vim keybindings + VSCode capabilities
⬡ You can use your mouse :)
○ No more set mouse=a
LaTeX Workshop
⬡ Build LaTeX and preview PDF all within VSCode
Gitlens
⬡ Git = version control software (more to come soon)
⬡ Extensive git capabilities on top of VSCode’s
⬡ Line-by-line blame (i.e. who wrote what)
⬡ Collaboration is important!
… and so much more!
⬡ FiraCode | Monospaced font with ligatures (e.g. ≠ vs. != or ≥ vs. >= etc.)
⬡ TODO Highlight | Highlight any TODO’s/README’s/keywords to make them pop
⬡ Live Share | Collaboratively code in real-time
⬡ Code Spell Checker | Especially useful when latex-ing
⬡ Path Intellisense | Autocomplete filenames
⬡ CodeSnap | Capture screenshots of your code
⬡ Random Everything | Generate random numbers, strings, dates, etc.
⬡ SFTP | Remote file exploration, upload/download
Personalization

Give your editor a glow up with


color themes and icon themes

Find a lot of ~aesthetic~ themes here

dark themes >> light themes


Productivity
⬡ Keyboard shortcuts are your best friend
○ Here are the keyboard shortcuts for each platform
○ You can even change key bindings to your heart’s content
⬡ Command palette: ⌘/ctrl + Shift P
settings.json
⬡ Controls workspace and global settings (shocker)
○ Language specific or project specific settings
○ Examples: line length, formatting on save, extension settings
Resources
⬡ We’ve barely scratched the surface - there’s still so much more you can do!
⬡ Useful sources of info:
○ The VSCode welcome page (what you see when VSCode opens)
○ The Official VSCode Tips and Tricks
○ Curated list of useful VSCode packages/resources
○ The VSCode website
Lab

⬡ fix-typos
◂ don’t swap the names in the header
⬡ hogwarts
◂ leave TWO spaces between books and MORE
◂ deleting inside the <container> tag leaves the closing tag on a new line, which
is not considered correct. the tags should be next to each other (vim version
dependent)
◂ after deleting paragraphs there should be ONE line in between them

You might also like