# HG changeset patch # User vimboss # Date 1140471460 0 # Node ID e649c78407e600ab28819574efd7d2d67f066171 # Parent 9cdb8018cdf1b55e4846ea1b264cfcfebd17f4a2 updated for version 7.0202 diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 +*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -284,8 +284,8 @@ Name triggered by ~ |WinEnter| after entering another window |WinLeave| before leaving a window -|TabEnterPost| after entering another tab page -|TabLeavePre| before leaving a tab page +|TabEnter| after entering another tab page +|TabLeave| before leaving a tab page |CmdwinEnter| after entering the command-line window |CmdwinLeave| before leaving the command-line window @@ -706,14 +706,14 @@ Syntax When the 'syntax' option has b where this option was set, and for the new value of 'syntax'. See |:syn-on|. - *TabEnterPost* -TabEnterPost Just after entering a tab page. |tab-page| + *TabEnter* +TabEnter Just after entering a tab page. |tab-page| Before triggering the WinEnter and BufEnter events. - *TabLeavePre* -TabLeavePre Just before leaving a tab page. |tab-page| - BufLeave and WinLeave events will have been - triggered first. + *TabLeave* +TabLeave Just before leaving a tab page. |tab-page| + A WinLeave event will have been triggered + first. *TermChanged* TermChanged After the value of 'term' has changed. Useful for re-loading the syntax file to update the diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 +*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1690,8 +1690,11 @@ synIDattr( {synID}, {what} [, {mode}]) String attribute {what} of syntax ID {synID} synIDtrans( {synID}) Number translated syntax ID of {synID} system( {expr} [, {input}]) String output of shell command/filter {expr} -tabpage( [{expr}]) Number number of current tab page -taglist( {expr}) List list of tags matching {expr} +tabpagebuflist( [{arg}]) List list of buffer numbers in tab page +tabpagenr( [{arg}]) Number number of current or last tab page +tabpagewinnr( {tabarg}[, {arg}]) + Number number of current window in tab page +taglist( {expr}) List list of tags matching {expr} tagfiles() List tags files used tempname() String name for a temporary file tolower( {expr}) String the String {expr} switched to lowercase @@ -3861,10 +3864,12 @@ searchpair({start}, {middle}, {end} [, { Search for the match of a nested start-end pair. This can be used to find the "endif" that matches an "if", while other if/endif pairs in between are ignored. - The search starts at the cursor. If a match is found, the - cursor is positioned at it and the line number is returned. - If no match is found 0 or -1 is returned and the cursor - doesn't move. No error message is given. + The search starts at the cursor. The default is to search + forward, include 'b' in {flags} to search backward. + If a match is found, the cursor is positioned at it and the + line number is returned. If no match is found 0 or -1 is + returned and the cursor doesn't move. No error message is + given. {start}, {middle} and {end} are patterns, see |pattern|. They must not contain \( \) pairs. Use of \%( \) is allowed. When @@ -4448,7 +4453,21 @@ system({expr} [, {input}]) *system()* Use |:checktime| to force a check. -tabpagenr([{arg}]) *tabpagenr()* +tabpagebuflist([{arg}]) *tabpagebuflist()* + The result is a List, where each item is the number of the + buffer associated with each window in the current tab page. + {arg} specifies the number of tab page to be used. When + omitted the current tab page is used. + When {arg} is invalid the number zero is returned. + To get a list of all buffers in all tabs use this: > + tablist = [] + for i in range(tabpagenr('$')) + call extend(tablist, tabpagebuflist(i + 1)) + endfor +< Note that a buffer may appear in more than one window. + + +tabpagenr([{arg}]) *tabpagenr()* The result is a Number, which is the number of the current tab page. The first tab page has number 1. When the optional argument is "$", the number of the last tab @@ -4456,6 +4475,19 @@ tabpagenr([{arg}]) *tabpagenr()* The number can be used with the |:tab| command. +tabpagewinnr({tabarg}, [{arg}]) *tabpagewinnr()* + Like |winnr()| but for tab page {arg}. + {tabarg} specifies the number of tab page to be used. + {arg} is used like with |winnr()|: + - When omitted the current window number is returned. This is + the window which will be used when going to this tab page. + - When "$" the number of windows is returned. + - When "#" the previous window nr is returned. + Useful examples: > + tabpagewinnr(1) " current window of tab page 1 + tabpagewinnr(4, '$') " number of windows in tab page 4 +< When {tabarg} is invalid zero is returned. + taglist({expr}) *taglist()* Returns a list of tags matching the regular expression {expr}. Each list item is a dictionary with at least the following diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 +*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4614,7 +4614,7 @@ A jump table for the options with a shor {only available when compiled with the |+linebreak| feature} Minimal number of columns to use for the line number. Only relevant - when the 'number' option is set. + when the 'number' option is set or printint lines with a line number. Since one space is always between the number and the text, there is one less character for the number itself. The value is the minimum width. A bigger width is used when needed to @@ -5680,6 +5680,21 @@ A jump table for the options with a shor NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset. + *'showtabline'* *'stal'* +'showtabline' 'stal' number (default 1) + global + {not in Vi} + {not available when compiled without the +windows + feature} + The value of this option specifies when the line with tab page labels + will be displayed: + 0: never + 1: only if there are at least two tab pages + 2: always + This is both for the GUI and non-GUI implementation of the tab pages + line. + See |tab-page| for more information about tab pages. + *'sidescroll'* *'ss'* 'sidescroll' 'ss' number (default 0) global @@ -6235,17 +6250,25 @@ A jump table for the options with a shor Only normal file name characters can be used, "/\*?[|<>" are illegal. *'tabline'* *'tal'* -'tabline' 'tal' number (default 1) +'tabline' 'tal' string (default empty) global {not in Vi} {not available when compiled without the +windows feature} - The value of this option specifies when the line with tab page labels - will be displayed: - 0: never - 1: only if there are at least two tab pages - 2: always - |tab-page| + When nonempty, this option determines the content of the tab pages + line at the top of the Vim window. When empty Vim will use a default + tab pages line. |tab-page| + + The tab pages line only appears as specified with the 'showtabline' + option and only when there is no GUI implementation for tabs. + + The value is evaluated like with 'statusline'. You can use + |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out + the text to be displayed. + + Keep in mind that only one of the tab pages is the current one, others + are invisible and you can't jump to their windows. + *'tabstop'* *'ts'* 'tabstop' 'ts' number (default 8) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.0aa. Last change: 2006 Feb 16 +*syntax.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4020,6 +4020,12 @@ StatusLine status line of current window StatusLineNC status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. + *hl-TabLine* +TabLine tab pages line, not active tab page label + *hl-TabLineFill* +TabLineFill tab pages line, where there are no labels + *hl-TabLineSel* +TabLineSel tab pages line, active tab page label *hl-Title* Title titles for output from ":set all", ":autocmd" etc. *hl-Visual* diff --git a/runtime/doc/tags b/runtime/doc/tags --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -718,6 +718,7 @@ 'showfulltag' options.txt /*'showfulltag'* 'showmatch' options.txt /*'showmatch'* 'showmode' options.txt /*'showmode'* +'showtabline' options.txt /*'showtabline'* 'shq' options.txt /*'shq'* 'si' options.txt /*'si'* 'sidescroll' options.txt /*'sidescroll'* @@ -758,6 +759,7 @@ 'ssop' options.txt /*'ssop'* 'st' options.txt /*'st'* 'sta' options.txt /*'sta'* +'stal' options.txt /*'stal'* 'startofline' options.txt /*'startofline'* 'statusline' options.txt /*'statusline'* 'stl' options.txt /*'stl'* @@ -2646,6 +2648,10 @@ 90.5 usr_90.txt /*90.5* :tabclose tabpage.txt /*:tabclose* :tabe tabpage.txt /*:tabe* :tabedit tabpage.txt /*:tabedit* +:tabf tabpage.txt /*:tabf* +:tabfind tabpage.txt /*:tabfind* +:tabn tabpage.txt /*:tabn* +:tabnew tabpage.txt /*:tabnew* :tabo tabpage.txt /*:tabo* :tabonly tabpage.txt /*:tabonly* :tabs tabpage.txt /*:tabs* @@ -4098,8 +4104,8 @@ TCL if_tcl.txt /*TCL* TERM starting.txt /*TERM* TTpro-telnet syntax.txt /*TTpro-telnet* Tab intro.txt /*Tab* -TabEnterPost autocmd.txt /*TabEnterPost* -TabLeavePre autocmd.txt /*TabLeavePre* +TabEnter autocmd.txt /*TabEnter* +TabLeave autocmd.txt /*TabLeave* Tcl if_tcl.txt /*Tcl* TermChanged autocmd.txt /*TermChanged* TermResponse autocmd.txt /*TermResponse* @@ -5515,6 +5521,9 @@ hl-SpellLocal syntax.txt /*hl-SpellLocal hl-SpellRare syntax.txt /*hl-SpellRare* hl-StatusLine syntax.txt /*hl-StatusLine* hl-StatusLineNC syntax.txt /*hl-StatusLineNC* +hl-TabLine syntax.txt /*hl-TabLine* +hl-TabLineFill syntax.txt /*hl-TabLineFill* +hl-TabLineSel syntax.txt /*hl-TabLineSel* hl-Title syntax.txt /*hl-Title* hl-Tooltip syntax.txt /*hl-Tooltip* hl-User1 syntax.txt /*hl-User1* @@ -6949,7 +6958,9 @@ tab-page-intro tabpage.txt /*tab-page-in tab-page-other tabpage.txt /*tab-page-other* tabpage tabpage.txt /*tabpage* tabpage.txt tabpage.txt /*tabpage.txt* +tabpagebuflist() eval.txt /*tabpagebuflist()* tabpagenr() eval.txt /*tabpagenr()* +tabpagewinnr() eval.txt /*tabpagewinnr()* tag tagsrch.txt /*tag* tag-! tagsrch.txt /*tag-!* tag-any-white tagsrch.txt /*tag-any-white* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 +*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,6 +30,50 @@ be worked on, but only if you sponsor Vi *known-bugs* -------------------- Known bugs and current work ----------------------- +'tabline' documentation with an example; esp for the highlighting + +P_INSECURE should be remembered for local option values separately. + +Completion: and don't insert completion, and +shouldn't either. + +Completion: case sensitiveness when typing BS: make it an option? + +Completion: When back at the original word behave like after BS. + +Completion: When to get out of the BS state when the user keeps on typing? + +TabLineMod, TabLineModSel hl when a buffer is modified in a tab. +Command(s) to reorder tabs? ":tabmove N". +Open new tab by double click in tab line. +"gT", ":tpNext" and ":tpprev" to go to previous tab? +":tab" -> ":tpnext". +":tab" or ":tabpage" modifier to open new window in new tab. + E.g., ":tab help gt" + Keep a few commands as shortcuts: + :tpnew :tab new + :tpedit - + :tpclose :tab close + :tponly :tab only + :tpnext - + :tpprevious - + :tpNext - + :tplast - + :tpfirst - + ":tab!" to open it at the end, ":0tab" to open at the start. + ":tab split" opens tab with window same as current window. + ":tpsplit" would split the tab with all its windows. +Option to put tab line at the left or right? Need an option to specify its +witdh. It's like a separate window with ":tabs" output. + :tabdo ":tabdo windo cmd" should also work + +Add an argument to search functions to stop at a certain line number. + search('{', 'b', line('w0')) + search('{', '', line('w$')) +Also start at a specified position? + +undo could remember the '< and '> marks. + Support WINDOW TABS. Works like several pages, each with their own split windows. Let's call them "tab pages". - line at top of frame with tabs. @@ -103,6 +147,7 @@ closing it, executing the command and re all. (Gautam Iyer) Mac unicode patch (Da Woon Jung): +- configuration option for platform: i386, ppc or both. - selecting proportional font breaks display - UTF-8 text causes display problems. Font replacement causes this. - Command-key mappings do not work. (Alan Schmitt) diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 7.0aa. Last change: 2006 Jan 08 +*various.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -94,7 +94,8 @@ g8 Print the hex values of the bytes u *:nu* *:number* :[range]nu[mber] [count] [flags] Same as :print, but precede each line with its line - number. (See also 'highlight' option). + number. (See also 'highlight' and 'numberwidth' + option). See |ex-flags| for [flags]. *:#* diff --git a/runtime/syntax/colortest.vim b/runtime/syntax/colortest.vim --- a/runtime/syntax/colortest.vim +++ b/runtime/syntax/colortest.vim @@ -1,7 +1,7 @@ " Vim script for testing colors " Maintainer: Bram Moolenaar " Contributors: Rafael Garcia-Suarez, Charles Campbell -" Last Change: 2006 Feb 16 +" Last Change: 2006 Feb 20 " edit this file, then do ":source %", and check if the colors match @@ -54,11 +54,12 @@ " Open this file in a window if it isn't edited yet. " Use the current window if it's empty. -if &mod || line('$') != 1 || getline(1) != '' - new -endif if expand('%:p') != expand(':p') - exe "edit " . expand('') + if &mod || line('$') != 1 || getline(1) != '' + exe "new " . expand('') + else + exe "edit " . expand('') + endif endif syn clear diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc --- a/runtime/tutor/tutor.ja.euc +++ b/runtime/tutor/tutor.ja.euc @@ -1,25 +1,26 @@ =============================================================================== -= V I M 教 本 (チュートリアル) へ よ う こ そ - Version 1.5 = += V I M 教 本 (チュートリアル) へ よ う こ そ - Version 1.7 = =============================================================================== - Vim は、このチュートリアルで説明するには多すぎる程のコマンドを備えた - 非常に強力なエディターです。このチュートリアルは、あなたが Vim - を万能エディターとして使いこなせるようになるのに十分なコマンドについて - 説明をするようなっています。 + Vim は、このチュートリアルで説明するには多すぎる程のコマンドを備えた非常 + に強力なエディターです。このチュートリアルは、あなたが Vim を万能エディ + ターとして使いこなせるようになるのに十分なコマンドについて説明をするよう + なっています。 - チュートリアルを完了するのに必要な時間は、覚えたコマンドを試すのにどれ - だけ時間を使うのかにもよりますが、およそ25〜30分です。 + チュートリアルを完了するのに必要な時間は、覚えたコマンドを試すのにどれだ + け時間を使うのかにもよりますが、およそ25から30分です。 - 学ぶコマンドにはこの文章を変更するものもあります。練習を始める前にコ - ピーを作成しましょう("vimtutor"したならば、既にコピーされています)。 + ATTENTION: + 以下の練習用コマンドにはこの文章を変更するものもあります。練習を始める前 + にコピーを作成しましょう("vimtutor"したならば、既にコピーされています)。 - このチュートリアルが、使うことで覚えられる仕組みになっていることを、心 - しておかなければなりません。正しく学習するにはコマンドを実際に試さなけ - ればならないのです。文章を読んだだけならば、きっと忘れてしまいます!。 + このチュートリアルが、使うことで覚えられる仕組みになっていることを、心し + ておかなければなりません。正しく学習するにはコマンドを実際に試さなければ + ならないのです。文章を読んだだけならば、きっと忘れてしまいます!。 - さぁ、Capsロック(Shift-Lock)キーが押されていないことを確認した後、 - 画面にレッスン1.1 が全部表示されるところまで、j キーを押してカーソルを - 移動しましょう。 + さぁ、Capsロック(Shift-Lock)キーが押されていないことを確認した後、画面に + レッスン1.1 が全部表示されるところまで、j キーを押してカーソルを移動しま + しょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1.1: カーソルの移動 @@ -33,15 +34,15 @@ 1. 移動に慣れるまで、スクリーンでカーソル移動させましょう。 2. 下へのキー(j)を押しつづけると、連続して移動できます。 ----> これで次のレッスンに移動する方法がわかりましたね。 + これで次のレッスンに移動する方法がわかりましたね。 3. 下へのキーを使って、レッスン1.2 に移動しましょう。 -NOTE: 何をタイプしているか判らなくなったら、を押してノーマルモードにしま - す。それから入力しようとしていたコマンドを再入力しましょう。 +Note: 何をタイプしているか判らなくなったら、を押してノーマルモードにし + ます。それから入力しようとしていたコマンドを再入力しましょう。 -NOTE: カーソルキーでも移動できます。しかし hjkl を使用することに一度慣れてしま - えば、はるかに速く移動することができるでしょう。 +Note: カーソルキーでも移動できます。しかし hjkl に一度慣れてしまえば、はるか + に速く移動することができるでしょう。いやマジで! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1.2: VIM の起動と終了 @@ -52,27 +53,27 @@ NOTE: カーソルキーでも移動できます。しかし hjkl を使用することに一度慣れてしま 1. キーを押しましょう。(確実にノーマルモードにするため) 2. 次のようにタイプ: :q! - ----> これにより編集した内容を保存せずにエディタが終了します。 - 編集内容を保存して終了するときは次のようにタイプします: - :wq + これにより編集した内容を保存せずにエディタが終了します。 - 3. シェルプロンプトからチュートリアルを始めるにはコマンドをタイプします。 + 3. シェルプロンプトが出てきたら、このチュートリアルを始める為ににコマンド + をタイプします。 そのコマンドは: vimtutor - 通常はこうでしょう: vim tutor - ----> 'vim' は Vim エディタの起動を、'tutor' は編集したいファイルを意味します。 4. これまでのステップを覚え自信がついたならば、ステップ 1 から 3 までを実 - 際に試して、Vim を1度終了してから再び起動しましょう。それからレッスン - 1.3までカーソルを移動させましょう。 + 際に試して、Vim を1度終了してから再び起動しましょう。 + +NOTE: :q! は全ての変更を破棄します。レッスンにて変更をファイルに保 + 存する方法についても勉強していきましょう。 + + 5. 1.3までカーソルを移動させましょう。 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1.3: テキスト編集 - 削除 ** ノーマルモードにてカーソルの下の文字を削除するには x を押します ** - 1. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 1. 以下の ---> と示された行にカーソルを移動しましょう。 2. 間違いを修正するために、削除する最初の文字までカーソルを移動します。 @@ -82,7 +83,7 @@ NOTE: カーソルキーでも移動できます。しかし hjkl を使用することに一度慣れてしま ---> その ううさぎ は つつきき を こええてて とびはねたた - 5. 行が正しくなったら、レッスン 1.4 に移りましょう。 + 5. 行が正しくなったら、レッスン 1.4 へ進みましょう。 NOTE: 全てのレッスンを通じて、覚えようとするのではなく実際にやってみましょう。 @@ -95,15 +96,15 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく実際にやってみましょう。 ** ノーマルモードにてテキストを挿入するには i を押します ** - 1. 以下の ---> と記されたされた最初の行にカーソルを移動しましょう。 + 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 - 2. 1行目を2行目と同じ様にするために、テキストを挿入しなければならない位 - 置の次の文字にカーソルを移動します。 + 2. 1行目を2行目と同じ様にするために、テキストを挿入しなければならない位置 + の次の文字にカーソルを移動します。 3. i キーを押してから、追加が必要な文字をタイプしましょう。 - 4. 間違いを修正したら を押してコマンドモードに戻り、正しい文に - なる様にステップ 2 から 4 を繰り返しましょう。 + 4. 間違いを修正したら を押してコマンドモードに戻り、正しい文になる様 + にステップ 2 から 4 を繰り返しましょう。 ---> この には 足りない テキスト ある。 ---> この 行 には 幾つか 足りない テキスト が ある。 @@ -113,6 +114,52 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく実際にやってみましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 1.5: テキスト編集 - 追加 + + + ** テキスト追加するには A を押しましょう ** + + 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 + カーソルがその文字上にあってもかまいません。 + + 2. 追加が必要な場所で A をタイプしましょう。 + + 3. テキストを追加し終えたら、 を押してノーマルモードに戻りましょう。 + + 4. 2行目の ---> と示された場所へ移動し、ステップ 2 から 3 繰り返して文法を + 修正しましょう。 + +---> ここには間違ったテキストがあり + ここには間違ったテキストがあります。 +---> ここにも間違ったテキス + ここにも間違ったテキストがあります。 + + 5. テキストの追加が軽快になってきたらレッスン 1.6 へ進みましょう。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 1.6: ファイルの編集 + + + ** ファイルを保存して終了するには :wq とタイプします ** + + !! NOTE: 以下のステップを実行する前に、まず全体を読んでください!! + + 1. レッスン 1.2 でやったように :q! をタイプして、このチュートリアルを終了 + します。 + + 2. シェルプロンプトでこのコマンドをタイプします: vim tutor + 'vim'が Vim エディタを起動するコマンド、'tutor' は編集したいファイルの + 名前です。変更してもよいファイルを使いましょう。 + + 3. 前のレッスンで学んだように、テキストを挿入、削除します。 + + 4. 変更をファイルに保存します: :wq + + 5. vimtutor を再度起動し、以下の要約へ進みましょう。 + + 6. 以上のステップを読んで理解した上でこれを実行しましょう。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1 要約 @@ -127,14 +174,14 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく実際にやってみましょう。 4. カーソルの下の文字を削除するには、ノーマルモードで x とタイプします。 5. カーソルの位置に文字を挿入するには、ノーマルモードで i とタイプします。 - i テキストのタイプ + i テキストのタイプ カーソル位置に追加 + A テキストの追加 行末に追加 -NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途中 - のコマンドを取り消すことができます。 +NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途 + 中のコマンドを取り消すことができます。 さて、続けてレッスン 2 を始めましょう。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 2.1: 削除コマンド @@ -143,7 +190,7 @@ NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途中 1. ノーマルモードであることを確認するために を押しましょう。 - 2. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 2. 以下の ---> と示された行にカーソルを移動しましょう。 3. 消したい単語の先頭にカーソルを移動しましょう。 @@ -154,7 +201,7 @@ NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途中 ---> この 文 紙 には いくつかの たのしい 必要のない 単語 が 含まれて います。 - 5. 3 から 4 までを文が正しくなるまで繰り返し、レッスン 2.2 に移りましょう。 + 5. 3 から 4 までを文が正しくなるまで繰り返し、レッスン 2.2 へ進みましょう。 @@ -166,7 +213,7 @@ NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途中 1. ノーマルモードであることを確認するのに を押しましょう。 - 2. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 2. 以下の ---> と示された行にカーソルを移動しましょう。 3. 正しい文の末尾へカーソルを移動しましょう(最初の . の後です)。 @@ -175,77 +222,123 @@ NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途中 ---> 誰かがこの行の最後を2度タイプしました。 2度タイプしました。 - 5. どういうことか理解するために、レッスン 2.3 へ移りましょう。 + 5. どういうことか理解するために、レッスン 2.3 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.3: コマンドと目的語 + レッスン 2.3: オペレータとモーション - 削除コマンド d の形式は次の様になっています: + 多くのコマンドはオペレータとモーションからテキストに変更を加ます。 + 削除コマンド d のオペレータは次の様になっています: - [回数] d 目的語 もしくは d [回数] 目的語 + d モーション + それぞれ: - 回数 - そのコマンドを何回繰り返すか(省略可能, 省略した時は =1)。 - d - 削除コマンド。 - 目的語 - 何に対して働きかけるか(以下に挙げます)。 + d - 削除コマンド。 + モーション - 何に対して働きかけるか(以下に挙げます)。 - 目的語一覧: + オペレータの一部一覧: w - カーソル位置から空白を含む単語の末尾まで。 e - カーソル位置から空白を含まない単語の末尾まで。 $ - カーソル位置から行末まで。 -NOTE: 冒険したい人は、ノーマルモードにてコマンドなしに目的語を押して + つまり de とタイプすると、カーソル位置から単語の終わりまでを削除します。 + +NOTE: 冒険したい人は、ノーマルモードにてコマンドなしにモーションを押して みましょう。カーソルが目的語一覧で示される位置に移動するはずです。 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 2.4: モーションにカウントを使用する + + + ** 何回も行いたい繰り返しのモーションの前に数値をタイプします。 ** + + 1. 以下の ---> と示された業の先頭にカーソルを移動します。 + + 2. 2dw をタイプして単語2つ分移動します。 + + 3. 3e をタイプして3つ目の単語の終端に移動します。 + + 4. 0 (ゼロ)をタイプして行頭に移動します。 + + 5. ステップ 2 と 3 を違う数値と使って繰り返します。 + +---> This is just a line with words you can move around in. + + 6. レッスン 2.5 に進みましょう。 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.4: それ以外の形のコマンド + レッスン 2.5: より多くを削除するためにカウントを使用する - ** 行全体を削除するには dd とタイプしましょう ** + ** オペレータとカウントをタイプすると、その操作が複数回繰り返されます。 ** - 行全体の削除は頻繁に行なう作業なので、Vim の設計者は行を削除するのには、 - 単に列内にて2回 d をタイプする方が簡単だろうと判断しました。 + 既述の削除のオペレータとモーションの組み合わせにカウントを追加することで、 + より多くの削除が行えます: + d 数値 モーション + + 1. ---> と示された行の行頭部分にカーソルを移動しましょう。 - 1. 下にある一連のフレーズの2行目にカーソルを移動しましょう。 - 2. dd とタイプして行を削除しましょう。 - 3. では4行目に移動してみましょう。 - 4. 2dd とタイプして2行削除してみましょう。 - (回数-コマンド-目的語 の形式を思い出しましょう) + 2. UPPER CASE の単語2つを 2dw とタイプして削除します。 + + 3. UPPER CASE という連続した単語を、1つのコマンドと異なるカウントを指定し、 + ステップ 1 と 2 を繰り返します。 - 1) バラは赤い、 - 2) つまらないものは楽しい、 - 3) スミレは青い、 - 4) 私は車をもっている、 - 5) 時計が時刻を告げる、 - 6) 砂糖は甘い - 7) オマエモナー +---> このABC DE行のFGHI JK LMN OP単語はQ RS TUV綺麗になった。 + +NOTE: オペレータ d とモーションの間にカウントを使った場合、オペレータのない + 場合のモーションのように動作します。 + 例: 3dw と d3w は同等で、3w を削除します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.5: やり直しコマンド + レッスン 2.6: 行の操作 + + + ** 行全体を削除するには dd とタイプします ** + + 行全体を削除する頻度が多いので、Viのデザイナーは行の削除を d の2回タイプと + いう簡単なものに決めました。 + + 1. 以下の句の2行目にカーソルを移動します。 + 2. dd とタイプして行を削除します。 + 3. さらに4行目に移動します。 + 4. 2dd とタイプして2行を削除します。 + +---> 1) バラは赤い、 +---> 2) つまらないものは楽しい、 +---> 3) スミレは青い、 +---> 4) 私は車をもっている、 +---> 5) 時計が時刻を告げる、 +---> 6) 砂糖は甘い +---> 7) オマエモナー + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 2.7: やり直しコマンド ** 最後のコマンドを取り消すには u を押します。U は行全体の取消です。 ** - 1. 以下の ---> と記されたされた行にカーソルを移動し、最初の間違いにカーソル - を移動しましょう。 + 1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ + ルを移動しましょう。 2. x をタイプしていらない先頭の文字を削除しましょう。 3. さぁ、u をタイプして最後に実行したコマンドを取り消しましょう。 4. 今度は、x を使用して誤りを全て修正しましょう。 5. 大文字の U をタイプして、行を元の状態に戻しましょう。 6. u をタイプして直前の U コマンドを取消しましょう。 - 7. ではコマンドを再実行するのに CTRL-R (CTRL を押したまま R を打つ)を - 数回タイプしてみましょう(取消の取消)。 + 7. ではコマンドを再実行するのに CTRL-R (CTRL を押したまま R を打つ)を数回 + タイプしてみましょう(取消の取消)。 ---> このの行のの間違いを修正々し、後でそれらの修正をを取消しまますす。 - 8. これはとても便利なコマンドです。さぁレッスン 2 要約に移りましょう。 + 8. これはとても便利なコマンドです。さぁレッスン 2 要約へ進みましょう。 @@ -255,24 +348,24 @@ NOTE: 冒険したい人は、ノーマルモードにてコマンドなしに目的語を押して 1. カーソル位置から単語の末尾までを削除するには dw とタイプします。 - 2. カーソル位置から行の末尾までを削除するには d$ とタイプします。 - 3. 行全体を削除するには dd とタイプします。 - 4. ノーマルモードでのコマンド形式は + 4. モーションを繰り返すには数値を付与します: 2w + 5. 変更に用いるコマンドの形式は + オペレータ [数値] モーション - [回数] コマンド 目的語 もしくは コマンド [回数] 目的語 それぞれ: - 回数 - そのコマンドを何回繰り返すか。 - コマンド - 削除 d の類で何をするか。 - 目的語 - 単語 w や行末 $ などの類で何に対して働きかけるか。 + オペレータ - 削除 d の類で何をするか。 + 数値 - そのコマンドを何回繰り返すか。 + モーション - w (単語)や $ (行末)などの類で、テキストの何に対して働きか + けるか。 - 5. 前回の動作を取消す: u (小文字 u) + 6. 行の先頭に移動するにはゼロを使用します: 0 + + 7. 前回の動作を取消す: u (小文字 u) 行全体の変更を取消す: U (大文字 U) 取消しの取消し: CTRL-R - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 3.1: 貼り付けコマンド @@ -302,7 +395,7 @@ NOTE: 冒険したい人は、ノーマルモードにてコマンドなしに目的語を押して ** カーソルの下の文字を置き換えるには r をタイプします ** - 1. 以下の ---> と記されたされた最初の行にカーソルを移動しましょう。 + 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 2. 最初の間違いの先頭にカーソルを移動しましょう。 @@ -313,7 +406,7 @@ NOTE: 冒険したい人は、ノーマルモードにてコマンドなしに目的語を押して ---> この合を人力した時ね、その人は幾つか問違ったキーを押しもした! ---> この行を入力した時に、その人は幾つか間違ったキーを押しました! - 5. さぁ、レッスン 3.2 に移りましょう。 + 5. さぁ、レッスン 3.2 へ進みましょう。 NOTE: 実際に試しましょう。決して覚えるだけにはしないこと。 @@ -325,7 +418,7 @@ NOTE: 実際に試しましょう。決して覚えるだけにはしないこと。 ** 単語の一部、もしくは全体を変更するには cw とタイプします ** - 1. 以下の ---> と記されたされた最初の行にカーソルを移動しましょう。 + 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 2. lubw の u の位置にカーソルを移動しましょう。 @@ -348,14 +441,13 @@ cw は単語を変更するだけでなく、挿入も行えることに注意しましょう。 ** 変更コマンドは、削除コマンドと同じ様にオブジェクトを使用します ** - 1. 変更コマンドは、削除コマンドと同じような動作をします。その形式は - [回数] c 目的語 もしくは c [回数] 目的語 + c [数値] モーション 2. オブジェクトも同じで、w は単語、 $ は行末などといったものです。 - 3. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 3. 以下の ---> と示された行にカーソルを移動しましょう。 4. 最初の間違いへカーソルを移動しましょう。 @@ -364,6 +456,7 @@ cw は単語を変更するだけでなく、挿入も行えることに注意しましょう。 ---> The end of this line needs some help to make it like the second. ---> The end of this line needs to be corrected using the c$ command. +NOTE: タイプ中の間違いはバックスペースキーを使って直すこともできます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 3 要約 @@ -376,63 +469,63 @@ cw は単語を変更するだけでなく、挿入も行えることに注意しましょう。 2. カーソルの下の文字を置き換えるには、r をタイプした後、それを置き換える 文字をタイプします。 - 3. 変更コマンドではカーソル位置から特定の目的語で指定される終端までを変更 - することが可能です。例えば cw ならばカーソル位置から単語の終わりまで、 + 3. 変更コマンドではカーソル位置から特定のモーションで指定される終端までを変 + 更することが可能です。例えば cw ならばカーソル位置から単語の終わりまで、 c$ ならば行の終わりまでを変更します。 4. 変更コマンドの形式は - [回数] c 目的語 もしくは c [回数] 目的語 + c [数値] モーション -さぁ、次のレッスンに移りましょう。 +さぁ、次のレッスンへ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.1: 位置とファイルの情報 - - ** ファイル内での位置とファイルの状態を表示するには CTRL-g をタイプします。 - ファイル内のある行に移動するには SHIFT-G をタイプします ** + ** ファイル内での位置とファイルの状態を表示するには CTRL-G をタイプします。 + ファイル内のある行に移動するには G をタイプします ** NOTE: ステップを実行する前に、このレッスン全てに目を通しましょう!! - 1. CTRL を押したまま g を押しましょう。ページの一番下にあるステータス行 - にファイル名と行が表示されるはずです。 ステップ 3 のために行番号を - 覚えておきましょう。(訳者注:ルーラーがある場合はそちらに注目) + 1. CTRL を押したまま g を押しましょう。この操作を CTRL-G と呼んでいます。 + ページの一番下にファイル名と行番号が表示されるはずです。 ステップ 3のため + に行番号を覚えておきましょう。 - 2. 最下行に移動するために shift-G とタイプしましょう。 +NOTE: 画面の右下隅にカーソルの位置が表示されているかもしれません。これは + 'ruler' オプション(レッスン6で説明)を設定することで表示されます。 - 3. 先ほどの行の番号をタイプし、 shift-G をタイプしましょう。 - 最初に Ctrl-g を押した行に戻って来るはずです。 - (数字をタイプしているときには画面に表示されません) + 2. 最下行に移動するために G をタイプしましょう。 + ファイルの先頭に移動するには gg とタイプしましょう。 + + 3. 先ほどの行の番号をタイプし G をタイプしましょう。最初に CTRL-G を押した行 + に戻って来るはずです。 4. 自信が持てたらステップ 1 から 3 を実行しましょう。 - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.2: 検索コマンド ** 語句を検索するには / と、前方検索する語句をタイプします。** - 1. ノーマルモードで / という文字をタイプします。画面一番下に : コマンド - と同じ様に / が現れることに気づくでしょう。 + 1. ノーマルモードで / という文字をタイプします。画面一番下に : コマンドと + 同じ様に / が現れることに気づくでしょう。 2. では、'errroor' とタイプしましょう。これが検索したい単語です。 3. 同じ語をもう一度検索するときは 単に n をタイプします。 逆方向に語句を検索するときは N をタイプします。 - 4. 逆方向に語句を検索したい場合は、/ コマンドのかわりに ? コマンドを使用し - ます。 + 4. 逆方向に語句を検索する場合は、/ の代わりに ? コマンドを使用します。 ----> "errroor" is not the way to spell error; errroor is an error. + 5. 元の場所に戻るには CTRL-O (Ctrl を押し続けながら o 文字タイプ)をタイプし + ます。さらに戻るにはこれを繰り返します。CTRL-I は前方向です。 -検索がファイルの終わりに達すると、ファイルの先頭から検索を続行します。 - - +Note: "errroor" は error とスペルが違います; errroor はいわゆる error です。 +Note: 検索がファイルの終わりに達すると、オプション 'wrapscan' が設定されている + 場合は、ファイルの先頭から検索を続行します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.3: 対応する括弧を検索 @@ -440,8 +533,7 @@ cw は単語を変更するだけでなく、挿入も行えることに注意しましょう。 ** 対応する ),] や } を検索するには % をタイプします ** - 1. 以下の ---> と記されたされた行で (,[ か { のどれかにカーソルを移動 - しましょう。 + 1. 下の ---> で示された行で (,[ か { のどれかにカーソルを移動しましょう。 2. そこで % とタイプしましょう。 @@ -449,21 +541,22 @@ cw は単語を変更するだけでなく、挿入も行えることに注意しましょう。 4. 最初の括弧に移動するには % とタイプしましょう。 + 5. 他の (,),[,],{ or } でカーソルを移動し、% が何をしているか確認しましょう。 + ---> This ( is a test line with ('s, ['s ] and {'s } in it. )) + NOTE: この機能は括弧が一致していないプログラムをデバッグするのにとても役立ち ます。 - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4.4: 間違いを変更する方法 ** 'old' を 'new' に置換するには :s/old/new/g とタイプします ** - 1. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 1. 以下の ---> と示された行にカーソルを移動しましょう。 2. :s/thee/the とタイプしましょう。このコマンドはその行で最初に見 つかったものにだけ行なわれることに気をつけましょう。 @@ -474,27 +567,28 @@ NOTE: この機能は括弧が一致していないプログラムをデバッグするのにとても役立ち ---> thee best time to see thee flowers is in thee spring. 4. 複数行から見つかる文字を変更するには - :#,#s/old/new/g #,# は2行の行番号を指します。 + :#,#s/old/new/g #,# には置き換える範囲の開始と終了の行番号を指定しま + す。 :%s/old/new/g ファイル全体で見つかるものに対して変更する。 - - - + :%s/old/new/gc ファイル全体で見つかるものに対して、1つ1つ確認をとりな + がら変更する。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 4 要約 - 1. Ctrl-g はファイルでの位置とファイルの詳細を表示します。 - Shift-G はファイルの最下行に移動します。行番号後に Shift-G とすると - その行に移動します。 + 1. CTRL-G はファイルでの位置とファイルの詳細を表示します。 + G はファイルの最下行に移動します。 + 数値 G はその行に移動します。 + gg は先頭行に移動します。 2. / の後に語句をタイプすると前方に語句を検索します。 ? の後に語句をタイプすると後方に語句を検索します。 - 検索の後 n で、同方向に検索を再び行い、また N で逆方向に検索を行ないま - す。 + 検索の後の n は同じ方向の次の検索を、N は逆方向の検索をします。 + CTRL-O は場所を前に移し、CTRL-I は場所を次に移動します。 - 3. (,),[,],{, or } 上にカーソルがある状態で % をタイプすると - 対応した対に移動します。 + 3. (,),[,],{, もしくは } 上にカーソルがある状態で % をタイプすると対になる文 + 字へ移動します。 4. 現在行の最初の old を new に置換する。 :s/old/new 現在行の全ての old を new に置換する。 :s/old/new/g @@ -502,7 +596,6 @@ NOTE: この機能は括弧が一致していないプログラムをデバッグするのにとても役立ち ファイルの中の全ての検索語句を置換する。 :%s/old/new/g 'c' を加えると置換の度に確認を求める。 :%s/old/new/gc - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5.1: 外部コマンドを実行する方法 @@ -519,11 +612,11 @@ NOTE: この機能は括弧が一致していないプログラムをデバッグするのにとても役立ち シェルプロンプトのようにディレクトリの一覧が表示されるはずです。 もしくは ls が動かないならば :!dir を使用しましょう。 ----> NOTE: この方法によってあらゆるコマンドが実行することができます。 +Note: この方法によってあらゆるコマンドが実行することができます。もちろん引数 + も与えられます。 ----> NOTE: 全ての : コマンドは を押して終了しなければなりません。 - - +Note: 全ての : コマンドは を押して終了しなければなりません。 + 以降ではこのことに言及しません。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -540,37 +633,38 @@ NOTE: この機能は括弧が一致していないプログラムをデバッグするのにとても役立ち 3. では :w TEST とタイプしましょう (TEST は、選んだファイル名です)。 4. これによりファイル全体が TEST という名前で保存されます。 - もう一度 :!dir とタイプして確認してみましょう。 + もう一度 :!dir もしくは !ls とタイプして確認してみましょう。 ----> ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の +Note: ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の チュートリアルの複製ができ上がるはずです。 - 5. では、 :!del TEST とタイプしてファイルを削除してみましょう。 - + 5. さらに、次のようにタイプしてファイルを消しましょう(MS-DOS): :!del TEST + もしくは(Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5.3: 選択した書き込み - ** 部分的に保存するには :#,# w ファイル名 とタイプします ** +** ファイルの位置を保存するには、v モーションと :w FILENAME をタイプします。 ** + + 1. この行にカーソルを移動します。 - 1. もう一度ディレクトリの一覧を取得するために :!ls とタイプし、TEST の様に - ファイルを一つ選んでみましょう。 + 2. v を押し、以下の第5項目にカーソルを移動します。テキストが強調表示されるの + に注目して下さい。 - 2. このページの始めまでカーソルを移動し、ファイルの行数を知るために Ctrl-g と - タイプしましょう。その行番号を憶えておきましょう。 + 3. 文字 : を押すと、画面の最下部に :'<,'> が現れます。 - 3. そしてページの終りまで移動し、再度 Ctrl-g を行います。 - この行番号も憶えておきましょう。 + 4. w TEST (TESET は存在しないファイル名)をタイプします。 + Enter を押す前に :'<,'>w TEST となっていることを確認して下さい。 - 4. ある部分だけを TEST という名で保存するために、:#,# w TEST とタイプします。 - この #,# は覚えておいた2つの番号(上端,下端) であり、 TEST がファイル名 - となります。 + 5. Vim は TEST というファイルに選択された行を書き込むでしょう。 + !dir もしくは !ls でそれを確認します。 + それは削除しないでおいて下さい。次のレッスンで使用します。 - 5. 再度、ファイルが存在することを確認するために :!dir とタイプしましょう。 - ただしこのファイルは消してはいけません。 - +NOTE: v を押すと、Visual 選択が始まります。カーソルを動かすことで、選択範囲を + 大きくも小さくもできます。さらに、その選択範囲に対してオペレータを適用 + きます。例えば d はテキストを削除します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 5.4: ファイルの取込と合併 @@ -578,21 +672,21 @@ NOTE: この機能は括弧が一致していないプログラムをデバッグするのにとても役立ち ** ファイルの中身を挿入するには :r ファイル名 とタイプします ** - 1. 先ほどの TEST というファイルが存在することを確かめるために :!dir と - タイプしましょう。 + 1. カーソルを以下の行に合わせます。 - 2. カーソルをこのページの先頭に移動します。 - -NOTE: ステップ 3 を実行すると、画面に レッスン 5.3 が現われるので、カーソルを - 下に移動しこのレッスンまで戻りましょう。 +NOTE: ステップ 2 の実行後、レッスン 5.3 のテキストが現れます。下に下がってこ + のレッスンに移動しましょう。 - 3. では、:r TEST とタイプして TEST ファイルを取込みましょう。この TEST は - ファイル名です。 + 2. では TEST というファイルを :r TEST というコマンドで読み込みましょう。 + ここでいう TEST は使うファイルの名前のことです。 + 読み込まれたファイルは、カーソル行の下にあります。 -NOTE: ファイルの取込みはカーソルの位置から行われます。 + 3. 取込んだファイルを確認してみましょう。カーソルを戻すと、レッスン5.3 の + オリジナルとファイルによるものの2つがあることがわかります。 - 4. 取込んだファイルを確認してみましょう。カーソルを戻すと、レッスン5.3 の - オリジナルとファイルによるものの2つがあることがわかります。 +NOTE: 外部コマンドの出力を読み込むことも出来ます。例えば、 + :r !ls は ls コマンドの出力をカーソル以下に読み込みます。 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -602,19 +696,19 @@ NOTE: ファイルの取込みはカーソルの位置から行われます。 1. :!command によって 外部コマンドを実行します。 よく使う例: - :!ls - ディレクトリのファイル一覧を見る。 - :!del ファイル名 - ファイル名というファイルの削除する。 + (MS-DOS) (Unix) + :!dir :!ls - ディレクトリ内の一覧を見る。 + :!del FILENAME :!rm FILENAME - ファイルを削除する。 2. :w ファイル名 によってファイル名というファイルがディスクに書き込まれる。 - 3. :#,# w ファイル名 によって # から # までを保存する。 + 3. v モーションで :w FILENAME とすると、ビジュアル選択行がファイルに保存さ + れる。 4. :r ファイル名 によりファイル名というファイルがディスクより取込まれ、 カーソル位置の下に挿入される。 - - - + 5. :r !dir は dir コマンドの出力をカーソル位置以下に読み込む。 @@ -624,18 +718,18 @@ NOTE: ファイルの取込みはカーソルの位置から行われます。 ** o をタイプすると、カーソルの下の行が開き、挿入モードに入ります ** - 1. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 1. 以下の ---> と示された行にカーソルを移動しましょう。 2. o (小文字) をタイプして、カーソルの下の行を開き、挿入モードに入ります。 - 3. ---> と記された行を写し、 とタイプして追加モードを終了しましょう。 + 3. さらに挿入モードを終了する為に をタイプします。 ---> o をタイプするとカーソルは開いた行へ移動し挿入モードに入ります。 4. カーソルの上の行に挿入するには、小文字の o ではなく、単純に大文字の O をタイプします。次の行で試してみましょう。 -この行の上へ挿入するには、この行へカーソルを置いて Shift-O をタイプします。 +---> この行の上へ挿入するには、この行へカーソルを置いて O をタイプします。 @@ -647,94 +741,118 @@ NOTE: ファイルの取込みはカーソルの位置から行われます。 ** カーソルの次の位置からテキストを追加するには a とタイプします ** - 1. ノーマルモードにして以下の ---> と記されたされた最初の行で $ をタイプし - て、終端にカーソルを移動しましょう。 + 1. カーソルを ---> で示された業へ移動しましょう。 - 2. カーソルの文字の後ろにテキストを追加するために a (小文字) をタイプしま - す。 + 2. e を押して li の終端部までカーソルを移動します。 + + 3. カーソルの後ろにテキストを追加するために a (小文字) をタイプします。 -NOTE: これは最後の文字にてテキストを挿入し、 をタイプしてカーソルを右に - 移動し、最後に x タイプして行末に追加するといったような i のタイプを - 避けることがきます。 + 4. その下の行ののような単語に完成させます。挿入モードを抜ける為に に押 + します。 - 3. さて最初の行を完成しましょう。テキストが挿入される位置を除けば、 - 追加コマンドは挿入モードとまったく同じです。 + 5. e を使って次の不完全な単語へ移動し、ステップ 3 と 4 を繰り返します。 + +---> This li will allow you to pract appendi text to a line. +---> This line will allow you to practice appending text to a line. ----> この行で、行末に文章を追加する ----> この行で、行末に文章を追加する練習をすることができるでしょう。 - +Note: a, i と A は同じ挿入モードへ移りますが、文字が挿入される位置だけが異なり + ます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.3: その他の置換 + レッスン 6.3: その他の置換方法 ** 1文字以上を置き換えるには大文字の R とタイプしましょう ** - 1. 以下の ---> と記されたされた行にカーソルを移動しましょう。 + 1. 以下の ---> と示された業にカーソルを移動します。最初の xxx の先頭に移動し + ます。 - 2. ---> と記された2行目と違う、最初の単語の先頭にカーソルを移動しましょう。 - (単語 'last') + 2. R を押して、2行目の数値をタイプすることで、xxx が置換されます。 - 3. ここで R をタイプして、最初の行と次の行が同じになるように既存のテキスト - へ上書きタイプし、1行目の残りの部分を書き換えましょう。 + 3. 置換モードを抜けるには を押します。行の残りが変更されていないままに + なることに注意してください。 ----> To make the first line the same as the last on this page use the keys. ----> To make the first line the same as the second, type R and the new text. + 5. 残った xxx をステップを繰り返して置換しましょう。 - 4. モードを抜けるために をタイプすると、変更していない部分が残ること - に注意しましょう。 +---> Adding 123 to xxx gives you xxx. +---> Adding 123 to 456 gives you 579. - +NOTE: 置換モードは挿入モードに似ていますが、全てのタイプされた文字は既存の文字 + を削除します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.4: オプションの設定 - - - ** 検索や置換の際に大文字と小文字を無視する様にオプションを設定します ** + レッスン 6.4: テキストのコピーとペースト - 1. 以下の様にタイプして 'ignore' を検索しましょう: - /ignore + ** テキストのコピーにはオペレータ y を、ペーストには p を使います ** + + 1. ---> と示された行へ移動し、カーソルを "a)" の後に置いておきます。 + + 2. v でビジュアルモードを開始し、"first"の手前までカーソルを移動します。 + + 3. y をタイプして強調表示されたテキストを yank (コピー)します。 + + 4. 次の行の行末までカーソルを移動します: j$ + + 5. p を押して貼り付け(put)てから、次をタイプします: a second + + 6. ビジュアルモードで " item." を選択し、y でヤンク、次の行の行末まで j$ で + 移動し、 p でテキストをそこに put します。 + +---> a) this is the first item. + b) + + Note: 単語を1つ yank するのに y をオペレータとして yw とすることも出来ます。 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 6.5: オプションの設定 + + + ** 検索や置換の際に大文字/小文字を無視するには、オプションを設定します ** + + 1. 次の様に入力して 'ignore' を検索しましょう: /ignore n を押して何度か検索を繰り返します。 - 2. 以下の様にタイプして 'ic' (Ignore Case の略です) オプションを設定します。 - :set ic + 2. 次の様に入力して 'ic' (Ignore Case の略) オプションを設定します: :set ic 3. では n によってもう1度 'ignore' を検索します。 n を押してさらに数回検索を繰り返しましょう。 - 4. 'hlsearch' と 'incsearch' オプションを以下の様に設定しましょう。 - :set hls is + 4. 'hlsearch' と 'incsearch' オプションを設定しましょう: :set hls is + + 5. 検索コマンドを再入力して、何が起こるか見てみましょう: /ignore - 5. もう一度検索コマンドを入力して、何が起こるか見てみましょう: - /ignore + 6. 大文字小文字の区別を無効にするには次の様に入力します: :set noic +Note: マッチの強調表示をやめるには次の様に入力します: :nohlsearch +Note: 1つの検索コマンドだけ大文字小文字の区別をやめたいならば、フレーズに \c + を使用します: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6 要約 - 1. o をタイプするとカーソルの下の行を開けて、そこで挿入モードになる。 O (大文字) をタイプするとカーソルの上の行で挿入モードになる。 2. カーソル上の文字の次からテキストを追加するには a とタイプする。 行末に自動でテキストを挿入するには大文字 A をタイプする。 - 3. 大文字の R をタイプすると置換モードに入り、を押すと抜ける。 + 3. e コマンドは単語の終端部カーソルを移動する。 - 4. ":set xxx" とタイプするとオプション "xxx" が設定される。 + 4. y オペレータはテキストを yank (コピー)し、p はそれを put (ペースト)する。 - + 5. 大文字の R をタイプすると置換モードに入り、を押すと抜ける。 - - + 6. ":set xxx" とタイプするとオプション "xxx" が設定される。 + 'ic' 'ignorecase' 検索時に大文字小文字の区別しない + 'is' 'incsearch' 検索フレーズに部分マッチしている部分を表示する + 'hls' 'hlsearch' マッチするすべを強調表示する + 長い方、短い方、どちらのオプション名でも使用できます。 - - - + 7. "no" を付与し、オプションを無効にします: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 7: オンラインヘルプコマンド + レッスン 7.1: オンラインヘルプコマンド + ** オンラインヘルプを使用しましょう ** @@ -744,20 +862,19 @@ NOTE: これは最後の文字にてテキストを挿入し、 をタイプしてカーソルを右に - キーを押す(もしあるならば)。 - :help とタイプする。 - ヘルプウィンドウを閉じるには :q とタイプします。 + ヘルプウィンドウのテキストを読むと、ヘルプの動作が理解できます。 + CTRL-W CTRL-W とタイプすると ヘルプウィンドウへジャンプします。 + :q とタイプすると ヘルプウィンドウが閉じられます。 - ":help" コマンドに引数を与えることにより、あらゆる題名のヘルプを見つける - ことができます。これらを試してみましょう( をタイプし忘れないように): + ":help" コマンドに引数を与えることにより、あらゆる題名のヘルプを見つけること + ができます。これらを試してみましょう( をタイプし忘れないように): :help w :help c_ をタイプしてカーソルを右に :edit $VIM/_vimrc MS-Windows 向け 2. ここでサンプルの "vimrc" を読み込みます。 - :read $VIMRUNTIME/vimrc_example.vim 3. 以下のようにファイルへ書き込みます。 - :write 次回 Vim を起動すると、色づけ構文が使えるようになるでしょう。 この "vimrc" ファイルへ、お好みの設定を追加することができます。 + より多くの情報を得るには :help vimrc-intro とタイプします。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 7.3: 補完 + + + ** CTRL-D と でコマンドラインを補完する ** + + 1. コンパチモードでないことを確認します: :set nocp + + 2. 現在のディレクトリに在るファイルを :!ls か :!dir で確認します。 + + 3. コマンドの開始をタイプします: :e + + 4. CTRL-D を押すと Vim は "e" から始まるコマンドの一覧を表示します。 + + 5. を押すと Vim は ":edit" というコマンド名を補完します。 + + 6. さらに空白と、既存のファイル名の始まりを加えます: :edit FIL + + 7. を押すと Vim は名前を補完します。(もし一つしか無かった場合) + +NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と 押してみてくだ + さい。特に :help の際に役立ちます。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 7 要約 + + + 1. ヘルプウィンドウを開くには :help とするか もしくは を押す。 + + 2. コマンド(cmd)のヘルプを検索するには :help cmd とタイプする。 + + 3. 別のウィンドウへジャンプするには CTRL-W CTRL-W とタイプする。 + + 4. ヘルプウィンドウを閉じるには :q とタイプする。 + + 5. お好みの設定を保つには vimrc 起動スクリプトを作成する。 + + 6. : command で可能な補完を見るには CTRL-D をタイプする。 + 補完を使用するには を押す。 + + + + + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ これにて Vim のチュートリアルを終わります。エディタを簡単に、しかも充分に @@ -805,7 +968,8 @@ NOTE: これは最後の文字にてテキストを挿入し、 をタイプしてカーソルを右に Modified for Vim by Bram Moolenaar. - 日本語訳 松本泰弘 E-mail:mattn@mail.goo.ne.jp + 日本語訳 松本 泰弘 + 監修 村岡 太郎 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - vi:set ts=8 sts=4 sw=4 tw=76: + vi:set ts=8 sts=4 sw=4 tw=78: diff --git a/runtime/tutor/tutor.ja.sjis b/runtime/tutor/tutor.ja.sjis --- a/runtime/tutor/tutor.ja.sjis +++ b/runtime/tutor/tutor.ja.sjis @@ -1,25 +1,26 @@ =============================================================================== -= V I M { (`[gA) - Version 1.5 = += V I M { (`[gA) - Version 1.7 = =============================================================================== - Vim A`[gAR}h - GfB^[B`[gAA Vim - \GfB^[g\R}h - B + Vim A`[gAR}h + GfB^[B`[gAA Vim \GfB + ^[g\R}h + B - `[gAKvAoR}h - gA25`30B + `[gAKvAoR}h + gA2530B - wR}hXBKnOR - s[("vimtutor"ARs[)B + ATTENTION: + KpR}hXBKnO + Rs[("vimtutor"ARs[)B - `[gAAgodgAS - BwKR}hタ - BAY!B + `[gAAgodgAS + BwKR}hタ + BAY!B - ACapsbN(Shift-Lock)L[mFA - bX1.1 S\ヲAj L[J[\ - B + ACapsbN(Shift-Lock)L[mFA + bX1.1 S\ヲAj L[J[\ + B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.1: J[\ @@ -33,15 +34,15 @@ 1. AXN[J[\B 2. L[(j)AAB ----> bX@B + bX@B 3. L[gAbX1.2 B -NOTE: ^CvAm[}[h - BR}hB +Note: ^CvAm[}[h + BR}hB -NOTE: J[\L[B hjkl gpx - AB +Note: J[\L[B hjkl xA + B}W! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.2: VIM NI @@ -52,27 +53,27 @@ NOTE: J[\L[B hjkl gpx 1. L[B(mタm[}[h) 2. ^Cv: :q! - ----> WeGfB^IB - WeI^Cv: - :wq + WeGfB^IB - 3. VFvvg`[gAnR}h^CvB + 3. VFvvgoA`[gAnR}h + ^CvB R}h: vimtutor - : vim tutor - ----> 'vim' Vim GfB^NA'tutor' Wt@CB 4. XebvoゥMAXebv 1 3 タ - AVim 1xINBbX - 1.3J[\B + AVim 1xINB + +NOTE: :q! SXjBbXXt@C + @B + + 5. 1.3J[\B + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1.3: eLXgW - ** m[}[hJ[\ x ** - 1. ---> LsJ[\B + 1. ---> ヲsJ[\B 2. CAJ[\B @@ -82,7 +83,7 @@ NOTE: J[\L[B hjkl gpx ---> - 5. sAbX 1.4 B + 5. sAbX 1.4 iB NOTE: SbXAoタB @@ -95,15 +96,15 @@ NOTE: SbXAoタB ** m[}[heLXg} i ** - 1. ---> LsJ[\B + 1. ---> ヲsJ[\B - 2. 1s2slAeLXg} - uJ[\B + 2. 1s2slAeLXg}u + J[\B 3. i L[AKv^CvB - 4. C R}h[hA - lXebv 2 4 JB + 4. C R}h[hAl + Xebv 2 4 JB ---> eLXg B ---> s eLXg B @@ -113,6 +114,52 @@ NOTE: SbXAoタB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 1.5: eLXgW - + + + ** eLXg A ** + + 1. ---> ヲsJ[\B + J[\B + + 2. Kv A ^CvB + + 3. eLXgIA m[}[hB + + 4. 2s ---> ヲAXebv 2 3 J@ + CB + +---> eLXg + eLXgB +---> eLX + eLXgB + + 5. eLXgybX 1.6 iB + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 1.6: t@CW + + + ** t@CI :wq ^Cv ** + + !! NOTE: XebvタsOAS!! + + 1. bX 1.2 :q! ^CvA`[gAI + B + + 2. VFvvgR}h^Cv: vim tutor + 'vim' Vim GfB^NR}hA'tutor' Wt@C + OBXt@CgB + + 3. ObXwAeLXg}AB + + 4. Xt@C: :wq + + 5. vimtutor xNAviB + + 6. XebvタsB + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1 v @@ -127,14 +174,14 @@ NOTE: SbXAoタB 4. J[\Am[}[h x ^CvB 5. J[\u}Am[}[h i ^CvB - i eLXg^Cv + i eLXg^Cv J[\u + A eLXg s -NOTE: L[m[}[hsBAr - R}hB +NOTE: L[m[}[hsBAr + R}hB AbX 2 nB - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 2.1: R}h @@ -143,7 +190,7 @@ NOTE: L[m[}[hsBAr 1. m[}[hmF B - 2. ---> LsJ[\B + 2. ---> ヲsJ[\B 3. PJ[\B @@ -154,7 +201,7 @@ NOTE: L[m[}[hsBAr ---> Kv P B - 5. 3 4 JAbX 2.2 B + 5. 3 4 JAbX 2.2 iB @@ -166,7 +213,7 @@ NOTE: L[m[}[hsBAr 1. m[}[hmF B - 2. ---> LsJ[\B + 2. ---> ヲsJ[\B 3. J[\( . )B @@ -175,77 +222,123 @@ NOTE: L[m[}[hsBAr ---> Ns2x^CvB 2x^CvB - 5. AbX 2.3 B + 5. AbX 2.3 iB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.3: R}hI + bX 2.3: Iy[^[V - R}h d `ョl: + R}hIy[^[VeLXgXB + R}h d Iy[^l: - [] d I d [] I + d [V + : - - R}hJ(\, =1)B - d - R}hB - I - ()B + d - R}hB + [V - ()B - I: + Iy[^: w - J[\uPB e - J[\uPB $ - J[\usB -NOTE: `lAm[}[hR}hI + de ^CvAJ[\uPIB + +NOTE: `lAm[}[hR}h[V BJ[\IヲuB +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 2.4: [VJEggp + + + ** sJ[VOl^CvB ** + + 1. ---> ヲJ[\B + + 2. 2dw ^CvP2B + + 3. 3e ^Cv3PI[B + + 4. 0 ([)^CvsB + + 5. Xebv 2 3 lgJB + +---> This is just a line with words you can move around in. + + 6. bX 2.5 iB + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bX 2.4: O`R}h + bX 2.5: JEggp - ** sS dd ^Cv ** + ** Iy[^JEg^CvAJB ** - sSpsAVim vメsA - P2 d ^CvPfB + qIy[^[VgJEgA + s: + d l [V + + 1. ---> ヲssJ[\B - 1. At[Y2sJ[\B - 2. dd ^CvsB - 3. 4sB - 4. 2dd ^Cv2sB - (-R}h-I `ョvo) + 2. UPPER CASE P2 2dw ^CvB + + 3. UPPER CASE APA1R}hJEgwA + Xebv 1 2 JB - 1) oA - 2) yA - 3) X~A - 4) ヤA - 5) vA - 6) - 7) I}Gi[ +---> ABC DEsFGHI JK LMN OPPQ RS TUVYB + +NOTE: Iy[^ d [VJEggAIy[^ + [VB + : 3dw d3w A3w B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bX 2.5: R}h + bX 2.6: s + + + ** sS dd ^Cv ** + + sSpxAVifUCi[s d 2^Cv + PB + + 1. 2sJ[\B + 2. dd ^CvsB + 3. 4sB + 4. 2dd ^Cv2sB + +---> 1) oA +---> 2) yA +---> 3) X~A +---> 4) ヤA +---> 5) vA +---> 6) +---> 7) I}Gi[ + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 2.7: R}h ** R}h u BU sSB ** - 1. ---> LsJ[\AJ[\ - B + 1. ---> ヲsJ[\AJ[\ + B 2. x ^CvB 3. Au ^CvタsR}hB 4. xAx gpSCB 5. U ^CvAsB 6. u ^CvO U R}hB - 7. R}hタs CTRL-R (CTRL R ) - ^Cv()B + 7. R}hタs CTRL-R (CTRL R ) + ^Cv()B ---> sCXACB - 8. R}hBbX 2 vB + 8. R}hBbX 2 viB @@ -255,24 +348,24 @@ NOTE: `lAm[}[hR}hI 1. J[\uP dw ^CvB - 2. J[\us d$ ^CvB - 3. sS dd ^CvB - 4. m[}[hR}h`ョ + 4. [VJlt^: 2w + 5. XpR}h`ョ + Iy[^ [l] [V - [] R}h I R}h [] I : - - R}hJB - R}h - d B - I - P w s $ B + Iy[^ - d B + l - R}hJB + [V - w (P) $ (s)AeLXg + B - 5. O: u ( u) + 6. s[gp: 0 + + 7. O: u ( u) sSX: U ( U) : CTRL-R - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3.1: \tR}h @@ -302,7 +395,7 @@ NOTE: `lAm[}[hR}hI ** J[\u r ^Cv ** - 1. ---> LsJ[\B + 1. ---> ヲsJ[\B 2. J[\B @@ -313,7 +406,7 @@ NOTE: `lAm[}[hR}hI ---> lAlL[! ---> sAlL[! - 5. AbX 3.2 B + 5. AbX 3.2 iB NOTE: タBoB @@ -325,7 +418,7 @@ NOTE: タBoB ** PASX cw ^Cv ** - 1. ---> LsJ[\B + 1. ---> ヲsJ[\B 2. lubw u uJ[\B @@ -348,14 +441,13 @@ cw PXA}sB ** XR}hAR}hlIuWFNggp ** - 1. XR}hAR}hB`ョ - [] c I c [] I + c [l] [V 2. IuWFNgAw PA $ sB - 3. ---> LsJ[\B + 3. ---> ヲsJ[\B 4. J[\B @@ -364,6 +456,7 @@ cw PXA}sB ---> The end of this line needs some help to make it like the second. ---> The end of this line needs to be corrected using the c$ command. +NOTE: ^CvobNXy[XL[gB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 3 v @@ -376,63 +469,63 @@ cw PXA}sB 2. J[\uAr ^CvAu ^CvB - 3. XR}hJ[\uIwI[X - \B cw J[\uPIA + 3. XR}hJ[\u[VwI[ + X\B cw J[\uPIA c$ sIXB 4. XR}h`ョ - [] c I c [] I + c [l] [V -AbXB +AbXiB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.1: ut@C - - ** t@Cut@C\ヲ CTRL-g ^CvB - t@Cs SHIFT-G ^Cv ** + ** t@Cut@C\ヲ CTRL-G ^CvB + t@Cs G ^Cv ** NOTE: XebvタsOAbXS!! - 1. CTRL g By[WXe[^Xs - t@Cs\ヲB Xebv 3 s - oB(メ:[[) + 1. CTRL g B CTRL-G B + y[Wt@Cs\ヲB Xebv 3 + soB - 2. s shift-G ^CvB +NOTE: EJ[\u\ヲB + 'ruler' IvV(bX6)\ヲB - 3. s^CvA shift-G ^CvB - Ctrl-g sB - (^Cv\ヲ) + 2. s G ^CvB + t@C gg ^CvB + + 3. s^Cv G ^CvB CTRL-G s + B 4. ゥMXebv 1 3 タsB - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.2: R}h ** / AO^CvB** - 1. m[}[h / ^CvB : R}h - l / CB + 1. m[}[h / ^CvB : R}h + l / CB 2. A'errroor' ^CvBPB 3. x P n ^CvB t N ^CvB - 4. tA/ R}h ? R}hgp - B + 4. tA/ ? R}hgpB ----> "errroor" is not the way to spell error; errroor is an error. + 5. CTRL-O (Ctrl o ^Cv)^Cv + BJBCTRL-I OB -t@CIBAt@CsB - - +Note: "errroor" error Xy; errroor error B +Note: t@CIBAIvV 'wrapscan' + At@CsB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.3: @@ -440,8 +533,7 @@ cw PXA}sB ** ),] } % ^Cv ** - 1. ---> Ls (,[ { J[\ - B + 1. ---> ヲs (,[ { J[\B 2. % ^CvB @@ -449,21 +541,22 @@ cw PXA}sB 4. % ^CvB + 5. (,),[,],{ or } J[\A% mFB + ---> This ( is a test line with ('s, ['s ] and {'s } in it. )) + NOTE: @\vvOfobO B - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4.4: X@ ** 'old' 'new' u :s/old/new/g ^Cv ** - 1. ---> LsJ[\B + 1. ---> ヲsJ[\B 2. :s/thee/the ^CvBR}hs sCB @@ -474,27 +567,28 @@ NOTE: @\vvOfobO ---> thee best time to see thee flowers is in thee spring. 4. sX - :#,#s/old/new/g #,# QsswB + :#,#s/old/new/g #,# uJnIsw + B :%s/old/new/g t@CSXB - - - + :%s/old/new/gc t@CSA11mF + XB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 4 v - 1. Ctrl-g t@Cut@C\ヲB - Shift-G t@CsBs Shift-G - sB + 1. CTRL-G t@Cut@C\ヲB + G t@CsB + l G sB + gg sB 2. / ^CvOB ? ^CvB - n AsA N ts - B + n AN tB + CTRL-O OACTRL-I B - 3. (,),[,],{, or } J[\ % ^Cv - B + 3. (,),[,],{, } J[\ % ^Cv + B 4. s old new uB :s/old/new sS old new uB :s/old/new/g @@ -502,7 +596,6 @@ NOTE: @\vvOfobO t@CSuB :%s/old/new/g 'c' uxmFB :%s/old/new/gc - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.1: OR}hタs@ @@ -519,11 +612,11 @@ NOTE: @\vvOfobO VFvvgfBNg\ヲB ls :!dir gpB ----> NOTE: @R}hタsB +Note: @R}hタsB + ^B ----> NOTE: S : R}h IB - - +Note: S : R}h IB + ~yB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -540,37 +633,38 @@ NOTE: @\vvOfobO 3. :w TEST ^Cv (TEST AIt@C)B 4. t@CS TEST OB - x :!dir ^CvmFB + x :!dir !ls ^CvmFB ----> Vim IAt@C TEST NA +Note: Vim IAt@C TEST NA `[gAB - 5. A :!del TEST ^Cvt@CB - + 5. A^Cvt@C(MS-DOS): :!del TEST + (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.3: I - ** I :#,# w t@C ^Cv ** +** t@CuAv [V :w FILENAME ^CvB ** + + 1. sJ[\B - 1. xfBNg :!ls ^CvATEST l - t@CIB + 2. v A5J[\BeLXg\ヲ + B - 2. y[WnJ[\At@Csm Ctrl-g - ^CvBsB + 3. : A :'<,'> B - 3. y[WIAx Ctrl-g sB - sB + 4. w TEST (TESET t@C)^CvB + Enter O :'<,'>w TEST mFB - 4. TEST A:#,# w TEST ^CvB - #,# oQ([,[) A TEST t@C - B + 5. Vim TEST t@CIsB + !dir !ls mFB + BbXgpB - 5. xAt@CmF :!dir ^CvB - t@CB - +NOTE: v AVisual InBJ[\AI + BAIIy[^Kp + B d eLXgB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 5.4: t@C @@ -578,21 +672,21 @@ NOTE: @\vvOfobO ** t@Cg} :r t@C ^Cv ** - 1. TEST t@Cm :!dir - ^CvB + 1. J[\sB - 2. J[\y[WB - -NOTE: Xebv 3 タsA bX 5.3 AJ[\ - bXB +NOTE: Xebv 2 タsAbX 5.3 eLXgB + bXB - 3. A:r TEST ^Cv TEST t@CB TEST - t@CB + 2. TEST t@C :r TEST R}hB + TEST gt@COB + t@CAJ[\sB -NOTE: t@CJ[\usB + 3. t@CmFBJ[\AbX5.3 + IWit@C2B - 4. t@CmFBJ[\AbX5.3 - IWit@C2B +NOTE: OR}hooBA + :r !ls ls R}hoJ[\B + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -602,19 +696,19 @@ NOTE: t@CJ[\usB 1. :!command OR}hタsB g: - :!ls - fBNgt@CB - :!del t@C - t@Ct@CB + (MS-DOS) (Unix) + :!dir :!ls - fBNgB + :!del FILENAME :!rm FILENAME - t@CB 2. :w t@C t@Ct@CfBXNB - 3. :#,# w t@C # # B + 3. v [V :w FILENAME ArWAIst@C + B 4. :r t@C t@Ct@CfBXNA J[\u}B - - - + 5. :r !dir dir R}hoJ[\uB @@ -624,18 +718,18 @@ NOTE: t@CJ[\usB ** o ^CvAJ[\sJA}[h ** - 1. ---> LsJ[\B + 1. ---> ヲsJ[\B 2. o () ^CvAJ[\sJA}[hB - 3. ---> LsハA ^Cv[hIB + 3. }[hI ^CvB ---> o ^CvJ[\Js}[hB 4. J[\s}A o AP O ^CvBsB -s}AsJ[\u Shift-O ^CvB +---> s}AsJ[\u O ^CvB @@ -647,94 +741,118 @@ NOTE: t@CJ[\usB ** J[\ueLXg a ^Cv ** - 1. m[}[h ---> Ls $ ^Cv - AI[J[\B + 1. J[\ ---> ヲB - 2. J[\eLXg a () ^Cv - B + 2. e li I[J[\B + + 3. J[\eLXg a () ^CvB -NOTE: eLXg}A ^CvJ[\E - A x ^Cvs i ^Cv - B + 4. sPB}[h + B - 3. sBeLXg}uA - R}h}[hB + 5. e gsSPAXebv 3 4 JB + +---> This li will allow you to pract appendi text to a line. +---> This line will allow you to practice appending text to a line. ----> sAs ----> sAsKB - +Note: a, i A }[hA}u + B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bX 6.3: u + bX 6.3: u@ ** 1u R ^Cv ** - 1. ---> LsJ[\B + 1. ---> ヲJ[\B xxx + B - 2. ---> LQsAPJ[\B - (P 'last') + 2. R A2sl^CvAxxx uB - 3. R ^CvAsseLXg - ^CvAPscB + 3. u[h BscX + B ----> To make the first line the same as the last on this page use the keys. ----> To make the first line the same as the second, type R and the new text. + 5. c xxx XebvJuB - 4. [h ^CvAXc - B +---> Adding 123 to xxx gives you xxx. +---> Adding 123 to 456 gives you 579. - +NOTE: u[h}[hAS^Cv + B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bX 6.4: IvV - - - ** ulIvV ** + bX 6.4: eLXgRs[y[Xg - 1. l^Cv 'ignore' : - /ignore + ** eLXgRs[Iy[^ y Ay[Xg p g ** + + 1. ---> ヲsAJ[\ "a)" uB + + 2. v rWA[hJnA"first"OJ[\B + + 3. y ^Cv\ヲeLXg yank (Rs[)B + + 4. ssJ[\: j$ + + 5. p \t(put)A^Cv: a second + + 6. rWA[h " item." IAy NAss j$ + A p eLXg put B + +---> a) this is the first item. + b) + + Note: P1 yank y Iy[^ yw oB +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 6.5: IvV + + + ** u/AIvV ** + + 1. l 'ignore' : /ignore n xJB - 2. l^Cv 'ic' (Ignore Case ) IvVB - :set ic + 2. l 'ic' (Ignore Case ) IvV: :set ic 3. n 1x 'ignore' B n JB - 4. 'hlsearch' 'incsearch' IvVlB - :set hls is + 4. 'hlsearch' 'incsearch' IvV: :set hls is + + 5. R}hAN: /ignore - 5. xR}hAN: - /ignore + 6. l: :set noic +Note: }b`\ヲl: :nohlsearch +Note: 1R}hAt[Y \c + gp: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6 v - 1. o ^CvJ[\sJA}[hB O () ^CvJ[\s}[hB 2. J[\eLXg a ^CvB sゥeLXg} A ^CvB - 3. R ^Cvu[hAB + 3. e R}hPI[J[\B - 4. ":set xxx" ^CvIvV "xxx" B + 4. y Iy[^eLXg yank (Rs[)Ap put (y[Xg)B - + 5. R ^Cvu[hAB - - + 6. ":set xxx" ^CvIvV "xxx" B + 'ic' 'ignorecase' + 'is' 'incsearch' t[Y}b`\ヲ + 'hls' 'hlsearch' }b`\ヲ + AZAIvVgpB - - - + 7. "no" t^AIvV: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bX 7: ICwvR}h + bX 7.1: ICwvR}h + ** ICwvgp ** @@ -744,20 +862,19 @@ NOTE: eLXg}A ^CvJ[\E - L[()B - :help ^CvB - wvEBhE :q ^CvB + wvEBhEeLXgAwvB + CTRL-W CTRL-W ^Cv wvEBhEWvB + :q ^Cv wvEBhEB - ":help" R}h^Awv - B( ^CvY): + ":help" R}h^Awv + B( ^CvY): :help w :help c_ ^CvJ[\E :edit $VIM/_vimrc MS-Windows 2. Tv "vimrc" B - :read $VIMRUNTIME/vimrc_example.vim 3. t@CB - :write Vim NAF\gB "vimrc" t@CADB + :help vimrc-intro ^CvB + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 7.3: + + + ** CTRL-D R}hC ** + + 1. Rp`[hmF: :set nocp + + 2. fBNgt@C :!ls :!dir mFB + + 3. R}hJn^Cv: :e + + 4. CTRL-D Vim "e" nR}h\ヲB + + 5. Vim ":edit" R}hB + + 6. At@Cn: :edit FIL + + 7. Vim OB() + +NOTE: R}hB CTRL-D + B :help B + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bX 7 v + + + 1. wvEBhEJ :help B + + 2. R}h(cmd)wv :help cmd ^CvB + + 3. EBhEWv CTRL-W CTRL-W ^CvB + + 4. wvEBhE :q ^CvB + + 5. D vimrc NXNvgB + + 6. : command \ CTRL-D ^CvB + gp B + + + + + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Vim `[gAIBGfB^PA[ @@ -805,7 +968,8 @@ NOTE: eLXg}A ^CvJ[\E Modified for Vim by Bram Moolenaar. - { {O E-mail:mattn@mail.goo.ne.jp + { { O + C Y ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - vi:set ts=8 sts=4 sw=4 tw=76: + vi:set ts=8 sts=4 sw=4 tw=78: diff --git a/src/Makefile b/src/Makefile --- a/src/Makefile +++ b/src/Makefile @@ -547,6 +547,10 @@ LINT_OPTIONS = -beprxzF #PROFILE_CFLAGS = -DEXITFREE #PROFILE_LIBS = -lccmalloc +# MAC OS X platform +#MAC_OSX_ARCH = -arch ppc +MAC_OSX_ARCH = -arch i386 -arch ppc + ##################################################### ### Specific systems, check if yours is listed! ### {{{ ##################################################### @@ -1197,11 +1201,11 @@ PHOTONGUI_BUNDLE = # CARBON GUI CARBONGUI_SRC = gui.c gui_mac.c CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o -CARBONGUI_DEFS = -DFEAT_GUI_MAC -arch ppc -fno-common -fpascal-strings \ +CARBONGUI_DEFS = -DFEAT_GUI_MAC $(MAC_OSX_ARCH) -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas \ -mdynamic-no-pic -pipe CARBONGUI_IPATH = -I. -Iproto -CARBONGUI_LIBS_DIR = +CARBONGUI_LIBS_DIR = $(MAC_OSX_ARCH) CARBONGUI_LIBS1 = -framework Carbon CARBONGUI_LIBS2 = CARBONGUI_INSTALL = install_macosx diff --git a/src/configure.in b/src/configure.in --- a/src/configure.in +++ b/src/configure.in @@ -106,7 +106,7 @@ if test "`(uname) 2>/dev/null`" = Darwin MACOSX=yes OS_EXTRA_SCR="os_macosx.c os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp" + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -arch i386 -arch ppc" dnl If Carbon is found, assume we don't want X11 dnl unless it was specifically asked for (--with-x) diff --git a/src/edit.c b/src/edit.c --- a/src/edit.c +++ b/src/edit.c @@ -2845,7 +2845,7 @@ ins_compl_addfrommatch() int c; p = compl_shown_match->cp_str; - if (STRLEN(p) <= len) /* the match is too short */ + if ((int)STRLEN(p) <= len) /* the match is too short */ return; p += len; #ifdef FEAT_MBYTE diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -621,7 +621,9 @@ static void f_synID __ARGS((typval_T *ar static void f_synIDattr __ARGS((typval_T *argvars, typval_T *rettv)); static void f_synIDtrans __ARGS((typval_T *argvars, typval_T *rettv)); static void f_system __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_tabpagebuflist __ARGS((typval_T *argvars, typval_T *rettv)); static void f_tabpagenr __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_tabpagewinnr __ARGS((typval_T *argvars, typval_T *rettv)); static void f_taglist __ARGS((typval_T *argvars, typval_T *rettv)); static void f_tagfiles __ARGS((typval_T *argvars, typval_T *rettv)); static void f_tempname __ARGS((typval_T *argvars, typval_T *rettv)); @@ -6984,7 +6986,9 @@ static struct fst {"synIDattr", 2, 3, f_synIDattr}, {"synIDtrans", 1, 1, f_synIDtrans}, {"system", 1, 2, f_system}, + {"tabpagebuflist", 0, 1, f_tabpagebuflist}, {"tabpagenr", 0, 1, f_tabpagenr}, + {"tabpagewinnr", 1, 2, f_tabpagewinnr}, {"tagfiles", 0, 0, f_tagfiles}, {"taglist", 1, 1, f_taglist}, {"tempname", 0, 0, f_tempname}, @@ -14870,6 +14874,52 @@ done: } /* + * "tabpagebuflist()" function + */ +/* ARGSUSED */ + static void +f_tabpagebuflist(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ +#ifndef FEAT_WINDOWS + rettv->vval.v_number = 0; +#else + tabpage_T *tp; + win_T *wp = NULL; + list_T *l; + + if (argvars[0].v_type == VAR_UNKNOWN) + wp = firstwin; + else + { + tp = find_tabpage((int)get_tv_number(&argvars[0])); + if (tp != NULL) + wp = tp->tp_firstwin; + } + if (wp == NULL) + rettv->vval.v_number = 0; + else + { + l = list_alloc(); + if (l == NULL) + rettv->vval.v_number = 0; + else + { + rettv->vval.v_list = l; + rettv->v_type = VAR_LIST; + ++l->lv_refcount; + + for (; wp != NULL; wp = wp->w_next) + if (list_append_number(l, wp->w_buffer->b_fnum) == FAIL) + break; + } + } +#endif +} + + +/* * "tabpagenr()" function */ /* ARGSUSED */ @@ -14903,6 +14953,75 @@ f_tabpagenr(argvars, rettv) rettv->vval.v_number = nr; } + +#ifdef FEAT_WINDOWS +static int get_winnr __ARGS((tabpage_T *tp, typval_T *argvar)); + +/* + * Common code for tabpagewinnr() and winnr(). + */ + static int +get_winnr(tp, argvar) + tabpage_T *tp; + typval_T *argvar; +{ + win_T *twin; + int nr = 1; + win_T *wp; + char_u *arg; + + twin = (tp == curtab) ? curwin : tp->tp_curwin; + if (argvar->v_type != VAR_UNKNOWN) + { + arg = get_tv_string_chk(argvar); + if (arg == NULL) + nr = 0; /* type error; errmsg already given */ + else if (STRCMP(arg, "$") == 0) + twin = (tp == curtab) ? lastwin : tp->tp_lastwin; + else if (STRCMP(arg, "#") == 0) + { + twin = (tp == curtab) ? prevwin : tp->tp_prevwin; + if (twin == NULL) + nr = 0; + } + else + { + EMSG2(_(e_invexpr2), arg); + nr = 0; + } + } + + if (nr > 0) + for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin; + wp != twin; wp = wp->w_next) + ++nr; + return nr; +} +#endif + +/* + * "tabpagewinnr()" function + */ +/* ARGSUSED */ + static void +f_tabpagewinnr(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + int nr = 1; +#ifdef FEAT_WINDOWS + tabpage_T *tp; + + tp = find_tabpage((int)get_tv_number(&argvars[0])); + if (tp == NULL) + nr = 0; + else + nr = get_winnr(tp, &argvars[1]); +#endif + rettv->vval.v_number = nr; +} + + /* * "tagfiles()" function */ @@ -15357,34 +15476,9 @@ f_winnr(argvars, rettv) typval_T *rettv; { int nr = 1; + #ifdef FEAT_WINDOWS - win_T *wp; - win_T *twin = curwin; - char_u *arg; - - if (argvars[0].v_type != VAR_UNKNOWN) - { - arg = get_tv_string_chk(&argvars[0]); - if (arg == NULL) - nr = 0; /* type error; errmsg already given */ - else if (STRCMP(arg, "$") == 0) - twin = lastwin; - else if (STRCMP(arg, "#") == 0) - { - twin = prevwin; - if (prevwin == NULL) - nr = 0; - } - else - { - EMSG2(_(e_invexpr2), arg); - nr = 0; - } - } - - if (nr > 0) - for (wp = firstwin; wp != twin; wp = wp->w_next) - ++nr; + nr = get_winnr(curtab, &argvars[0]); #endif rettv->vval.v_number = nr; } diff --git a/src/ex_cmds.c b/src/ex_cmds.c --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3425,7 +3425,7 @@ do_ecmd(fnum, ffname, sfname, eap, newln * autocommands. This allows for the autocommands to position the * cursor. */ - win_init(curwin); + curwin_init(); #ifdef FEAT_FOLDING /* It's like all lines in the buffer changed. Need to update diff --git a/src/ex_cmds.h b/src/ex_cmds.h --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -881,11 +881,11 @@ EX(CMD_tab, "tab", ex_tab, RANGE|NOTADR|COUNT|TRLBAR), EX(CMD_tabclose, "tabclose", ex_tabclose, RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN), -EX(CMD_tabedit, "tabedit", ex_tabedit, +EX(CMD_tabedit, "tabedit", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR), -EX(CMD_tabfind, "tabfind", ex_tabedit, +EX(CMD_tabfind, "tabfind", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|NEEDARG|TRLBAR), -EX(CMD_tabnew, "tabnew", ex_tabedit, +EX(CMD_tabnew, "tabnew", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR), EX(CMD_tabonly, "tabonly", ex_tabonly, TRLBAR|CMDWIN), diff --git a/src/globals.h b/src/globals.h --- a/src/globals.h +++ b/src/globals.h @@ -495,6 +495,7 @@ EXTERN win_T *prevwin INIT(= NULL); /* p # define lastwin curwin # define W_NEXT(wp) NULL # define FOR_ALL_WINDOWS(wp) wp = curwin; +# define FOR_ALL_TAB_WINDOWS(tp, wp) wp = curwin; #endif EXTERN win_T *curwin; /* currently active window */ diff --git a/src/hardcopy.c b/src/hardcopy.c --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -475,6 +475,7 @@ prt_header(psettings, pagenum, lnum) if (*p_header != NUL) { linenr_T tmp_lnum, tmp_topline, tmp_botline; + int use_sandbox = FALSE; /* * Need to (temporarily) set current line number and first/last line @@ -490,8 +491,12 @@ prt_header(psettings, pagenum, lnum) curwin->w_botline = lnum + 63; printer_page_num = pagenum; +# ifdef FEAT_EVAL + use_sandbox = was_set_insecurely((char_u *)"printheader"); +# endif build_stl_str_hl(curwin, tbuf, (size_t)(width + IOSIZE), - p_header, ' ', width, NULL); + p_header, use_sandbox, + ' ', width, NULL); /* Reset line numbers */ curwin->w_cursor.lnum = tmp_lnum; diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -1142,7 +1142,7 @@ static struct vimoption {(char_u *)FALSE, (char_u *)0L}}, {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, (char_u *)&p_hl, PV_NONE, - {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabPage,#:TabPageSel,_:TabPageFill", + {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill", (char_u *)0L}}, {"history", "hi", P_NUM|P_VIM, (char_u *)&p_hi, PV_NONE, @@ -2046,6 +2046,13 @@ static struct vimoption {"showmode", "smd", P_BOOL|P_VIM, (char_u *)&p_smd, PV_NONE, {(char_u *)FALSE, (char_u *)TRUE}}, + {"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL, +#ifdef FEAT_WINDOWS + (char_u *)&p_stal, PV_NONE, +#else + (char_u *)NULL, PV_NONE, +#endif + {(char_u *)1L, (char_u *)0L}}, {"sidescroll", "ss", P_NUM|P_VI_DEF, (char_u *)&p_ss, PV_NONE, {(char_u *)0L, (char_u *)0L}}, @@ -2181,13 +2188,13 @@ static struct vimoption {(char_u *)0L, (char_u *)0L} #endif }, - {"tabline", "tal", P_NUM|P_VI_DEF|P_RALL, -#ifdef FEAT_WINDOWS + {"tabline", "tal", P_STRING|P_VI_DEF|P_RALL, +#ifdef FEAT_STL_OPT (char_u *)&p_tal, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)1L, (char_u *)0L}}, + {(char_u *)"", (char_u *)0L}}, {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, (char_u *)&p_ts, PV_TS, {(char_u *)8L, (char_u *)0L}}, @@ -3181,8 +3188,10 @@ set_option_default(opt_idx, opt_flags, c *(int *)varp; } - /* the default value is not insecure */ - options[opt_idx].flags &= ~P_INSECURE; + /* The default value is not insecure. But if there are local values + * we can't be sure. */ + if (options[opt_idx].indir == PV_NONE) + options[opt_idx].flags &= ~P_INSECURE; } #ifdef FEAT_EVAL @@ -3351,12 +3360,12 @@ set_init_2() static char_u * term_bg_default() { - char_u *p; - #if defined(MSDOS) || defined(OS2) || defined(WIN3264) /* DOS console nearly always black */ return (char_u *)"dark"; #else + char_u *p; + if (STRCMP(T_NAME, "linux") == 0 || STRCMP(T_NAME, "screen.linux") == 0 || STRCMP(T_NAME, "cygwin") == 0 @@ -4462,14 +4471,14 @@ did_set_option(opt_idx, opt_flags, new_v /* When an option is set in the sandbox, from a modeline or in secure mode * set the P_INSECURE flag. Otherwise, if a new value is stored reset the - * flag. */ + * flag. But not when there are local values. */ if (secure #ifdef HAVE_SANDBOX || sandbox != 0 #endif || (opt_flags & OPT_MODELINE)) options[opt_idx].flags |= P_INSECURE; - else if (new_value) + else if (new_value && options[opt_idx].indir == PV_NONE) options[opt_idx].flags &= ~P_INSECURE; } @@ -7284,7 +7293,7 @@ set_num_option(opt_idx, varp, value, err } /* (re)set tab page line */ - else if (pp == &p_tal) + else if (pp == &p_stal) { shell_new_rows(); /* recompute window positions and heights */ } diff --git a/src/option.h b/src/option.h --- a/src/option.h +++ b/src/option.h @@ -577,7 +577,7 @@ EXTERN char_u *p_lispwords; /* 'lispword #endif #ifdef FEAT_WINDOWS EXTERN long p_ls; /* 'laststatus' */ -EXTERN long p_tal; /* 'tabline' */ +EXTERN long p_stal; /* 'showtabline' */ #endif EXTERN char_u *p_lcs; /* 'listchars' */ @@ -716,6 +716,9 @@ EXTERN int p_scs; /* 'smartcase' */ EXTERN int p_sta; /* 'smarttab' */ #ifdef FEAT_WINDOWS EXTERN int p_sb; /* 'splitbelow' */ +# if defined(FEAT_STL_OPT) +EXTERN char_u *p_tal; /* 'tabline' */ +# endif #endif #ifdef FEAT_SYN_HL EXTERN char_u *p_sps; /* 'spellsuggest' */ diff --git a/src/proto/window.pro b/src/proto/window.pro --- a/src/proto/window.pro +++ b/src/proto/window.pro @@ -11,7 +11,7 @@ void win_close __ARGS((win_T *win, int f void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp)); void win_free_all __ARGS((void)); void close_others __ARGS((int message, int forceit)); -void win_init __ARGS((win_T *wp)); +void curwin_init __ARGS((void)); int win_alloc_first __ARGS((void)); void win_init_size __ARGS((void)); int win_new_tabpage __ARGS((void)); diff --git a/src/quickfix.c b/src/quickfix.c --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2887,11 +2887,14 @@ ex_vimgrep(eap) int found_match; buf_T *first_match_buf = NULL; time_t seconds = 0; + int save_mls; #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) char_u *save_ei = NULL; +#endif +#ifndef FEAT_AUTOCMD + buf_T *save_curbuf; +#else aco_save_T aco; -#endif -#ifdef FEAT_AUTOCMD char_u *au_name = NULL; int flags = 0; colnr_T col; @@ -2999,11 +3002,15 @@ ex_vimgrep(eap) * indent scripts, a great speed improvement. */ save_ei = au_event_disable(",Filetype"); #endif + /* Don't use modelines here, it's useless. */ + save_mls = p_mls; + p_mls = 0; /* Load file into a buffer, so that 'fileencoding' is detected, * autocommands applied, etc. */ buf = load_dummy_buffer(fnames[fi]); + p_mls = save_mls; #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) au_event_restore(save_ei); #endif @@ -3089,19 +3096,30 @@ ex_vimgrep(eap) } } -#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) if (buf != NULL) { /* The buffer is still loaded, the Filetype autocommands - * need to be done now, in that buffer. And then the - * modelines need to be done (again). */ + * need to be done now, in that buffer. And the modelines + * need to be done (again). */ +#if defined(FEAT_AUTOCMD) aucmd_prepbuf(&aco, buf); +#else + save_curbuf = curbuf; + curbuf = buf; + curwin->w_buffer = curbuf; +#endif +#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, buf->b_fname, TRUE, buf); +#endif do_modelines(FALSE); +#if defined(FEAT_AUTOCMD) aucmd_restbuf(&aco); +#else + curbuf = save_curbuf; + curwin->w_buffer = curbuf; +#endif } -#endif } } } diff --git a/src/screen.c b/src/screen.c --- a/src/screen.c +++ b/src/screen.c @@ -168,7 +168,7 @@ static int win_do_lines __ARGS((win_T *w static void win_rest_invalid __ARGS((win_T *wp)); static void msg_pos_mode __ARGS((void)); #if defined(FEAT_WINDOWS) -static void draw_tabpage __ARGS((void)); +static void draw_tabline __ARGS((void)); #endif #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) static int fillchar_status __ARGS((int *attr, int is_curwin)); @@ -420,7 +420,7 @@ update_screen(type) #ifdef FEAT_LINEBREAK /* Force redraw when width of 'number' column changes. */ if (curwin->w_redr_type < NOT_VALID - && curwin->w_nrwidth != number_width(curwin)) + && curwin->w_nrwidth != (curwin->w_p_nu ? number_width(curwin) : 0)) curwin->w_redr_type = NOT_VALID; #endif @@ -477,7 +477,7 @@ update_screen(type) #ifdef FEAT_WINDOWS /* Redraw the tab pages line if needed. */ if (redraw_tabline || type >= NOT_VALID) - draw_tabpage(); + draw_tabline(); #endif /* @@ -707,7 +707,7 @@ updateWindow(wp) #ifdef FEAT_WINDOWS /* When the screen was cleared redraw the tab pages line. */ if (redraw_tabline) - draw_tabpage(); + draw_tabline(); if (wp->w_redr_status # ifdef FEAT_CMDL_INFO @@ -845,11 +845,11 @@ win_update(wp) #ifdef FEAT_LINEBREAK /* Force redraw when width of 'number' column changes. */ - i = number_width(curwin); - if (curwin->w_nrwidth != i) + i = wp->w_p_nu ? number_width(wp) : 0; + if (wp->w_nrwidth != i) { type = NOT_VALID; - curwin->w_nrwidth = i; + wp->w_nrwidth = i; } else #endif @@ -4965,7 +4965,7 @@ redraw_statuslines() if (wp->w_redr_status) win_redr_status(wp); if (redraw_tabline) - draw_tabpage(); + draw_tabline(); } #endif @@ -5543,7 +5543,8 @@ get_keymap_str(wp, buf, len) #if defined(FEAT_STL_OPT) || defined(PROTO) /* - * Redraw the status line or ruler of window wp. + * Redraw the status line or ruler of window "wp". + * When "wp" is NULL redraw the tab pages line from 'tabline'. */ static void win_redr_custom(wp, draw_ruler) @@ -5562,56 +5563,88 @@ win_redr_custom(wp, draw_ruler) char_u buf[MAXPATHL]; char_u *p; struct stl_hlrec hl[STL_MAX_ITEM]; + int use_sandbox = FALSE; /* setup environment for the task at hand */ - row = W_WINROW(wp) + wp->w_height; - fillchar = fillchar_status(&attr, wp == curwin); - maxwidth = W_WIDTH(wp); - if (*wp->w_p_stl != NUL) - p = wp->w_p_stl; + if (wp == NULL) + { + /* Use 'tabline'. Always at the first line of the screen. */ + p = p_tal; + row = 0; + fillchar = t_colors < 8 ? '_' : ' '; + attr = hl_attr(HLF_TPF); + maxwidth = Columns; +# ifdef FEAT_EVAL + use_sandbox = was_set_insecurely((char_u *)"tabline"); +# endif + } else - p = p_stl; - if (draw_ruler) - { - p = p_ruf; - /* advance past any leading group spec - implicit in ru_col */ - if (*p == '%') - { - if (*++p == '-') - p++; - if (atoi((char *) p)) - while (VIM_ISDIGIT(*p)) + { + row = W_WINROW(wp) + wp->w_height; + fillchar = fillchar_status(&attr, wp == curwin); + maxwidth = W_WIDTH(wp); + + if (draw_ruler) + { + p = p_ruf; + /* advance past any leading group spec - implicit in ru_col */ + if (*p == '%') + { + if (*++p == '-') p++; - if (*p++ != '(') - p = p_ruf; - } + if (atoi((char *) p)) + while (VIM_ISDIGIT(*p)) + p++; + if (*p++ != '(') + p = p_ruf; + } #ifdef FEAT_VERTSPLIT - col = ru_col - (Columns - W_WIDTH(wp)); - if (col < (W_WIDTH(wp) + 1) / 2) - col = (W_WIDTH(wp) + 1) / 2; + col = ru_col - (Columns - W_WIDTH(wp)); + if (col < (W_WIDTH(wp) + 1) / 2) + col = (W_WIDTH(wp) + 1) / 2; #else - col = ru_col; - if (col > (Columns + 1) / 2) - col = (Columns + 1) / 2; -#endif - maxwidth = W_WIDTH(wp) - col; + col = ru_col; + if (col > (Columns + 1) / 2) + col = (Columns + 1) / 2; +#endif + maxwidth = W_WIDTH(wp) - col; #ifdef FEAT_WINDOWS - if (!wp->w_status_height) -#endif - { - row = Rows - 1; - --maxwidth; /* writing in last column may cause scrolling */ - fillchar = ' '; - attr = 0; - } - } + if (!wp->w_status_height) +#endif + { + row = Rows - 1; + --maxwidth; /* writing in last column may cause scrolling */ + fillchar = ' '; + attr = 0; + } + +# ifdef FEAT_EVAL + use_sandbox = was_set_insecurely((char_u *)"rulerformat"); +# endif + } + else + { + if (*wp->w_p_stl != NUL) + p = wp->w_p_stl; + else + p = p_stl; +# ifdef FEAT_EVAL + use_sandbox = was_set_insecurely((char_u *)"statusline"); +# endif + } + +#ifdef FEAT_VERTSPLIT + col += W_WINCOL(wp); +#endif + } + if (maxwidth <= 0) return; -#ifdef FEAT_VERTSPLIT - col += W_WINCOL(wp); -#endif - - width = build_stl_str_hl(wp, buf, sizeof(buf), p, fillchar, maxwidth, hl); + + width = build_stl_str_hl(wp == NULL ? curwin : wp, + buf, sizeof(buf), + p, use_sandbox, + fillchar, maxwidth, hl); len = STRLEN(buf); while (width < maxwidth && len < sizeof(buf) - 1) @@ -6822,7 +6855,7 @@ screenalloc(clear) new_TabPageIdxs = (char_u *)lalloc((long_u)(Columns * sizeof(char_u)), FALSE); #endif - FOR_ALL_WINDOWS(wp) + FOR_ALL_TAB_WINDOWS(tp, wp) { if (win_alloc_lines(wp) == FAIL) { @@ -8456,14 +8489,13 @@ unshowmode(force) * Draw the tab pages line at the top of the Vim window. */ static void -draw_tabpage() +draw_tabline() { int tabcount = 0; tabpage_T *tp; int tabwidth; int col = 0; int scol = 0; - int had_current = FALSE; int attr; win_T *wp; win_T *cwp; @@ -8475,12 +8507,27 @@ draw_tabpage() int attr_nosel = hl_attr(HLF_TP); int attr_fill = hl_attr(HLF_TPF); char_u *p; + int room; + int use_sep_chars = (t_colors < 8 +#ifdef FEAT_GUI + && !gui.in_use +#endif + ); redraw_tabline = FALSE; if (tabpageline_height() < 1) return; +#if defined(FEAT_STL_OPT) + /* Use the 'tabline' option if it's set. */ + if (*p_tal != NUL) + { + win_redr_custom(NULL, FALSE); + return; + } +#endif + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) ++tabcount; @@ -8495,17 +8542,9 @@ draw_tabpage() scol = col; if (tp->tp_topframe == topframe) - { - c = '/'; - had_current = TRUE; attr = attr_sel; - } - else if (!had_current) - c = '/'; - else - c = '\\'; - if (t_colors < 8) - screen_putchar(c, 0, col++, attr); + if (use_sep_chars && col > 0) + screen_putchar('|', 0, col++, attr); if (tp->tp_topframe != topframe) attr = attr_nosel; @@ -8531,32 +8570,49 @@ draw_tabpage() { if (wincount > 1) { - vim_snprintf((char *)NameBuff, MAXPATHL, "#%d", wincount); + vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); len = STRLEN(NameBuff); - screen_puts_len(NameBuff, len, 0, col, attr); + screen_puts_len(NameBuff, len, 0, col, +#if defined(FEAT_SYN_HL) + hl_combine_attr(attr, hl_attr(HLF_T)) +#else + attr +#endif + ); col += len; } if (modified) - screen_puts_len((char_u *)"+", 2, 0, col++, attr); + screen_puts_len((char_u *)"+", 1, 0, col++, attr); screen_putchar(' ', 0, col++, attr); } - if (buf_spname(cwp->w_buffer) != NULL) - STRCPY(NameBuff, buf_spname(cwp->w_buffer)); - else - home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff, + room = scol - col + tabwidth - 1; + if (room > 0) + { + if (buf_spname(cwp->w_buffer) != NULL) + STRCPY(NameBuff, buf_spname(cwp->w_buffer)); + else + home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff, MAXPATHL, TRUE); - trans_characters(NameBuff, MAXPATHL); - len = STRLEN(NameBuff); - p = NameBuff; - if (len > scol - col + tabwidth - 1) /* TODO: multi-byte chars */ - { - p += len - (scol - col + tabwidth - 1); - len = scol - col + tabwidth - 1; - } - if (len > 0) - { - screen_puts_len(p, len, 0, col, attr); + trans_characters(NameBuff, MAXPATHL); + len = vim_strsize(NameBuff); + p = NameBuff; +#ifdef FEAT_MBYTE + if (has_mbyte) + while (len > room) + { + len -= ptr2cells(p); + mb_ptr_adv(p); + } + else +#endif + if (len > room) + { + p += len - room; + len = room; + } + + screen_puts_len(p, STRLEN(p), 0, col, attr); col += len; } screen_putchar(' ', 0, col++, attr); @@ -8568,11 +8624,8 @@ draw_tabpage() TabPageIdxs[scol++] = tabcount; } - if (t_colors < 8) - { - screen_putchar('\\', 0, col++, attr); + if (use_sep_chars) c = '_'; - } else c = ' '; screen_fill(0, 1, col, (int)Columns, c, c, attr_fill); @@ -8902,7 +8955,7 @@ win_redr_ruler(wp, always) #if defined(FEAT_LINEBREAK) || defined(PROTO) /* * Return the width of the 'number' column. - * Zero when 'number' isn't set. + * Caller may need to check if 'number' is set. * Otherwise it depends on 'numberwidth' and the line count. */ int @@ -8912,9 +8965,6 @@ number_width(wp) int n; linenr_T lnum; - if (!wp->w_p_nu) - return 0; - lnum = wp->w_buffer->b_ml.ml_line_count; if (lnum == wp->w_nrwidth_line_count) return wp->w_nrwidth_width; diff --git a/src/structs.h b/src/structs.h --- a/src/structs.h +++ b/src/structs.h @@ -1578,6 +1578,7 @@ struct tabpage_S buf_T *(tp_diffbuf[DB_COUNT]); int tp_diff_invalid; /* list of diffs is outdated */ #endif + frame_T *tp_snapshot; /* window layout snapshot */ }; /* diff --git a/src/syntax.c b/src/syntax.c --- a/src/syntax.c +++ b/src/syntax.c @@ -6079,8 +6079,8 @@ static char *(highlight_init_both[]) = "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red", "PmenuThumb cterm=reverse gui=reverse", "PmenuSbar ctermbg=Grey guibg=Grey", - "TabPageSel term=bold cterm=bold gui=bold", - "TabPageFill term=reverse cterm=reverse gui=reverse", + "TabLineSel term=bold cterm=bold gui=bold", + "TabLineFill term=reverse cterm=reverse gui=reverse", NULL }; @@ -6109,7 +6109,7 @@ static char *(highlight_init_light[]) = "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue", "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta", "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan", - "TabPage term=underline cterm=underline ctermbg=LightGrey gui=underline guibg=LightGrey", + "TabLine term=underline cterm=underline ctermbg=LightGrey gui=underline guibg=LightGrey", NULL }; @@ -6138,7 +6138,7 @@ static char *(highlight_init_dark[]) = "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue", "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta", "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan", - "TabPage term=underline cterm=underline ctermbg=DarkGrey gui=underline guibg=DarkGrey", + "TabLine term=underline cterm=underline ctermbg=DarkGrey gui=underline guibg=DarkGrey", NULL }; diff --git a/src/version.h b/src/version.h --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 18)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 18, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20, compiled "