The Vim Editor: Philosophy, Principles and Practice Lecture 0: Welcome & Conventions

The Vim Editor: Philosophy, Principles and Practice Lecture 0: Welcome & Conventions

98-277: The Vim Editor: Philosophy, Principles and Practice Lecture 0: Welcome & Conventions (Hence, not much of meat, but a lot to know) Announcements • There will be no class next Monday! • (Labour day!) • Go out and have fun! Course Website http://andrew.cmu.edu/~haoxuany/vim Props to Andrew Benson(adbenson) for creating the amazingly beautiful CSS!!! :) Poll the website for homeworks and announcements! • Course Logistics :( • A Bit of Foreshadowing... • Installing Vim • Keyboard Ergonomics • Course Logistics :( • A Bit of Foreshadowing... • Installing Vim • Keyboard Ergonomics whoami • Haoxuan "Aaron" Yue (Plz call me Aaron) • [email protected] • School of Computer Science, Class of 2018 • Started using Vim rougly 6+ years ago • Thought it was awful, was miserable (but we'll talk about it later...) • Use Vim exclusively for text editing now This is me! http://abstrusegoose.com/354 Before that... This is a StuCo course!!! Meaning... • You are REQUIRED to attend class! • More specifically, you are not allowed to miss more than 2 classes. (StuCo policy) • (If there are documented illnesses, emergency situations, university bussiness etc., email me or talk to me preferably BEFORE it happens) Meaning... • Def Missing Class: Not coming, Tardiness (miss more than 15 minutes of class). • To enforce that, you are REQUIRED to sign an attendence sheet (during class) • Please remember to do that!! It's hard to verify attendence if you don't. Grading • Aside from attendance... • 40% Homeworks • 5 homeworks in total (each 8%). • PRINT, finish, and hand it in the next class after it is assigned. • Unless in special circumstances, will not accept late homework. Homework • Roughly 3 problems each. • 1st problem is basically lecture material. • Recommend doing without referencing the lecture notes. • (*May* show up on exams *hint hint*). • Other problems extend the discussion in lecture. • Please do them! Very few resources out there cover these (will talk about that later). Grading • 30% Midterm • 30% Finals • Midterm will NOT be curved. Finals may be. • Midterm will not cover commands (generally), hence understand, don't memorize. • Final will cover nearly all commands in lecture! • Passing requires 60% (under consideration...) Grading • On a side note • It shouldn't be a tough course! • Please do all the homeworks! • Pay attention in lecture, since the material is very different from others... • Which brings us to... • Course Logistics :( • A Bit of Foreshadowing... • Installing Vim • Keyboard Ergonomics • Course Logistics :( • A Bit of Foreshadowing... Yay! :D • Installing Vim • Keyboard Ergonomics What is Vim? • Vim is a text editor. What is Vim? • Vim is a text editor. •This is actually true. • Moreover, Vim is a text editor specially designed for programmers. (Especially C-style programmers, but also works pretty well with other languages). A bit more about me... • 14 slides ago: "Started using Vim rougly 6+ years ago" • Emphasis on the word *started* • Then I quit... A bit more about me... • 15 slides ago: "Started using Vim rougly 6+ years ago" • Emphasis on the word *started* • Then I ragequit... A bit more about me... • 16 slides ago: "Started using Vim rougly 6+ years ago" • Emphasis on the word *started* • Then I ragequit... • Well not completely. Picked it up again sometime around 6 years ago. • Then ragequit again. Until finally one day decided to actually learn it. A bit more about me... • 17 slides ago: "Started using Vim rougly 6+ years ago" • Emphasis on the word *started* • Then I ragequit... • Well not completely. Picked it up again sometime around 6 years ago. • Then ragequit again. Until finally one day decided to actually learn? it. A bit more about me... • 3 weeks. Food + vimtutor. • At least 4 hrs of vimtutor drill over and over and over again. A bit more about me... • 3 weeks. Food + vimtutor. • At least 4 hrs of vimtutor drill over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over and over again. Moral of the Story? • Vim is hard! • Vim is not for mortals like me! • Screw that, I'll just use another editor instead.... Why would I spend so much time on it? (in your case, an entire course) Moral of the Story? • Vim is hard! • Vim is not for mortals like me! • Screw that, I'll just use another editor instead.... Why would I spend so much time on it? (in your case, an entire course) • Completely WRONG moral of the story Actual Moral of the Story • vimtutor is BAD BAD BAD!!! • Something you learn in retrospect... Something you hear very often... • "Vim is hard to learn for beginners" • "Vim is great since it has many commands, which makes you fast" Something you hear very often... • "Vim is hard to learn for beginners" • "Vim is great since it has many commands, which makes you fast" • "<insert random editor name> is better since it has <insert feature name>." Something you hear very often... • They are all either wrong, or unintentionally misleading... • They all miss the point! • Vim is also not hard to learn, it is just that most resources out there are complete garbage. To list a few... • Resources you should avoid: • vimtutor (Worst offender, probably should give it some kind of award) • Two books from O'Reilly • Also, almost everything... To list a few... • Resources you should avoid: • vimtutor (Worst offender, probably should give it some kind of award) • Two books from O'Reilly • Also, almost everything... To list a few... • Resources you should avoid: • vimtutor (Worst offender, probably should give it some kind of award) • Two books from O'Reilly • Also, almost everything... Actually Good Resources Actually Good Resources • However, Practical Vim requires some familiarity with Vim... • By that time, most people have already completed vimtutor :( • There are also roughly 3 screencasts from Destroy All Software, by Gary Bernhardt, though it's a bit pricy... Emphasis in this course • Systematic use of Vim Emphasis in this course • Systematic use of Vim • Command Clarity and Ergonomics Emphasis in this course • Systematic use of Vim • Command Clarity and Ergonomics • Use Cases – When to use certain commands Emphasis in this course • Systematic use of Vim • Command Clarity and Ergonomics • Use Cases – When to use certain commands – When NOT to use certain commands (antipatterns) Emphasis in this course • Systematic use of Vim • Command Clarity and Ergonomics • Use Cases – When to use certain commands – When NOT to use certain commands (antipatterns) • WHY? So why this course? • Explain HOW to think about text editing. (Philosophy) So why this course? • Explain HOW to think about text editing. (Philosophy) • Explain what RULES we follow when we manage integration of features, and why some commands are better than others. Also, why we DON'T use some commands. (Principles) So why this course? • Explains HOW to use Vim commands. (Practice). • And most importantly, throughout the course explains a fundamental question... WHY VIM? Word of Warning!! • This course does have prerequisites!!! • Requires working knowledge of using a unix(- based/-like) command line • basic shell commands (ls, mkdir, cd, ...) • some utilities (make, man, ...) • it's okay to be bad at shell scripting • These commands will NOT be reviewed in lecture!! • There is a course for that: http://www.cs.cmu.edu/~15131/ Word of Warning!! • This course is in no way "beginner- friendly", nor is it a crash course. • In fact, you should be very wary of crash courses that tries to explain Vim. • We won't even be able to actually use Vim until roughly the 6th lecture. Word of Warning!! • Some topics will be covered in much detail (navigation, repetition...) • Some of them will only be covered if there is time left at the end of the semester (plugins...) • This is a new course with brand new material, so the syllabus should only used as a rough reference. Word of Warning!! • Some topics will only be briefly mentioned, because these features are nearly obsolete (marks...) • Some topics will be intentionally avoided! Because they are either broken or its fundamental ideas are WRONG (vimscript, vim regular expressions, certain plugins) • Course Logistics :( • A Bit of Foreshadowing... • Installing Vim • Keyboard Ergonomics • Cool thing about Vim is that it is *mostly* designed to be portable. • *mostly* • However, it doesn't run on your toaster. • (maybe if you really try). • For the purposes of this course, we will be using a very specific version of Vim. Requirements • For this particular course, you need Vim 7.4 huge version with ruby support. • (Huh?) • First thing to know is that every subversion upgrade introduces quite a few important changes. • Vim 7.3 *may* work, but do not depend on it. • Vim comes in different flavors... • tiny • small • normal • big • huge • There is very little reason not to use the huge version... Check Version • vim --version • (good idea to pipe into less) • Within vim: • :version<CR> • <CR> stands for "Carriage Return". For our purposes, it's the Enter key on the keyboard. Ruby Support • The only reason for this requirement is that there is a very specific plugin that we will talk about called Command-T: • https://github.com/wincent/Command-T • Requires vim compiled with ruby support • vim --version | grep ruby • Make sure that there is a "+" sign next to "ruby". Ruby Support • Also requires a "compatible" ruby version installed in system. • Read the plugin README markdown on github, gives you all the details for that. • Also requires a C compiler, highly unlikely that you don't have one. OS woes • Some operating systems are very uncooperative... • In fact, one specific operating system comes to mind. • We'll try workarounds, for time being, here's a general guide.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    121 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us