LINUX.ORG.RU

vim, дополнение из всех открытых буферов


0

1

Сабж. Хочется, чтобы при нажатии C-X C-P/N поиск соответствий происходил по всем открытым буферам, а не только по текущему. Выяснил, что за это отвечает опция complete. судя хелпу

'complete' 'cpt'	string	(default: ".,w,b,u,t,i")
			local to buffer
			{not in Vi}
	This option specifies how keyword completion |ins-completion| works
	when CTRL-P or CTRL-N are used.  It is also used for whole-line
	completion |i_CTRL-X_CTRL-L|.  It indicates the type of completion
	and the places to scan.  It is a comma separated list of flags:
	.	scan the current buffer ('wrapscan' is ignored)
	w	scan buffers from other windows
	b	scan other loaded buffers that are in the buffer list
	u	scan the unloaded buffers that are in the buffer list
	U	scan the buffers that are not in the buffer list
	k	scan the files given with the 'dictionary' option
	kspell  use the currently active spell checking |spell|
	k{dict}	scan the file {dict}.  Several "k" flags can be given,
		patterns are valid too.  For example: >
			:set cpt=k/usr/dict/*,k~/spanish
<	s	scan the files given with the 'thesaurus' option
	s{tsr}	scan the file {tsr}.  Several "s" flags can be given, patterns
		are valid too.
	i	scan current and included files
	d	scan current and included files for defined name or macro
		|i_CTRL-X_CTRL-D|
	]	tag completion
	t	same as "]"

якобы по дефолту уже и так выставлено, что он должен искать сначала в текущем буфере, потом в буферах открытых окон, потом во всех остальных загруженных буферах. однакой буй там плавал. упорно ищет только в текущем буфере. что ему нужно?

★★★★★

УМВР.

:echo &cpt
.,w,b,u,t,i
:badd second_buffer
iololo
<ESC>:bn!
io<C-N>

Как-то так.

anonymous
()

А, пропустил.

C-X C-P/N

С C-X C-N и не будет работать. Эта штука только для C-N и C-P.

anonymous
()
Ответ на: комментарий от vvviperrr

Использую SuperTab и не знаю таких проблем :) Оно иногда теряет контекст, но всегда можно использовать явно C-n/C-p или C-x C-…

Homura_Akemi
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.