![]() |
VOOZH | about |
Vim (Vi improved) — это текстовый редактор, основанный на vi. Его можно использовать из командной строки или как отдельное приложение с графическим интерфейсом.
Vim should not be confused with Neovim, a similar program which may be used in its place.
X
|
Link console vim against X11 libraries to enable title and clipboard features in xterm |
acl
|
Add support for Access Control Lists |
crypt
|
Use dev-libs/libsodium for crypto support |
cscope
|
Enable cscope interface |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
gpm
|
Add support for sys-libs/gpm (Console-based mouse driver) |
lua
|
Enable Lua scripting support |
minimal
|
Install a very minimal build (disables, for example, plugins, fonts, most drivers, non-critical features) |
nls
|
Add Native Language Support (using gettext - GNU locale utilities) |
perl
|
Add optional support/bindings for the Perl language |
python
|
Add optional support/bindings for the Python language |
racket
|
Enable support for Scheme using dev-scheme/racket |
ruby
|
Add support/bindings for the Ruby language |
selinux
|
!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur |
sound
|
Enable sound support |
tcl
|
Add support the Tcl language |
terminal
|
Enable terminal emulation support |
vim-pager
|
Install vimpager and vimmanpager links |
wayland
|
Enable dev-libs/wayland backend |
Если поддержка X Window System не требуется, просто установите app-editors/vim:
root #emerge --ask app-editors/vimЧтобы установить Vim как с интерфейсом на основе ncurses (/usr/bin/vim), так и с графическим интерфейсом (для X Window System — /usr/bin/gvim), установите пакет app-editors/gvim:
root #emerge --ask app-editors/gvimVim has support for packages, which provide a native mechanism to extend functionality. Read the built-in packages documentation for more information: :help packages
Категория app-vim содержит множество дополнительных спецификаций синтаксиса, плагины и прочие вещи, относящиеся к Vim.
Используйте emerge или eix, чтобы получить обзор существующих пакетов в категории app-vim:
user $emerge --search "%@^app-vim"
user $eix -cC app-vimNot all Vim plugins will be available in the Gentoo repository. Vim now includes native packages, as a way to install plugins, and there are also several plugin managers for Vim.
Vim можно настроить для каждого пользователя или с помощью общесистемного конфигурационного файла:
From version 9.1.0327 Vim adopts freedesktop XDG Base Directory Specification: that means, you can now place your configuration files under ~/.config/vim/ so Vim will stop littering your home directory.
Want to share the same config for root or other users? Softlink it:
root #ln -s /home/someUserName/.config/vim /root/.config/vimAbout a dozen color schemes are shipped with the core Vim package. They can be listed in last line mode by typing colorscheme (followed by a space), then pressing either + or pressing the key twice:
:colorscheme blue darkblue default delek desert elflord evening industry koehler morning murphy pablo peachpuff ron shine slate torte zellner
They can be changed in Vim by using the colorscheme (alternatively use colo) command while in last line mode:
:colorscheme peachpuffColor schemes can be permanently applied in the .vimrc file. Note that the syntax on line is also needed for activation:
~/.vimrccolorscheme peachpuff syntax on
The first line sets the default color scheme while the last line activates the color scheme.
If Vim - and only Vim - is installed, the vi command should launch Vim. If other vi-like editors are installed, eselect may be used to choose which editor the vi command launches.
The text editor article may also be of interest for setting a system default editor, if Vim is to be set as the default.
To enable support for the Gentoo syntax plugin (app-vim/gentoo-syntax) within vim, add the following lines to the user's ~/.vimrc file:
~/.vimrcfiletype plugin on filetype indent on
From the command line:
user $vim --helpvim --help VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov 26 2021 11:56:27) Usage: vim [arguments] [file ..] edit specified file(s) or: vim [arguments] - read text from stdin or: vim [arguments] -t tag edit file where tag is defined or: vim [arguments] -q [errorfile] edit file with first error Arguments: -- Only file names after this -v Vi mode (like "vi") -e Ex mode (like "ex") -E Improved Ex mode -s Silent (batch) mode (only for "ex") -d Diff mode (like "vimdiff") -y Easy mode (like "evim", modeless) -R Readonly mode (like "view") -Z Restricted mode (like "rvim") -m Modifications (writing files) not allowed -M Modifications in text not allowed -b Binary mode -l Lisp mode -C Compatible with Vi: 'compatible' -N Not fully Vi compatible: 'nocompatible' -V[N][fname] Be verbose [level N] [log messages to fname] -D Debugging mode -n No swap file, use memory only -r List swap files and exit -r (with file name) Recover crashed session -L Same as -r -A Start in Arabic mode -H Start in Hebrew mode -T <terminal> Set terminal type to <terminal> --not-a-term Skip warning for input/output not being a terminal --ttyfail Exit if input or output is not a terminal -u <vimrc> Use <vimrc> instead of any .vimrc --noplugin Don't load plugin scripts -p[N] Open N tab pages (default: one for each file) -o[N] Open N windows (default: one for each file) -O[N] Like -o but split vertically + Start at end of file +<lnum> Start at line <lnum> --cmd <command> Execute <command> before loading any vimrc file -c <command> Execute <command> after loading the first file -S <session> Source file <session> after loading the first file -s <scriptin> Read Normal mode commands from file <scriptin> -w <scriptout> Append all typed commands to file <scriptout> -W <scriptout> Write all typed commands to file <scriptout> -x Edit encrypted files --startuptime <file> Write startup timing messages to <file> -i <viminfo> Use <viminfo> instead of .viminfo --clean 'nocompatible', Vim defaults, no plugins, no viminfo -h or --help Print Help (this message) and exit --version Print version information and exit
The vi command may also be used to launch Vim, if so configured.
Specify a name, to open an existing file, or to create a new one:
user $vim <filename>В Vim есть встроенный учебник, который требует около 30 минут на изучение. Запустите его, используя команду vimtutor:
user $vimtutorVim можно использовать для создания однострочников — выполняющихся без человеческого участия команд, применимых в скриптах или при работе из командной строки.
К примеру, следующая команда добавляет # в начало каждой строки файла file.txt:
user $vim -c ":%s/^/#/g" -c ":x" file.txtЧто тут происходит? Vim интерпретирует переданные ему (через параметр -c) команды. Первой идет команда поиска и замены Vim (очень похожая на аналогичную команду sed), второй — команда сохранения файла и выхода из редактора.
Чтобы изменить кодировку файла на UTF-8, используйте следующую команду (в режиме последней строки):
:e ++enc=utf8Как показано в предыдущем примере, можно сделать это и из командной строки:
user $vim -c ":wq! ++enc=utf8" file.txtFor someone entering vim without first having learned how to use it, it may not be obvious how to quit.
Press several times, then , , . To quit without saving, press several times, then , , , .
If several files are open, try pressing several times, then , , , . To quit without saving, press several times, then , , , , .
If this doesn't help, and desperate measures are needed, something like killall vim may be a last ditch solution (from another terminal). Beware that this will terminate all the vim sessions for a user, without saving. If run as root, such a command will terminate all vim sessions for all users on the system.
Say the following text is trying to be pasted into a Vim buffer:
some: yaml: - data - structured in: - this - shape that: - VIM - may not: like
Vim may interpret this with autotabbing, breaking the paste:
some: yaml: - data - structured in: - this - shape that: - VIM - may not: like
To correct this, run the following command: :set paste to enable Vim's paste mode, once the paste is completed, :set nopaste can be used to go back to the previous settings.
user $vim foobarE1187: Failed to source defaults.vim Press ENTER or type command to continue
Seems solved by destabilize 8.2.4328.
sphinx2-build на sphinx-build в SPHINXBUILD в файле rst/en/Makefile. Запустите ./makedist.sh. Читайте PDF в ./dist/vimpourleshumains/.