Skip to content

Commit c458fce

Browse files
authored
Merge pull request #4 from Maffblaster/master
Fixed relative image path, English Makefile; updated README
2 parents 58cc550 + cd5b503 commit c458fce

File tree

5 files changed

+38
-27
lines changed

5 files changed

+38
-27
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vim for humans
22

3-
## Installation
3+
## Install
44

55
Be sure to create a symlink named 'vim-for-humans' in the project directory. This symlink should point to a directory where you've cloned [code examples](https://github.com/vjousse/vim-for-humans).
66

@@ -11,6 +11,17 @@ You will need some prerequisites to be able to compile the LaTeX source code:
1111
- [Sphinx](http://sphinx-doc.org/) to generate the epub file.
1212
- [kindlegen](http://www.amazon.com/gp/feature.html?docId=1000765211) to generate the .mobi file.
1313

14-
## Compiling
14+
### Gentoo
1515

16-
If you've installed everything, running the `makedist.sh` script should do the trick. If not, be sure to check the content of the script and to run each command one after another.
16+
* dev-python/sphinx[latex]
17+
* dev-python/pygments
18+
* app-text/texlive
19+
* kindlegen package not available.
20+
21+
## Compile
22+
23+
After the dependencies have been installed, create the dist directory via `mkdir dist` then run `makedist.sh` script to start compiling. The compilation fails be sure to check the content of the script and try running each command one after another.
24+
25+
## Enjoy
26+
27+
Upon success outputs can be found in the `dist/vimpourleshumains/` directory. Enjoy!

rst/en/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line.
55
SPHINXOPTS =
6-
SPHINXBUILD = sphinx-build2
6+
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = _build
99

rst/en/plugins.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Once the modification made and taken into account by |vim| (by restarting |vim|
7676

7777
.. _lusty:
7878

79-
.. image:: ../book-tex/graphics/vim-lusty.png
79+
.. image:: ../../book-tex/graphics/vim-lusty.png
8080

8181
The next thing to do is to deactivate *The Nerd Tree* by commenting the corresponding line like I have done on the screenshot above. It will not be useful anymore as *Lusty Explorer* is a better replacement when using the keyboard.
8282

@@ -86,7 +86,7 @@ You can see on the `lusty`_ screenshot that *Lusty Explorer* is made of two part
8686

8787
.. _fuzzy:
8888

89-
.. image:: ../book-tex/graphics/vim-lusty-fuzzy.png
89+
.. image:: ../../book-tex/graphics/vim-lusty-fuzzy.png
9090

9191

9292
Here are some handy handy shortcuts of *Lusty Explorer*:
@@ -143,7 +143,7 @@ Ack will start the search from the directory of the file currently opened. Here
143143

144144
The results will be displayed in a window called the *Quickfix Window*, as you can see below.
145145

146-
.. image:: ../book-tex/graphics/vim-ack-quickfix.png
146+
.. image:: ../../book-tex/graphics/vim-ack-quickfix.png
147147

148148
Here are some commands available inside this window:
149149

@@ -204,7 +204,7 @@ Now we need to add the shortcut to our |vimrc| to invoke CtrlP like in the listi
204204

205205
Here is CtrlP in action.
206206

207-
.. image:: ../book-tex/graphics/vim-ctrlp.png
207+
.. image:: ../../book-tex/graphics/vim-ctrlp.png
208208

209209
Launch it with ``,c`` and then type the name of the file you want to search. When the searched file will be selected first, you will just have to press |ttenter| to open it.
210210

rst/en/text-manip.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To copy/past using |vim|, you will have to switch to the "normal" mode (the defa
4040

4141
.. _mode insert:
4242

43-
.. image:: ../book-tex/graphics/vim-insert.png
43+
.. image:: ../../book-tex/graphics/vim-insert.png
4444

4545

4646
When there is nothing displayed at the bottom left, it's because you are currently in "normal" mode. In order to quit a mode to return to the normal one, you just have to press |ttesc|. You may already have noticed that pressing |ttesc| is a pain for your fingers. No worries, it's just a temporary thing, I will explain why in the ":ref:`secesc`" section.
@@ -49,15 +49,15 @@ Let's say that you are currently in the "normal" mode and that you already have
4949

5050
.. _twain:
5151

52-
.. image:: ../book-tex/graphics/vim-twain.png
52+
.. image:: ../../book-tex/graphics/vim-twain.png
5353

5454
The most intuitive way (but not the most efficient, we will see why a little bit later) to copy/paste the "impossible" word is to move the cursor at the first letter of the word using the directional keys, to press |ttv| (to switch to the "visual" mode), to move to the last letter of the word (you should have the word "impossible" highlighted) and then to press |tty| (|tty| stands for *yank*). You've just copied your first word using |vim|. Hooray!
5555

5656
Then, move to the end of the sentence (in "normal" mode) and press |ttp| (|ttp| standing for *paste*). The word should now be pasted at the end, and you should have something like the figure below.
5757

5858
.. _vim-paste:
5959

60-
.. image:: ../book-tex/graphics/vim-paste.png
60+
.. image:: ../../book-tex/graphics/vim-paste.png
6161

6262
We can see that |vim| uses the mode switching trick (including the "normal" mode for moving) in order to not have to use the mouse.
6363
When you will be used to switch quickly from one mode to another (and in order to do so, going without |ttesc| will be mandatory), using the mouse will appear like a pure waste of time. But obviously, you will first need to train yourself.
@@ -84,7 +84,7 @@ When in normal mode, 4 keys will allow you to move your cursor:
8484

8585
.. _hjkl:
8686

87-
.. image:: ../book-tex/graphics/hjkl.png
87+
.. image:: ../../book-tex/graphics/hjkl.png
8888

8989
As you can notice, those keys are located on the home row so that you don't have to move your hands. Your index has two moves (left and bottom) while your auricular doesn't have any. You will see that it's not a problem, it's even a feature: your index is stronger than your auricular. By checking the keyboard that was used to develop *Vi* in the ":ref:`secesc`" section, you will understand why.
9090

@@ -139,7 +139,7 @@ Here is an handy graphical cheat sheet that you can download on http://www.viemu
139139

140140
.. _cheat-sheet:
141141

142-
.. image:: ../book-tex/graphics/vi-vim-cheat-sheet.png
142+
.. image:: ../../book-tex/graphics/vi-vim-cheat-sheet.png
143143

144144
Keep in mind that the main goal here is to increase your speed while keeping your hands on the "home row" and using the "normal mode". Get down to work!
145145

@@ -154,7 +154,7 @@ To understand why |ttesc| is used by default to exit the "insert mode", we have
154154

155155
.. _vi-keyboard:
156156

157-
.. image:: ../book-tex/graphics/lsi-adm3a-full-keyboard.jpg
157+
.. image:: ../../book-tex/graphics/lsi-adm3a-full-keyboard.jpg
158158

159159
So we agree that we need another key to exit the insert mode. There are many solutions, here are some possibilities that you can try in your |vimrc|: ::
160160

@@ -316,6 +316,6 @@ To awaken the child in you, I urge you to go have fun with http://vim-adventures
316316

317317
.. _vim-adventures:
318318

319-
.. image:: ../book-tex/graphics/vim-adventures.png
319+
.. image:: ../../book-tex/graphics/vim-adventures.png
320320

321321
Now we will go to the next level: the use of plugins, or how to make |vim| indispensable.

rst/en/usable-vim.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Here is what a default |vim| is missing (and why **most of people are giving up*
1616

1717
|solarized|
1818

19-
.. |solarized| image:: ../book-tex/graphics/solarized-yinyang-mini.png
19+
.. |solarized| image:: ../../book-tex/graphics/solarized-yinyang-mini.png
2020

2121
**File explorer**
2222
If your are using |vim| along with a graphical interface (I suppose it's the case for 99% of you) you will by default have a ``File`` menu available. This menu should allow you to open a file. It's, for sure, a good start. But having a file explorer a la Netbeans or Textmate can be very handy. To mimic the same behavior, we will be using `The NERD Tree <http://www.vim.org/scripts/script.php?script_id=1658>`_. Be aware that, once you will have read this guide, you will not need the mouse anymore.
@@ -38,15 +38,15 @@ The first thing to do will certainly be to install a |vim| version for your oper
3838

3939
When you will start |vim|, you should see a welcome text asking you to help poor children in Uganda (or something along the lines).
4040

41-
.. image:: ../book-tex/graphics/en/vim-uganda.png
41+
.. image:: ../../book-tex/graphics/en/vim-uganda.png
4242

4343
This text will disappear as soon as we will be writing text in |vim|.
4444

4545
We will start by adding a comment in the header of the file to specify the author of the document (should be you). To be able to type text, the first thing to do will be to press |tti| (the cursor should have changed). The welcome text should have disappeared and you should have `a blank page`_ looking like the image below:
4646

4747
.. _a blank page:
4848

49-
.. image:: ../book-tex/graphics/en/vim-new.png
49+
.. image:: ../../book-tex/graphics/en/vim-new.png
5050

5151
**On a side note**: if you don't really understand what you have done and |vim| is displaying red messages at the bottom left or doesn't seem to react as it should when you press |tti|, don't panic. Pressing multiples times on |ttesc| (two times should be enough) should bring |vim| to its default mode, the *Normal mode*. Then it should behave as you would expect again.
5252

@@ -60,7 +60,7 @@ You should know be able to write down `the comment below`_:
6060

6161
You will have noticed that comments in *VimL* (the name of the |vim| programing language) start with a :viml:`"`. Then press |ttesc| to come back to the default mode (the normal mode) of |vim|. That's all, you are done. Here is a screenshot of what your |vim| should look like now:
6262

63-
.. image:: ../book-tex/graphics/en/vim-first-comment.png
63+
.. image:: ../../book-tex/graphics/en/vim-first-comment.png
6464

6565
I can already hear you: all that fuss for that? Well, yes. And you even don't know how to save a file. But all these things are logical that I'm gonna explain to you. One of the advantages of |vim| is that, usually, it is logical. Once you will have understood the logic behind it, all will be crystal clear for you (at least I hope so).
6666

@@ -83,7 +83,7 @@ So what do you have the right to do? Not a lot to be honest (but it's for your o
8383

8484
.. _as you can see on the picture below:
8585

86-
.. figure:: ../book-tex/graphics/hand-position.png
86+
.. figure:: ../../book-tex/graphics/hand-position.png
8787

8888
Home row, QWERTY keyboard
8989

@@ -128,7 +128,7 @@ Below is a screenshot of |vim| (macvim) `after your first configuration`_.
128128

129129
.. _after your first configuration:
130130

131-
.. figure:: ../book-tex/graphics/en/vim-first-config.png
131+
.. figure:: ../../book-tex/graphics/en/vim-first-config.png
132132

133133
|vim| after your first configuration.
134134

@@ -151,7 +151,7 @@ First, we need to enable syntax highlighting in the configuration file. Add thes
151151
You should have a |vim| looking like the picture below.
152152

153153

154-
.. figure:: ../book-tex/graphics/vim-syntax-hl.png
154+
.. figure:: ../../book-tex/graphics/vim-syntax-hl.png
155155

156156
Default syntax highlighting.
157157

@@ -163,7 +163,7 @@ Themes will allow you to have a nicer |vim| than the default one. A theme will c
163163

164164
To install it, you will first need to create a directory called `.vim` in the same directory than your |vimrc| (that is to say, in your home directory). Note that when using Windows, the `.vim` directory is called `vimfiles`. Each time I'll be speaking of the `.vim` directory, it will be the `vimfiles` directory for people using Windows. In this `.vim` directory, create a sub directory named `colors`. Then, download the *Solarized* theme file https://raw.github.com/altercation/vim-colors-solarized/master/colors/solarized.vim (it's the same file for the light and the dark version) and copy it in your `vim/colors/` directory. You `.vim` directory should look like the picture below.
165165

166-
.. figure:: ../book-tex/graphics/solarized-tree.png
166+
.. figure:: ../../book-tex/graphics/solarized-tree.png
167167

168168
Content of the .vim directory with Solarized.
169169

@@ -177,12 +177,12 @@ To test the light theme, you just have to change `dark` with `light` (for the `b
177177

178178
Here is a preview of the two versions (personally, I prefer the dark one).
179179

180-
.. figure:: ../book-tex/graphics/vim-solarized-dark.png
180+
.. figure:: ../../book-tex/graphics/vim-solarized-dark.png
181181

182182
The dark *Solarized* theme.
183183

184184

185-
.. figure:: ../book-tex/graphics/vim-solarized-light.png
185+
.. figure:: ../../book-tex/graphics/vim-solarized-light.png
186186

187187
The light *Solarized* theme.
188188

@@ -222,7 +222,7 @@ The main problem with this approach is that the plugins are not isolated. So you
222222

223223
That's why *Pathogen* is especially useful, it will allow each plugin to be located in a separate directory. Here is an example of a |.vim| directory before and after the usage of *Pathogen*:
224224

225-
.. figure:: ../book-tex/graphics/pathogen-tree.png
225+
.. figure:: ../../book-tex/graphics/pathogen-tree.png
226226

227227
|.vim| before and after Pathogen
228228

@@ -308,7 +308,7 @@ I have to admit that this command is a little bit obscure. Actually it means: ev
308308

309309
Nothing special then, *The NERD Tree* will display the tree of the directory where you've launched |vim| as you can see on the picture below. You can use your mouse and/or your keyboard to move inside *The NERD Tree*.
310310

311-
.. figure:: ../book-tex/graphics/vim-nerdtree.png
311+
.. figure:: ../../book-tex/graphics/vim-nerdtree.png
312312

313313
|vim| with *The NERD Tree*.
314314

0 commit comments

Comments
 (0)