Archive

Posts Tagged ‘vim’

Использование табов (вкладок) в VIM 7

March 10th, 2009 No comments

Открыть несколько файлов, каждый в своем табе:
$ vim -p file1 file2 file3
Открыть файл для редактирования в новом табе:
:tabe /path/to/file
Закрыть таб:
:tabc или :wq или ZZ
Перейти к следующему табу:
:tabn
Перейти к предыдущему табу:
:tabp
Вывести список открытых табов:
:tabs
Справка по табам:
:help tabpage

Tags:

VIM

February 28th, 2009 No comments

Vim is a virtually compatible, extremely enhanced, version of the UNIX
text editor vi.

There are a lot of enhancements above Vi: multi level undo, multi-windows
and buffers, syntax highlighting, command line editing, filename completion,
on-line help, visual selection, etc..

Many features above standard vi’s have been added:
multiple windows and buffers, multi level undo, command line history,
filename completion, selection highlighting, block operations (including
column/rectangular blocks), syntax highlighting, on-line help, etc.
Embeded Perl, Tcl, and Python support.
See “:help vi_diff” for a summary of the differences between Vim and Vi.

An X-windows aware or a full X-windows GUI version can also be built
that allows full use of the mouse and pull-down menus

See http://www.vim.org/why.html for a full explanation of Vim’s features.

Portability to all UNIX platforms, AmigaOS, Archimedes, Atari MiNT, BeOS,
M$-DOS, MacOS, OS/2, VMS, WinNT+Win95.

– David (obrien@cs.ucdavis.edu)
WWW: http://www.vim.org/

Для начала уберем поддержку X11 – в файле /usr/local/etc/pkgtools.conf должно быть следующее:

1
2
3
  MAKE_ARGS = {
        'editors/vim' => 'WITHOUT_X11=1',
  }

Устанавливаем:

1
# portinstall vim

Производим небольшую настройку в файле ~/.vimrc:

1
2
3
4
5
6
7
8
set title
set fdm=marker
set shiftwidth=4
set ts=4
set ruler
au BufReadPost * if line("'"") > 0 && line("'"") <= line("$") | exe "normal g'"" | endif
syntax on
set nomodeline
Tags: