Return to Video

Writing Learn Vimscript the Hard Way

  • 0:01 - 0:04
    Hey guys, this is Steve Losh.
  • 0:04 - 0:07
    If you're watching this screencast you probably already know that I've been writing a book
  • 0:07 - 0:09
    called "Learn Vimscript the Hard Way".
  • 0:09 - 0:12
    I figured I'd do a screencast while I wrote one of the shorter chapters
  • 0:12 - 0:15
    just to show you kind of how I work and how I'm making the book.
  • 0:15 - 0:21
    So first what I'm going to do is open an iTerm window...
  • 0:22 - 0:25
    and let's make it nice and big... okay.
  • 0:25 - 0:30
    I'm going to open DVTM, which is -- it's a terminal multiplexer, kind of like Tmux or Screen,
  • 0:30 - 0:34
    just a lot simpler. I don't really use all the functionality of Tmux or Screen,
  • 0:34 - 0:38
    so DVTM does pretty much everything I need.
  • 0:38 - 0:43
    And I'm going to open three splits with one of them a little smaller.
  • 0:43 - 0:50
    I'm going to go into the repo for the book in each of them.
  • 0:54 - 1:02
    In this window I'm going to run a little script -- a little program called "kicker",
  • 1:02 - 1:07
    which is open source, it's Ruby so you can just "gem install kicker".
  • 1:07 - 1:12
    What it does is it basically monitors all the files that you tell it
  • 1:12 - 1:14
    and whenever any one of them changes it just runs a command.
  • 1:14 - 1:16
    Any shell command you want.
  • 1:16 - 1:19
    So in this case I'm the command that builds the book,
  • 1:19 - 1:23
    so any time I make a change to the book it will automatically get built, which is really handy.
  • 1:23 - 1:28
    So I'm going to run that, and it fires off -- oops, sorry, I need to be in the virtualenv.
  • 1:28 - 1:32
    "workon" the virtualenv... okay. Now I'm going to run kicker... okay.
  • 1:32 - 1:35
    And it goes ahead and does it once to begin with,
  • 1:35 - 1:37
    and then any time I touch a file that I told it to watch,
  • 1:37 - 1:43
    so if I go here and say "touch preface" you can it executes again.
  • 1:43 - 1:49
    Okay. The other thing I'm going to do is "cd" into the "build" directory,
  • 1:49 - 1:54
    where the output of Bookmarkdown is going to put the HTML files,
  • 1:54 - 1:58
    and I'm just going to run "serve_this", which is a little alias
  • 1:58 - 2:03
    that basically serves the current directory on port 8000.
  • 2:03 - 2:10
    And if you want to see what it is, it's just a Python module -- it's just
  • 2:10 - 2:13
    "python -m SimpleHTTPServer"
  • 2:13 - 2:16
    SimpleHTTPServer is a built-in Python module,
  • 2:16 - 2:20
    so anywhere that has Python, I mean a relatively recent version, will have this.
  • 2:20 - 2:25
    So it's just a simple command to serve a directory on port 8000.
  • 2:25 - 2:31
    And I'm going to open Firefox and open localhost:8000.
  • 2:31 - 2:36
    Alright, so this is our book, right, this is what I've got so far.
  • 2:36 - 2:40
    I'm going to move that over here... okay,
  • 2:40 - 2:43
    ah, we don't need it that big.
  • 2:43 - 2:51
    Alright, we've got a book. And now I'm just going to open Vim and start working.
  • 2:51 - 2:53
    I'm not going to comment on everything and explain how I do everything
  • 2:53 - 2:55
    because that would just take forever.
  • 2:55 - 2:57
    Everything's in my muscle memory and I'd have to stop and think about every key I press
  • 2:57 - 3:01
    so if you see something that I do and you're kinda wondering how I did it
  • 3:01 - 3:06
    just leave a comment with the time in the video that it appears and I'll do my best to explain it for you.
  • 3:06 - 3:10
    With that said, I'm just going to put my headphones on and start typing. Cool.
  • 44:17 - 44:20
    Okay guys, I think that's about it.
  • 44:20 - 44:25
    I'm going to encode this screencast and upload it to Vimeo and that should be about it.
  • 44:25 - 44:30
    Like I said, if there's anything that you saw and you liked and you want to know how I did it
  • 44:30 - 44:32
    or you think I have a special mapping,
  • 44:32 - 44:37
    just post a comment on the video and -- or just tweet at me, either one --
  • 44:37 - 44:43
    and just let me know the time and what it looks like and I'll let you know.
  • 44:43 -
    Otherwise I guess that's it. Alright, cool. Thanks guys.
Title:
Writing Learn Vimscript the Hard Way
Description:

A long, mostly boring screencast of me writing one of the chapters of http://learnvimscriptthehardway.stevelosh.com/

more » « less
Video Language:
English
Steve Losh added a translation

English subtitles

Revisions