[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.03,0:00:05.34,Default,,0000,0000,0000,,Okay, cool. So, welcome to the third Dialogue: 0,0:00:03.36,0:00:07.50,Default,,0000,0000,0000,,lecture of the missing semester of your Dialogue: 0,0:00:05.34,0:00:09.99,Default,,0000,0000,0000,,si a second today we're going to be Dialogue: 0,0:00:07.50,0:00:11.76,Default,,0000,0000,0000,,talking about text editors this is a Dialogue: 0,0:00:09.99,0:00:13.26,Default,,0000,0000,0000,,topic that I really like I think it's Dialogue: 0,0:00:11.76,0:00:14.94,Default,,0000,0000,0000,,one of the most valuable topics that Dialogue: 0,0:00:13.26,0:00:17.13,Default,,0000,0000,0000,,we're teaching in this class because as Dialogue: 0,0:00:14.94,0:00:19.62,Default,,0000,0000,0000,,programmers you spend so much of your Dialogue: 0,0:00:17.13,0:00:21.84,Default,,0000,0000,0000,,time editing text editing programs that Dialogue: 0,0:00:19.62,0:00:23.61,Default,,0000,0000,0000,,if you invest time into making yourself Dialogue: 0,0:00:21.84,0:00:25.58,Default,,0000,0000,0000,,more efficient at doing this you'll save Dialogue: 0,0:00:23.61,0:00:27.99,Default,,0000,0000,0000,,a ton of time probably hundreds of hours Dialogue: 0,0:00:25.58,0:00:31.98,Default,,0000,0000,0000,,over the course of your undergrad or Dialogue: 0,0:00:27.99,0:00:33.51,Default,,0000,0000,0000,,over the course of your career so text Dialogue: 0,0:00:31.98,0:00:36.48,Default,,0000,0000,0000,,editors are a little bit different than Dialogue: 0,0:00:33.51,0:00:38.28,Default,,0000,0000,0000,,other programs you might use to edit say Dialogue: 0,0:00:36.48,0:00:39.75,Default,,0000,0000,0000,,things like English prose because Dialogue: 0,0:00:38.28,0:00:41.76,Default,,0000,0000,0000,,programming is different than writing Dialogue: 0,0:00:39.75,0:00:44.16,Default,,0000,0000,0000,,English prose when you're programming Dialogue: 0,0:00:41.76,0:00:45.60,Default,,0000,0000,0000,,you spend a lot of time reading what Dialogue: 0,0:00:44.16,0:00:47.58,Default,,0000,0000,0000,,you've written you spend a lot of time Dialogue: 0,0:00:45.60,0:00:49.08,Default,,0000,0000,0000,,navigating around a buffer and you spend Dialogue: 0,0:00:47.58,0:00:51.03,Default,,0000,0000,0000,,a lot of time making little edits to Dialogue: 0,0:00:49.08,0:00:52.86,Default,,0000,0000,0000,,code all over the place rather than just Dialogue: 0,0:00:51.03,0:00:53.79,Default,,0000,0000,0000,,writing in a long stream like you do Dialogue: 0,0:00:52.86,0:00:55.29,Default,,0000,0000,0000,,when you're writing an essay or Dialogue: 0,0:00:53.79,0:00:56.46,Default,,0000,0000,0000,,something and so it makes sense that Dialogue: 0,0:00:55.29,0:00:57.90,Default,,0000,0000,0000,,there different programs for these Dialogue: 0,0:00:56.46,0:00:59.31,Default,,0000,0000,0000,,different purposes right so yeah things Dialogue: 0,0:00:57.90,0:01:01.44,Default,,0000,0000,0000,,like Microsoft Word for writing essays Dialogue: 0,0:00:59.31,0:01:05.82,Default,,0000,0000,0000,,and things like vim and Emacs and vs Dialogue: 0,0:01:01.44,0:01:07.41,Default,,0000,0000,0000,,code and sublime for writing code so the Dialogue: 0,0:01:05.82,0:01:09.18,Default,,0000,0000,0000,,way you learn a text editor and become Dialogue: 0,0:01:07.41,0:01:11.13,Default,,0000,0000,0000,,really good at it is you start with a Dialogue: 0,0:01:09.18,0:01:12.84,Default,,0000,0000,0000,,tutorial and so that's basically going Dialogue: 0,0:01:11.13,0:01:15.72,Default,,0000,0000,0000,,to be the function of today's lecture Dialogue: 0,0:01:12.84,0:01:17.76,Default,,0000,0000,0000,,plus the exercises we've given you and Dialogue: 0,0:01:15.72,0:01:19.95,Default,,0000,0000,0000,,then after the tutorial you need to Dialogue: 0,0:01:17.76,0:01:22.02,Default,,0000,0000,0000,,stick with the editor for all your Dialogue: 0,0:01:19.95,0:01:24.00,Default,,0000,0000,0000,,editing tasks and when you're learning a Dialogue: 0,0:01:22.02,0:01:25.38,Default,,0000,0000,0000,,sophisticated tool so today we're going Dialogue: 0,0:01:24.00,0:01:26.85,Default,,0000,0000,0000,,to teach you vim which is one powerful Dialogue: 0,0:01:25.38,0:01:28.23,Default,,0000,0000,0000,,editor that a lot of programmers use Dialogue: 0,0:01:26.85,0:01:30.24,Default,,0000,0000,0000,,when you're learning such a Dialogue: 0,0:01:28.23,0:01:32.40,Default,,0000,0000,0000,,sophisticated tool it may be the case Dialogue: 0,0:01:30.24,0:01:33.75,Default,,0000,0000,0000,,that initially switching to this tool Dialogue: 0,0:01:32.40,0:01:35.85,Default,,0000,0000,0000,,slows you down a little bit when you're Dialogue: 0,0:01:33.75,0:01:38.73,Default,,0000,0000,0000,,programming but stick with it because Dialogue: 0,0:01:35.85,0:01:41.34,Default,,0000,0000,0000,,I'd say that in about 20 hours of Dialogue: 0,0:01:38.73,0:01:42.99,Default,,0000,0000,0000,,programming using a new editor you'll be Dialogue: 0,0:01:41.34,0:01:44.79,Default,,0000,0000,0000,,back to the same speed at which you Dialogue: 0,0:01:42.99,0:01:46.35,Default,,0000,0000,0000,,programmed using your old tool and then Dialogue: 0,0:01:44.79,0:01:47.76,Default,,0000,0000,0000,,after that the benefits will start and Dialogue: 0,0:01:46.35,0:01:50.19,Default,,0000,0000,0000,,you'll get faster and faster as you Dialogue: 0,0:01:47.76,0:01:53.58,Default,,0000,0000,0000,,learn more with these sophisticated Dialogue: 0,0:01:50.19,0:01:55.08,Default,,0000,0000,0000,,programs like them it takes not way too Dialogue: 0,0:01:53.58,0:01:58.20,Default,,0000,0000,0000,,long to learn the basics but a lifetime Dialogue: 0,0:01:55.08,0:01:59.76,Default,,0000,0000,0000,,to master and so throughout the time Dialogue: 0,0:01:58.20,0:02:01.65,Default,,0000,0000,0000,,you're using this tool make sure you Dialogue: 0,0:01:59.76,0:02:03.24,Default,,0000,0000,0000,,look things up as you go if you ever get Dialogue: 0,0:02:01.65,0:02:04.71,Default,,0000,0000,0000,,to a point where you're like oh this is Dialogue: 0,0:02:03.24,0:02:06.42,Default,,0000,0000,0000,,a really inefficient way of doing things Dialogue: 0,0:02:04.71,0:02:09.66,Default,,0000,0000,0000,,is there a better way the answer is Dialogue: 0,0:02:06.42,0:02:11.73,Default,,0000,0000,0000,,almost always yes because these text Dialogue: 0,0:02:09.66,0:02:13.71,Default,,0000,0000,0000,,editors were written by programmers for Dialogue: 0,0:02:11.73,0:02:13.97,Default,,0000,0000,0000,,programmers and so of course like the Dialogue: 0,0:02:13.71,0:02:15.20,Default,,0000,0000,0000,,peep Dialogue: 0,0:02:13.97,0:02:17.33,Default,,0000,0000,0000,,I wrote these tolls ran into the same Dialogue: 0,0:02:15.20,0:02:18.08,Default,,0000,0000,0000,,kinds of issues and fixed them so that Dialogue: 0,0:02:17.33,0:02:19.76,Default,,0000,0000,0000,,you don't need to deal with these Dialogue: 0,0:02:18.08,0:02:21.86,Default,,0000,0000,0000,,anymore and so yeah as you're learning Dialogue: 0,0:02:19.76,0:02:23.87,Default,,0000,0000,0000,,make sure you look things up as you go Dialogue: 0,0:02:21.86,0:02:25.37,Default,,0000,0000,0000,,either use Google or feel free to send Dialogue: 0,0:02:23.87,0:02:27.32,Default,,0000,0000,0000,,us emails if you have questions or come Dialogue: 0,0:02:25.37,0:02:29.59,Default,,0000,0000,0000,,to office hours and we'll help you Dialogue: 0,0:02:27.32,0:02:32.30,Default,,0000,0000,0000,,figure out how to do things really fast Dialogue: 0,0:02:29.59,0:02:34.13,Default,,0000,0000,0000,,so as far as which editor to learn in Dialogue: 0,0:02:32.30,0:02:35.51,Default,,0000,0000,0000,,previous iterations of this class we Dialogue: 0,0:02:34.13,0:02:36.89,Default,,0000,0000,0000,,actually avoided teaching a specific Dialogue: 0,0:02:35.51,0:02:39.05,Default,,0000,0000,0000,,editor because we didn't want to enforce Dialogue: 0,0:02:36.89,0:02:40.43,Default,,0000,0000,0000,,our opinions on you guys but we actually Dialogue: 0,0:02:39.05,0:02:42.05,Default,,0000,0000,0000,,think that it's really useful to teach Dialogue: 0,0:02:40.43,0:02:44.90,Default,,0000,0000,0000,,you how to use one particular tool and Dialogue: 0,0:02:42.05,0:02:46.46,Default,,0000,0000,0000,,use it well and so people have really Dialogue: 0,0:02:44.90,0:02:48.50,Default,,0000,0000,0000,,strong opinions about editor so you can Dialogue: 0,0:02:46.46,0:02:52.04,Default,,0000,0000,0000,,see the course notes for more links on Dialogue: 0,0:02:48.50,0:02:54.08,Default,,0000,0000,0000,,this topic looking at which editors have Dialogue: 0,0:02:52.04,0:02:56.66,Default,,0000,0000,0000,,been popular over the years Stack Dialogue: 0,0:02:54.08,0:02:59.09,Default,,0000,0000,0000,,Overflow I'm sure you've all heard of Dialogue: 0,0:02:56.66,0:03:00.32,Default,,0000,0000,0000,,that does a survey every year asking Dialogue: 0,0:02:59.09,0:03:02.00,Default,,0000,0000,0000,,developers various questions and one Dialogue: 0,0:03:00.32,0:03:03.44,Default,,0000,0000,0000,,thing to ask is which TextEdit Derk do Dialogue: 0,0:03:02.00,0:03:05.30,Default,,0000,0000,0000,,you use and it seems to be that Dialogue: 0,0:03:03.44,0:03:07.73,Default,,0000,0000,0000,,currently the most popular kind of Dialogue: 0,0:03:05.30,0:03:10.16,Default,,0000,0000,0000,,graphical editor is vs code and the most Dialogue: 0,0:03:07.73,0:03:12.44,Default,,0000,0000,0000,,popular editor that is based within a Dialogue: 0,0:03:10.16,0:03:13.91,Default,,0000,0000,0000,,command line interface is vim and so Dialogue: 0,0:03:12.44,0:03:16.04,Default,,0000,0000,0000,,we're going to be teaching you vim and Dialogue: 0,0:03:13.91,0:03:17.81,Default,,0000,0000,0000,,there a couple reasons for this one is Dialogue: 0,0:03:16.04,0:03:19.97,Default,,0000,0000,0000,,that all the instructors so me John and Dialogue: 0,0:03:17.81,0:03:21.32,Default,,0000,0000,0000,,Jose use vim as our primary editor and Dialogue: 0,0:03:19.97,0:03:23.15,Default,,0000,0000,0000,,we've been doing this for many years and Dialogue: 0,0:03:21.32,0:03:25.01,Default,,0000,0000,0000,,we've been very happy with it Dialogue: 0,0:03:23.15,0:03:28.82,Default,,0000,0000,0000,,and we think that there are a lot of Dialogue: 0,0:03:25.01,0:03:30.50,Default,,0000,0000,0000,,interesting ideas behind them so even if Dialogue: 0,0:03:28.82,0:03:32.45,Default,,0000,0000,0000,,you don't end up using this particular Dialogue: 0,0:03:30.50,0:03:35.54,Default,,0000,0000,0000,,tool in the long term I think it's Dialogue: 0,0:03:32.45,0:03:37.28,Default,,0000,0000,0000,,valuable to learn these ideas and also a Dialogue: 0,0:03:35.54,0:03:39.20,Default,,0000,0000,0000,,lot of tools have actually been really Dialogue: 0,0:03:37.28,0:03:42.20,Default,,0000,0000,0000,,excited about the ideas in vim and so Dialogue: 0,0:03:39.20,0:03:44.36,Default,,0000,0000,0000,,they support a vim emulation mode for Dialogue: 0,0:03:42.20,0:03:45.82,Default,,0000,0000,0000,,example vs code what's apparently the Dialogue: 0,0:03:44.36,0:03:48.17,Default,,0000,0000,0000,,most popular editor in use today Dialogue: 0,0:03:45.82,0:03:50.66,Default,,0000,0000,0000,,supports vim bindings and this vim Dialogue: 0,0:03:48.17,0:03:53.63,Default,,0000,0000,0000,,emulation mode as of now has like 1.4 Dialogue: 0,0:03:50.66,0:03:56.45,Default,,0000,0000,0000,,million downloads and as you'll see over Dialogue: 0,0:03:53.63,0:03:57.83,Default,,0000,0000,0000,,the course of this lecture a lot of Dialogue: 0,0:03:56.45,0:03:59.57,Default,,0000,0000,0000,,different tools like including your Dialogue: 0,0:03:57.83,0:04:01.73,Default,,0000,0000,0000,,shell including things like the Python Dialogue: 0,0:03:59.57,0:04:03.20,Default,,0000,0000,0000,,repple and like Jupiter notebook and all Dialogue: 0,0:04:01.73,0:04:04.94,Default,,0000,0000,0000,,sorts of other things even your web Dialogue: 0,0:04:03.20,0:04:06.89,Default,,0000,0000,0000,,browser can support of emulation mode Dialogue: 0,0:04:04.94,0:04:10.40,Default,,0000,0000,0000,,and so yeah we're going to be teaching Dialogue: 0,0:04:06.89,0:04:12.14,Default,,0000,0000,0000,,you this really neat tool today and in Dialogue: 0,0:04:10.40,0:04:14.39,Default,,0000,0000,0000,,this lecture we can't really cover all Dialogue: 0,0:04:12.14,0:04:17.03,Default,,0000,0000,0000,,of them right it's a very powerful tool Dialogue: 0,0:04:14.39,0:04:18.77,Default,,0000,0000,0000,,but our goal is to teach you and the Dialogue: 0,0:04:17.03,0:04:20.72,Default,,0000,0000,0000,,core philosophy of them like the really Dialogue: 0,0:04:18.77,0:04:22.37,Default,,0000,0000,0000,,neat ideas behind it and then in Dialogue: 0,0:04:20.72,0:04:23.75,Default,,0000,0000,0000,,addition to that some of the basics like Dialogue: 0,0:04:22.37,0:04:25.49,Default,,0000,0000,0000,,how do you open a file close a file Dialogue: 0,0:04:23.75,0:04:27.01,Default,,0000,0000,0000,,navigate around a file make edits and Dialogue: 0,0:04:25.49,0:04:28.63,Default,,0000,0000,0000,,things like that and Dialogue: 0,0:04:27.01,0:04:29.95,Default,,0000,0000,0000,,you may not remember every single little Dialogue: 0,0:04:28.63,0:04:31.03,Default,,0000,0000,0000,,detail from this lecture because we're Dialogue: 0,0:04:29.95,0:04:32.86,Default,,0000,0000,0000,,gonna go pretty fast through some of the Dialogue: 0,0:04:31.03,0:04:34.51,Default,,0000,0000,0000,,material but it's all in the lecture Dialogue: 0,0:04:32.86,0:04:36.64,Default,,0000,0000,0000,,notes and then the exercises actually Dialogue: 0,0:04:34.51,0:04:37.90,Default,,0000,0000,0000,,give you links to some tutorials and Dialogue: 0,0:04:36.64,0:04:40.03,Default,,0000,0000,0000,,things so I highly recommend that you Dialogue: 0,0:04:37.90,0:04:43.84,Default,,0000,0000,0000,,actually go through all the exercises at Dialogue: 0,0:04:40.03,0:04:49.45,Default,,0000,0000,0000,,least the non advanced exercises any Dialogue: 0,0:04:43.84,0:04:51.25,Default,,0000,0000,0000,,questions so far great okay so one of Dialogue: 0,0:04:49.45,0:04:54.16,Default,,0000,0000,0000,,the really cool ideas behind them is Dialogue: 0,0:04:51.25,0:04:56.08,Default,,0000,0000,0000,,that vim is a modal editor what does Dialogue: 0,0:04:54.16,0:04:58.45,Default,,0000,0000,0000,,this mean modal comes from the word mode Dialogue: 0,0:04:56.08,0:05:00.97,Default,,0000,0000,0000,,and this means that vim has multiple Dialogue: 0,0:04:58.45,0:05:02.92,Default,,0000,0000,0000,,operating modes and this is kind of Dialogue: 0,0:05:00.97,0:05:04.57,Default,,0000,0000,0000,,developed from the idea that when you're Dialogue: 0,0:05:02.92,0:05:05.95,Default,,0000,0000,0000,,programming there often times where Dialogue: 0,0:05:04.57,0:05:07.42,Default,,0000,0000,0000,,you're doing different types of things Dialogue: 0,0:05:05.95,0:05:09.22,Default,,0000,0000,0000,,like sometimes you're reading code Dialogue: 0,0:05:07.42,0:05:10.96,Default,,0000,0000,0000,,sometimes you're making small edits to Dialogue: 0,0:05:09.22,0:05:12.34,Default,,0000,0000,0000,,code like you're finding a particular Dialogue: 0,0:05:10.96,0:05:15.04,Default,,0000,0000,0000,,point like changing a little thing Dialogue: 0,0:05:12.34,0:05:16.54,Default,,0000,0000,0000,,somewhere sometimes you're just writing Dialogue: 0,0:05:15.04,0:05:17.47,Default,,0000,0000,0000,,a lot of code in one go like suppose Dialogue: 0,0:05:16.54,0:05:19.09,Default,,0000,0000,0000,,you're just writing a function from Dialogue: 0,0:05:17.47,0:05:20.38,Default,,0000,0000,0000,,scratch and so there's different Dialogue: 0,0:05:19.09,0:05:24.07,Default,,0000,0000,0000,,operating modes for doing these Dialogue: 0,0:05:20.38,0:05:25.18,Default,,0000,0000,0000,,different types of things and so I'm Dialogue: 0,0:05:24.07,0:05:26.47,Default,,0000,0000,0000,,actually want to write this down on the Dialogue: 0,0:05:25.18,0:05:28.78,Default,,0000,0000,0000,,blackboard so I'll have a useful thing Dialogue: 0,0:05:26.47,0:05:33.28,Default,,0000,0000,0000,,to refer to later so when you start vim Dialogue: 0,0:05:28.78,0:05:35.26,Default,,0000,0000,0000,,up it starts up in what's called normal Dialogue: 0,0:05:33.28,0:05:37.27,Default,,0000,0000,0000,,mode and in this mode all the different Dialogue: 0,0:05:35.26,0:05:38.65,Default,,0000,0000,0000,,key combinations behave in one way and Dialogue: 0,0:05:37.27,0:05:40.03,Default,,0000,0000,0000,,then there are different key Dialogue: 0,0:05:38.65,0:05:42.40,Default,,0000,0000,0000,,combinations that switch you between Dialogue: 0,0:05:40.03,0:05:45.88,Default,,0000,0000,0000,,normal mode and other modes which change Dialogue: 0,0:05:42.40,0:05:47.95,Default,,0000,0000,0000,,the meaning of different keys so for the Dialogue: 0,0:05:45.88,0:05:49.87,Default,,0000,0000,0000,,most part you'll be spending most of Dialogue: 0,0:05:47.95,0:05:55.42,Default,,0000,0000,0000,,your time in vim in normal mode or what Dialogue: 0,0:05:49.87,0:05:57.40,Default,,0000,0000,0000,,is called insert mode and to go to Dialogue: 0,0:05:55.42,0:05:59.53,Default,,0000,0000,0000,,insert mode you press the key I for Dialogue: 0,0:05:57.40,0:06:01.60,Default,,0000,0000,0000,,normal mode and to go from insert mode Dialogue: 0,0:05:59.53,0:06:06.70,Default,,0000,0000,0000,,back to normal mode you press the Escape Dialogue: 0,0:06:01.60,0:06:09.58,Default,,0000,0000,0000,,key a little note on notation because Dialogue: 0,0:06:06.70,0:06:11.02,Default,,0000,0000,0000,,we'll need this later in the notation Dialogue: 0,0:06:09.58,0:06:12.61,Default,,0000,0000,0000,,I'm going to be using in this lecture Dialogue: 0,0:06:11.02,0:06:15.10,Default,,0000,0000,0000,,and what's also in the lecture notes and Dialogue: 0,0:06:12.61,0:06:16.15,Default,,0000,0000,0000,,what vim uses to give you feedback they Dialogue: 0,0:06:15.10,0:06:17.74,Default,,0000,0000,0000,,have a couple different ways of talking Dialogue: 0,0:06:16.15,0:06:19.27,Default,,0000,0000,0000,,about different keys so when they're Dialogue: 0,0:06:17.74,0:06:20.44,Default,,0000,0000,0000,,talking about bare keys like just the Dialogue: 0,0:06:19.27,0:06:22.66,Default,,0000,0000,0000,,eye key on your keyboard they'll just Dialogue: 0,0:06:20.44,0:06:24.31,Default,,0000,0000,0000,,say eye but for a different key Dialogue: 0,0:06:22.66,0:06:27.13,Default,,0000,0000,0000,,combinations like when you press control Dialogue: 0,0:06:24.31,0:06:29.92,Default,,0000,0000,0000,,and something like say control V it's Dialogue: 0,0:06:27.13,0:06:32.35,Default,,0000,0000,0000,,notated in one of like approximately Dialogue: 0,0:06:29.92,0:06:34.60,Default,,0000,0000,0000,,three ways one way that can be notated Dialogue: 0,0:06:32.35,0:06:37.48,Default,,0000,0000,0000,,is a caret and then the control Dialogue: 0,0:06:34.60,0:06:39.58,Default,,0000,0000,0000,,character so this is control V another Dialogue: 0,0:06:37.48,0:06:40.66,Default,,0000,0000,0000,,way this might be written I think we've Dialogue: 0,0:06:39.58,0:06:42.25,Default,,0000,0000,0000,,written it this way in Dialogue: 0,0:06:40.66,0:06:43.15,Default,,0000,0000,0000,,lecture notes as control-v this is Dialogue: 0,0:06:42.25,0:06:46.06,Default,,0000,0000,0000,,probably the one you're more used to Dialogue: 0,0:06:43.15,0:06:48.88,Default,,0000,0000,0000,,seeing and then in some parts of them Dialogue: 0,0:06:46.06,0:06:51.01,Default,,0000,0000,0000,,this is written as angle brackets C - V Dialogue: 0,0:06:48.88,0:06:54.21,Default,,0000,0000,0000,,close angle bracket so just a little bit Dialogue: 0,0:06:51.01,0:06:54.21,Default,,0000,0000,0000,,of notation that will be useful later Dialogue: 0,0:06:54.22,0:06:59.35,Default,,0000,0000,0000,,so yeah vim has a couple different modes Dialogue: 0,0:06:56.95,0:07:01.54,Default,,0000,0000,0000,,where normal mode is designed for Dialogue: 0,0:06:59.35,0:07:03.52,Default,,0000,0000,0000,,navigating around a file reading things Dialogue: 0,0:07:01.54,0:07:05.62,Default,,0000,0000,0000,,going from file to file things like that Dialogue: 0,0:07:03.52,0:07:08.38,Default,,0000,0000,0000,,and then insert mode is where you type Dialogue: 0,0:07:05.62,0:07:10.33,Default,,0000,0000,0000,,in text so most keys that you press here Dialogue: 0,0:07:08.38,0:07:12.04,Default,,0000,0000,0000,,will just go into your text buffer where Dialogue: 0,0:07:10.33,0:07:13.78,Default,,0000,0000,0000,,as keys that you press here are not Dialogue: 0,0:07:12.04,0:07:15.19,Default,,0000,0000,0000,,being put into the buffer and instead Dialogue: 0,0:07:13.78,0:07:20.38,Default,,0000,0000,0000,,are used for things like navigation or Dialogue: 0,0:07:15.19,0:07:21.52,Default,,0000,0000,0000,,making edits and actually the picture is Dialogue: 0,0:07:20.38,0:07:23.20,Default,,0000,0000,0000,,a little bit more complicated than this Dialogue: 0,0:07:21.52,0:07:24.37,Default,,0000,0000,0000,,there are a whole bunch of other modes Dialogue: 0,0:07:23.20,0:07:25.90,Default,,0000,0000,0000,,and I'm just gonna write them down here Dialogue: 0,0:07:24.37,0:07:29.05,Default,,0000,0000,0000,,because we'll have them here to refer to Dialogue: 0,0:07:25.90,0:07:33.10,Default,,0000,0000,0000,,later and so if it also has a replace Dialogue: 0,0:07:29.05,0:07:34.03,Default,,0000,0000,0000,,mode for rather than inserting text and Dialogue: 0,0:07:33.10,0:07:36.16,Default,,0000,0000,0000,,kind of pushing what's ahead of it Dialogue: 0,0:07:34.03,0:07:37.81,Default,,0000,0000,0000,,forward it will overwrite text and then Dialogue: 0,0:07:36.16,0:07:44.92,Default,,0000,0000,0000,,it has a bunch of different modes for Dialogue: 0,0:07:37.81,0:07:48.04,Default,,0000,0000,0000,,selection so it has a mode called visual Dialogue: 0,0:07:44.92,0:07:53.71,Default,,0000,0000,0000,,mode and then it has visual line and Dialogue: 0,0:07:48.04,0:07:57.04,Default,,0000,0000,0000,,visual block this one is enter via the R Dialogue: 0,0:07:53.71,0:08:01.81,Default,,0000,0000,0000,,key this was entered via the V key this Dialogue: 0,0:07:57.04,0:08:05.68,Default,,0000,0000,0000,,one is entered via shift B and this one Dialogue: 0,0:08:01.81,0:08:13.30,Default,,0000,0000,0000,,is entered via control V and then Dialogue: 0,0:08:05.68,0:08:17.43,Default,,0000,0000,0000,,there's the command line mode which is Dialogue: 0,0:08:13.30,0:08:17.43,Default,,0000,0000,0000,,entered via the colon key Dialogue: 0,0:08:19.18,0:08:31.30,Default,,0000,0000,0000,,okay so now that we have that on the Dialogue: 0,0:08:21.07,0:08:35.23,Default,,0000,0000,0000,,board to refer to later we can actually Dialogue: 0,0:08:31.30,0:08:36.34,Default,,0000,0000,0000,,try some of this out all right so one Dialogue: 0,0:08:35.23,0:08:38.56,Default,,0000,0000,0000,,thing we noticed looking at that picture Dialogue: 0,0:08:36.34,0:08:40.39,Default,,0000,0000,0000,,is that to go from normal mode to any of Dialogue: 0,0:08:38.56,0:08:41.80,Default,,0000,0000,0000,,the other modes we press some key but to Dialogue: 0,0:08:40.39,0:08:43.33,Default,,0000,0000,0000,,go from any of the other modes back to Dialogue: 0,0:08:41.80,0:08:45.19,Default,,0000,0000,0000,,normal mode where we spend a lot of our Dialogue: 0,0:08:43.33,0:08:48.64,Default,,0000,0000,0000,,time we use the Escape key on our Dialogue: 0,0:08:45.19,0:08:49.96,Default,,0000,0000,0000,,keyboard so for this reason since you Dialogue: 0,0:08:48.64,0:08:51.97,Default,,0000,0000,0000,,under pressing the Escape key a lot when Dialogue: 0,0:08:49.96,0:08:53.65,Default,,0000,0000,0000,,using vim a lot of programmers rebind Dialogue: 0,0:08:51.97,0:08:55.18,Default,,0000,0000,0000,,one of the keys on their keyboard to be Dialogue: 0,0:08:53.65,0:08:56.62,Default,,0000,0000,0000,,escape because it's really inconvenient Dialogue: 0,0:08:55.18,0:08:58.06,Default,,0000,0000,0000,,to reach up with your left pinkie to Dialogue: 0,0:08:56.62,0:08:59.92,Default,,0000,0000,0000,,press that tiny little Escape key in the Dialogue: 0,0:08:58.06,0:09:01.87,Default,,0000,0000,0000,,corner of your keyboard and so a lot of Dialogue: 0,0:08:59.92,0:09:04.54,Default,,0000,0000,0000,,people use the caps lock key instead so Dialogue: 0,0:09:01.87,0:09:06.58,Default,,0000,0000,0000,,it's right there in the home row and we Dialogue: 0,0:09:04.54,0:09:14.38,Default,,0000,0000,0000,,have some links in the lecture notes for Dialogue: 0,0:09:06.58,0:09:15.73,Default,,0000,0000,0000,,how you can do this key rebinding okay Dialogue: 0,0:09:14.38,0:09:17.50,Default,,0000,0000,0000,,so now that we've talked about kind of Dialogue: 0,0:09:15.73,0:09:19.30,Default,,0000,0000,0000,,one of the core ideas of vim the idea of Dialogue: 0,0:09:17.50,0:09:20.83,Default,,0000,0000,0000,,modal editing we can talk about some of Dialogue: 0,0:09:19.30,0:09:23.08,Default,,0000,0000,0000,,the basics like how do you open up this Dialogue: 0,0:09:20.83,0:09:25.87,Default,,0000,0000,0000,,text editor how do you open file save Dialogue: 0,0:09:23.08,0:09:28.24,Default,,0000,0000,0000,,files and things like that and so this Dialogue: 0,0:09:25.87,0:09:29.74,Default,,0000,0000,0000,,is a command line based program although Dialogue: 0,0:09:28.24,0:09:31.90,Default,,0000,0000,0000,,there are some graphical variants and Dialogue: 0,0:09:29.74,0:09:34.42,Default,,0000,0000,0000,,the way you start this program is by Dialogue: 0,0:09:31.90,0:09:35.80,Default,,0000,0000,0000,,running vim one thing you might notice Dialogue: 0,0:09:34.42,0:09:37.51,Default,,0000,0000,0000,,is that in the bottom left corner of my Dialogue: 0,0:09:35.80,0:09:40.09,Default,,0000,0000,0000,,screen they actually saw what I just Dialogue: 0,0:09:37.51,0:09:41.53,Default,,0000,0000,0000,,typed this will be useful later in this Dialogue: 0,0:09:40.09,0:09:44.02,Default,,0000,0000,0000,,lecture where I'm actually typing in Dialogue: 0,0:09:41.53,0:09:45.37,Default,,0000,0000,0000,,commands for vim and I'll be saying what Dialogue: 0,0:09:44.02,0:09:47.89,Default,,0000,0000,0000,,I'm typing but you'll also see it on the Dialogue: 0,0:09:45.37,0:09:50.38,Default,,0000,0000,0000,,screen so if I press ctrl C see it says Dialogue: 0,0:09:47.89,0:09:55.51,Default,,0000,0000,0000,,ctrl C over there is that text big Dialogue: 0,0:09:50.38,0:09:57.61,Default,,0000,0000,0000,,enough for everybody to read great okay Dialogue: 0,0:09:55.51,0:09:59.80,Default,,0000,0000,0000,,so the way we open vim is just by Dialogue: 0,0:09:57.61,0:10:02.47,Default,,0000,0000,0000,,running the program vim on our command Dialogue: 0,0:09:59.80,0:10:03.79,Default,,0000,0000,0000,,line and this comes pre-installed on Dialogue: 0,0:10:02.47,0:10:05.02,Default,,0000,0000,0000,,most systems and if you don't have it Dialogue: 0,0:10:03.79,0:10:07.60,Default,,0000,0000,0000,,you can install it using your package Dialogue: 0,0:10:05.02,0:10:08.56,Default,,0000,0000,0000,,manager vim can also take an argument if Dialogue: 0,0:10:07.60,0:10:10.57,Default,,0000,0000,0000,,we want to use it to edit a particular Dialogue: 0,0:10:08.56,0:10:12.85,Default,,0000,0000,0000,,file instead of just opening up the Dialogue: 0,0:10:10.57,0:10:15.31,Default,,0000,0000,0000,,program then later opening a file so for Dialogue: 0,0:10:12.85,0:10:17.14,Default,,0000,0000,0000,,example I have a file in this directory Dialogue: 0,0:10:15.31,0:10:19.69,Default,,0000,0000,0000,,this is actually the lecture notes for Dialogue: 0,0:10:17.14,0:10:21.94,Default,,0000,0000,0000,,this lecture so I can do vim editors MD Dialogue: 0,0:10:19.69,0:10:25.69,Default,,0000,0000,0000,,and press ENTER and then boom them is Dialogue: 0,0:10:21.94,0:10:29.82,Default,,0000,0000,0000,,started and then in this lecture I'm not Dialogue: 0,0:10:25.69,0:10:32.86,Default,,0000,0000,0000,,running vim in the completely Exton I've Dialogue: 0,0:10:29.82,0:10:34.93,Default,,0000,0000,0000,,configured a couple of things that Dialogue: 0,0:10:32.86,0:10:36.94,Default,,0000,0000,0000,,behave a little bit nicer by defaults Dialogue: 0,0:10:34.93,0:10:38.41,Default,,0000,0000,0000,,little things like having line numbers Dialogue: 0,0:10:36.94,0:10:40.21,Default,,0000,0000,0000,,on the left or having some more status Dialogue: 0,0:10:38.41,0:10:41.14,Default,,0000,0000,0000,,information on the bottom and if you Dialogue: 0,0:10:40.21,0:10:42.85,Default,,0000,0000,0000,,want to start with this default Dialogue: 0,0:10:41.14,0:10:43.93,Default,,0000,0000,0000,,configuration we have a link to this in Dialogue: 0,0:10:42.85,0:10:49.27,Default,,0000,0000,0000,,the lecture notes so you can get a Dialogue: 0,0:10:43.93,0:10:51.25,Default,,0000,0000,0000,,slightly more sane config by default. So, Dialogue: 0,0:10:49.27,0:10:53.29,Default,,0000,0000,0000,,once you've opened Vim, what do you do? Dialogue: 0,0:10:51.25,0:10:54.58,Default,,0000,0000,0000,,Well, as I said earlier, Vim starts in Dialogue: 0,0:10:53.29,0:10:57.88,Default,,0000,0000,0000,,normal mode, so if I just start typing Dialogue: 0,0:10:54.58,0:10:59.65,Default,,0000,0000,0000,,letters like, say, type X it didn't insert Dialogue: 0,0:10:57.88,0:11:01.66,Default,,0000,0000,0000,,X into the buffer. You can see the cursor Dialogue: 0,0:10:59.65,0:11:03.61,Default,,0000,0000,0000,,up in the top left: it actually deleted Dialogue: 0,0:11:01.66,0:11:07.30,Default,,0000,0000,0000,,one of the characters. That's because I'm Dialogue: 0,0:11:03.61,0:11:08.62,Default,,0000,0000,0000,,in normal mode, not insert mode. So insert Dialogue: 0,0:11:07.30,0:11:09.85,Default,,0000,0000,0000,,mode is basically what you're used to with Dialogue: 0,0:11:08.62,0:11:10.90,Default,,0000,0000,0000,,all the other text editors you've used Dialogue: 0,0:11:09.85,0:11:12.31,Default,,0000,0000,0000,,in the past, where there's a cursor Dialogue: 0,0:11:10.90,0:11:15.31,Default,,0000,0000,0000,,somewhere, you press the character, and it Dialogue: 0,0:11:12.31,0:11:18.13,Default,,0000,0000,0000,,just goes into your buffer. I'm instead Dialogue: 0,0:11:15.31,0:11:19.90,Default,,0000,0000,0000,,in vim you start a normal mode and you Dialogue: 0,0:11:18.13,0:11:21.61,Default,,0000,0000,0000,,can press I to go into insert mode so Dialogue: 0,0:11:19.90,0:11:23.98,Default,,0000,0000,0000,,see I've pressed I and then in the Dialogue: 0,0:11:21.61,0:11:26.50,Default,,0000,0000,0000,,bottom left notice that it says - - Dialogue: 0,0:11:23.98,0:11:27.85,Default,,0000,0000,0000,,insert the bottom left always tells you Dialogue: 0,0:11:26.50,0:11:29.65,Default,,0000,0000,0000,,what mode you're in unless this normal Dialogue: 0,0:11:27.85,0:11:31.27,Default,,0000,0000,0000,,mode in which case it's blank and now Dialogue: 0,0:11:29.65,0:11:33.25,Default,,0000,0000,0000,,that I'm an insert mode if I press the X Dialogue: 0,0:11:31.27,0:11:35.74,Default,,0000,0000,0000,,character for example see it just gets Dialogue: 0,0:11:33.25,0:11:37.45,Default,,0000,0000,0000,,inserted into my text buffer and I can Dialogue: 0,0:11:35.74,0:11:39.58,Default,,0000,0000,0000,,backspace over at type other stuff and Dialogue: 0,0:11:37.45,0:11:41.40,Default,,0000,0000,0000,,now my text editor kind of behaves like Dialogue: 0,0:11:39.58,0:11:43.78,Default,,0000,0000,0000,,you'd expect any other program to behave Dialogue: 0,0:11:41.40,0:11:45.52,Default,,0000,0000,0000,,so from this point how to go back to Dialogue: 0,0:11:43.78,0:11:48.91,Default,,0000,0000,0000,,normal mode if I want to stop inserting Dialogue: 0,0:11:45.52,0:11:51.67,Default,,0000,0000,0000,,characters. Yes, exactly. I press escape. Dialogue: 0,0:11:48.91,0:11:53.83,Default,,0000,0000,0000,,And, that's the symbol my keystroke Dialogue: 0,0:11:51.67,0:11:58.96,Default,,0000,0000,0000,,visualizer uses for escape, so Dialogue: 0,0:11:53.83,0:12:01.15,Default,,0000,0000,0000,,just be aware of that. And then, Vim has Dialogue: 0,0:11:58.96,0:12:02.89,Default,,0000,0000,0000,,this idea, that using the mouse is Dialogue: 0,0:12:01.15,0:12:04.57,Default,,0000,0000,0000,,inefficient, like your hands are on the Dialogue: 0,0:12:02.89,0:12:06.46,Default,,0000,0000,0000,,keyboard, moving your hand over to the Dialogue: 0,0:12:04.57,0:12:08.29,Default,,0000,0000,0000,,mouse takes a lot of time, right, like you Dialogue: 0,0:12:06.46,0:12:09.61,Default,,0000,0000,0000,,don't want to waste those couple of Dialogue: 0,0:12:08.29,0:12:11.41,Default,,0000,0000,0000,,milliseconds while you're programming, Dialogue: 0,0:12:09.61,0:12:13.99,Default,,0000,0000,0000,,like in the middle of things. So, instead, Dialogue: 0,0:12:11.41,0:12:15.70,Default,,0000,0000,0000,,all Vim functionality can be accessed Dialogue: 0,0:12:13.99,0:12:16.78,Default,,0000,0000,0000,,just through the keyboard. And, it's all Dialogue: 0,0:12:15.70,0:12:19.33,Default,,0000,0000,0000,,sorts of things you might be used to Dialogue: 0,0:12:16.78,0:12:21.46,Default,,0000,0000,0000,,doing like opening files by going, like, Dialogue: 0,0:12:19.33,0:12:23.05,Default,,0000,0000,0000,,file open, or file save, or things like Dialogue: 0,0:12:21.46,0:12:25.45,Default,,0000,0000,0000,,that, or instead access through the Dialogue: 0,0:12:23.05,0:12:27.52,Default,,0000,0000,0000,,keyboard. And, how is that done? That's Dialogue: 0,0:12:25.45,0:12:28.69,Default,,0000,0000,0000,,done through one of the other Vim modes Dialogue: 0,0:12:27.52,0:12:31.96,Default,,0000,0000,0000,,that are on the board over there. In Dialogue: 0,0:12:28.69,0:12:33.85,Default,,0000,0000,0000,,particular, through command line mode. So, Dialogue: 0,0:12:31.96,0:12:36.37,Default,,0000,0000,0000,,if you're in normal mode, and you press Dialogue: 0,0:12:33.85,0:12:39.37,Default,,0000,0000,0000,,the ":" key, you'll notice that the Dialogue: 0,0:12:36.37,0:12:41.32,Default,,0000,0000,0000,,cursor - I guess my visualizer is covering Dialogue: 0,0:12:39.37,0:12:43.06,Default,,0000,0000,0000,,the thing right now but it's gone - the Dialogue: 0,0:12:41.32,0:12:46.11,Default,,0000,0000,0000,,cursor jumps to the bottom - the bottom Dialogue: 0,0:12:43.06,0:12:48.51,Default,,0000,0000,0000,,left - and it shows that ":" I just typed. Dialogue: 0,0:12:46.11,0:12:50.22,Default,,0000,0000,0000,,Now, I can type in a command. So, you can Dialogue: 0,0:12:48.51,0:12:51.57,Default,,0000,0000,0000,,think of this almost like the command Dialogue: 0,0:12:50.22,0:12:53.16,Default,,0000,0000,0000,,shell that we've talked been talking Dialogue: 0,0:12:51.57,0:12:54.03,Default,,0000,0000,0000,,about over the last few days, except this Dialogue: 0,0:12:53.16,0:12:55.80,Default,,0000,0000,0000,,is Vim's Dialogue: 0,0:12:54.03,0:12:57.20,Default,,0000,0000,0000,,command shell, so you give Vim commands Dialogue: 0,0:12:55.80,0:12:59.34,Default,,0000,0000,0000,,here, instead of shell commands. And Dialogue: 0,0:12:57.20,0:13:00.60,Default,,0000,0000,0000,,there are a bunch of built-in commands Dialogue: 0,0:12:59.34,0:13:02.82,Default,,0000,0000,0000,,that do all the things that you're used Dialogue: 0,0:13:00.60,0:13:04.26,Default,,0000,0000,0000,,to. Like, for example, one command that you Dialogue: 0,0:13:02.82,0:13:05.67,Default,,0000,0000,0000,,might want to know is how to quit this Dialogue: 0,0:13:04.26,0:13:07.44,Default,,0000,0000,0000,,editor. You might notice that if you're in Dialogue: 0,0:13:05.67,0:13:08.73,Default,,0000,0000,0000,,normal mode, I can press "Escape" to go Dialogue: 0,0:13:07.44,0:13:11.94,Default,,0000,0000,0000,,back from command line mode to normal Dialogue: 0,0:13:08.73,0:13:13.56,Default,,0000,0000,0000,,mode, and I press "control C", unlike what Dialogue: 0,0:13:11.94,0:13:16.02,Default,,0000,0000,0000,,happens to a lot of programs, this doesn't Dialogue: 0,0:13:13.56,0:13:18.36,Default,,0000,0000,0000,,quit Vim. So, how do I quit Vim? I can Dialogue: 0,0:13:16.02,0:13:19.86,Default,,0000,0000,0000,,press ":", and then go into command Dialogue: 0,0:13:18.36,0:13:23.43,Default,,0000,0000,0000,,line mode, and then I can type in the Dialogue: 0,0:13:19.86,0:13:24.87,Default,,0000,0000,0000,,command "quit". "Q-U-I-T". You'll see that I Dialogue: 0,0:13:23.43,0:13:28.56,Default,,0000,0000,0000,,- maybe I should move this over to the Dialogue: 0,0:13:24.87,0:13:31.35,Default,,0000,0000,0000,,middle or something - see, it says ":quit" Dialogue: 0,0:13:28.56,0:13:32.91,Default,,0000,0000,0000,,and I press ENTER, and it quits Vim. I can Dialogue: 0,0:13:31.35,0:13:35.49,Default,,0000,0000,0000,,open Vim up again. There's actually a Dialogue: 0,0:13:32.91,0:13:38.43,Default,,0000,0000,0000,,short form for this command, just ":q", and Dialogue: 0,0:13:35.49,0:13:40.02,Default,,0000,0000,0000,,that'll do the same thing. And, there are a Dialogue: 0,0:13:38.43,0:13:42.84,Default,,0000,0000,0000,,bunch of other useful commands like this. Dialogue: 0,0:13:40.02,0:13:45.15,Default,,0000,0000,0000,,So, some other handy ones to know are Dialogue: 0,0:13:42.84,0:13:47.79,Default,,0000,0000,0000,,how do you save a file? So, suppose I make Dialogue: 0,0:13:45.15,0:13:51.42,Default,,0000,0000,0000,,some edits here, like "hello world". Dialogue: 0,0:13:47.79,0:13:53.97,Default,,0000,0000,0000,,So, I pressed "i" to go into insert mode - or Dialogue: 0,0:13:51.42,0:13:55.56,Default,,0000,0000,0000,,let me redo that - I press "i" to go into Dialogue: 0,0:13:53.97,0:14:02.01,Default,,0000,0000,0000,,insert mode. Right now, I can use the down Dialogue: 0,0:13:55.56,0:14:03.24,Default,,0000,0000,0000,,arrow to... I think I've slightly I Dialogue: 0,0:14:02.01,0:14:07.02,Default,,0000,0000,0000,,should fix that. Can you fix the config, Dialogue: 0,0:14:03.24,0:14:11.73,Default,,0000,0000,0000,,actually, John? Never mind that. Dialogue: 0,0:14:07.02,0:14:14.82,Default,,0000,0000,0000,,Okay, so, suppose I go down to this line, Dialogue: 0,0:14:11.73,0:14:17.01,Default,,0000,0000,0000,,and I press "i" to go into insert mode, and Dialogue: 0,0:14:14.82,0:14:18.93,Default,,0000,0000,0000,,type in some text, and then press "escape" Dialogue: 0,0:14:17.01,0:14:20.61,Default,,0000,0000,0000,,to go back to normal mode. Now, how do I Dialogue: 0,0:14:18.93,0:14:22.68,Default,,0000,0000,0000,,actually save this file? Well, there's Dialogue: 0,0:14:20.61,0:14:25.55,Default,,0000,0000,0000,,another command for that. So, ":" to go Dialogue: 0,0:14:22.68,0:14:30.48,Default,,0000,0000,0000,,into command mode, and then I can type "W"... Dialogue: 0,0:14:25.55,0:14:33.24,Default,,0000,0000,0000,,...and press "Enter". "W" stands for write. And, Dialogue: 0,0:14:30.48,0:14:35.70,Default,,0000,0000,0000,,it says in the bottom "editors.md" Dialogue: 0,0:14:33.24,0:14:37.83,Default,,0000,0000,0000,,whatever blah blah written. And, so, this Dialogue: 0,0:14:35.70,0:14:40.32,Default,,0000,0000,0000,,means it saved the file and so now if I Dialogue: 0,0:14:37.83,0:14:42.21,Default,,0000,0000,0000,,":q" to quit and open the same file, Dialogue: 0,0:14:40.32,0:14:46.85,Default,,0000,0000,0000,,again, you'll see that the changes have Dialogue: 0,0:14:42.21,0:14:49.02,Default,,0000,0000,0000,,been persisted. There are a couple other Dialogue: 0,0:14:46.85,0:14:50.13,Default,,0000,0000,0000,,there's... So, there's a ton of different Dialogue: 0,0:14:49.02,0:14:53.07,Default,,0000,0000,0000,,Vim commands that are useful for Dialogue: 0,0:14:50.13,0:14:56.10,Default,,0000,0000,0000,,different reasons. But, I'll just explain Dialogue: 0,0:14:53.07,0:14:59.07,Default,,0000,0000,0000,,a couple more to you now. One command Dialogue: 0,0:14:56.10,0:15:01.50,Default,,0000,0000,0000,,that's really useful is help. ":help" Dialogue: 0,0:14:59.07,0:15:04.08,Default,,0000,0000,0000,,And you can do ":help", and then type in a Dialogue: 0,0:15:01.50,0:15:06.09,Default,,0000,0000,0000,,particular key, or a particular command, Dialogue: 0,0:15:04.08,0:15:08.58,Default,,0000,0000,0000,,and get help for that keystroke or that Dialogue: 0,0:15:06.09,0:15:10.95,Default,,0000,0000,0000,,command. So, if I want to know what Dialogue: 0,0:15:08.58,0:15:15.42,Default,,0000,0000,0000,,":w" does, I Dialogue: 0,0:15:10.95,0:15:21.30,Default,,0000,0000,0000,,can do : help : W, and that'll give me Dialogue: 0,0:15:15.42,0:15:23.16,Default,,0000,0000,0000,,the documentation on : w or : write. If I Dialogue: 0,0:15:21.30,0:15:25.56,Default,,0000,0000,0000,,do : q, it'll close this window and bring Dialogue: 0,0:15:23.16,0:15:28.53,Default,,0000,0000,0000,,me back to where I was before. Dialogue: 0,0:15:25.56,0:15:35.34,Default,,0000,0000,0000,,And, notice that ":help :w" is different Dialogue: 0,0:15:28.53,0:15:38.19,Default,,0000,0000,0000,,from ":help w", because the W key is the W Dialogue: 0,0:15:35.34,0:15:40.59,Default,,0000,0000,0000,,that, like, when you're in normal mode and Dialogue: 0,0:15:38.19,0:15:41.67,Default,,0000,0000,0000,,press W, what happens is just the W key Dialogue: 0,0:15:40.59,0:15:43.53,Default,,0000,0000,0000,,here without the ":". Dialogue: 0,0:15:41.67,0:15:50.34,Default,,0000,0000,0000,,And, if I look for help for ":w", that's Dialogue: 0,0:15:43.53,0:15:56.04,Default,,0000,0000,0000,,the help for the W command. So, now you Dialogue: 0,0:15:50.34,0:15:58.11,Default,,0000,0000,0000,,basically have the bare fundamentals Dialogue: 0,0:15:56.04,0:16:00.72,Default,,0000,0000,0000,,needed to use them. right? You can open Dialogue: 0,0:15:58.11,0:16:03.18,Default,,0000,0000,0000,,the editor, use it to edit a particular Dialogue: 0,0:16:00.72,0:16:05.01,Default,,0000,0000,0000,,file, press "i" to go into insert mode and Dialogue: 0,0:16:03.18,0:16:06.84,Default,,0000,0000,0000,,type in some text, press "escape" to go Dialogue: 0,0:16:05.01,0:16:09.63,Default,,0000,0000,0000,,back to normal mode, and then :w to save Dialogue: 0,0:16:06.84,0:16:11.46,Default,,0000,0000,0000,,your changes, :w to quit. So, like already Dialogue: 0,0:16:09.63,0:16:13.92,Default,,0000,0000,0000,,you have the bare fundamentals necessary Dialogue: 0,0:16:11.46,0:16:17.21,Default,,0000,0000,0000,,to edit files using Vim, albeit somewhat Dialogue: 0,0:16:13.92,0:16:23.70,Default,,0000,0000,0000,,inefficiently. So, any questions so far? Dialogue: 0,0:16:17.21,0:16:25.47,Default,,0000,0000,0000,,Yeah in the back. Yeah so the question is, Dialogue: 0,0:16:23.70,0:16:27.06,Default,,0000,0000,0000,,What's the benefit of the Dialogue: 0,0:16:25.47,0:16:28.59,Default,,0000,0000,0000,,normal mode? And, we'll talk about that in Dialogue: 0,0:16:27.06,0:16:31.56,Default,,0000,0000,0000,,more detail, in like five minutes. Dialogue: 0,0:16:28.59,0:16:33.03,Default,,0000,0000,0000,,But, in short, insert mode is just for Dialogue: 0,0:16:31.56,0:16:34.92,Default,,0000,0000,0000,,typing in text. So, I'm in insert mode, I Dialogue: 0,0:16:33.03,0:16:36.27,Default,,0000,0000,0000,,can type in text. But, when I'm Dialogue: 0,0:16:34.92,0:16:39.00,Default,,0000,0000,0000,,programming, I actually spend a lot of Dialogue: 0,0:16:36.27,0:16:40.59,Default,,0000,0000,0000,,time moving around my file making small Dialogue: 0,0:16:39.00,0:16:42.21,Default,,0000,0000,0000,,little changes. So, I go here and like, oh Dialogue: 0,0:16:40.59,0:16:45.39,Default,,0000,0000,0000,,maybe I want to change this HTTPS link to Dialogue: 0,0:16:42.21,0:16:48.12,Default,,0000,0000,0000,,an HTTP. Dialogue: 0,0:16:45.39,0:16:49.92,Default,,0000,0000,0000,,I can make like small point edits, things Dialogue: 0,0:16:48.12,0:16:51.12,Default,,0000,0000,0000,,like that, in normal mode. And we'll see a Dialogue: 0,0:16:49.92,0:16:52.92,Default,,0000,0000,0000,,whole lot more of that in about five Dialogue: 0,0:16:51.12,0:16:59.13,Default,,0000,0000,0000,,minutes. Good question! Dialogue: 0,0:16:52.92,0:17:05.07,Default,,0000,0000,0000,,Any other questions? Okay cool. So, moving Dialogue: 0,0:16:59.13,0:17:11.10,Default,,0000,0000,0000,,along, one other thing that's kind of Dialogue: 0,0:17:05.07,0:17:12.72,Default,,0000,0000,0000,,useful to know, I think, is, at a high Dialogue: 0,0:17:11.10,0:17:15.48,Default,,0000,0000,0000,,level, Vim's model of Dialogue: 0,0:17:12.72,0:17:16.47,Default,,0000,0000,0000,,buffers versus windows versus tabs. So, Dialogue: 0,0:17:15.48,0:17:17.94,Default,,0000,0000,0000,,it's probably the case that whatever Dialogue: 0,0:17:16.47,0:17:19.83,Default,,0000,0000,0000,,program you were using before, like Dialogue: 0,0:17:17.94,0:17:21.90,Default,,0000,0000,0000,,Sublime Text or VS Code or whatever, Dialogue: 0,0:17:19.83,0:17:23.25,Default,,0000,0000,0000,,you could open multiple files in it, Dialogue: 0,0:17:21.90,0:17:24.90,Default,,0000,0000,0000,,right, and you could probably have Dialogue: 0,0:17:23.25,0:17:27.45,Default,,0000,0000,0000,,multiple tabs open and have multiple Dialogue: 0,0:17:24.90,0:17:29.13,Default,,0000,0000,0000,,windows open of your editor. So, Vim also Dialogue: 0,0:17:27.45,0:17:31.20,Default,,0000,0000,0000,,has a notion of those different things. Dialogue: 0,0:17:29.13,0:17:34.38,Default,,0000,0000,0000,,But, its model is a little bit different Dialogue: 0,0:17:31.20,0:17:36.36,Default,,0000,0000,0000,,than most other programs. So, Vim Dialogue: 0,0:17:34.38,0:17:38.34,Default,,0000,0000,0000,,maintains a set of open buffers - that's Dialogue: 0,0:17:36.36,0:17:40.32,Default,,0000,0000,0000,,the word it uses for open files - and so, Dialogue: 0,0:17:38.34,0:17:42.24,Default,,0000,0000,0000,,it has a set of open files, and then kind Dialogue: 0,0:17:40.32,0:17:44.49,Default,,0000,0000,0000,,of separately from that, you can have a Dialogue: 0,0:17:42.24,0:17:46.62,Default,,0000,0000,0000,,number of tabs, and tabs can have windows. Dialogue: 0,0:17:44.49,0:17:47.46,Default,,0000,0000,0000,,The kind of weird thing which makes Vim Dialogue: 0,0:17:46.62,0:17:48.90,Default,,0000,0000,0000,,a little bit different than the Dialogue: 0,0:17:47.46,0:17:50.73,Default,,0000,0000,0000,,program you've probably used in the past is Dialogue: 0,0:17:48.90,0:17:52.05,Default,,0000,0000,0000,,that there isn't necessarily a Dialogue: 0,0:17:50.73,0:17:55.20,Default,,0000,0000,0000,,one-to-one correspondence between Dialogue: 0,0:17:52.05,0:17:56.67,Default,,0000,0000,0000,,buffers and windows. So, one thing I can Dialogue: 0,0:17:55.20,0:17:58.26,Default,,0000,0000,0000,,do, for example, here - and we'll show you Dialogue: 0,0:17:56.67,0:18:00.99,Default,,0000,0000,0000,,the key combinations and stuff for this Dialogue: 0,0:17:58.26,0:18:02.22,Default,,0000,0000,0000,,later - but one thing you can do is create Dialogue: 0,0:18:00.99,0:18:04.11,Default,,0000,0000,0000,,two different windows. So, I have one Dialogue: 0,0:18:02.22,0:18:07.14,Default,,0000,0000,0000,,window up here, and then one window down Dialogue: 0,0:18:04.11,0:18:08.61,Default,,0000,0000,0000,,here. And, notice that the same files open Dialogue: 0,0:18:07.14,0:18:10.53,Default,,0000,0000,0000,,in both windows. So, if I make some edits Dialogue: 0,0:18:08.61,0:18:11.76,Default,,0000,0000,0000,,over here, they actually happen in the Dialogue: 0,0:18:10.53,0:18:13.73,Default,,0000,0000,0000,,bottom window, as well, because it's the Dialogue: 0,0:18:11.76,0:18:14.41,Default,,0000,0000,0000,,same buffer that's open in both windows. Dialogue: 0,0:18:14.41,0:18:18.27,Default,,0000,0000,0000,,And, this is kind of useful, for, say, Dialogue: 0,0:18:16.59,0:18:19.83,Default,,0000,0000,0000,,looking at two different parts of a Dialogue: 0,0:18:18.27,0:18:20.94,Default,,0000,0000,0000,,single file at the same time. Like, so you Dialogue: 0,0:18:19.83,0:18:22.92,Default,,0000,0000,0000,,want to be able to look at the top of a Dialogue: 0,0:18:20.94,0:18:25.05,Default,,0000,0000,0000,,file, say at an import to your program, Dialogue: 0,0:18:22.92,0:18:27.81,Default,,0000,0000,0000,,while you're down below, working Dialogue: 0,0:18:25.05,0:18:29.13,Default,,0000,0000,0000,,somewhere else. So, this is one helpful Dialogue: 0,0:18:27.81,0:18:32.100,Default,,0000,0000,0000,,thing to keep in mind, that Vim has this Dialogue: 0,0:18:29.13,0:18:35.73,Default,,0000,0000,0000,,idea of - there are a number of tabs, and Dialogue: 0,0:18:32.100,0:18:38.16,Default,,0000,0000,0000,,each tab has some number of windows, and Dialogue: 0,0:18:35.73,0:18:40.65,Default,,0000,0000,0000,,then each window has, uh, corresponds to Dialogue: 0,0:18:38.16,0:18:42.27,Default,,0000,0000,0000,,some buffer. But, a particular buffer can Dialogue: 0,0:18:40.65,0:18:44.40,Default,,0000,0000,0000,,be open in zero or more windows at a Dialogue: 0,0:18:42.27,0:18:45.81,Default,,0000,0000,0000,,time. Just one thing that confused me Dialogue: 0,0:18:44.40,0:18:48.05,Default,,0000,0000,0000,,when I was initially learning Vim, so I Dialogue: 0,0:18:45.81,0:18:50.67,Default,,0000,0000,0000,,want to explain that early on. And then, Dialogue: 0,0:18:48.05,0:18:53.58,Default,,0000,0000,0000,,the ":q" command, which we talked about Dialogue: 0,0:18:50.67,0:18:55.35,Default,,0000,0000,0000,,earlier, is not exactly quit. It's kind of Dialogue: 0,0:18:53.58,0:18:56.73,Default,,0000,0000,0000,,"close the current window", and then, when Dialogue: 0,0:18:55.35,0:18:59.46,Default,,0000,0000,0000,,there are no more open windows, Vim will Dialogue: 0,0:18:56.73,0:19:01.32,Default,,0000,0000,0000,,quit. So, here, if I do ":q", it'll only Dialogue: 0,0:18:59.46,0:19:03.57,Default,,0000,0000,0000,,close the window, I think, on the top here Dialogue: 0,0:19:01.32,0:19:05.61,Default,,0000,0000,0000,,because that's the one I was in, and, now, Dialogue: 0,0:19:03.57,0:19:08.16,Default,,0000,0000,0000,,the remaining window becomes fullscreen. Dialogue: 0,0:19:05.61,0:19:10.38,Default,,0000,0000,0000,,I can do : Q again to close this. Now we're in Dialogue: 0,0:19:08.16,0:19:14.88,Default,,0000,0000,0000,,the second tab that I'd opened. If I do :Q Dialogue: 0,0:19:10.38,0:19:16.23,Default,,0000,0000,0000,,a final time, okay, now, Vim exits. And if Dialogue: 0,0:19:14.88,0:19:17.94,Default,,0000,0000,0000,,you don't want to press ":q" way too many Dialogue: 0,0:19:16.23,0:19:21.42,Default,,0000,0000,0000,,times... Okay, so, here I have three split Dialogue: 0,0:19:17.94,0:19:24.59,Default,,0000,0000,0000,,windows. If I do ":qa", for quit all, it Dialogue: 0,0:19:21.42,0:19:24.59,Default,,0000,0000,0000,,closes all the open windows. Dialogue: 0,0:19:25.37,0:19:30.66,Default,,0000,0000,0000,,All right, so, now, to answer your question of Dialogue: 0,0:19:28.65,0:19:32.61,Default,,0000,0000,0000,,"What is normal mode actually for?" This is Dialogue: 0,0:19:30.66,0:19:34.08,Default,,0000,0000,0000,,another, really cool idea in Vim, and I Dialogue: 0,0:19:32.61,0:19:36.03,Default,,0000,0000,0000,,think this is actually, like, the most Dialogue: 0,0:19:34.08,0:19:38.55,Default,,0000,0000,0000,,fundamentally interesting idea of this Dialogue: 0,0:19:36.03,0:19:42.00,Default,,0000,0000,0000,,program. It's that, like, you're all Dialogue: 0,0:19:38.55,0:19:44.37,Default,,0000,0000,0000,,programmers, you like programming; Vim has Dialogue: 0,0:19:42.00,0:19:47.22,Default,,0000,0000,0000,,this idea that Vim's normal mode, like, Dialogue: 0,0:19:44.37,0:19:49.74,Default,,0000,0000,0000,,Vim's interface, itself, is a programming Dialogue: 0,0:19:47.22,0:19:51.06,Default,,0000,0000,0000,,language. And, let me repeat that. Dialogue: 0,0:19:49.74,0:19:52.86,Default,,0000,0000,0000,,That's like a kind of fundamentally Dialogue: 0,0:19:51.06,0:19:54.02,Default,,0000,0000,0000,,interesting idea: the interface is a Dialogue: 0,0:19:52.86,0:19:56.25,Default,,0000,0000,0000,,programming language. Dialogue: 0,0:19:54.02,0:19:57.57,Default,,0000,0000,0000,,What does that mean? It means that Dialogue: 0,0:19:56.25,0:19:59.28,Default,,0000,0000,0000,,different key combinations have Dialogue: 0,0:19:57.57,0:20:00.15,Default,,0000,0000,0000,,different effects, and, once you learn the Dialogue: 0,0:19:59.28,0:20:02.40,Default,,0000,0000,0000,,different effects, you can actually Dialogue: 0,0:20:00.15,0:20:03.39,Default,,0000,0000,0000,,combine them together - just like in a Dialogue: 0,0:20:02.40,0:20:04.77,Default,,0000,0000,0000,,programming language - you can learn Dialogue: 0,0:20:03.39,0:20:05.88,Default,,0000,0000,0000,,different functions and stuff and then Dialogue: 0,0:20:04.77,0:20:08.07,Default,,0000,0000,0000,,glue them all together to make an Dialogue: 0,0:20:05.88,0:20:09.87,Default,,0000,0000,0000,,interesting program. In the same way, once Dialogue: 0,0:20:08.07,0:20:10.98,Default,,0000,0000,0000,,you learn Vim's different movement and Dialogue: 0,0:20:09.87,0:20:13.89,Default,,0000,0000,0000,,editing commands, and things like that, Dialogue: 0,0:20:10.98,0:20:16.95,Default,,0000,0000,0000,,you can talk to Vim by programming Vim Dialogue: 0,0:20:13.89,0:20:19.17,Default,,0000,0000,0000,,through its interface. And, once this Dialogue: 0,0:20:16.95,0:20:20.88,Default,,0000,0000,0000,,becomes muscle memory, you can basically Dialogue: 0,0:20:19.17,0:20:22.44,Default,,0000,0000,0000,,edit files at the speed at which you Dialogue: 0,0:20:20.88,0:20:23.64,Default,,0000,0000,0000,,think. Like at least for me, I don't think Dialogue: 0,0:20:22.44,0:20:25.32,Default,,0000,0000,0000,,I've been able to do this with any other Dialogue: 0,0:20:23.64,0:20:29.01,Default,,0000,0000,0000,,text editor that I've used in the past, Dialogue: 0,0:20:25.32,0:20:31.38,Default,,0000,0000,0000,,but this one gets pretty close. So, let's Dialogue: 0,0:20:29.01,0:20:34.17,Default,,0000,0000,0000,,dig into how exactly normal mode works. Dialogue: 0,0:20:31.38,0:20:36.14,Default,,0000,0000,0000,,So, you can try to follow along with this, Dialogue: 0,0:20:34.17,0:20:38.40,Default,,0000,0000,0000,,like, open up some random file in Vim, and Dialogue: 0,0:20:36.14,0:20:40.47,Default,,0000,0000,0000,,follow some of the key combinations I Dialogue: 0,0:20:38.40,0:20:42.33,Default,,0000,0000,0000,,type in. So, one basic thing that you Dialogue: 0,0:20:40.47,0:20:44.01,Default,,0000,0000,0000,,might want to do, is just navigate around Dialogue: 0,0:20:42.33,0:20:46.02,Default,,0000,0000,0000,,a buffer. Like, move your cursor up/down/ Dialogue: 0,0:20:44.01,0:20:48.51,Default,,0000,0000,0000,,left/right. And, so the way you do that in Dialogue: 0,0:20:46.02,0:20:50.70,Default,,0000,0000,0000,,Vim, is using the hjkl keys, not the arrow Dialogue: 0,0:20:48.51,0:20:52.05,Default,,0000,0000,0000,,keys. Though they do work by default, try Dialogue: 0,0:20:50.70,0:20:53.52,Default,,0000,0000,0000,,to avoid them, because you don't want to Dialogue: 0,0:20:52.05,0:20:54.66,Default,,0000,0000,0000,,have to move your hand all the way over Dialogue: 0,0:20:53.52,0:20:57.24,Default,,0000,0000,0000,,to the arrow keys. Like, there's a ton of Dialogue: 0,0:20:54.66,0:21:00.51,Default,,0000,0000,0000,,time you're wasting, right? HJKL is right Dialogue: 0,0:20:57.24,0:21:04.02,Default,,0000,0000,0000,,on the home row. And, so, J moves down, K Dialogue: 0,0:21:00.51,0:21:06.39,Default,,0000,0000,0000,,moves up, H moves left, and L moves right. Dialogue: 0,0:21:04.02,0:21:08.94,Default,,0000,0000,0000,,And, this may seem a little unintuitive Dialogue: 0,0:21:06.39,0:21:10.41,Default,,0000,0000,0000,,now; there was some historical reason for Dialogue: 0,0:21:08.94,0:21:13.44,Default,,0000,0000,0000,,it, like, the keyboard the original vi Dialogue: 0,0:21:10.41,0:21:14.91,Default,,0000,0000,0000,,developer used had the hjkl keys, like, Dialogue: 0,0:21:13.44,0:21:17.04,Default,,0000,0000,0000,,labeled, and arranged in a way that made Dialogue: 0,0:21:14.91,0:21:19.26,Default,,0000,0000,0000,,this more reasonable. But, this will very Dialogue: 0,0:21:17.04,0:21:20.37,Default,,0000,0000,0000,,soon become muscle memory. So, this is the Dialogue: 0,0:21:19.26,0:21:24.27,Default,,0000,0000,0000,,basic way you can move your cursor Dialogue: 0,0:21:20.37,0:21:26.07,Default,,0000,0000,0000,,around while in normal mode. Now, what Dialogue: 0,0:21:24.27,0:21:27.72,Default,,0000,0000,0000,,else can you do? Well, if we had to move Dialogue: 0,0:21:26.07,0:21:29.82,Default,,0000,0000,0000,,around files like this, it'd be really Dialogue: 0,0:21:27.72,0:21:31.59,Default,,0000,0000,0000,,slow. We don't want to have to Dialogue: 0,0:21:29.82,0:21:33.21,Default,,0000,0000,0000,,hold down these keys, and like, wait for a Dialogue: 0,0:21:31.59,0:21:34.35,Default,,0000,0000,0000,,long time for Vim to do its thing. And Dialogue: 0,0:21:33.21,0:21:35.76,Default,,0000,0000,0000,,so, there are all these other, different Dialogue: 0,0:21:34.35,0:21:36.65,Default,,0000,0000,0000,,key combinations for doing different Dialogue: 0,0:21:35.76,0:21:38.12,Default,,0000,0000,0000,,movements. Dialogue: 0,0:21:36.65,0:21:39.20,Default,,0000,0000,0000,,Also, by the way, this is all in the Dialogue: 0,0:21:38.12,0:21:40.94,Default,,0000,0000,0000,,lecture notes, so you don't need to Dialogue: 0,0:21:39.20,0:21:43.55,Default,,0000,0000,0000,,memorize every single key and its Dialogue: 0,0:21:40.94,0:21:45.32,Default,,0000,0000,0000,,meaning right now. Just try to understand Dialogue: 0,0:21:43.55,0:21:47.57,Default,,0000,0000,0000,,the overall idea that Vim's interface is Dialogue: 0,0:21:45.32,0:21:50.00,Default,,0000,0000,0000,,a programming language. So, another thing Dialogue: 0,0:21:47.57,0:21:52.82,Default,,0000,0000,0000,,you can do is press the W key. This moves Dialogue: 0,0:21:50.00,0:21:54.62,Default,,0000,0000,0000,,the cursor forward by one word. And then, Dialogue: 0,0:21:52.82,0:21:57.74,Default,,0000,0000,0000,,similarly, the "B" key moves the cursor Dialogue: 0,0:21:54.62,0:21:59.36,Default,,0000,0000,0000,,backward by one word. So, this allows Dialogue: 0,0:21:57.74,0:22:01.82,Default,,0000,0000,0000,,slightly more efficient movement within Dialogue: 0,0:21:59.36,0:22:04.01,Default,,0000,0000,0000,,the line. There's also the "E" key for Dialogue: 0,0:22:01.82,0:22:06.62,Default,,0000,0000,0000,,moving to the end of a word. I'm going to Dialogue: 0,0:22:04.01,0:22:08.03,Default,,0000,0000,0000,,move this over a little bit. So, if I'm Dialogue: 0,0:22:06.62,0:22:09.80,Default,,0000,0000,0000,,here, for example, and I press the "E" key Dialogue: 0,0:22:08.03,0:22:12.85,Default,,0000,0000,0000,,it'll go to the end of this word, end of Dialogue: 0,0:22:09.80,0:22:15.98,Default,,0000,0000,0000,,this word, end of the next word and so on. Dialogue: 0,0:22:12.85,0:22:17.72,Default,,0000,0000,0000,,You can also move by whole lines, so zero Dialogue: 0,0:22:15.98,0:22:19.76,Default,,0000,0000,0000,,moves to the beginning of a line, dollar Dialogue: 0,0:22:17.72,0:22:22.64,Default,,0000,0000,0000,,sign moves to the end of a line, and the Dialogue: 0,0:22:19.76,0:22:25.79,Default,,0000,0000,0000,,caret key moves to the first non-empty Dialogue: 0,0:22:22.64,0:22:31.73,Default,,0000,0000,0000,,character on a line. So, let me find one Dialogue: 0,0:22:25.79,0:22:33.59,Default,,0000,0000,0000,,of those, for example. So, here, my Dialogue: 0,0:22:31.73,0:22:34.76,Default,,0000,0000,0000,,cursor's right here; if I press 0, my Dialogue: 0,0:22:33.59,0:22:37.04,Default,,0000,0000,0000,,cursor goes to the beginning of the line, Dialogue: 0,0:22:34.76,0:22:39.59,Default,,0000,0000,0000,,dollar sign, end of the current line; and Dialogue: 0,0:22:37.04,0:22:41.27,Default,,0000,0000,0000,,if I press caret, where, like, on what Dialogue: 0,0:22:39.59,0:22:44.84,Default,,0000,0000,0000,,character will the curser end up? Can Dialogue: 0,0:22:41.27,0:22:47.87,Default,,0000,0000,0000,,anybody guess? So, caret goes to the first Dialogue: 0,0:22:44.84,0:22:53.00,Default,,0000,0000,0000,,non-empty character on a line, kind of Dialogue: 0,0:22:47.87,0:22:57.20,Default,,0000,0000,0000,,like Regex caret. Yeah, exactly! It goes Dialogue: 0,0:22:53.00,0:22:59.78,Default,,0000,0000,0000,,to this dash. Let's talk about some more Dialogue: 0,0:22:57.20,0:23:01.22,Default,,0000,0000,0000,,movement commands. There're ways to Dialogue: 0,0:22:59.78,0:23:06.23,Default,,0000,0000,0000,,scroll up and down in a buffer, so Dialogue: 0,0:23:01.22,0:23:08.51,Default,,0000,0000,0000,,control U goes up, and control D scrolls Dialogue: 0,0:23:06.23,0:23:10.85,Default,,0000,0000,0000,,down. So, this is better than holding down Dialogue: 0,0:23:08.51,0:23:13.19,Default,,0000,0000,0000,,the K or J keys, for example. This is a Dialogue: 0,0:23:10.85,0:23:17.72,Default,,0000,0000,0000,,lot slower than moving by entire pages. Dialogue: 0,0:23:13.19,0:23:19.97,Default,,0000,0000,0000,,Control D and control U. There's also Dialogue: 0,0:23:17.72,0:23:22.40,Default,,0000,0000,0000,,ways to move by the entire buffer. So, Dialogue: 0,0:23:19.97,0:23:26.42,Default,,0000,0000,0000,,capital "G" moves all the way down... "gg" Dialogue: 0,0:23:22.40,0:23:28.49,Default,,0000,0000,0000,,moves all the way up. Some of these Dialogue: 0,0:23:26.42,0:23:29.60,Default,,0000,0000,0000,,movement keys are mnemonics; so, they're Dialogue: 0,0:23:28.49,0:23:31.40,Default,,0000,0000,0000,,like, a little bit easier to remember for Dialogue: 0,0:23:29.60,0:23:33.44,Default,,0000,0000,0000,,that reason, right, like, "W" is word, "B" Dialogue: 0,0:23:31.40,0:23:36.23,Default,,0000,0000,0000,,is beginning of word, E is end of word. Those Dialogue: 0,0:23:33.44,0:23:38.03,Default,,0000,0000,0000,,all seem pretty logical. 0, caret and Dialogue: 0,0:23:36.23,0:23:39.56,Default,,0000,0000,0000,,dollar, kind of inspired from Regex, so Dialogue: 0,0:23:38.03,0:23:41.12,Default,,0000,0000,0000,,those make a little bit of sense. There's Dialogue: 0,0:23:39.56,0:23:42.89,Default,,0000,0000,0000,,some other ones that, like, don't Dialogue: 0,0:23:41.12,0:23:43.94,Default,,0000,0000,0000,,necessarily make way too much sense, but, Dialogue: 0,0:23:42.89,0:23:46.31,Default,,0000,0000,0000,,there are only so many keys on your Dialogue: 0,0:23:43.94,0:23:48.59,Default,,0000,0000,0000,,keyboard, so what are you going to do? For Dialogue: 0,0:23:46.31,0:23:49.43,Default,,0000,0000,0000,,example, the "L" key moves your cursor to Dialogue: 0,0:23:48.59,0:23:51.89,Default,,0000,0000,0000,,the lowest Dialogue: 0,0:23:49.43,0:23:54.92,Default,,0000,0000,0000,,line that's shown on the screen. "L" for Dialogue: 0,0:23:51.89,0:24:01.43,Default,,0000,0000,0000,,lowest makes sense, M for middle, and then H for Dialogue: 0,0:23:54.92,0:24:02.66,Default,,0000,0000,0000,,highest, I guess. And, there's a whole Dialogue: 0,0:24:01.43,0:24:04.25,Default,,0000,0000,0000,,bunch of other interesting movements Dialogue: 0,0:24:02.66,0:24:05.33,Default,,0000,0000,0000,,like this. So, we're obviously not going Dialogue: 0,0:24:04.25,0:24:07.07,Default,,0000,0000,0000,,to be able to cover all of them right Dialogue: 0,0:24:05.33,0:24:08.69,Default,,0000,0000,0000,,now, but you'll be able to go through Dialogue: 0,0:24:07.07,0:24:11.32,Default,,0000,0000,0000,,them in the Vim tutor exercise, which is Dialogue: 0,0:24:08.69,0:24:15.79,Default,,0000,0000,0000,,exercise number one for this lecture. Dialogue: 0,0:24:11.32,0:24:18.08,Default,,0000,0000,0000,,Some other ones I want to talk about now - Dialogue: 0,0:24:15.79,0:24:19.64,Default,,0000,0000,0000,,maybe I'll talk about one more. There's Dialogue: 0,0:24:18.08,0:24:21.44,Default,,0000,0000,0000,,another movement called "find". This is Dialogue: 0,0:24:19.64,0:24:23.21,Default,,0000,0000,0000,,also kind of useful. Suppose I'm on this Dialogue: 0,0:24:21.44,0:24:25.34,Default,,0000,0000,0000,,line, and I want to jump to the first Dialogue: 0,0:24:23.21,0:24:27.26,Default,,0000,0000,0000,,character that equal's to... Like, I Dialogue: 0,0:24:25.34,0:24:31.31,Default,,0000,0000,0000,,want to jump to the first "o". I can press Dialogue: 0,0:24:27.26,0:24:33.86,Default,,0000,0000,0000,,"fo", and my cursor moves to the first Dialogue: 0,0:24:31.31,0:24:35.21,Default,,0000,0000,0000,,"o". I've like, found "o". I can do fw and Dialogue: 0,0:24:33.86,0:24:39.56,Default,,0000,0000,0000,,it'll move to the first "w", which I think Dialogue: 0,0:24:35.21,0:24:40.88,Default,,0000,0000,0000,,is right here. fc: find the first C. I can Dialogue: 0,0:24:39.56,0:24:44.51,Default,,0000,0000,0000,,also do the same thing, but backwards. If Dialogue: 0,0:24:40.88,0:24:47.93,Default,,0000,0000,0000,,I do capital F, w, I can find the W that's Dialogue: 0,0:24:44.51,0:24:49.76,Default,,0000,0000,0000,,before it. Capital F, s: find the s that's Dialogue: 0,0:24:47.93,0:24:53.45,Default,,0000,0000,0000,,before that. And then, there's a variant Dialogue: 0,0:24:49.76,0:24:56.69,Default,,0000,0000,0000,,of f, for find: t for to, so I can jump to Dialogue: 0,0:24:53.45,0:24:58.52,Default,,0000,0000,0000,,O, and it jumps, like, until it's found o. Dialogue: 0,0:24:56.69,0:25:03.11,Default,,0000,0000,0000,,But not on top of it, right before it. And Dialogue: 0,0:24:58.52,0:25:04.82,Default,,0000,0000,0000,,capital T say, t, jumps backwards to the t Dialogue: 0,0:25:03.11,0:25:07.19,Default,,0000,0000,0000,,except not all the way on top of it, one Dialogue: 0,0:25:04.82,0:25:09.77,Default,,0000,0000,0000,,character before. And, so, you can already Dialogue: 0,0:25:07.19,0:25:10.97,Default,,0000,0000,0000,,see that idea I talked about, of like, Vim Dialogue: 0,0:25:09.77,0:25:13.16,Default,,0000,0000,0000,,is a programming language; you can, like, Dialogue: 0,0:25:10.97,0:25:15.05,Default,,0000,0000,0000,,compose these commands. "F", and "T", are Dialogue: 0,0:25:13.16,0:25:16.79,Default,,0000,0000,0000,,"find", and "to", and you can say "find" a Dialogue: 0,0:25:15.05,0:25:20.18,Default,,0000,0000,0000,,particular character, or jump "to" a Dialogue: 0,0:25:16.79,0:25:22.40,Default,,0000,0000,0000,,particular character. So, those are a Dialogue: 0,0:25:20.18,0:25:26.66,Default,,0000,0000,0000,,couple of Vim movement commands. So, any Dialogue: 0,0:25:22.40,0:25:32.05,Default,,0000,0000,0000,,questions about those so far? So this is - Dialogue: 0,0:25:26.66,0:25:33.98,Default,,0000,0000,0000,,yeah, question? Or... no? Okay, cool. So, Dialogue: 0,0:25:32.05,0:25:35.54,Default,,0000,0000,0000,,those are Vim movement commands. Dialogue: 0,0:25:33.98,0:25:37.88,Default,,0000,0000,0000,,This is how you can navigate around a Dialogue: 0,0:25:35.54,0:25:40.07,Default,,0000,0000,0000,,file quickly in normal mode. Now, another Dialogue: 0,0:25:37.88,0:25:42.77,Default,,0000,0000,0000,,category of useful commands are editing Dialogue: 0,0:25:40.07,0:25:44.48,Default,,0000,0000,0000,,commands. So, one we kind of already Dialogue: 0,0:25:42.77,0:25:46.52,Default,,0000,0000,0000,,talked about is the "i" command Dialogue: 0,0:25:44.48,0:25:48.50,Default,,0000,0000,0000,,for moving from "normal" mode to "insert" Dialogue: 0,0:25:46.52,0:25:50.69,Default,,0000,0000,0000,,mode, where you can start just writing Dialogue: 0,0:25:48.50,0:25:52.49,Default,,0000,0000,0000,,text. So, suppose I go up here and I press Dialogue: 0,0:25:50.69,0:25:57.02,Default,,0000,0000,0000,,"i". Now I can type in whatever text I want Dialogue: 0,0:25:52.49,0:25:58.37,Default,,0000,0000,0000,,"Hello world", "enter". Then, press Dialogue: 0,0:25:57.02,0:26:00.89,Default,,0000,0000,0000,,"escape" to go back to normal mode, and Dialogue: 0,0:25:58.37,0:26:01.64,Default,,0000,0000,0000,,I've made a change to my buffer. But, Dialogue: 0,0:26:00.89,0:26:03.74,Default,,0000,0000,0000,,there are a whole bunch of other Dialogue: 0,0:26:01.64,0:26:05.54,Default,,0000,0000,0000,,commands for making efficient edits Dialogue: 0,0:26:03.74,0:26:07.76,Default,,0000,0000,0000,,that makes sense for when you're dealing Dialogue: 0,0:26:05.54,0:26:09.41,Default,,0000,0000,0000,,with programming languages. So, one useful Dialogue: 0,0:26:07.76,0:26:10.67,Default,,0000,0000,0000,,command that I accidentally used earlier, Dialogue: 0,0:26:09.41,0:26:13.28,Default,,0000,0000,0000,,before teaching you about it, is the "o" Dialogue: 0,0:26:10.67,0:26:16.13,Default,,0000,0000,0000,,command. So, suppose my cursor is, like, Dialogue: 0,0:26:13.28,0:26:18.41,Default,,0000,0000,0000,,over here, and if I press "o", from normal Dialogue: 0,0:26:16.13,0:26:19.49,Default,,0000,0000,0000,,mode, what it does, is it opens a new line Dialogue: 0,0:26:18.41,0:26:22.04,Default,,0000,0000,0000,,below where my cursor is. Dialogue: 0,0:26:19.49,0:26:23.42,Default,,0000,0000,0000,,That's what "o" stands for. And it, so it Dialogue: 0,0:26:22.04,0:26:24.98,Default,,0000,0000,0000,,creates a new line, and it put me into Dialogue: 0,0:26:23.42,0:26:27.29,Default,,0000,0000,0000,,insert mode. So, now I can start typing in Dialogue: 0,0:26:24.98,0:26:29.60,Default,,0000,0000,0000,,some text, press escape, and go back to Dialogue: 0,0:26:27.29,0:26:32.24,Default,,0000,0000,0000,,normal mode. And then, just like the "o" Dialogue: 0,0:26:29.60,0:26:35.54,Default,,0000,0000,0000,,command, there's a capital "O" command, so Dialogue: 0,0:26:32.24,0:26:37.85,Default,,0000,0000,0000,,if I'm here and I do capital "O", it puts Dialogue: 0,0:26:35.54,0:26:41.69,Default,,0000,0000,0000,,me into insert mode above where I Dialogue: 0,0:26:37.85,0:26:44.24,Default,,0000,0000,0000,,currently am. There's another Vim command Dialogue: 0,0:26:41.69,0:26:47.69,Default,,0000,0000,0000,,for deleting things. So, suppose my cursor Dialogue: 0,0:26:44.24,0:26:51.56,Default,,0000,0000,0000,,is, like, on top of this word right here, Dialogue: 0,0:26:47.69,0:26:54.35,Default,,0000,0000,0000,,and I press the D key. "D" for delete. Oh, Dialogue: 0,0:26:51.56,0:26:55.97,Default,,0000,0000,0000,,nothing happens; turns out that the D key Dialogue: 0,0:26:54.35,0:26:57.86,Default,,0000,0000,0000,,needs to be combined with a movement Dialogue: 0,0:26:55.97,0:26:59.63,Default,,0000,0000,0000,,command. So, remember we just talked about Dialogue: 0,0:26:57.86,0:27:02.87,Default,,0000,0000,0000,,different movement commands, like hjkl, Dialogue: 0,0:26:59.63,0:27:03.53,Default,,0000,0000,0000,,and, like, word, and backward word, and Dialogue: 0,0:27:02.87,0:27:07.67,Default,,0000,0000,0000,,things like that. Dialogue: 0,0:27:03.53,0:27:11.60,Default,,0000,0000,0000,,So, I press D. Whoops. I press D and I can Dialogue: 0,0:27:07.67,0:27:13.97,Default,,0000,0000,0000,,press W, and it's deleted a word. So, let Dialogue: 0,0:27:11.60,0:27:16.82,Default,,0000,0000,0000,,me undo that. Undoing in Vim is just u for Dialogue: 0,0:27:13.97,0:27:19.94,Default,,0000,0000,0000,,undo. So, notice my cursor's right here. I Dialogue: 0,0:27:16.82,0:27:21.77,Default,,0000,0000,0000,,do "dw": it's deleted a word. I can move Dialogue: 0,0:27:19.94,0:27:25.10,Default,,0000,0000,0000,,around, and then delete another word. Dialogue: 0,0:27:21.77,0:27:27.62,Default,,0000,0000,0000,,Suppose I'm - uh, keeps getting in the way Dialogue: 0,0:27:25.10,0:27:29.42,Default,,0000,0000,0000,,Suppose I'm, like, somewhere in the middle Dialogue: 0,0:27:27.62,0:27:31.13,Default,,0000,0000,0000,,of a word, and I want to delete to the end Dialogue: 0,0:27:29.42,0:27:35.63,Default,,0000,0000,0000,,of a word. Any guesses for what Dialogue: 0,0:27:31.13,0:27:39.32,Default,,0000,0000,0000,,combination of keys I'd use for that? "d" Dialogue: 0,0:27:35.63,0:27:43.79,Default,,0000,0000,0000,,and what? de, exactly. Delete to the end of Dialogue: 0,0:27:39.32,0:27:46.79,Default,,0000,0000,0000,,the word. Another useful editing command Dialogue: 0,0:27:43.79,0:27:48.80,Default,,0000,0000,0000,,is the c command. c stands for change. So, Dialogue: 0,0:27:46.79,0:27:50.84,Default,,0000,0000,0000,,change is really similar to delete, Dialogue: 0,0:27:48.80,0:27:52.22,Default,,0000,0000,0000,,except change puts you in insert mode, Dialogue: 0,0:27:50.84,0:27:54.50,Default,,0000,0000,0000,,because, like, I want to delete a thing, Dialogue: 0,0:27:52.22,0:27:56.96,Default,,0000,0000,0000,,but change it to something else. So, if Dialogue: 0,0:27:54.50,0:27:59.81,Default,,0000,0000,0000,,I'm here, and I do "ce", it's like, change Dialogue: 0,0:27:56.96,0:28:00.95,Default,,0000,0000,0000,,to the end of the word. And, it gets rid Dialogue: 0,0:27:59.81,0:28:02.63,Default,,0000,0000,0000,,of the contents until the end of the Dialogue: 0,0:28:00.95,0:28:04.46,Default,,0000,0000,0000,,word, and notice it put me in insert mode. Dialogue: 0,0:28:02.63,0:28:06.74,Default,,0000,0000,0000,,So now, whatever characters I type go Dialogue: 0,0:28:04.46,0:28:11.27,Default,,0000,0000,0000,,into the buffer. If I press "escape", I go Dialogue: 0,0:28:06.74,0:28:13.25,Default,,0000,0000,0000,,back into normal mode. And so, c and d are Dialogue: 0,0:28:11.27,0:28:15.65,Default,,0000,0000,0000,,analogs: they both take motions as Dialogue: 0,0:28:13.25,0:28:17.29,Default,,0000,0000,0000,,arguments. And, they will either delete Dialogue: 0,0:28:15.65,0:28:20.95,Default,,0000,0000,0000,,that motion, or change Dialogue: 0,0:28:17.29,0:28:24.37,Default,,0000,0000,0000,,that motion. So, for example, if you press Dialogue: 0,0:28:20.95,0:28:25.99,Default,,0000,0000,0000,,the c key, there's also this pattern that, Dialogue: 0,0:28:24.37,0:28:27.88,Default,,0000,0000,0000,,if you press a particular editing key Dialogue: 0,0:28:25.99,0:28:30.40,Default,,0000,0000,0000,,twice, it'll have that effect on the Dialogue: 0,0:28:27.88,0:28:32.98,Default,,0000,0000,0000,,given line. So, if I press "dd", that Dialogue: 0,0:28:30.40,0:28:34.36,Default,,0000,0000,0000,,deletes the line. If I press "cc", that Dialogue: 0,0:28:32.98,0:28:35.56,Default,,0000,0000,0000,,deletes the given line, but puts me in Dialogue: 0,0:28:34.36,0:28:39.76,Default,,0000,0000,0000,,insert mode, so I can replace it with Dialogue: 0,0:28:35.56,0:28:43.36,Default,,0000,0000,0000,,some other line. We'll cover a couple Dialogue: 0,0:28:39.76,0:28:44.29,Default,,0000,0000,0000,,other, uh, editing commands, because then Dialogue: 0,0:28:43.36,0:28:46.72,Default,,0000,0000,0000,,later we'll see how all these things Dialogue: 0,0:28:44.29,0:28:48.70,Default,,0000,0000,0000,,interact together. So, another useful one Dialogue: 0,0:28:46.72,0:28:50.29,Default,,0000,0000,0000,,is the x command. So, suppose my cursor is Dialogue: 0,0:28:48.70,0:28:52.12,Default,,0000,0000,0000,,over some particular character. If I Dialogue: 0,0:28:50.29,0:28:57.88,Default,,0000,0000,0000,,press "x", it just deletes that Dialogue: 0,0:28:52.12,0:29:00.31,Default,,0000,0000,0000,,character. There's another command called Dialogue: 0,0:28:57.88,0:29:02.26,Default,,0000,0000,0000,,r. If I'm over a particular character, and Dialogue: 0,0:29:00.31,0:29:03.94,Default,,0000,0000,0000,,I press "r", it takes another character as Dialogue: 0,0:29:02.26,0:29:05.44,Default,,0000,0000,0000,,an argument, and it replaces that Dialogue: 0,0:29:03.94,0:29:12.55,Default,,0000,0000,0000,,particular character with some other Dialogue: 0,0:29:05.44,0:29:14.11,Default,,0000,0000,0000,,character. And, I'll cover a couple more Dialogue: 0,0:29:12.55,0:29:16.39,Default,,0000,0000,0000,,editing commands. So, I think one I Dialogue: 0,0:29:14.11,0:29:17.98,Default,,0000,0000,0000,,talked about a moment ago - but, of course Dialogue: 0,0:29:16.39,0:29:19.36,Default,,0000,0000,0000,,you can undo changes you've made in Vim. Dialogue: 0,0:29:17.98,0:29:21.52,Default,,0000,0000,0000,,And the way you do that is by pressing Dialogue: 0,0:29:19.36,0:29:23.23,Default,,0000,0000,0000,,"u" while you're in normal mode. So, u for Dialogue: 0,0:29:21.52,0:29:24.85,Default,,0000,0000,0000,,undo is pretty easy to remember. So, I Dialogue: 0,0:29:23.23,0:29:26.31,Default,,0000,0000,0000,,press "u" a whole bunch of times; it's Dialogue: 0,0:29:24.85,0:29:28.75,Default,,0000,0000,0000,,undone all the changes I've made. And Dialogue: 0,0:29:26.31,0:29:31.00,Default,,0000,0000,0000,,then, the opposite of undo is, of course, Dialogue: 0,0:29:28.75,0:29:40.96,Default,,0000,0000,0000,,redo. And, the binding for that in Vim is Dialogue: 0,0:29:31.00,0:29:42.31,Default,,0000,0000,0000,,control + R. All right, one other editing Dialogue: 0,0:29:40.96,0:29:55.09,Default,,0000,0000,0000,,command I'm going to talk about is copy Dialogue: 0,0:29:42.31,0:29:56.29,Default,,0000,0000,0000,,and paste because-oh yes, question? That's Dialogue: 0,0:29:55.09,0:29:58.15,Default,,0000,0000,0000,,a - that's a great question! So, the Dialogue: 0,0:29:56.29,0:29:59.50,Default,,0000,0000,0000,,question is, "Does 'undo' undo everything Dialogue: 0,0:29:58.15,0:30:00.97,Default,,0000,0000,0000,,you've done since you've gone into Dialogue: 0,0:29:59.50,0:30:02.38,Default,,0000,0000,0000,,insert mode, or just the last character?" Dialogue: 0,0:30:00.97,0:30:03.28,Default,,0000,0000,0000,,It's - it's actually a little bit more Dialogue: 0,0:30:02.38,0:30:05.86,Default,,0000,0000,0000,,complicated than that. Dialogue: 0,0:30:03.28,0:30:07.54,Default,,0000,0000,0000,,"Undo" does, like, undoes the last change Dialogue: 0,0:30:05.86,0:30:08.80,Default,,0000,0000,0000,,you've made. So, if you went into insert Dialogue: 0,0:30:07.54,0:30:10.48,Default,,0000,0000,0000,,mode, and typed in some stuff, and went Dialogue: 0,0:30:08.80,0:30:12.52,Default,,0000,0000,0000,,back into normal mode, and then press "u" Dialogue: 0,0:30:10.48,0:30:14.56,Default,,0000,0000,0000,,for "undo", it'll undo all you've done in Dialogue: 0,0:30:12.52,0:30:16.09,Default,,0000,0000,0000,,insert mode. But, if you've done some Dialogue: 0,0:30:14.56,0:30:18.28,Default,,0000,0000,0000,,other type of editing command, like, say I Dialogue: 0,0:30:16.09,0:30:20.14,Default,,0000,0000,0000,,press "x" to delete a character... If I do Dialogue: 0,0:30:18.28,0:30:24.28,Default,,0000,0000,0000,,"u" for undo, it'll just undo that change Dialogue: 0,0:30:20.14,0:30:26.44,Default,,0000,0000,0000,,that that editing command made. Now, does Dialogue: 0,0:30:24.28,0:30:28.78,Default,,0000,0000,0000,,that answer the question? (Yeah) Great any Dialogue: 0,0:30:26.44,0:30:32.78,Default,,0000,0000,0000,,other questions? Dialogue: 0,0:30:28.78,0:30:35.48,Default,,0000,0000,0000,,Cool. So, I'll talk about copy and paste Dialogue: 0,0:30:32.78,0:30:37.58,Default,,0000,0000,0000,,as well, because that's a popular one. The Dialogue: 0,0:30:35.48,0:30:39.71,Default,,0000,0000,0000,,y command stands for copying, and the p Dialogue: 0,0:30:37.58,0:30:41.81,Default,,0000,0000,0000,,command stands for pasting. y for "copy", Dialogue: 0,0:30:39.71,0:30:43.37,Default,,0000,0000,0000,,because, yank. Like, that's the word they- Dialogue: 0,0:30:41.81,0:30:46.31,Default,,0000,0000,0000,,that's the terminology that Dialogue: 0,0:30:43.37,0:30:49.22,Default,,0000,0000,0000,,Vim uses for copying. And, these commands Dialogue: 0,0:30:46.31,0:30:52.58,Default,,0000,0000,0000,,are- y also takes a motion as an argument. Dialogue: 0,0:30:49.22,0:30:54.35,Default,,0000,0000,0000,,So if I do like, yy, it copies the current Dialogue: 0,0:30:52.58,0:30:56.09,Default,,0000,0000,0000,,line. And, if I press "p" for "paste", Dialogue: 0,0:30:54.35,0:30:57.26,Default,,0000,0000,0000,,notice that now these two lines are Dialogue: 0,0:30:56.09,0:31:00.11,Default,,0000,0000,0000,,identical, because I've just pasted a Dialogue: 0,0:30:57.26,0:31:02.33,Default,,0000,0000,0000,,line below. "u" for "undo". But if I do Dialogue: 0,0:31:00.11,0:31:04.91,Default,,0000,0000,0000,,something like "yw", it's copied the word. Dialogue: 0,0:31:02.33,0:31:05.45,Default,,0000,0000,0000,,And then I can do "p", and it just pasted Dialogue: 0,0:31:04.91,0:31:08.93,Default,,0000,0000,0000,,that word again, Dialogue: 0,0:31:05.45,0:31:10.70,Default,,0000,0000,0000,,right where my cursor was. One useful Dialogue: 0,0:31:08.93,0:31:12.53,Default,,0000,0000,0000,,thing, especially in the context of copy Dialogue: 0,0:31:10.70,0:31:14.15,Default,,0000,0000,0000,,and paste, is to be able to select a Dialogue: 0,0:31:12.53,0:31:15.65,Default,,0000,0000,0000,,block of stuff and copy it, right? Like, Dialogue: 0,0:31:14.15,0:31:16.94,Default,,0000,0000,0000,,this is probably how you used copy and Dialogue: 0,0:31:15.65,0:31:19.22,Default,,0000,0000,0000,,paste in whatever editor you were using Dialogue: 0,0:31:16.94,0:31:21.44,Default,,0000,0000,0000,,before. And so, that's where we get into Dialogue: 0,0:31:19.22,0:31:23.21,Default,,0000,0000,0000,,the visual modes. So, these are another Dialogue: 0,0:31:21.44,0:31:24.59,Default,,0000,0000,0000,,set of modes that are all related to Dialogue: 0,0:31:23.21,0:31:26.03,Default,,0000,0000,0000,,each other, and that can be reached from Dialogue: 0,0:31:24.59,0:31:28.79,Default,,0000,0000,0000,,normal mode, and they're used for Dialogue: 0,0:31:26.03,0:31:31.04,Default,,0000,0000,0000,,selecting chunks of text. So, one mode is, Dialogue: 0,0:31:28.79,0:31:33.14,Default,,0000,0000,0000,,just, regular visual mode. You can enter Dialogue: 0,0:31:31.04,0:31:34.82,Default,,0000,0000,0000,,that by pressing v. And then, once you're Dialogue: 0,0:31:33.14,0:31:36.65,Default,,0000,0000,0000,,in this mode, you can use most of the Dialogue: 0,0:31:34.82,0:31:38.45,Default,,0000,0000,0000,,regular normal mode commands to move Dialogue: 0,0:31:36.65,0:31:39.98,Default,,0000,0000,0000,,your pointer around. And it selects Dialogue: 0,0:31:38.45,0:31:42.05,Default,,0000,0000,0000,,everything in between. So I can use, like, Dialogue: 0,0:31:39.98,0:31:44.03,Default,,0000,0000,0000,,hjkl just to move the cursor, or I can Dialogue: 0,0:31:42.05,0:31:45.89,Default,,0000,0000,0000,,use "w" to move by words, or different Dialogue: 0,0:31:44.03,0:31:48.08,Default,,0000,0000,0000,,things like that, and it will select a Dialogue: 0,0:31:45.89,0:31:49.49,Default,,0000,0000,0000,,block of text. And, once I've selected Dialogue: 0,0:31:48.08,0:31:50.90,Default,,0000,0000,0000,,this block of text there are a whole bunch Dialogue: 0,0:31:49.49,0:31:52.61,Default,,0000,0000,0000,,of different types of useful things you Dialogue: 0,0:31:50.90,0:31:54.77,Default,,0000,0000,0000,,could do with it. One of the most popular Dialogue: 0,0:31:52.61,0:31:57.32,Default,,0000,0000,0000,,things to do is copying this. So, once Dialogue: 0,0:31:54.77,0:31:59.63,Default,,0000,0000,0000,,I've selected, I can do y to copy, and it Dialogue: 0,0:31:57.32,0:32:01.28,Default,,0000,0000,0000,,puts me back into normal mode. And now, Dialogue: 0,0:31:59.63,0:32:02.81,Default,,0000,0000,0000,,it's copied this to the - to the paste Dialogue: 0,0:32:01.28,0:32:04.85,Default,,0000,0000,0000,,buffer. And then if I go somewhere else, Dialogue: 0,0:32:02.81,0:32:07.67,Default,,0000,0000,0000,,and press "p", it pastes in that whole Dialogue: 0,0:32:04.85,0:32:10.52,Default,,0000,0000,0000,,chunk of text I copied. And it's similar Dialogue: 0,0:32:07.67,0:32:13.61,Default,,0000,0000,0000,,to visual mode, which selects kind of a Dialogue: 0,0:32:10.52,0:32:15.56,Default,,0000,0000,0000,,contiguous stream of text. There's visual Dialogue: 0,0:32:13.61,0:32:17.72,Default,,0000,0000,0000,,line mode: that can be reached by Dialogue: 0,0:32:15.56,0:32:19.76,Default,,0000,0000,0000,,pressing capital V, and that selects Dialogue: 0,0:32:17.72,0:32:21.47,Default,,0000,0000,0000,,whole lines at a time. And then there's Dialogue: 0,0:32:19.76,0:32:23.15,Default,,0000,0000,0000,,VISUAL BLOCK mode, which can be selected Dialogue: 0,0:32:21.47,0:32:24.89,Default,,0000,0000,0000,,by pressing "control" + " V", and that can Dialogue: 0,0:32:23.15,0:32:26.24,Default,,0000,0000,0000,,select rectangular blocks of text. So Dialogue: 0,0:32:24.89,0:32:31.67,Default,,0000,0000,0000,,this is something your old editor Dialogue: 0,0:32:26.24,0:32:33.32,Default,,0000,0000,0000,,couldn't do. Alright, so, there's a lot Dialogue: 0,0:32:31.67,0:32:35.12,Default,,0000,0000,0000,,more Vim editing commands to learn. Dialogue: 0,0:32:33.32,0:32:36.71,Default,,0000,0000,0000,,There's lots of, like, really weird and Dialogue: 0,0:32:35.12,0:32:38.42,Default,,0000,0000,0000,,fancy things. Like, for example, the tilde Dialogue: 0,0:32:36.71,0:32:40.22,Default,,0000,0000,0000,,command changes the case of the Dialogue: 0,0:32:38.42,0:32:41.69,Default,,0000,0000,0000,,character, or the selection that you've Dialogue: 0,0:32:40.22,0:32:43.64,Default,,0000,0000,0000,,currently selected. So for example, Dialogue: 0,0:32:41.69,0:32:45.62,Default,,0000,0000,0000,,I can take this, like, Visual Studio Code, Dialogue: 0,0:32:43.64,0:32:48.26,Default,,0000,0000,0000,,and flip the case on the whole thing, by Dialogue: 0,0:32:45.62,0:32:49.43,Default,,0000,0000,0000,,selecting it and pressing tilde. And, Dialogue: 0,0:32:48.26,0:32:50.48,Default,,0000,0000,0000,,there's a whole bunch of other things Dialogue: 0,0:32:49.43,0:32:52.16,Default,,0000,0000,0000,,like that; they get more and more Dialogue: 0,0:32:50.48,0:32:54.05,Default,,0000,0000,0000,,esoteric as you go. So, we're not going to Dialogue: 0,0:32:52.16,0:32:56.63,Default,,0000,0000,0000,,cover all of those, but you'll get to Dialogue: 0,0:32:54.05,0:32:58.49,Default,,0000,0000,0000,,those in the exercises. So, those are Vim Dialogue: 0,0:32:56.63,0:33:00.62,Default,,0000,0000,0000,,editing commands, and a lot of them can Dialogue: 0,0:32:58.49,0:33:02.12,Default,,0000,0000,0000,,be composed with movement commands. So, Dialogue: 0,0:33:00.62,0:33:09.26,Default,,0000,0000,0000,,any questions about either of those so Dialogue: 0,0:33:02.12,0:33:12.68,Default,,0000,0000,0000,,far? Cool. So, moving along, another Dialogue: 0,0:33:09.26,0:33:14.24,Default,,0000,0000,0000,,category of things -of commands- that are Dialogue: 0,0:33:12.68,0:33:16.88,Default,,0000,0000,0000,,mostly relevant to normal mode are Dialogue: 0,0:33:14.24,0:33:18.53,Default,,0000,0000,0000,,counts. So, you can give them a number, to Dialogue: 0,0:33:16.88,0:33:22.10,Default,,0000,0000,0000,,do a particular thing, some number of Dialogue: 0,0:33:18.53,0:33:25.43,Default,,0000,0000,0000,,times. So suppose my cursor is here, and I Dialogue: 0,0:33:22.10,0:33:26.96,Default,,0000,0000,0000,,want to move down, like 1 2 3 4 lines. One Dialogue: 0,0:33:25.43,0:33:29.39,Default,,0000,0000,0000,,way I can do that is by pressing "j" four Dialogue: 0,0:33:26.96,0:33:32.57,Default,,0000,0000,0000,,times - go down four times. "kkkk" goes Dialogue: 0,0:33:29.39,0:33:34.01,Default,,0000,0000,0000,,up four times. But, rather than pressing a Dialogue: 0,0:33:32.57,0:33:37.43,Default,,0000,0000,0000,,particular key again, and again, I can use Dialogue: 0,0:33:34.01,0:33:38.96,Default,,0000,0000,0000,,a count. So if I press "4", "j", it does j Dialogue: 0,0:33:37.43,0:33:40.13,Default,,0000,0000,0000,,four times, right? Dialogue: 0,0:33:38.96,0:33:42.29,Default,,0000,0000,0000,,Vim's interface is a programming Dialogue: 0,0:33:40.13,0:33:45.89,Default,,0000,0000,0000,,language. If I do "4k", it moves up four Dialogue: 0,0:33:42.29,0:33:47.60,Default,,0000,0000,0000,,times. If I am here, and I press "v" to go Dialogue: 0,0:33:45.89,0:33:49.04,Default,,0000,0000,0000,,into visual mode... Okay so now I can move Dialogue: 0,0:33:47.60,0:33:51.68,Default,,0000,0000,0000,,my cursor around, and select blocks of Dialogue: 0,0:33:49.04,0:33:53.66,Default,,0000,0000,0000,,text. I can do, like, "eee" to select a Dialogue: 0,0:33:51.68,0:33:56.60,Default,,0000,0000,0000,,couple of words, but, I could also go back Dialogue: 0,0:33:53.66,0:33:59.72,Default,,0000,0000,0000,,here -v for visual mode- and press three e Dialogue: 0,0:33:56.60,0:34:03.08,Default,,0000,0000,0000,,to select, like, three "ends of words" Dialogue: 0,0:33:59.72,0:34:05.06,Default,,0000,0000,0000,,forward. And then of course these can also Dialogue: 0,0:34:03.08,0:34:08.00,Default,,0000,0000,0000,,be combined with editing commands. So, Dialogue: 0,0:34:05.06,0:34:10.91,Default,,0000,0000,0000,,like, suppose I want to delete seven Dialogue: 0,0:34:08.00,0:34:13.97,Default,,0000,0000,0000,,words. I can do that by moving my cursor Dialogue: 0,0:34:10.91,0:34:17.66,Default,,0000,0000,0000,,somewhere, and doing "7dw". Seven delete Dialogue: 0,0:34:13.97,0:34:19.49,Default,,0000,0000,0000,,words. And so, this is particularly useful Dialogue: 0,0:34:17.66,0:34:21.26,Default,,0000,0000,0000,,for things like, suppose my cursor is Dialogue: 0,0:34:19.49,0:34:22.46,Default,,0000,0000,0000,,somewhere on the screen, and I'm looking Dialogue: 0,0:34:21.26,0:34:24.02,Default,,0000,0000,0000,,somewhere else on the screen, or, I want Dialogue: 0,0:34:22.46,0:34:26.24,Default,,0000,0000,0000,,my cursor to go to that particular line. Dialogue: 0,0:34:24.02,0:34:28.40,Default,,0000,0000,0000,,Notice that I've set up relative line Dialogue: 0,0:34:26.24,0:34:29.75,Default,,0000,0000,0000,,numbering on the left. So, wherever my Dialogue: 0,0:34:28.40,0:34:31.58,Default,,0000,0000,0000,,cursor is, it shows the current line Dialogue: 0,0:34:29.75,0:34:33.83,Default,,0000,0000,0000,,number, but everywhere else, it's just the Dialogue: 0,0:34:31.58,0:34:35.87,Default,,0000,0000,0000,,offset from where I am. Now, suppose my Dialogue: 0,0:34:33.83,0:34:38.48,Default,,0000,0000,0000,,cursor is here, but I want to move down Dialogue: 0,0:34:35.87,0:34:40.16,Default,,0000,0000,0000,,to the like "Microsoft Word" down here, so Dialogue: 0,0:34:38.48,0:34:41.81,Default,,0000,0000,0000,,that's eight lines down. So, what Dialogue: 0,0:34:40.16,0:34:44.02,Default,,0000,0000,0000,,combination of keys would I press, to do Dialogue: 0,0:34:41.81,0:34:45.56,Default,,0000,0000,0000,,that? Like, what's the most efficient way? Dialogue: 0,0:34:44.02,0:34:47.81,Default,,0000,0000,0000,,Yeah, exactly! Dialogue: 0,0:34:45.56,0:34:50.44,Default,,0000,0000,0000,,Let's try that out-8j-and my cursor moved Dialogue: 0,0:34:47.81,0:34:50.44,Default,,0000,0000,0000,,down to this line. Dialogue: 0,0:34:51.27,0:34:57.88,Default,,0000,0000,0000,,Okay. And then, one, final category of key Dialogue: 0,0:34:56.11,0:34:59.92,Default,,0000,0000,0000,,meanings in Vim is something called Dialogue: 0,0:34:57.88,0:35:02.20,Default,,0000,0000,0000,,modifiers. So we have, so far, movement, Dialogue: 0,0:34:59.92,0:35:04.90,Default,,0000,0000,0000,,edits, counts, and, finally, we have Dialogue: 0,0:35:02.20,0:35:06.52,Default,,0000,0000,0000,,modifiers. So, modifiers kind of change Dialogue: 0,0:35:04.90,0:35:08.83,Default,,0000,0000,0000,,the meaning of a movement command a Dialogue: 0,0:35:06.52,0:35:11.53,Default,,0000,0000,0000,,little bit. And, a couple modifiers that Dialogue: 0,0:35:08.83,0:35:15.19,Default,,0000,0000,0000,,are especially useful are the "a" and "i" Dialogue: 0,0:35:11.53,0:35:18.01,Default,,0000,0000,0000,,modifier. So, a stands for like around and Dialogue: 0,0:35:15.19,0:35:19.90,Default,,0000,0000,0000,,"i" stands for inside. And, to see where Dialogue: 0,0:35:18.01,0:35:21.76,Default,,0000,0000,0000,,this is really useful, I can move my Dialogue: 0,0:35:19.90,0:35:22.48,Default,,0000,0000,0000,,cursor to somewhere like here, for Dialogue: 0,0:35:21.76,0:35:24.67,Default,,0000,0000,0000,,example. Dialogue: 0,0:35:22.48,0:35:26.32,Default,,0000,0000,0000,,So, hopefully, most of you are familiar Dialogue: 0,0:35:24.67,0:35:28.24,Default,,0000,0000,0000,,with markdown syntax - and if not it Dialogue: 0,0:35:26.32,0:35:30.49,Default,,0000,0000,0000,,doesn't matter too much. Uh, this is a Dialogue: 0,0:35:28.24,0:35:31.78,Default,,0000,0000,0000,,link in markdown; it's a text rendered in Dialogue: 0,0:35:30.49,0:35:33.61,Default,,0000,0000,0000,,square brackets, and then the link in Dialogue: 0,0:35:31.78,0:35:35.50,Default,,0000,0000,0000,,parentheses. Suppose my cursor is inside Dialogue: 0,0:35:33.61,0:35:38.35,Default,,0000,0000,0000,,here, and I want to change the text Dialogue: 0,0:35:35.50,0:35:40.15,Default,,0000,0000,0000,,corresponding to this link. Well, one way Dialogue: 0,0:35:38.35,0:35:43.48,Default,,0000,0000,0000,,I could do that is, like, move back here Dialogue: 0,0:35:40.15,0:35:45.13,Default,,0000,0000,0000,,with b, and, like, 2dw, and then "i" to go Dialogue: 0,0:35:43.48,0:35:46.45,Default,,0000,0000,0000,,into insert mode. That's one of the Dialogue: 0,0:35:45.13,0:35:47.95,Default,,0000,0000,0000,,many ways I can make this change, and I Dialogue: 0,0:35:46.45,0:35:51.07,Default,,0000,0000,0000,,can type in whatever other thing I want - Dialogue: 0,0:35:47.95,0:35:53.41,Default,,0000,0000,0000,,u to undo, u to undo. Another way I could Dialogue: 0,0:35:51.07,0:35:58.03,Default,,0000,0000,0000,,have done that is change two words - "c2w" Dialogue: 0,0:35:53.41,0:35:59.95,Default,,0000,0000,0000,,- and then type in some other text. But, Dialogue: 0,0:35:58.03,0:36:03.28,Default,,0000,0000,0000,,one final way I could do the same change Dialogue: 0,0:35:59.95,0:36:05.38,Default,,0000,0000,0000,,is using the modifier commands to talk Dialogue: 0,0:36:03.28,0:36:07.12,Default,,0000,0000,0000,,about how I want to interact with these Dialogue: 0,0:36:05.38,0:36:09.49,Default,,0000,0000,0000,,different types of grouping things like Dialogue: 0,0:36:07.12,0:36:12.07,Default,,0000,0000,0000,,parentheses and square brackets. So, one Dialogue: 0,0:36:09.49,0:36:15.61,Default,,0000,0000,0000,,final way of doing this is change inside Dialogue: 0,0:36:12.07,0:36:17.44,Default,,0000,0000,0000,,square brackets-"c" "i" "["-and that puts Dialogue: 0,0:36:15.61,0:36:20.23,Default,,0000,0000,0000,,me into insert mode, after deleting the Dialogue: 0,0:36:17.44,0:36:21.40,Default,,0000,0000,0000,,contents that are inside the brackets. So, Dialogue: 0,0:36:20.23,0:36:22.69,Default,,0000,0000,0000,,do you see how we can take all these Dialogue: 0,0:36:21.40,0:36:24.31,Default,,0000,0000,0000,,different ingredients, like we talked Dialogue: 0,0:36:22.69,0:36:25.57,Default,,0000,0000,0000,,about "change", and we could combine that Dialogue: 0,0:36:24.31,0:36:27.46,Default,,0000,0000,0000,,with different movement commands. We Dialogue: 0,0:36:25.57,0:36:30.10,Default,,0000,0000,0000,,talked about inside, how it's a modifier. Dialogue: 0,0:36:27.46,0:36:32.77,Default,,0000,0000,0000,,And then we talked about, uh... we didn't Dialogue: 0,0:36:30.10,0:36:34.23,Default,,0000,0000,0000,,talk about parentheses. But, if your Dialogue: 0,0:36:32.77,0:36:36.07,Default,,0000,0000,0000,,cursor is hovering over a different, uh, Dialogue: 0,0:36:34.23,0:36:37.81,Default,,0000,0000,0000,,different types of grouping things like Dialogue: 0,0:36:36.07,0:36:39.88,Default,,0000,0000,0000,,parentheses, or square brackets, you can Dialogue: 0,0:36:37.81,0:36:40.99,Default,,0000,0000,0000,,press the percent movement key to jump Dialogue: 0,0:36:39.88,0:36:45.34,Default,,0000,0000,0000,,back and forth between matching Dialogue: 0,0:36:40.99,0:36:49.51,Default,,0000,0000,0000,,parentheses. If I go over here and I do d, Dialogue: 0,0:36:45.34,0:36:52.48,Default,,0000,0000,0000,,i, (, I can delete the contents Dialogue: 0,0:36:49.51,0:36:55.78,Default,,0000,0000,0000,,inside these parentheses. And so, those Dialogue: 0,0:36:52.48,0:36:57.55,Default,,0000,0000,0000,,are Vim, uh, modifiers. I guess we talked Dialogue: 0,0:36:55.78,0:37:00.31,Default,,0000,0000,0000,,about i, but we didn't talk about a. If I Dialogue: 0,0:36:57.55,0:37:02.08,Default,,0000,0000,0000,,do "da(", it deletes a whole, Dialogue: 0,0:37:00.31,0:37:04.46,Default,,0000,0000,0000,,like parenthesized group including the Dialogue: 0,0:37:02.08,0:37:10.73,Default,,0000,0000,0000,,parentheses so I is inside Dialogue: 0,0:37:04.46,0:37:11.84,Default,,0000,0000,0000,,is around or including all right so Dialogue: 0,0:37:10.73,0:37:13.67,Default,,0000,0000,0000,,those are basically the different Dialogue: 0,0:37:11.84,0:37:15.89,Default,,0000,0000,0000,,categories of things you can combine Dialogue: 0,0:37:13.67,0:37:18.05,Default,,0000,0000,0000,,together, when interacting with Vim's Dialogue: 0,0:37:15.89,0:37:20.33,Default,,0000,0000,0000,,interface. So, any questions about that or Dialogue: 0,0:37:18.05,0:37:28.82,Default,,0000,0000,0000,,the overall idea of this interface being Dialogue: 0,0:37:20.33,0:37:31.58,Default,,0000,0000,0000,,a programming language? Cool. So, let's do Dialogue: 0,0:37:28.82,0:37:33.86,Default,,0000,0000,0000,,a quick demo, to kind of demonstrate the Dialogue: 0,0:37:31.58,0:37:36.29,Default,,0000,0000,0000,,power of this editor. And, it will kind of Dialogue: 0,0:37:33.86,0:37:38.24,Default,,0000,0000,0000,,help us see how this tool can work Dialogue: 0,0:37:36.29,0:37:41.26,Default,,0000,0000,0000,,really fast and kind of match the speed Dialogue: 0,0:37:38.24,0:37:43.76,Default,,0000,0000,0000,,at which we think. So, over here is a very Dialogue: 0,0:37:41.26,0:37:44.78,Default,,0000,0000,0000,,broken "fizzbuzz" implementation that Dialogue: 0,0:37:43.76,0:37:46.64,Default,,0000,0000,0000,,doesn't actually print anything. Dialogue: 0,0:37:44.78,0:37:48.68,Default,,0000,0000,0000,,Uh, hopefully, most of you have heard of Dialogue: 0,0:37:46.64,0:37:51.08,Default,,0000,0000,0000,,"fizzbuzz" - if not, I'll explain it super Dialogue: 0,0:37:48.68,0:37:52.73,Default,,0000,0000,0000,,briefly. Uh, "fizzbuzz" is a programming Dialogue: 0,0:37:51.08,0:37:54.29,Default,,0000,0000,0000,,exercise where you print the numbers 1 Dialogue: 0,0:37:52.73,0:37:56.54,Default,,0000,0000,0000,,through n, but when the number is Dialogue: 0,0:37:54.29,0:37:58.70,Default,,0000,0000,0000,,divisible by 3, you print fizz - when it's Dialogue: 0,0:37:56.54,0:38:00.86,Default,,0000,0000,0000,,divisible by 5, you print buzz. And, when Dialogue: 0,0:37:58.70,0:38:02.84,Default,,0000,0000,0000,,it's divisible by both 3, and 5. you print Dialogue: 0,0:38:00.86,0:38:05.09,Default,,0000,0000,0000,,fizzbuzz. And, if none of those apply, you Dialogue: 0,0:38:02.84,0:38:09.29,Default,,0000,0000,0000,,just print the number. So, you should Dialogue: 0,0:38:05.09,0:38:13.46,Default,,0000,0000,0000,,print like 1, 2, fizz, 4, buzz, and so on. Dialogue: 0,0:38:09.29,0:38:16.55,Default,,0000,0000,0000,,But, if I run this program, it doesn't Dialogue: 0,0:38:13.46,0:38:20.09,Default,,0000,0000,0000,,print anything here I have them on the Dialogue: 0,0:38:16.55,0:38:21.53,Default,,0000,0000,0000,,left in just a terminal on the right ok Dialogue: 0,0:38:20.09,0:38:23.75,Default,,0000,0000,0000,,so there's a bunch of issues with this Dialogue: 0,0:38:21.53,0:38:26.47,Default,,0000,0000,0000,,one is that main is never called so Dialogue: 0,0:38:23.75,0:38:29.45,Default,,0000,0000,0000,,let's start off with fixing that so Dialogue: 0,0:38:26.47,0:38:31.96,Default,,0000,0000,0000,,here's how I would make this change and Dialogue: 0,0:38:29.45,0:38:34.25,Default,,0000,0000,0000,,notice how few keystrokes this requires Dialogue: 0,0:38:31.96,0:38:37.61,Default,,0000,0000,0000,,capital G means go to the bottom of the Dialogue: 0,0:38:34.25,0:38:39.65,Default,,0000,0000,0000,,file o opens a new line below and now I Dialogue: 0,0:38:37.61,0:38:45.38,Default,,0000,0000,0000,,can just type in stuff so I'm an insert Dialogue: 0,0:38:39.65,0:38:47.21,Default,,0000,0000,0000,,mode okay so I've typed in whatever Dialogue: 0,0:38:45.38,0:38:50.48,Default,,0000,0000,0000,,change I want to make escape to go back Dialogue: 0,0:38:47.21,0:38:53.54,Default,,0000,0000,0000,,to normal mode if I do : W so command Dialogue: 0,0:38:50.48,0:38:54.65,Default,,0000,0000,0000,,mode right let me go back here okay now Dialogue: 0,0:38:53.54,0:38:56.69,Default,,0000,0000,0000,,at least my program prints something Dialogue: 0,0:38:54.65,0:38:58.94,Default,,0000,0000,0000,,when I run it another issue with this Dialogue: 0,0:38:56.69,0:39:02.75,Default,,0000,0000,0000,,program is that it starts at 0 instead Dialogue: 0,0:38:58.94,0:39:05.03,Default,,0000,0000,0000,,of 1 so let's go fix that so I want to Dialogue: 0,0:39:02.75,0:39:06.95,Default,,0000,0000,0000,,go over to this range whoops this range Dialogue: 0,0:39:05.03,0:39:08.48,Default,,0000,0000,0000,,thing and it shouldn't be going from 0 Dialogue: 0,0:39:06.95,0:39:11.27,Default,,0000,0000,0000,,to limit it should be going from 1 to Dialogue: 0,0:39:08.48,0:39:12.65,Default,,0000,0000,0000,,limit plus 1 1 command which I didn't Dialogue: 0,0:39:11.27,0:39:16.06,Default,,0000,0000,0000,,show you about is how you search in vim Dialogue: 0,0:39:12.65,0:39:16.06,Default,,0000,0000,0000,,so you press forward slash Dialogue: 0,0:39:17.01,0:39:21.93,Default,,0000,0000,0000,,to close this and restart it if you Dialogue: 0,0:39:19.08,0:39:24.84,Default,,0000,0000,0000,,press forward slash it starts search so Dialogue: 0,0:39:21.93,0:39:26.22,Default,,0000,0000,0000,,if I type in range enter my cursor goes Dialogue: 0,0:39:24.84,0:39:27.81,Default,,0000,0000,0000,,from wherever it was before to the first Dialogue: 0,0:39:26.22,0:39:28.92,Default,,0000,0000,0000,,instance of range it found so it's a Dialogue: 0,0:39:27.81,0:39:31.68,Default,,0000,0000,0000,,really efficient way of moving where I Dialogue: 0,0:39:28.92,0:39:33.99,Default,,0000,0000,0000,,want to move WW to move forward two Dialogue: 0,0:39:31.68,0:39:36.33,Default,,0000,0000,0000,,words I to go into insert mode add the Dialogue: 0,0:39:33.99,0:39:38.31,Default,,0000,0000,0000,,one comma space escape I'm back in Dialogue: 0,0:39:36.33,0:39:40.08,Default,,0000,0000,0000,,normal mode this is a very common Dialogue: 0,0:39:38.31,0:39:41.85,Default,,0000,0000,0000,,pattern in vim you stay in normal mode Dialogue: 0,0:39:40.08,0:39:43.26,Default,,0000,0000,0000,,you go somewhere you go into insert mode Dialogue: 0,0:39:41.85,0:39:44.88,Default,,0000,0000,0000,,you make a tiny change and you jump Dialogue: 0,0:39:43.26,0:39:45.90,Default,,0000,0000,0000,,right back to normal mode like normal Dialogue: 0,0:39:44.88,0:39:48.81,Default,,0000,0000,0000,,mode is home and that's where you should Dialogue: 0,0:39:45.90,0:39:51.03,Default,,0000,0000,0000,,be most of the time I also want to add a Dialogue: 0,0:39:48.81,0:39:55.43,Default,,0000,0000,0000,,plus one so e to go to the end of this Dialogue: 0,0:39:51.03,0:39:58.14,Default,,0000,0000,0000,,word a for a pend plus one escape Dialogue: 0,0:39:55.43,0:40:00.81,Default,,0000,0000,0000,,alright fix that problem and other issue Dialogue: 0,0:39:58.14,0:40:02.94,Default,,0000,0000,0000,,is that this program prints fizz for Dialogue: 0,0:40:00.81,0:40:05.97,Default,,0000,0000,0000,,both divisible by three and five so Dialogue: 0,0:40:02.94,0:40:07.92,Default,,0000,0000,0000,,let's fix that slash fizz searches for Dialogue: 0,0:40:05.97,0:40:11.79,Default,,0000,0000,0000,,fizz been oppressed and it goes to the Dialogue: 0,0:40:07.92,0:40:13.71,Default,,0000,0000,0000,,next match see I press E I quote changes Dialogue: 0,0:40:11.79,0:40:15.66,Default,,0000,0000,0000,,what's inside the quote so it's deleted Dialogue: 0,0:40:13.71,0:40:17.46,Default,,0000,0000,0000,,the fizz and put me in insert mode right Dialogue: 0,0:40:15.66,0:40:18.51,Default,,0000,0000,0000,,in between those two quotes and I can Dialogue: 0,0:40:17.46,0:40:23.46,Default,,0000,0000,0000,,type in whatever I want Dialogue: 0,0:40:18.51,0:40:26.63,Default,,0000,0000,0000,,escape to go back to normal mode so Dialogue: 0,0:40:23.46,0:40:28.89,Default,,0000,0000,0000,,great I've fixed that particular problem Dialogue: 0,0:40:26.63,0:40:31.71,Default,,0000,0000,0000,,another problem with this program is Dialogue: 0,0:40:28.89,0:40:37.71,Default,,0000,0000,0000,,that it prints fizz and Buzz on separate Dialogue: 0,0:40:31.71,0:40:42.15,Default,,0000,0000,0000,,lines for multiples of 15 so let's let's Dialogue: 0,0:40:37.71,0:40:42.87,Default,,0000,0000,0000,,go and fix that let me go down to this Dialogue: 0,0:40:42.15,0:40:44.58,Default,,0000,0000,0000,,line here Dialogue: 0,0:40:42.87,0:40:46.35,Default,,0000,0000,0000,,one way I can don't actually worry about Dialogue: 0,0:40:44.58,0:40:47.43,Default,,0000,0000,0000,,like the actual contents of this program Dialogue: 0,0:40:46.35,0:40:48.69,Default,,0000,0000,0000,,like this some stupid program that Dialogue: 0,0:40:47.43,0:40:51.00,Default,,0000,0000,0000,,doesn't matter pay attention to what Dialogue: 0,0:40:48.69,0:40:52.17,Default,,0000,0000,0000,,keys I'm pressing in vim that allow me Dialogue: 0,0:40:51.00,0:40:54.96,Default,,0000,0000,0000,,to make changes to this program really Dialogue: 0,0:40:52.17,0:40:56.79,Default,,0000,0000,0000,,efficiently so my cursor is on this line Dialogue: 0,0:40:54.96,0:40:59.46,Default,,0000,0000,0000,,i press dollar to go to the end of this Dialogue: 0,0:40:56.79,0:41:01.17,Default,,0000,0000,0000,,line i for insert mode okay and i'm Dialogue: 0,0:40:59.46,0:41:03.33,Default,,0000,0000,0000,,typing some stuff escape to go back to Dialogue: 0,0:41:01.17,0:41:07.05,Default,,0000,0000,0000,,normal mode now I want to make the same Dialogue: 0,0:41:03.33,0:41:11.61,Default,,0000,0000,0000,,change the print below look at this JJ Dialogue: 0,0:41:07.05,0:41:13.26,Default,,0000,0000,0000,,dot so what dot dozen vim is it repeats Dialogue: 0,0:41:11.61,0:41:15.99,Default,,0000,0000,0000,,the previous editing command that was Dialogue: 0,0:41:13.26,0:41:17.88,Default,,0000,0000,0000,,made and so this is a really nice way of Dialogue: 0,0:41:15.99,0:41:19.89,Default,,0000,0000,0000,,doing repetitive tasks without typing Dialogue: 0,0:41:17.88,0:41:21.63,Default,,0000,0000,0000,,the same thing over and over again so in Dialogue: 0,0:41:19.89,0:41:24.63,Default,,0000,0000,0000,,that particular case that inserted comma Dialogue: 0,0:41:21.63,0:41:27.11,Default,,0000,0000,0000,,end quote and so it applied the same Dialogue: 0,0:41:24.63,0:41:29.58,Default,,0000,0000,0000,,thing on this line when I press dot and Dialogue: 0,0:41:27.11,0:41:30.69,Default,,0000,0000,0000,,then when I guess one final part of this Dialogue: 0,0:41:29.58,0:41:32.93,Default,,0000,0000,0000,,demo is Dialogue: 0,0:41:30.69,0:41:34.62,Default,,0000,0000,0000,,we will fix the issue that this program Dialogue: 0,0:41:32.93,0:41:35.67,Default,,0000,0000,0000,,maybe should take a command-line Dialogue: 0,0:41:34.62,0:41:38.52,Default,,0000,0000,0000,,argument instead of having this Dialogue: 0,0:41:35.67,0:41:40.44,Default,,0000,0000,0000,,hard-coded 10 down here so how do we do Dialogue: 0,0:41:38.52,0:41:43.17,Default,,0000,0000,0000,,that I'll press GG to go to the top Dialogue: 0,0:41:40.44,0:41:44.49,Default,,0000,0000,0000,,capital o so now I've opened a line Dialogue: 0,0:41:43.17,0:41:47.22,Default,,0000,0000,0000,,above and I'm going to type in some text Dialogue: 0,0:41:44.49,0:41:49.71,Default,,0000,0000,0000,,like imports this enter escape to go Dialogue: 0,0:41:47.22,0:41:52.11,Default,,0000,0000,0000,,back to normal mode and then I want to Dialogue: 0,0:41:49.71,0:41:54.87,Default,,0000,0000,0000,,go down to where this 10 is so slash 10 Dialogue: 0,0:41:52.11,0:41:57.54,Default,,0000,0000,0000,,makes me jump straight down there CI Dialogue: 0,0:41:54.87,0:41:59.76,Default,,0000,0000,0000,,pren to edit what's inside the Dialogue: 0,0:41:57.54,0:42:02.15,Default,,0000,0000,0000,,parentheses and now I can type in like Dialogue: 0,0:41:59.76,0:42:07.08,Default,,0000,0000,0000,,whatever thing I need to type in here Dialogue: 0,0:42:02.15,0:42:09.84,Default,,0000,0000,0000,,and then once I've done this my program Dialogue: 0,0:42:07.08,0:42:10.92,Default,,0000,0000,0000,,does fizzbuzz correctly I think I missed Dialogue: 0,0:42:09.84,0:42:12.39,Default,,0000,0000,0000,,one change I wanted to make but it Dialogue: 0,0:42:10.92,0:42:14.54,Default,,0000,0000,0000,,doesn't matter this demonstrates that Dialogue: 0,0:42:12.39,0:42:17.25,Default,,0000,0000,0000,,you can make lots of changes really fast Dialogue: 0,0:42:14.54,0:42:23.40,Default,,0000,0000,0000,,so any questions about this demo or the Dialogue: 0,0:42:17.25,0:42:27.96,Default,,0000,0000,0000,,overall idea we've been talking about ok Dialogue: 0,0:42:23.40,0:42:29.55,Default,,0000,0000,0000,,so this will be covered Tuesday so the Dialogue: 0,0:42:27.96,0:42:31.71,Default,,0000,0000,0000,,kind of outside environment I'm running Dialogue: 0,0:42:29.55,0:42:33.63,Default,,0000,0000,0000,,vim on the left and my shell on the Dialogue: 0,0:42:31.71,0:42:38.91,Default,,0000,0000,0000,,right and then this is team ox on the Dialogue: 0,0:42:33.63,0:42:39.90,Default,,0000,0000,0000,,outside one variant of that question Dialogue: 0,0:42:38.91,0:42:41.67,Default,,0000,0000,0000,,might be like how do you switch between Dialogue: 0,0:42:39.90,0:42:42.84,Default,,0000,0000,0000,,different vim windows and you can see Dialogue: 0,0:42:41.67,0:42:44.25,Default,,0000,0000,0000,,the lecture notes for that but there's a Dialogue: 0,0:42:42.84,0:42:45.72,Default,,0000,0000,0000,,key binding for that so if you have the Dialogue: 0,0:42:44.25,0:42:50.24,Default,,0000,0000,0000,,same window open or multiple things open Dialogue: 0,0:42:45.72,0:42:50.24,Default,,0000,0000,0000,,there's a way of doing that question ah Dialogue: 0,0:42:50.84,0:42:56.52,Default,,0000,0000,0000,,good question so delete takes a motion Dialogue: 0,0:42:54.57,0:42:58.11,Default,,0000,0000,0000,,and then removes those contents but Dialogue: 0,0:42:56.52,0:43:00.12,Default,,0000,0000,0000,,keeps you in normal mode so you can keep Dialogue: 0,0:42:58.11,0:43:02.43,Default,,0000,0000,0000,,just moving around in a file what change Dialogue: 0,0:43:00.12,0:43:03.90,Default,,0000,0000,0000,,does is very similar to delete it takes Dialogue: 0,0:43:02.43,0:43:06.15,Default,,0000,0000,0000,,motions and treats them in the same way Dialogue: 0,0:43:03.90,0:43:07.98,Default,,0000,0000,0000,,deletes those contents but then puts you Dialogue: 0,0:43:06.15,0:43:11.28,Default,,0000,0000,0000,,in insert mode and so it saves you from Dialogue: 0,0:43:07.98,0:43:13.29,Default,,0000,0000,0000,,typing one extra keystroke so if I'm Dialogue: 0,0:43:11.28,0:43:16.38,Default,,0000,0000,0000,,here for example I want to delete main Dialogue: 0,0:43:13.29,0:43:18.24,Default,,0000,0000,0000,,DW deletes a word but now if I press Dialogue: 0,0:43:16.38,0:43:21.72,Default,,0000,0000,0000,,whatever key likes I press J it just Dialogue: 0,0:43:18.24,0:43:23.49,Default,,0000,0000,0000,,moved me down if I undo that do cw4 Dialogue: 0,0:43:21.72,0:43:24.81,Default,,0000,0000,0000,,change a word now it's actually put me Dialogue: 0,0:43:23.49,0:43:28.64,Default,,0000,0000,0000,,into insert mode and I can type in Dialogue: 0,0:43:24.81,0:43:31.89,Default,,0000,0000,0000,,whatever I want it to insert so DWI is Dialogue: 0,0:43:28.64,0:43:33.81,Default,,0000,0000,0000,,the same thing as CW but it saves a Dialogue: 0,0:43:31.89,0:43:35.28,Default,,0000,0000,0000,,keystroke one thing we've linked in the Dialogue: 0,0:43:33.81,0:43:37.14,Default,,0000,0000,0000,,resources is something called vim golf Dialogue: 0,0:43:35.28,0:43:39.84,Default,,0000,0000,0000,,basically people have set up a game Dialogue: 0,0:43:37.14,0:43:41.40,Default,,0000,0000,0000,,online where you can get an editing task Dialogue: 0,0:43:39.84,0:43:43.59,Default,,0000,0000,0000,,and try to figure out the minimal number Dialogue: 0,0:43:41.40,0:43:44.49,Default,,0000,0000,0000,,of keystrokes necessary to complete that Dialogue: 0,0:43:43.59,0:43:46.02,Default,,0000,0000,0000,,editing Dialogue: 0,0:43:44.49,0:43:47.34,Default,,0000,0000,0000,,it's actually really addictive so I'd Dialogue: 0,0:43:46.02,0:43:52.68,Default,,0000,0000,0000,,only suggest going on their chest and Dialogue: 0,0:43:47.34,0:44:00.45,Default,,0000,0000,0000,,script time I think I saw a hand for Dialogue: 0,0:43:52.68,0:44:02.07,Default,,0000,0000,0000,,another question yeah uh period yeah one Dialogue: 0,0:44:00.45,0:44:05.75,Default,,0000,0000,0000,,of the most useful of em commands good Dialogue: 0,0:44:02.07,0:44:05.75,Default,,0000,0000,0000,,question any other questions Dialogue: 0,0:44:06.74,0:44:13.26,Default,,0000,0000,0000,,cool so I think we have about five Dialogue: 0,0:44:10.80,0:44:14.76,Default,,0000,0000,0000,,minutes left and I'm gonna briefly talk Dialogue: 0,0:44:13.26,0:44:15.99,Default,,0000,0000,0000,,about a thing that's also covered in Dialogue: 0,0:44:14.76,0:44:19.47,Default,,0000,0000,0000,,detail in the notes so make sure you Dialogue: 0,0:44:15.99,0:44:22.35,Default,,0000,0000,0000,,look at the notes for this so vim is a Dialogue: 0,0:44:19.47,0:44:24.42,Default,,0000,0000,0000,,programmers text editor and so of course Dialogue: 0,0:44:22.35,0:44:25.74,Default,,0000,0000,0000,,it's highly programmable not only Dialogue: 0,0:44:24.42,0:44:27.72,Default,,0000,0000,0000,,through its interface that's a Dialogue: 0,0:44:25.74,0:44:29.10,Default,,0000,0000,0000,,programming language but also a couple Dialogue: 0,0:44:27.72,0:44:31.05,Default,,0000,0000,0000,,of different ways there's lots of Dialogue: 0,0:44:29.10,0:44:32.97,Default,,0000,0000,0000,,settings that you can tweak to match Dialogue: 0,0:44:31.05,0:44:34.74,Default,,0000,0000,0000,,your preferences and you can also Dialogue: 0,0:44:32.97,0:44:37.59,Default,,0000,0000,0000,,install plugins for them that do all Dialogue: 0,0:44:34.74,0:44:40.38,Default,,0000,0000,0000,,sorts of useful stuff so the way vim is Dialogue: 0,0:44:37.59,0:44:42.93,Default,,0000,0000,0000,,configured is through a file on disk Dialogue: 0,0:44:40.38,0:44:45.48,Default,,0000,0000,0000,,called vim RC and you'll see this is a Dialogue: 0,0:44:42.93,0:44:47.34,Default,,0000,0000,0000,,common pattern in a lot of shell based Dialogue: 0,0:44:45.48,0:44:49.35,Default,,0000,0000,0000,,tools there'll be a plain text file that Dialogue: 0,0:44:47.34,0:44:50.88,Default,,0000,0000,0000,,configures how the Tool Works and so if Dialogue: 0,0:44:49.35,0:44:53.67,Default,,0000,0000,0000,,I edit this file and it may or may not Dialogue: 0,0:44:50.88,0:44:56.31,Default,,0000,0000,0000,,exist on your machine yet but I've Dialogue: 0,0:44:53.67,0:44:58.17,Default,,0000,0000,0000,,downloaded the we've created a kind of Dialogue: 0,0:44:56.31,0:44:59.43,Default,,0000,0000,0000,,default vim RC for you and linked it on Dialogue: 0,0:44:58.17,0:45:02.19,Default,,0000,0000,0000,,the course website so you can start with Dialogue: 0,0:44:59.43,0:45:04.86,Default,,0000,0000,0000,,that one if I do vim tilde slash boom RC Dialogue: 0,0:45:02.19,0:45:07.08,Default,,0000,0000,0000,,I can see here a bunch of comments and Dialogue: 0,0:45:04.86,0:45:09.06,Default,,0000,0000,0000,,then particular commands like by default Dialogue: 0,0:45:07.08,0:45:11.28,Default,,0000,0000,0000,,we want syntax highlighting on and we Dialogue: 0,0:45:09.06,0:45:12.75,Default,,0000,0000,0000,,want line numbers if we didn't do some Dialogue: 0,0:45:11.28,0:45:14.88,Default,,0000,0000,0000,,of these things like let me remove the Dialogue: 0,0:45:12.75,0:45:16.50,Default,,0000,0000,0000,,stuff that sets line numbers if I remove Dialogue: 0,0:45:14.88,0:45:17.79,Default,,0000,0000,0000,,those configurations and relaunch vim Dialogue: 0,0:45:16.50,0:45:21.27,Default,,0000,0000,0000,,notice that I no longer have line Dialogue: 0,0:45:17.79,0:45:23.10,Default,,0000,0000,0000,,numbers on the left but yeah so in short Dialogue: 0,0:45:21.27,0:45:26.10,Default,,0000,0000,0000,,there's a lot of stuff you can configure Dialogue: 0,0:45:23.10,0:45:28.59,Default,,0000,0000,0000,,with them we've given you a very basic Dialogue: 0,0:45:26.10,0:45:29.88,Default,,0000,0000,0000,,configuration that tries to like remove Dialogue: 0,0:45:28.59,0:45:32.16,Default,,0000,0000,0000,,some of the kind of weird behavior Dialogue: 0,0:45:29.88,0:45:33.48,Default,,0000,0000,0000,,that's on by default in vim but we don't Dialogue: 0,0:45:32.16,0:45:35.55,Default,,0000,0000,0000,,really try to enforce too many of our Dialogue: 0,0:45:33.48,0:45:37.08,Default,,0000,0000,0000,,other opinions on you but of course like Dialogue: 0,0:45:35.55,0:45:39.21,Default,,0000,0000,0000,,the three of us used them a lot and we Dialogue: 0,0:45:37.08,0:45:41.31,Default,,0000,0000,0000,,have heavily customized VMR C's so we've Dialogue: 0,0:45:39.21,0:45:42.48,Default,,0000,0000,0000,,linked to our personal configurations Dialogue: 0,0:45:41.31,0:45:44.55,Default,,0000,0000,0000,,too if you want to take anything from Dialogue: 0,0:45:42.48,0:45:46.05,Default,,0000,0000,0000,,that and also like thousands or like Dialogue: 0,0:45:44.55,0:45:47.64,Default,,0000,0000,0000,,millions of people share their var C's Dialogue: 0,0:45:46.05,0:45:48.45,Default,,0000,0000,0000,,on github so there's lots of places to Dialogue: 0,0:45:47.64,0:45:49.92,Default,,0000,0000,0000,,look for inspiration Dialogue: 0,0:45:48.45,0:45:53.04,Default,,0000,0000,0000,,there's also cool blog posts on this Dialogue: 0,0:45:49.92,0:45:54.81,Default,,0000,0000,0000,,topic another thing you can do in vim is Dialogue: 0,0:45:53.04,0:45:56.82,Default,,0000,0000,0000,,you can extend it with plugins that do Dialogue: 0,0:45:54.81,0:45:58.08,Default,,0000,0000,0000,,all sorts of useful things this lets you Dialogue: 0,0:45:56.82,0:45:59.73,Default,,0000,0000,0000,,do things like fuzzy file Dialogue: 0,0:45:58.08,0:46:00.96,Default,,0000,0000,0000,,finding which a lot of text editors come Dialogue: 0,0:45:59.73,0:46:02.79,Default,,0000,0000,0000,,with by default so you can get like a Dialogue: 0,0:46:00.96,0:46:04.71,Default,,0000,0000,0000,,pop-up window you can type in a name of Dialogue: 0,0:46:02.79,0:46:07.02,Default,,0000,0000,0000,,a file or approximately the name of a Dialogue: 0,0:46:04.71,0:46:08.48,Default,,0000,0000,0000,,file and find it very quickly or there Dialogue: 0,0:46:07.02,0:46:10.92,Default,,0000,0000,0000,,are things that show you like Dialogue: 0,0:46:08.48,0:46:14.97,Default,,0000,0000,0000,,visualizations of undo history there are Dialogue: 0,0:46:10.92,0:46:16.35,Default,,0000,0000,0000,,things that show you like file explorers Dialogue: 0,0:46:14.97,0:46:18.36,Default,,0000,0000,0000,,things like that so we've linked to a Dialogue: 0,0:46:16.35,0:46:20.52,Default,,0000,0000,0000,,couple of our favorite plugins on the Dialogue: 0,0:46:18.36,0:46:22.23,Default,,0000,0000,0000,,course website and so I highly recommend Dialogue: 0,0:46:20.52,0:46:23.34,Default,,0000,0000,0000,,becoming familiar with how to install a Dialogue: 0,0:46:22.23,0:46:24.84,Default,,0000,0000,0000,,plug-in because it takes like three Dialogue: 0,0:46:23.34,0:46:29.58,Default,,0000,0000,0000,,seconds and some of them are really cool Dialogue: 0,0:46:24.84,0:46:32.13,Default,,0000,0000,0000,,and then finally the last topic I'll Dialogue: 0,0:46:29.58,0:46:34.68,Default,,0000,0000,0000,,briefly mention before we finish today's Dialogue: 0,0:46:32.13,0:46:37.17,Default,,0000,0000,0000,,lecture is vim mode and other programs Dialogue: 0,0:46:34.68,0:46:38.76,Default,,0000,0000,0000,,so turns out that a lot of programmers Dialogue: 0,0:46:37.17,0:46:40.65,Default,,0000,0000,0000,,we're really excited about VIMS Dialogue: 0,0:46:38.76,0:46:42.78,Default,,0000,0000,0000,,interface and so they've implemented Dialogue: 0,0:46:40.65,0:46:44.73,Default,,0000,0000,0000,,similar functionality and other tools Dialogue: 0,0:46:42.78,0:46:47.73,Default,,0000,0000,0000,,for example like I've configured my Dialogue: 0,0:46:44.73,0:46:49.53,Default,,0000,0000,0000,,Python repple to run in vim mode so I Dialogue: 0,0:46:47.73,0:46:51.72,Default,,0000,0000,0000,,can like type in stuff here and if I Dialogue: 0,0:46:49.53,0:46:53.25,Default,,0000,0000,0000,,press escape now I'm in normal mode in Dialogue: 0,0:46:51.72,0:46:55.23,Default,,0000,0000,0000,,my Python repple and I can like move Dialogue: 0,0:46:53.25,0:46:58.19,Default,,0000,0000,0000,,back and forth and like press X here Dialogue: 0,0:46:55.23,0:47:01.53,Default,,0000,0000,0000,,delete a thing like CW change a word and Dialogue: 0,0:46:58.19,0:47:03.21,Default,,0000,0000,0000,,do all those good things and it's not Dialogue: 0,0:47:01.53,0:47:05.91,Default,,0000,0000,0000,,just the Python repple like I have my Dialogue: 0,0:47:03.21,0:47:07.89,Default,,0000,0000,0000,,terminal behaving this way too so like I Dialogue: 0,0:47:05.91,0:47:10.05,Default,,0000,0000,0000,,can type in whatever I want here and Dialogue: 0,0:47:07.89,0:47:11.43,Default,,0000,0000,0000,,like escape and I'm in normal mode I can Dialogue: 0,0:47:10.05,0:47:13.32,Default,,0000,0000,0000,,go here and like go into visual mode Dialogue: 0,0:47:11.43,0:47:15.57,Default,,0000,0000,0000,,inside my terminal and like select Dialogue: 0,0:47:13.32,0:47:19.68,Default,,0000,0000,0000,,blocks of text press tilde to change the Dialogue: 0,0:47:15.57,0:47:22.08,Default,,0000,0000,0000,,case whatever so we've linked sir like Dialogue: 0,0:47:19.68,0:47:25.80,Default,,0000,0000,0000,,how exactly you can enable vim mode for Dialogue: 0,0:47:22.08,0:47:27.51,Default,,0000,0000,0000,,like bash z shell fish a lot of read Dialogue: 0,0:47:25.80,0:47:28.71,Default,,0000,0000,0000,,line based programs like jupiter Dialogue: 0,0:47:27.51,0:47:30.33,Default,,0000,0000,0000,,notebook a whole bunch of other things Dialogue: 0,0:47:28.71,0:47:32.13,Default,,0000,0000,0000,,and if it's not another place you can Dialogue: 0,0:47:30.33,0:47:33.84,Default,,0000,0000,0000,,probably find it by googling it because Dialogue: 0,0:47:32.13,0:47:36.03,Default,,0000,0000,0000,,a lot of people like to have this sort Dialogue: 0,0:47:33.84,0:47:37.38,Default,,0000,0000,0000,,of functionality and if you're really Dialogue: 0,0:47:36.03,0:47:39.27,Default,,0000,0000,0000,,gonna like commit to learning them I Dialogue: 0,0:47:37.38,0:47:41.49,Default,,0000,0000,0000,,think it's valuable to enable this sort Dialogue: 0,0:47:39.27,0:47:43.08,Default,,0000,0000,0000,,of like vim emulation mode in every tool Dialogue: 0,0:47:41.49,0:47:44.97,Default,,0000,0000,0000,,you use is like one or like make you Dialogue: 0,0:47:43.08,0:47:46.80,Default,,0000,0000,0000,,learn the tool a lot better and to once Dialogue: 0,0:47:44.97,0:47:47.97,Default,,0000,0000,0000,,you become good at vim like those skills Dialogue: 0,0:47:46.80,0:47:53.13,Default,,0000,0000,0000,,will now transfer to all your other Dialogue: 0,0:47:47.97,0:47:54.84,Default,,0000,0000,0000,,tools you use okay so I think that's it Dialogue: 0,0:47:53.13,0:47:57.06,Default,,0000,0000,0000,,for our rapid introduction to them Dialogue: 0,0:47:54.84,0:47:58.32,Default,,0000,0000,0000,,there's some other neat material that we Dialogue: 0,0:47:57.06,0:47:59.79,Default,,0000,0000,0000,,weren't able to fit in today's lecture Dialogue: 0,0:47:58.32,0:48:01.14,Default,,0000,0000,0000,,but it's in the lecture notes and then Dialogue: 0,0:47:59.79,0:48:02.88,Default,,0000,0000,0000,,finally I highly recommend going through Dialogue: 0,0:48:01.14,0:48:05.22,Default,,0000,0000,0000,,the exercises for today like at least Dialogue: 0,0:48:02.88,0:48:07.44,Default,,0000,0000,0000,,for me personally I think spending time Dialogue: 0,0:48:05.22,0:48:08.91,Default,,0000,0000,0000,,learning my text editor has been like Dialogue: 0,0:48:07.44,0:48:10.14,Default,,0000,0000,0000,,the most beneficial thing out of like Dialogue: 0,0:48:08.91,0:48:11.58,Default,,0000,0000,0000,,the kinds of things we're teaching in Dialogue: 0,0:48:10.14,0:48:14.02,Default,,0000,0000,0000,,this class Dialogue: 0,0:48:11.58,0:48:15.54,Default,,0000,0000,0000,,so yeah that's it for today's lecture Dialogue: 0,0:48:14.02,0:48:17.53,Default,,0000,0000,0000,,and we'll see you tomorrow Dialogue: 0,0:48:15.54,0:48:20.32,Default,,0000,0000,0000,,note that we've changed tomorrow's Dialogue: 0,0:48:17.53,0:48:22.06,Default,,0000,0000,0000,,lecture to data wrangling Thursday and Dialogue: 0,0:48:20.32,0:48:23.50,Default,,0000,0000,0000,,Tuesday lectures are now switched this Dialogue: 0,0:48:22.06,0:48:25.00,Default,,0000,0000,0000,,is reflected on the course website in Dialogue: 0,0:48:23.50,0:48:27.51,Default,,0000,0000,0000,,case anybody was going to come to one Dialogue: 0,0:48:25.00,0:48:27.51,Default,,0000,0000,0000,,but not the other