How to keep syntax highlighting for buffer throughout vim session

When i open the file

 :e x

and change its file type

 :set ft=plsql

I see the effect of setting the file type, because the keywords in the buffer are highlighted according to the type of file (syntax) that I just installed.

Then I open another file

 :e y

and go back to the file where I set the file type

 :e #

keyword selection is lost, although the file type is still valid.

 :set ft?

confirms that the file type is plsql.

So, how can I make vim so that it keeps highlighting when I go back to the file?

+4
source share
1 answer

, set nohidden (, , set hidden). , , -, . , :e y Vim x. :e #, x: . , filetype, , .

set hidden, y x, , :e # , x ( filetype > set). Vim , , ( Vim, - , ).

: . set hidden. .

+4

Source: https://habr.com/ru/post/1535875/


All Articles