WEBVTT 00:00:01.155 --> 00:00:03.500 Hey guys, this is Steve Losh. 00:00:03.500 --> 00:00:06.803 If you're watching this screencast you probably already know that I've been writing a book 00:00:06.803 --> 00:00:08.739 called "Learn Vimscript the Hard Way". 00:00:08.739 --> 00:00:11.900 I figured I'd do a screencast while I wrote one of the shorter chapters 00:00:11.900 --> 00:00:15.300 just to show you kind of how I work and how I'm making the book. 00:00:15.300 --> 00:00:21.202 So first what I'm going to do is open an iTerm window... 00:00:21.571 --> 00:00:25.009 and let's make it nice and big... okay. 00:00:25.009 --> 00:00:30.290 I'm going to open DVTM, which is -- it's a terminal multiplexer, kind of like Tmux or Screen, 00:00:30.290 --> 00:00:33.878 just a lot simpler. I don't really use all the functionality of Tmux or Screen, 00:00:33.878 --> 00:00:38.329 so DVTM does pretty much everything I need. 00:00:38.329 --> 00:00:43.200 And I'm going to open three splits with one of them a little smaller. 00:00:43.200 --> 00:00:50.038 I'm going to go into the repo for the book in each of them. 00:00:54.346 --> 00:01:02.015 In this window I'm going to run a little script -- a little program called "kicker", 00:01:02.015 --> 00:01:07.193 which is open source, it's Ruby so you can just "gem install kicker". 00:01:07.193 --> 00:01:11.935 What it does is it basically monitors all the files that you tell it 00:01:11.935 --> 00:01:14.371 and whenever any one of them changes it just runs a command. 00:01:14.371 --> 00:01:15.992 Any shell command you want. 00:01:15.992 --> 00:01:18.507 So in this case I'm the command that builds the book, 00:01:18.507 --> 00:01:22.985 so any time I make a change to the book it will automatically get built, which is really handy. 00:01:22.985 --> 00:01:27.867 So I'm going to run that, and it fires off -- oops, sorry, I need to be in the virtualenv. 00:01:27.867 --> 00:01:32.318 "workon" the virtualenv... okay. Now I'm going to run kicker... okay. 00:01:32.318 --> 00:01:34.807 And it goes ahead and does it once to begin with, 00:01:34.807 --> 00:01:37.233 and then any time I touch a file that I told it to watch, 00:01:37.233 --> 00:01:43.448 so if I go here and say "touch preface" you can it executes again. 00:01:43.448 --> 00:01:49.000 Okay. The other thing I'm going to do is "cd" into the "build" directory, 00:01:49.000 --> 00:01:53.985 where the output of Bookmarkdown is going to put the HTML files, 00:01:53.985 --> 00:01:58.367 and I'm just going to run "serve_this", which is a little alias 00:01:58.367 --> 00:02:02.867 that basically serves the current directory on port 8000. 00:02:02.867 --> 00:02:09.892 And if you want to see what it is, it's just a Python module -- it's just 00:02:09.892 --> 00:02:12.733 "python -m SimpleHTTPServer" 00:02:12.733 --> 00:02:15.579 SimpleHTTPServer is a built-in Python module, 00:02:15.579 --> 00:02:20.225 so anywhere that has Python, I mean a relatively recent version, will have this. 00:02:20.225 --> 00:02:24.800 So it's just a simple command to serve a directory on port 8000. 00:02:24.800 --> 00:02:31.362 And I'm going to open Firefox and open localhost:8000. 00:02:31.362 --> 00:02:36.433 Alright, so this is our book, right, this is what I've got so far. 00:02:36.433 --> 00:02:40.062 I'm going to move that over here... okay, 00:02:40.062 --> 00:02:43.200 ah, we don't need it that big. 00:02:43.200 --> 00:02:50.533 Alright, we've got a book. And now I'm just going to open Vim and start working. 00:02:50.533 --> 00:02:53.041 I'm not going to comment on everything and explain how I do everything 00:02:53.041 --> 00:02:54.730 because that would just take forever. 00:02:54.730 --> 00:02:57.400 Everything's in my muscle memory and I'd have to stop and think about every key I press 00:02:57.400 --> 00:03:01.278 so if you see something that I do and you're kinda wondering how I did it 00:03:01.278 --> 00:03:06.340 just leave a comment with the time in the video that it appears and I'll do my best to explain it for you. 00:03:06.340 --> 00:03:10.438 With that said, I'm just going to put my headphones on and start typing. Cool. 00:44:16.900 --> 00:44:19.533 Okay guys, I think that's about it. 00:44:19.533 --> 00:44:25.467 I'm going to encode this screencast and upload it to Vimeo and that should be about it. 00:44:25.467 --> 00:44:29.501 Like I said, if there's anything that you saw and you liked and you want to know how I did it 00:44:29.501 --> 00:44:32.339 or you think I have a special mapping, 00:44:32.339 --> 00:44:36.695 just post a comment on the video and -- or just tweet at me, either one -- 00:44:36.695 --> 00:44:42.541 and just let me know the time and what it looks like and I'll let you know. 00:44:42.541 --> 99:59:59.999 Otherwise I guess that's it. Alright, cool. Thanks guys.