2. Vim
How to Develop Like a Ninja
Alex Lewin
Sources: Vysakh Sreenivasan
https://www.slideshare.net/vysakh0/introduction-to-vim-the-text-editor
https://thoughtbot.com/blog/learning-vim-in-a-week
3. What is Vim?
• Text Editor (kind of like sublime/notepad)
• You don’t use your mouse
• Provides a language for editing
25. TODO 1: Master movement
- Just learn how to reach a particular position in a file.
- $ vimtutor
- pacvim
(brew install pacvim)
- Vim-Adventures.com
37. yy yanks (copies) the current line
dd deletes the current line
cc changes the current line
gUgU upcase the current line
Shortcut - doing the action twice
38. inside(i) the object or around(a) the object
:h text-objects
(This is where it get cool)
40. Actions
- Paragraph p
- Sentence s
- Tag <p1></p1> t
- ‘ ‘ , “ ”
- (, [, {, <
- Delete d
- Yank y
- Change c
Text Objects
Where
- Inside i
- Around a
41. - From the cursor position, you can say this
entire thing inside quotes using i”
- From the cursor position, you can say this
entire thing of quotes using a”
“This quote is an object”
Vim is a text editor that runs inside of the command line.It’s iconic for being hard to use, because you don’t touch your mouse
Learning Vim seems really hard… until it clicks,I’m gonna try to give you the secret sauce ahead of time, which will hopefully get you over the initial ”hump” of getting used to using vim.I’m gonna show a few features of vim that will dramatically improve your efficiency... with the goal of blowing your mind
Infamous for being really hard to learn
https://youtu.be/DAUxjfiD4hY
https://youtu.be/DAUxjfiD4hY
Vim is a modal editor, so when in different modes, keys do different things- Insert mode: every button that you press, get printed where your cursor is
Vim is a powerhouse for movement and navigation… Once you get fluent, you’ll blow your collogues away
Vim is a powerhouse for movement and navigation… Once you get fluent, you’ll blow your collogues away
Learning Vim is an investment in yourself... I tell people that Vim costs about a month of being bad at vim… After a month, you get to the same level of efficiency as your other editor (sublime, vscode)… After that first month, everything you learn is profit.
For a very short while when starting out at vim, you’re gonna move really slowly…
So, it might not be a good start using vim on projects with deadlines…
Dedicate enough time to get to just a “workable” level, before moving to real projects
I’m sure some people on this call are thinking “I’m not switching to vim unless it can do x, y, and z”…
I promise, vim can do those things… it might take a little while to learn how to do it, but vim can do it… probably better than what ever you’ve been usingSo, try to suppress those thoughts as much as possible and it’ll work out…
I’m sure some people on this call are thinking “I’m not switching to vim unless it can do x, y, and z”…
I promise, vim can do those things… it might take a little while to learn how to do it, but vim can do it… probably better than what ever you’ve been usingSo, try to suppress those thoughts as much as possible and it’ll work out…