Recently, it is necessary to use vim to edit a text file with. cl as the suffix, but vim always automatically highlights the. cl file with. lisp syntax. To prevent file highlighting, add the following statement to. vimrc:
autocmd BufNewFile,BufRead *.cl set filetype=
In doing so, grammar highlighting was successfully removed. However, at the same time, it is found that. cl files still keep the automatic indenting habit of lisp files. I hope its indenting habit will keep java or python’s, so I change it to
autocmd BufNewFile,BufRead *.cl set filetype=python
But there was no success. My.vim file has been set autoindent. How should I solve it?
Today, I happened to see a post which said that it could be nolisp. Then I tried it myself and succeeded. I think it may be that vim automatically recognizes *.cl file as lisp file and then set lisp. as long as you cancel this setting, the indent of the new line will be the same as that of the previous line. In addition, it was found that filetype does not need to be set to Python. I just need to indent like Python and do not need syntax highlighting. Attached are my. vimrc related settings:
set autoindent autocmd BufNewFile,BufRead *.cl set filetype= autocmd BufNewFile,BufRead *.cl set nolisp