VIMを使う (1)

最近 VIM を使ってます。
今まで簡単な設定ファイルなどは vim (vi) 使ってたけど、ブログの記事や何かは gedit 、bluefish などで書いてました。
VineLinux6.0になって、またこのブログも続きそうな気配なので、今回からは vim 、gvim を使って書いていこうと思います。
ちゃんと使えるようになりたいです。

ネタも少ないのでシリーズで続けてみる。


vimtutor ではじめる

vim (vi) の使い方はいろんなところで書かれてるので、その度にどっかで調べて使ってました。まずこれがイカンと思い、ちゃんとした使い方(基本)を学ぶことに。

vimtutor というコマンドがある。
vim が入っている環境なら一緒にインストールされている。これ知らなかったし。使ったことないし。

$ vimtutor

これはわかりやすい。
30分でいきなり使えるようになるね。
(今まで全然使えてないじゃんw)
正直言うと今まで最低限の操作で使ってたので。

[cw] - 単語の置換
[dw] - 単語の削除
[u] - 前回に戻す
[Ctrl+r] - 戻すを戻す

を知ってから編集効率が上がりました。(恥ずかしい;)


vimtutor の次は?

ここでつまづいた。
:help user-manual」すれば何でも教えてくれそうなんですが。。。その先がw

<:help user-manual>

                  Table Of Contents            *user-manual*

==============================================================================
Overview

Getting Started
|usr_01.txt| About the manuals
|usr_02.txt| The first steps in Vim
|usr_03.txt| Moving around
|usr_04.txt| Making small changes
|usr_05.txt| Set your settings
|usr_06.txt| Using syntax highlighting
|usr_07.txt| Editing more than one file
|usr_08.txt| Splitting windows
|usr_09.txt| Using the GUI
|usr_10.txt| Making big changes
|usr_11.txt| Recovering from a crash
|usr_12.txt| Clever tricks

<----- 以下省略 ----->

この |usr_01.txt| にリンクで飛びたいけどどうやるの?
ってことが、「:help user-manual」= usr_toc.txt に書いてない。

「:help usr_01.txt」とすると |usr_01.txt| が見れます。
そして usr_01.txt に「リンクに飛ぶ方法」が書いてあります。

<:help usr_01.txt>
*usr_01.txt*    For Vim version 7.3.  Last change: 2008 May 07

VIM USER MANUAL - by Bram Moolenaar

About the manuals


This chapter introduces the manuals available with Vim. Read this to know the
conditions under which the commands are explained.


<----- 前後省略 ----->


JUMPING AROUND

The text contains hyperlinks between the two parts, allowing you to quickly
jump between the description of an editing task and a precise explanation of
the commands and options used for it. Use these two commands:

Press CTRL-] to jump to a subject under the cursor.
Press CTRL-O to jump back (repeat to go further back).

Many links are in vertical bars, like this: |bars|. An option name, like
'number', a command in double quotes like ":write" and any other word can also
be used as a link. Try it out: Move the cursor to CTRL-] and press CTRL-]
on it.

<----- 以下省略 ----->


カーソルを |bars| の上のどこかにおいて

" Ctrl + ] " でジャンプ。 "]" は "j" ではなく "["の"]" です。

" Ctrl + o " でジャンプする前に戻る。



あとがき

Ameba BLOG で記事を貼り付けようとすると大変なんですよ。
普通の日本語の文章なら問題ないけど、コマンドなどの様子を書こうとすると。。。
はじめからHTMLで書いてHTML形式で貼り付けた方が、文章がくずれないのはわかるんだけど。
どうにか出来ないかな~って。vim 使ってどうなるのかだけどやってみます。
Bluefish は良かったですよ。

-- さらに --
今回「お試し版」で記事投稿すると、良いですね。
今まで <pre> タグでの表示に問題があったのだけど、「お試し版」はHTMLを変に変更しないので良い!
これなら vim でもOKになった。