Answer the question
In order to leave comments, you need to log in
How to make vim highlight syntax in .conf files?
Good day everyone!
I ran into a problem here, although it is a little strange. There are two machines, both are running FreeBSD 10.3-RELEASE, installed the vim editor on both machines. But an incomprehensible situation arose. On one machine, the syntax in the editor is highlighted in all files, but only in the configuration files of vim itself and newly created ones, but in rc.conf it does not want to highlight in any way.
Configuration from the first machine /usr/local/etc/vim/vimrc
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif
let g:is_posix = 1
set nocompatible
set bs=indent,eol,start
set history=50
set ruler
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
if has("autocmd")
augroup freebsd
autocmd!
if $PORTSDIR != ""
autocmd BufNewFile $PORTSDIR/*/*/Makefile 0r $PORTSDIR/Templates/Makefile
else
autocmd BufNewFile /usr/ports/*/*/Makefile 0r /usr/ports/Templates/Makefile
endif
endif
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif
let g:is_posix = 1
set nocompatible
set bs=indent,eol,start
set history=50
set ruler
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
if has("autocmd")
augroup freebsd
autocmd!
if $PORTSDIR != ""
autocmd BufNewFile $PORTSDIR/*/*/Makefile 0r $PORTSDIR/Templates/Makefile
else
autocmd BufNewFile /usr/ports/*/*/Makefile 0r /usr/ports/Templates/Makefile
endif
endif
Answer the question
In order to leave comments, you need to log in
The problem with copy-paste in visual mode is treated by adding the line set mouse=v to vimrc. Do you have exactly the same vim installed on both wheelbarrows? $pkginfo | grep vim
I prefer to just put one reference .vimrc with all the settings into my user's hamster on the newly installed server and work with highlighting and all the necessary features.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question