[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.16,0:00:03.50,Default,,0000,0000,0000,,Hey guys, this is Steve Losh. Dialogue: 0,0:00:03.50,0:00:06.80,Default,,0000,0000,0000,,If you're watching this screencast you probably already know that I've been writing a book Dialogue: 0,0:00:06.80,0:00:08.74,Default,,0000,0000,0000,,called "Learn Vimscript the Hard Way". Dialogue: 0,0:00:08.74,0:00:11.90,Default,,0000,0000,0000,,I figured I'd do a screencast while I wrote one of the shorter chapters Dialogue: 0,0:00:11.90,0:00:15.30,Default,,0000,0000,0000,,just to show you kind of how I work and how I'm making the book. Dialogue: 0,0:00:15.30,0:00:21.20,Default,,0000,0000,0000,,So first what I'm going to do is open an iTerm window... Dialogue: 0,0:00:21.57,0:00:25.01,Default,,0000,0000,0000,,and let's make it nice and big... okay. Dialogue: 0,0:00:25.01,0:00:30.29,Default,,0000,0000,0000,,I'm going to open DVTM, which is -- it's a terminal multiplexer, kind of like Tmux or Screen, Dialogue: 0,0:00:30.29,0:00:33.88,Default,,0000,0000,0000,,just a lot simpler. I don't really use all the functionality of Tmux or Screen, Dialogue: 0,0:00:33.88,0:00:38.33,Default,,0000,0000,0000,,so DVTM does pretty much everything I need. Dialogue: 0,0:00:38.33,0:00:43.20,Default,,0000,0000,0000,,And I'm going to open three splits with one of them a little smaller. Dialogue: 0,0:00:43.20,0:00:50.04,Default,,0000,0000,0000,,I'm going to go into the repo for the book in each of them. Dialogue: 0,0:00:54.35,0:01:02.02,Default,,0000,0000,0000,,In this window I'm going to run a little script -- a little program called "kicker", Dialogue: 0,0:01:02.02,0:01:07.19,Default,,0000,0000,0000,,which is open source, it's Ruby so you can just "gem install kicker". Dialogue: 0,0:01:07.19,0:01:11.94,Default,,0000,0000,0000,,What it does is it basically monitors all the files that you tell it Dialogue: 0,0:01:11.94,0:01:14.37,Default,,0000,0000,0000,,and whenever any one of them changes it just runs a command. Dialogue: 0,0:01:14.37,0:01:15.99,Default,,0000,0000,0000,,Any shell command you want. Dialogue: 0,0:01:15.99,0:01:18.51,Default,,0000,0000,0000,,So in this case I'm the command that builds the book, Dialogue: 0,0:01:18.51,0:01:22.98,Default,,0000,0000,0000,,so any time I make a change to the book it will automatically get built, which is really handy. Dialogue: 0,0:01:22.98,0:01:27.87,Default,,0000,0000,0000,,So I'm going to run that, and it fires off -- oops, sorry, I need to be in the virtualenv. Dialogue: 0,0:01:27.87,0:01:32.32,Default,,0000,0000,0000,,"workon" the virtualenv... okay. Now I'm going to run kicker... okay. Dialogue: 0,0:01:32.32,0:01:34.81,Default,,0000,0000,0000,,And it goes ahead and does it once to begin with, Dialogue: 0,0:01:34.81,0:01:37.23,Default,,0000,0000,0000,,and then any time I touch a file that I told it to watch, Dialogue: 0,0:01:37.23,0:01:43.45,Default,,0000,0000,0000,,so if I go here and say "touch preface" you can it executes again. Dialogue: 0,0:01:43.45,0:01:49.00,Default,,0000,0000,0000,,Okay. The other thing I'm going to do is "cd" into the "build" directory, Dialogue: 0,0:01:49.00,0:01:53.98,Default,,0000,0000,0000,,where the output of Bookmarkdown is going to put the HTML files, Dialogue: 0,0:01:53.98,0:01:58.37,Default,,0000,0000,0000,,and I'm just going to run "serve_this", which is a little alias Dialogue: 0,0:01:58.37,0:02:02.87,Default,,0000,0000,0000,,that basically serves the current directory on port 8000. Dialogue: 0,0:02:02.87,0:02:09.89,Default,,0000,0000,0000,,And if you want to see what it is, it's just a Python module -- it's just Dialogue: 0,0:02:09.89,0:02:12.73,Default,,0000,0000,0000,,"python -m SimpleHTTPServer" Dialogue: 0,0:02:12.73,0:02:15.58,Default,,0000,0000,0000,,SimpleHTTPServer is a built-in Python module, Dialogue: 0,0:02:15.58,0:02:20.22,Default,,0000,0000,0000,,so anywhere that has Python, I mean a relatively recent version, will have this. Dialogue: 0,0:02:20.22,0:02:24.80,Default,,0000,0000,0000,,So it's just a simple command to serve a directory on port 8000. Dialogue: 0,0:02:24.80,0:02:31.36,Default,,0000,0000,0000,,And I'm going to open Firefox and open localhost:8000. Dialogue: 0,0:02:31.36,0:02:36.43,Default,,0000,0000,0000,,Alright, so this is our book, right, this is what I've got so far. Dialogue: 0,0:02:36.43,0:02:40.06,Default,,0000,0000,0000,,I'm going to move that over here... okay, Dialogue: 0,0:02:40.06,0:02:43.20,Default,,0000,0000,0000,,ah, we don't need it that big. Dialogue: 0,0:02:43.20,0:02:50.53,Default,,0000,0000,0000,,Alright, we've got a book. And now I'm just going to open Vim and start working. Dialogue: 0,0:02:50.53,0:02:53.04,Default,,0000,0000,0000,,I'm not going to comment on everything and explain how I do everything Dialogue: 0,0:02:53.04,0:02:54.73,Default,,0000,0000,0000,,because that would just take forever. Dialogue: 0,0:02:54.73,0:02:57.40,Default,,0000,0000,0000,,Everything's in my muscle memory and I'd have to stop and think about every key I press Dialogue: 0,0:02:57.40,0:03:01.28,Default,,0000,0000,0000,,so if you see something that I do and you're kinda wondering how I did it Dialogue: 0,0:03:01.28,0:03:06.34,Default,,0000,0000,0000,,just leave a comment with the time in the video that it appears and I'll do my best to explain it for you. Dialogue: 0,0:03:06.34,0:03:10.44,Default,,0000,0000,0000,,With that said, I'm just going to put my headphones on and start typing. Cool. Dialogue: 0,0:44:16.90,0:44:19.53,Default,,0000,0000,0000,,Okay guys, I think that's about it. Dialogue: 0,0:44:19.53,0:44:25.47,Default,,0000,0000,0000,,I'm going to encode this screencast and upload it to Vimeo and that should be about it. Dialogue: 0,0:44:25.47,0:44:29.50,Default,,0000,0000,0000,,Like I said, if there's anything that you saw and you liked and you want to know how I did it Dialogue: 0,0:44:29.50,0:44:32.34,Default,,0000,0000,0000,,or you think I have a special mapping, Dialogue: 0,0:44:32.34,0:44:36.70,Default,,0000,0000,0000,,just post a comment on the video and -- or just tweet at me, either one -- Dialogue: 0,0:44:36.70,0:44:42.54,Default,,0000,0000,0000,,and just let me know the time and what it looks like and I'll let you know. Dialogue: 0,0:44:42.54,9:59:59.99,Default,,0000,0000,0000,,Otherwise I guess that's it. Alright, cool. Thanks guys.