diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 6 | ||||
-rw-r--r-- | runtime/doc/manpages/de/vim-de.1 | 37 | ||||
-rw-r--r-- | runtime/doc/manpages/fr/vim-fr.1 | 46 | ||||
-rw-r--r-- | runtime/doc/manpages/it/vim-it.1 | 46 | ||||
-rw-r--r-- | runtime/doc/manpages/ja/vim-ja.1 | 45 | ||||
-rw-r--r-- | runtime/doc/manpages/pl/vim-pl.1 | 48 | ||||
-rw-r--r-- | runtime/doc/manpages/ru/vim-ru.1 | 45 | ||||
-rw-r--r-- | runtime/doc/manpages/vim.1 | 55 | ||||
-rw-r--r-- | runtime/doc/quickref.txt | 1 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 80 | ||||
-rw-r--r-- | runtime/doc/usr_90.txt | 18 | ||||
-rw-r--r-- | runtime/doc/vi_diff.txt | 5 | ||||
-rw-r--r-- | runtime/syntax/dirpager.vim | 2 | ||||
-rw-r--r-- | src/nvim/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 6 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 4 | ||||
-rw-r--r-- | src/nvim/globals.h | 2 | ||||
-rw-r--r-- | src/nvim/main.c | 82 |
19 files changed, 41 insertions, 490 deletions
diff --git a/.gitignore b/.gitignore index 3ad1a352eb..629e73169e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ /.vim-src/ # Files generated by the tests +/src/nvim/testdir/del /src/nvim/testdir/mbyte.vim /src/nvim/testdir/mzscheme.vim /src/nvim/testdir/lua.vim diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b303ad61b1..8994c313b3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1551,9 +1551,9 @@ v:profiling Normally zero. Set to one after using ":profile start". See |profiling|. *v:progname* *progname-variable* -v:progname Contains the name (with path removed) with which Vim was - invoked. Allows you to do special initialisations for |view|, - |rview|, or any other name you might symlink to Vim. +v:progname Contains the name (with path removed) with which Nvim was + invoked. Allows you to do special initialisations for any + other name you might symlink to Nvim. Read-only. *v:progpath* *progpath-variable* diff --git a/runtime/doc/manpages/de/vim-de.1 b/runtime/doc/manpages/de/vim-de.1 index d958372012..e956a22755 100644 --- a/runtime/doc/manpages/de/vim-de.1 +++ b/runtime/doc/manpages/de/vim-de.1 @@ -17,15 +17,6 @@ vim \- Vi IMproved, ein Text\-Editor für Programmierer \fBvim\fP [Optionen] \-t Tag .br \fBvim\fP [Optionen] \-q [Fehlerdatei] -.PP -.br -\fBex\fP -.br -\fBview\fP -.br -\fBgvim\fP \fBgview\fP -.br -\fBrvim\fP \fBrview\fP \fBrgvim\fP \fBrgview\fP .SH BESCHREIBUNG \fBVim\fP ist ein Text\-Editor, der aufwärtskompatibel zu Vi ist. Er kann verwendet werden, um alle Arten von Klartext zu bearbeiten. Er ist besonders @@ -82,29 +73,6 @@ erste Fehler wird angezeigt. Falls [Fehlerdatei] ausgelassen wird, wird der Dateiname aus der Option 'errorfile' verwendet (bei AmigaOS ist dies vorgabemäßig »AztecC.Err«, sowie „errors.err« bei anderen). Weitere Fehler können mit dem »:cn«\-Befehl angesprungen werden. Siehe „:help quickfix«. -.PP -\fBVim\fP reagiert unterschiedlich auf den Namen, der verwendet wird, um Vim zu -starten (die ausführbare Datei kann dieselbe sein). -.TP 10 -vim -der »normale« Weg, alles ist standardmäßig -.TP -ex -Startet im Ex\-Modus. Mit dem Befehl »:vi« gelangt man in den normalen -Modus. Funktioniert auch mit dem Argument »\-e«. -.TP -view -Startet im Nur\-Lesen\-Modus. Die Datei wird vor dem Überschreiben -geschützt. Dasselbe wird mit dem Parameter »\-R« erreicht. -.TP -gvim gview -Die grafische Version: Öffnet ein neues Fenster. Dasselbe wird mit dem -Parameter »\-g« erreicht. -.TP -rvim rview rgvim rgview -Wie die obigen, aber mit Beschränkungen: Es ist nicht möglich, Shell\-Befehle -aufzurufen oder mit Unterbrechung in eine Shell zurückzuspringen. Dasselbe -wird mit dem Parameter »\-Z« erreicht. .SH OPTIONEN Die Optionen können in beliebiger Reihenfolge vor oder nach den Dateinamen angegeben werden. Optionen ohne Parameter können hinter einem einzigen @@ -305,11 +273,6 @@ Ausführlich (verbose): Gibt Meldungen darüber, welche Befehlsdateien eingelesen werden, und über das Lesen und Schreiben einer VimInfo\-Datei. Die optionale Zahl N ist der Wert für 'verbose'. Vorgabe ist 10. .TP -\-v -Startet \fBVim\fP im Vi\-Modus, so als würde die ausführbare Datei mit »vi« -aufgerufen. Dies wirkt sich nur aus, wenn die ausführbare Datei als »ex« -aufgerufen wird. -.TP \-w {Ausgabeskript} Alle Zeichen, die eingetippt werden, werden in der Datei {Ausgabeskript} aufgezeichnet, solange bis Sie \fBVim\fP beenden. Dies ist nützlich, falls Sie diff --git a/runtime/doc/manpages/fr/vim-fr.1 b/runtime/doc/manpages/fr/vim-fr.1 index 2b2a50765f..158779de0c 100644 --- a/runtime/doc/manpages/fr/vim-fr.1 +++ b/runtime/doc/manpages/fr/vim-fr.1 @@ -21,19 +21,6 @@ vim \- Vi IMproved, éditeur de texte pour programmeurs .br .B vim [options] \-q [fichiererreurs] -.PP -.br -.B ex -.br -.B view -.br -.B gvim -.B gview -.br -.B rvim -.B rview -.B rgvim -.B rgview .SH DESCRIPTION .B Vim est un éditeur de texte proposant une compatibilité ascendante @@ -101,33 +88,6 @@ l'option 'errorfile' ("AztecC.Err" par défaut sur Amiga, "errors.err" sur les autres systèmes). La commande ":cn" permet de sauter aux erreurs suivantes. Voir ":help quickfix". -.PP -.B Vim -se comporte différemment selon le nom de la commande (l'exécutable peut -cependant être le même fichier). -.TP 10 -vim -La façon "normale", le comportement par défaut. -.TP -ex -Démarre en mode Ex. -La commande ":vi" permet de passer en mode Normal. -Ce mode est également accessible avec l'argument "\-e". -.TP -view -Démarre en mode Lecture-Seule. Vous êtes protégé de l'écriture accidentelle -des fichiers. Ce mode est également accessible avec l'argument "\-R". -.TP -gvim gview -La version graphique. -Ouvre une nouvelle fenêtre. -Également accessible avec l'argument "\-g". -.TP -rvim rview rgvim rgview -Comme ci-dessus, mais avec des restrictions. Il vous sera impossible de -lancer des commandes du shell, ou de suspendre -.B Vim. -Également accessible avec l'argument "\-Z". .SH OPTIONS Les options peuvent être spécifiées dans n'importe quel ordre, avant ou après les noms de fichiers. Les options sans arguments @@ -389,12 +349,6 @@ Donne des messages à propos des fichiers sourcés, ainsi que sur la lecture et les écritures dans le fichier viminfo. le nombre optionnel N précise la valeur de l'option 'verbose' (10 par défaut). .TP -\-v -Démarre -.B Vim -en mode Vi, comme si l'exécutable s'appelait "vi". Cela n'a d'effet que si -l'exécutable invoqué est "ex". -.TP \-w {scriptSortie} Tous les caractères que vous tapez sont enregistrés dans le fichier {scriptSortie}, jusqu'à ce que vous quittiez diff --git a/runtime/doc/manpages/it/vim-it.1 b/runtime/doc/manpages/it/vim-it.1 index 36ece8fb0b..ad7ef51934 100644 --- a/runtime/doc/manpages/it/vim-it.1 +++ b/runtime/doc/manpages/it/vim-it.1 @@ -14,19 +14,6 @@ vim \- VI Migliorato, un editor di testi per programmatori .br .B vim [opzioni] \-q [file_errori] -.PP -.br -.B ex -.br -.B view -.br -.B gvim -.B gview -.br -.B rvim -.B rview -.B rgvim -.B rgview .SH DESCRIZIONE .B Vim Un editore di testi, compatibile con, e migliore di, Vi. @@ -94,33 +81,6 @@ dell'opzione 'errorfile' (che, se non specificata, vale "AztecC.Err" per l'Amiga, "errors.err" su altri sistemi). Si può saltare all'errore successivo col comando ":cn". Vedere ":help quickfix". -.PP -.B Vim -si comporta in modo diverso se invocato con nomi differenti (il programma -eseguibile "sottostante" può essere sempre lo stesso). -.TP 10 -vim -Modo Normal, comportamento normale. -.TP -ex -Inizia in Modo "Ex". -Si può passare in Modo Normal col comando ":vi". -Si può invocare il Modo "Ex" anche con l'argomento "\-e". -.TP -view -Inizia in Modo Read-only (Sola Lettura). Non potete modificare i file. -Si può invocare il Modo Read-only anche con l'argomento "\-R". -.TP -gvim gview -La versione GUI [Graphical User Interface]. -Apre una nuova finestra. -Si può invocare il Modo GUI anche con l'argomento "\-g". -.TP -rvim rview rgvim rgview -Come sopra, ma con restrizioni ai comandi. Non si potranno eseguire comandi -della shell o sospendere -.B Vim. -Si può chiedere la stessa cosa anche con l'argomento "\-Z". .SH OPZIONI Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di file. Opzioni che non necessitano un argomento possono essere specificate @@ -372,12 +332,6 @@ e quando legge o scrive un file viminfo. Il numero opzionale N è il valore dell'opzione 'verbose'. Il valore predefinito è 10. .TP -\-v -Inizia -.B Vim -in Modo Vi, come se il programma eseguibile fosse "vi". Questo ha -effetto solo quando Vim viene invocato con il nome "ex". -.TP \-w {scriptout} Ogni carattere immesso viene registrato nel file {scriptout}, finché non uscite da diff --git a/runtime/doc/manpages/ja/vim-ja.1 b/runtime/doc/manpages/ja/vim-ja.1 index 9a9111a69f..4bb432aae1 100644 --- a/runtime/doc/manpages/ja/vim-ja.1 +++ b/runtime/doc/manpages/ja/vim-ja.1 @@ -14,19 +14,6 @@ vim \- Vi IMproved, プログラマのテキストエディタ .br .B vim [options] \-q [errorfile] -.PP -.br -.B ex -.br -.B view -.br -.B gvim -.B gview -.br -.B rvim -.B rview -.B rgvim -.B rgview .SH 説明 .B Vim は Vi 互換のテキストエディタです。 @@ -84,33 +71,6 @@ tags ファイルから {tag} が検索され、関連したファイルがカ は、Amiga では "AztecC.Err"、その他のシステムでは "errors.err" です)。 ":cn" コマンドで次のエラーにジャンプできます。 詳しくは ":help quickfix" を参照してください。 -.PP -.B Vim -は、起動されたときの実行ファイルの名前によって動作を変えます -(実行ファイルの実体が同じであっても)。 -.TP 10 -vim -"普通" に起動します。標準の状態です。 -.TP -ex -Ex モードで起動します。 -ノーマルモードに切り替えるには ":vi" コマンドを使ってください。 -引数に "\-e" を指定した場合と同じです。 -.TP -view -読み込み専用モードで起動します。ファイルの保存が制限されます。 -引数に "\-R" を指定した場合と同じです。 -.TP -gvim gview -GUI バージョン。 -新しいウィンドウを開いて起動します。 -引数に "\-g" を指定した場合と同じです。 -.TP -rvim rview rgvim rgview -上記と同じですが、制限モードで起動します。シェルコマンドを実行したり、 -.B Vim -をサスペンドしたりできなくなります。 -引数に "\-Z" を指定した場合と同じです。 .SH オプション ファイル名の前でも後ろでも、好きな順番でオプションを指定できます。 パラメータを必要としない引数は、一つのダッシュにまとめて指定できます。 @@ -320,11 +280,6 @@ termcap または terminfo ファイルで定義されている名前を指定 びにメッセージを表示します。N に指定した数値が 'verbose' に設定されます。 省略した場合は 10 になります。 .TP -\-v -Vi モードで起動します。 -実行ファイルの名前が "vi" の場合と同じです。 -実行ファイルの名前が "ex" の場合だけ効果があります。 -.TP \-w {scriptout} 入力した文字を {scriptout} に記録します。 "vim \-s" や "source!" で実行するためのスクリプトファイルを作成するのに便利 diff --git a/runtime/doc/manpages/pl/vim-pl.1 b/runtime/doc/manpages/pl/vim-pl.1 index e92c3fd35f..71ba6e3ffa 100644 --- a/runtime/doc/manpages/pl/vim-pl.1 +++ b/runtime/doc/manpages/pl/vim-pl.1 @@ -14,19 +14,6 @@ vim \- Vi rozbudowany, edytor tekstu dla programisty .br .B vim [opcje] \-q [plik_błędu] -.PP -.br -.B ex -.br -.B view -.br -.B gvim -.B gview -.br -.B rvim -.B rview -.B rgvim -.B rgview .SH OPIS .B Vim jest edytorem tekstu kompatybilnym z Vi. Może być @@ -93,35 +80,6 @@ Jeśli brak opcji [plik_błędów] nazwa pliku zostanie pobrana z opcji systemów. Do kolejnych błędów można przeskoczyć dzięki poleceniu ":cn". Zobacz ":help quickfix". -.PP -W zależności od wywołania -.B Vim -zachowuje się inaczej (program może być cały czas tym samym -plikiem). -.TP 10 -vim -"Normalny" sposób, wszystko jest domyślne. -.TP -ex -Zacznij w trybie Ex. -Przejdź do trybu Normalnego poleceniem ":vi". -Można także uruchomić poprzez argument "\-e". -.TP -view -Zacznij w trybie tylko do odczytu. W ten sposób będziesz chroniony -przed zapisywaniem pliku. Można także uruchomić poprzez argument -"\-R". -.TP -gvim gview -Wersja GUI. -Uruchamia nowe okno. -Można także uruchomić poprzez argument "\-g". -.TP -rvim rview rgvim rgview -Podobnie jak powyżej, ale z ograniczeniami. Nie będzie można uruchomić -poleceń powłoki lub zawiesić -.B Vima. -Można także uruchomić poprzez argument "\-Z". .SH OPCJE Opcje można podać w dowolnej kolejności, przed lub po nazwach plików. Opcje bez argumentów można łączyć po pojedynczym myślniku. @@ -371,12 +329,6 @@ Tryb gadatliwy. Wypisz wiadomości o tym jaki pliki są wczytywane i o informacjach pobieranych i dodawanych do pliku viminfo. Opcjonalny argument N jest wartością 'verbose'. Domyślnie 10. .TP -\-v -Uruchom -.B Vima -w trybie Vi, tak jakby program był nazwany "vi". Ma znaczenie -tylko wtedy jeśli program nazwany jest "ex". -.TP \-w {plik} Wszystkie wciśnięcia klawiszy, aż do zakończenia działania programu, są zapisywane w {plik} . diff --git a/runtime/doc/manpages/ru/vim-ru.1 b/runtime/doc/manpages/ru/vim-ru.1 index c48fb6691a..90bdeddc0c 100644 --- a/runtime/doc/manpages/ru/vim-ru.1 +++ b/runtime/doc/manpages/ru/vim-ru.1 @@ -14,19 +14,6 @@ vim \- Vi IMproved (Улучшенный Vi), текстовый редакто .br .B vim [ключи] \-q [файл ошибок] -.PP -.br -.B ex -.br -.B view -.br -.B gvim -.B gview -.br -.B rvim -.B rview -.B rgvim -.B rgview .SH ОПИСАНИЕ .B Vim -- текстовый редактор, обратно-совместимый с Vi. @@ -90,32 +77,6 @@ vim \- Vi IMproved (Улучшенный Vi), текстовый редакто (по умолчанию: "AztecC.Err" для Amiga, "errors.err" для других систем). К следующим ошибкам можно перейти по команде ":cn". См. ":help quickfix". -.PP -.B Vim -ведёт себя по-разному в зависимости от имени команды (исполняемый файл может -быть одним и тем же). -.TP 10 -vim -"Нормальный" запуск, всё по умолчанию. -.TP -ex -Запуск в режиме Ex. Для перехода в нормальный режим -необходимо выполнить команду ":vi". Режим Ex включает -также ключ "\-e". -.TP -view -Запуск в режиме "только для чтения". Вы будете защищены от случайной записи -файла. То же самое можно сделать ключом "\-R". -.TP -gvim gview -Версия с графическим интерфейсом. Запускается в новом окне. -То же самое можно сделать при запуске с ключом "\-g". -.TP -rvim rview rgvim rgview -Как и предыдущие команды, но с ограничениями. Нельзя запускать команды оболочки -или приостанавливать работу -.B Vim. -Вместо приставки "r" можно использовать ключ "\-Z". .SH КЛЮЧИ Ключи могут быть указаны в любом порядке, до или после имён файлов. Ключи без аргументов могут быть объединены под одним @@ -329,12 +290,6 @@ rvim rview rgvim rgview "Болтливый" режим. Выводить сообщения о том, какие файлы читаются, и о чтении-записи файла viminfo. .TP -\-v -Запустить -.B Vim -в режиме Vi, как будто исполняемый файл имеет имя "vi". Имеет смысл только если -исполняемый файл имеет имя "ex". -.TP \-w {scriptout} Все символы, введённые с клавиатуры вплоть до момента завершения работы, записываются в файл {scriptout}. diff --git a/runtime/doc/manpages/vim.1 b/runtime/doc/manpages/vim.1 index c35fa78f0d..d4e9ab2ad8 100644 --- a/runtime/doc/manpages/vim.1 +++ b/runtime/doc/manpages/vim.1 @@ -14,19 +14,6 @@ vim \- Vi IMproved, a programmers text editor .br .B vim [options] \-q [errorfile] -.PP -.br -.B ex -.br -.B view -.br -.B gvim -.B gview -.br -.B rvim -.B rview -.B rgvim -.B rgview .SH DESCRIPTION .B Vim is a text editor that is upwards compatible to Vi. @@ -91,33 +78,6 @@ If [errorfile] is omitted, the filename is obtained from the 'errorfile' option (defaults to "errors.err"). Further errors can be jumped to with the ":cn" command. See ":help quickfix". -.PP -.B Vim -behaves differently, depending on the name of the command (the executable may -still be the same file). -.TP 10 -vim -The "normal" way, everything is default. -.TP -ex -Start in Ex mode. -Go to Normal mode with the ":vi" command. -Can also be done with the "\-e" argument. -.TP -view -Start in read-only mode. You will be protected from writing the files. Can -also be done with the "\-R" argument. -.TP -gvim gview -The GUI version. -Starts a new window. -Can also be done with the "\-g" argument. -.TP -rvim rview rgvim rgview -Like the above, but with restrictions. It will not be possible to start shell -commands, or suspend -.B Vim. -Can also be done with the "\-Z" argument. .SH OPTIONS The options may be given in any order, before or after filenames. Options without an argument can be combined after a single dash. @@ -188,12 +148,12 @@ script. \-e Start .B Vim -in Ex mode, just like the executable was called "ex". +in Ex mode. .TP \-E Start .B Vim -in improved Ex mode, just like the executable was called "exim". +in improved Ex mode. .TP \-f Foreground. For the GUI version, @@ -319,8 +279,7 @@ appended. See ":help recovery". .TP \-s -Silent mode. Only when started as "Ex" or when the "\-e" option was given -before the "\-s" option. +Silent mode. Only when the "\-e" option was given before the "\-s" option. .TP \-s {scriptin} The script file {scriptin} is read. @@ -357,12 +316,6 @@ Verbose. Give messages about which files are sourced and for reading and writing a viminfo file. The optional number N is the value for 'verbose'. Default is 10. .TP -\-v -Start -.B Vim -in Vi mode, just like the executable was called "vi". This only has effect -when the executable is called "ex". -.TP \-w {scriptout} All the characters that you type are recorded in the file {scriptout}, until you exit @@ -379,7 +332,7 @@ Don't connect to the X server. Shortens startup time in a terminal, but the window title and clipboard will not be used. .TP \-Z -Restricted mode. Works like the executable starts with "r". +Restricted mode. .TP \-\- Denotes the end of the options. diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 0e4418ba6a..5d251e7b68 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1128,7 +1128,6 @@ Context-sensitive completion on the command-line: |-+| +[num] put the cursor at line [num] (default: last line) |-+c| +{command} execute {command} after loading the file |-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat} -|-v| -v Vi mode, start ex in Normal mode |-e| -e Ex mode, start vim in Ex mode |-R| -R Read-only mode, implies -n |-m| -m modifications not allowed (resets 'write' option) diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 39cb522002..bb555e1666 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -19,11 +19,11 @@ Starting Vim *starting* Most often, Vim is started to edit a single file with the command - vim filename *-vim* + nvim filename *-vim* More generally, Vim is started with: - vim [option | filename] .. + nvim [option | filename] .. Option arguments and file name arguments can be mixed, and any number of them can be given. However, watch out for options that take an argument. @@ -39,7 +39,7 @@ filename One or more file names. The first one will be the current on the first line of the buffer. To avoid a file name starting with a '-' being interpreted as an option, precede the arglist with "--", e.g.: > - vim -- -filename + nvim -- -filename < All arguments after the "--" will be interpreted as file names, no other options or "+command" argument can follow. @@ -48,22 +48,18 @@ filename One or more file names. The first one will be the current mode is to be used. Starting in Normal mode: > - vim - - ex -v - + nvim - < Start editing a new buffer, which is filled with text that is read from stdin. The commands that would normally be read from stdin will now be read from stderr. Example: > - find . -name "*.c" -print | vim - + find . -name "*.c" -print | nvim - < The buffer will be marked modified, because it contains text that needs to be saved. Except when in readonly mode, then the buffer is not marked modified. Example: > - ls | view - -< + ls | nvim -R - Starting in Ex mode: > - ex - - vim -e - - exim - - vim -E + nvim -e - + nvim -E < Start editing in silent mode. See |-s-ex|. *-t* *-tag* @@ -85,32 +81,6 @@ filename One or more file names. The first one will be the current (nothing) Without one of the four items above, Vim will start editing a new buffer. It's empty and doesn't have a file name. - -The startup mode can be changed by using another name instead of "vim", which -is equal to giving options: -ex vim -e Start in Ex mode (see |Ex-mode|). *ex* -exim vim -E Start in improved Ex mode (see |Ex-mode|). *exim* - (normally not installed) -view vim -R Start in read-only mode (see |-R|). *view* -gvim vim -g Start the GUI (see |gui|). *gvim* -gex vim -eg Start the GUI in Ex mode. *gex* -gview vim -Rg Start the GUI in read-only mode. *gview* -rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* -rview vim -RZ Like "view", but in restricted mode. *rview* -rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* -rgview vim -RgZ Like "gview", but in restricted mode. *rgview* - -Additional characters may follow, they are ignored. For example, you can have -"gvim-5" to start the GUI. You must have an executable by that name then, of -course. - -On Unix, you would normally have one executable called Vim, and links from the -different startup-names to that executable. If your system does not support -links and you do not want to have several copies of the executable, you could -use an alias instead. For example: > - alias view vim -R - alias gvim vim -g -< *startup-options* The option arguments may be given in any order. Single-letter options can be combined after one dash. There can be no option arguments after the "--" @@ -245,28 +215,20 @@ argument. -g Start Vim in GUI mode. See |gui|. For the opposite see |-v|. {not in Vi} - *-v* --v Start Ex in Vi mode. Only makes a difference when the - executable is called "ex" or "gvim". For gvim the GUI is not - started if possible. - *-e* --e Start Vim in Ex mode |Q|. Only makes a difference when the - executable is not called "ex". +-e Start Vim in Ex mode |Q|. *-E* --E Start Vim in improved Ex mode |gQ|. Only makes a difference - when the executable is not called "exim". - {not in Vi} +-E Start Vim in improved Ex mode |gQ|. *-s-ex* --s Silent or batch mode. Only when Vim was started as "ex" or - when preceded with the "-e" argument. Otherwise see |-s|, - which does take an argument while this use of "-s" doesn't. - To be used when Vim is used to execute Ex commands from a file - instead of a terminal. Switches off most prompts and - informative messages. Also warnings and error messages. - The output of these commands is displayed (to stdout): +-s Silent or batch mode. Only when "-s" is preceded by the "-e" + argument. Otherwise see |-s|, which does take an argument + while this use of "-s" doesn't. To be used when Vim is used + to execute Ex commands from a file instead of a terminal. + Switches off most prompts and informative messages. Also + warnings and error messages. The output of these commands is + displayed (to stdout): :print :list :number @@ -561,14 +523,6 @@ argument. Note that the implementation is still primitive. It won't work with all applications and the menu doesn't work. -If the executable is called "view", Vim will start in Readonly mode. This is -useful if you can make a hard or symbolic link from "view" to "vim". -Starting in Readonly mode can also be done with "vim -R". - -If the executable is called "ex", Vim will start in "Ex" mode. This means it -will accept only ":" commands. But when the "-v" argument is given, Vim will -start in Normal mode anyway. - Additional arguments are available on unix like systems when compiled with X11 GUI support. See |gui-resources|. diff --git a/runtime/doc/usr_90.txt b/runtime/doc/usr_90.txt index 4be0e93718..ab0b8156f8 100644 --- a/runtime/doc/usr_90.txt +++ b/runtime/doc/usr_90.txt @@ -434,27 +434,9 @@ someone supplied, you can't do this. Do delete the files manually, here is an example for when "/usr/local" was used as the root: > rm -rf /usr/local/share/vim/vim61 - rm /usr/local/bin/ex - rm /usr/local/bin/gview - rm /usr/local/bin/gvim - rm /usr/local/bin/gvim - rm /usr/local/bin/rgview - rm /usr/local/bin/rgvim - rm /usr/local/bin/rview - rm /usr/local/bin/rvim - rm /usr/local/bin/rvim - rm /usr/local/bin/view rm /usr/local/bin/vim rm /usr/local/bin/vimtutor rm /usr/local/bin/xxd - rm /usr/local/man/man1/ex.1 - rm /usr/local/man/man1/gview.1 - rm /usr/local/man/man1/gvim.1 - rm /usr/local/man/man1/rgview.1 - rm /usr/local/man/man1/rgvim.1 - rm /usr/local/man/man1/rview.1 - rm /usr/local/man/man1/rvim.1 - rm /usr/local/man/man1/view.1 rm /usr/local/man/man1/vim.1 rm /usr/local/man/man1/vimtutor.1 rm /usr/local/man/man1/xxd.1 diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index b4e621e516..919002cffd 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -830,10 +830,9 @@ Only Vim is able to accept options in between and after the file names. -D Vim: debug mode. --e Elvis, Nvi, Vim: Start in Ex mode, as if the executable is - called "ex". +-e Elvis, Nvi, Vim: Start in Ex mode. --E Vim: Start in improved Ex mode |gQ|, like "exim". +-E Vim: Start in improved Ex mode |gQ|. -f Vim: Run GUI in foreground. -f {session} Elvis: Use {session} as the session file. diff --git a/runtime/syntax/dirpager.vim b/runtime/syntax/dirpager.vim index 1a60063798..40137e4936 100644 --- a/runtime/syntax/dirpager.vim +++ b/runtime/syntax/dirpager.vim @@ -14,7 +14,7 @@ " License: VIM License " Vim is Charityware, see ":help Uganda" " -" Usage: $ ls -la | view -c "set ft=dirpager" - +" Usage: $ ls -la | nvim -R -c "set ft=dirpager" - " " ",----[ ls(1posix) ]-------------------------------------------------- diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index c4abcd77b1..c0b688e6ef 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -213,7 +213,7 @@ open_buffer ( * So the modelines have priority over auto commands. */ /* When reading stdin, the buffer contents always needs writing, so set - * the changed flag. Unless in readonly mode: "ls | gview -". + * the changed flag. Unless in readonly mode: "ls | nvim -R -". * When interrupted and 'cpoptions' contains 'i' set changed flag. */ if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL) || modified_was_set /* ":set modified" used in autocmd */ diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index e98032da5c..a47b303a4a 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -853,7 +853,7 @@ void do_bang(int addr_count, exarg_T *eap, int forceit, int do_in, int do_out) int scroll_save = msg_scroll; /* - * Disallow shell commands for "rvim". + * Disallow shell commands in restricted mode (-Z) * Disallow shell commands from .exrc and .vimrc in current directory for * security reasons. */ @@ -1217,7 +1217,7 @@ do_shell ( int save_nwr; /* - * Disallow shell commands for "rvim". + * Disallow shell commands in restricted mode (-Z) * Disallow shell commands from .exrc and .vimrc in current directory for * security reasons. */ @@ -3378,7 +3378,7 @@ void ex_z(exarg_T *eap) int check_restricted(void) { if (restricted) { - EMSG(_("E145: Shell commands not allowed in rvim")); + EMSG(_("E145: Shell commands not allowed in restricted mode")); return TRUE; } return FALSE; diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 4e835cc43a..fa6021075d 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5375,9 +5375,7 @@ static void ex_hide(exarg_T *eap) */ static void ex_stop(exarg_T *eap) { - /* - * Disallow suspending for "rvim". - */ + // Disallow suspending in restricted mode (-Z) if (!check_restricted()) { if (!eap->forceit) { autowrite_all(); diff --git a/src/nvim/globals.h b/src/nvim/globals.h index b15db61f99..d7087ee928 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -601,7 +601,7 @@ EXTERN volatile int full_screen INIT(= FALSE); * otherwise only writing some messages */ EXTERN int restricted INIT(= FALSE); -/* TRUE when started as "rvim" */ +// TRUE when started in restricted mode (-Z) EXTERN int secure INIT(= FALSE); /* non-zero when only "safe" commands are * allowed, e.g. when sourcing .exrc or .vimrc diff --git a/src/nvim/main.c b/src/nvim/main.c index 897f251bb3..a4f430e811 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -204,11 +204,9 @@ int main(int argc, char **argv) // Check if we have an interactive window. check_and_set_isatty(¶ms); - /* - * Figure out the way to work from the command name argv[0]. - * "view" sets "readonlymode", "rvim" sets "restricted", etc. - */ - parse_command_name(¶ms); + // Get the name with which Nvim was invoked, with and without path. + set_vim_var_string(VV_PROGPATH, (char_u *)argv[0], -1); + set_vim_var_string(VV_PROGNAME, path_tail((char_u *)argv[0]), -1); /* * Process the command line arguments. File names are put in the global @@ -820,69 +818,8 @@ static void init_locale(void) } TIME_MSG("locale set"); } - #endif -/* - * Check for: [r][g][vi|vim|view][ex[im]] - * If the executable name starts with "r" we disable shell commands. - * If the next character is "g" we run the GUI version. - * If the next characters are "view" we start in readonly mode. - * If the next characters are "ex" we start in Ex mode. If it's followed - * by "im" use improved Ex mode. - */ -static void parse_command_name(mparm_T *parmp) -{ - char_u *initstr; - - initstr = path_tail((char_u *)parmp->argv[0]); - - set_vim_var_string(VV_PROGNAME, initstr, -1); - set_vim_var_string(VV_PROGPATH, (char_u *)parmp->argv[0], -1); - - if (parse_string(&initstr, "editor", 6)) - return; - - if (parse_char_i(&initstr, 'r')) - restricted = TRUE; - - /* "gvim" starts the GUI. Also accept "Gvim" for MS-Windows. */ - if (parse_char_i(&initstr, 'g')) - main_start_gui(); - - if (parse_string(&initstr, "view", 4)) { - readonlymode = TRUE; - curbuf->b_p_ro = TRUE; - p_uc = 10000; /* don't update very often */ - } else { - parse_string(&initstr, "vim", 3); /* consume "vim" if it's there */ - } - - if (parse_string(&initstr, "ex", 2)) { - if (parse_string(&initstr, "im", 2)) - exmode_active = EXMODE_VIM; - else - exmode_active = EXMODE_NORMAL; - } -} - -static bool parse_char_i(char_u **input, char val) -{ - if (TOLOWER_ASC(**input) == val) { - *input += 1; /* or (*input)++ WITH parens */ - return true; - } - return false; -} - -static bool parse_string(char_u **input, char *val, int len) -{ - if (STRNICMP(*input, val, len) == 0) { - *input += len; - return true; - } - return false; -} /* * Scan the command line arguments. @@ -1134,10 +1071,6 @@ static void command_line_scan(mparm_T *parmp) } break; - case 'v': /* "-v" Vi-mode (as if called "vi") */ - exmode_active = 0; - break; - case 'w': /* "-w{number}" set window height */ /* "-w {scriptout}" write to script */ if (vim_isdigit(((char_u *)argv[0])[argv_idx])) { @@ -2034,13 +1967,12 @@ static void usage(void) #if !defined(UNIX) mch_msg(_(" --literal Don't expand wildcards\n")); #endif - mch_msg(_(" -v Vi mode (like \"vi\")\n")); - mch_msg(_(" -e Ex mode (like \"ex\")\n")); + mch_msg(_(" -e Ex mode\n")); mch_msg(_(" -E Improved Ex mode\n")); - mch_msg(_(" -s Silent (batch) mode (only for \"ex\")\n")); + mch_msg(_(" -s Silent (batch) mode (only for ex mode)\n")); mch_msg(_(" -d Diff mode\n")); - mch_msg(_(" -R Readonly mode (like \"view\")\n")); - mch_msg(_(" -Z Restricted mode (like \"rvim\")\n")); + mch_msg(_(" -R Readonly mode\n")); + mch_msg(_(" -Z Restricted mode\n")); mch_msg(_(" -m Modifications (writing files) not allowed\n")); mch_msg(_(" -M Modifications in text not allowed\n")); mch_msg(_(" -b Binary mode\n")); |