mirror of https://github.com/Icinga/icinga2.git
parent
f4241ba185
commit
916537b33a
|
@ -325,28 +325,19 @@ to obtain the Vim configuration, please install the extra package `vim-icinga2`.
|
||||||
|
|
||||||
### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
|
### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
|
||||||
|
|
||||||
Create a new local vim configuration storage in your home directory (`~/.vim`), if it doesn't exist already.
|
Install the package vim-icinga2 with your distribution's package manager.
|
||||||
The `~/.vim/syntax` directory contains the actual syntax file and the one in `~/.vim/ftdetect` is used to detect
|
|
||||||
the file type. Both are called `icinga2.vim`.
|
|
||||||
|
|
||||||
$ PREFIX=~/.vim
|
Debian/Ubuntu:
|
||||||
$ mkdir -p $PREFIX/{syntax,ftdetect}
|
|
||||||
$ cd /usr/share/doc/icinga2-common-[x.x.x]/syntax/vim
|
|
||||||
$ cp syntax/icinga2.vim $PREFIX/syntax/
|
|
||||||
$ cp ftdetect/icinga2.vim $PREFIX/ftdetect/
|
|
||||||
|
|
||||||
On Debian systems replace the path `/usr/share/doc/icinga2-common-[x.x.x]/syntax/vim` with `/usr/share/vim/addons`. Alternatively,
|
$ apt-get install vim-icinga2
|
||||||
you can use the `vim-addons` tool to create the `~/.vim/syntax` and `~/.vim/ftdetect` directories and create symlinks to the files
|
|
||||||
in `/usr/share/vim/addons`:
|
|
||||||
|
|
||||||
$ vim-addons install icinga2
|
RHEL/CentOS/Fedora:
|
||||||
Info: installing removed addon 'icinga2' to /home/root/.vim
|
|
||||||
$ ls -l /home/root/.vim/*
|
|
||||||
/home/root/.vim/ftdetect:
|
|
||||||
lrwxrwxrwx 1 root root [...] icinga2.vim -> /usr/share/vim/addons/ftdetect/icinga2.vim
|
|
||||||
|
|
||||||
/home/root/.vim/syntax:
|
$ yum install vim-icinga2
|
||||||
lrwxrwxrwx 1 root root [...] icinga2.vim -> /usr/share/vim/addons/syntax/icinga2.vim
|
|
||||||
|
SLES/openSUSE:
|
||||||
|
|
||||||
|
$ zypper install vim-icinga2
|
||||||
|
|
||||||
Test it:
|
Test it:
|
||||||
|
|
||||||
|
@ -357,19 +348,30 @@ Test it:
|
||||||
|
|
||||||
### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
|
### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
|
||||||
|
|
||||||
Copy the `/etc/nanorc` sample file to your home directory and rename it to `~/.nanorc`. Create the `/etc/nano`
|
Install the package nano-icinga2 with your distribution's package manager.
|
||||||
directory and copy the provided `icinga2.nanorc` into it.
|
|
||||||
|
Debian/Ubuntu:
|
||||||
|
|
||||||
|
$ apt-get install nano-icinga2
|
||||||
|
|
||||||
|
RHEL/CentOS/Fedora:
|
||||||
|
|
||||||
|
$ yum install nano-icinga2
|
||||||
|
|
||||||
|
SLES/openSUSE:
|
||||||
|
|
||||||
|
$ zypper install nano-icinga2
|
||||||
|
|
||||||
|
Copy the `/etc/nanorc` sample file to your home directory.
|
||||||
|
|
||||||
$ cp /etc/nanorc ~/.nanorc
|
$ cp /etc/nanorc ~/.nanorc
|
||||||
# mkdir -p /etc/nano
|
|
||||||
# cp /usr/share/doc/icinga2-common-[x.x.x]/syntax/nano/icinga2.nanorc /etc/nano
|
|
||||||
|
|
||||||
On Debian systems change `/usr/share/doc/icinga2-common-[x.x.x]/syntax/nano/icinga2.nanorc` to `/usr/share/nano/icinga2.nanorc`.
|
On Debian systems change `/usr/share/doc/icinga2-common-[x.x.x]/syntax/nano/icinga2.nanorc` to `/usr/share/nano/icinga2.nanorc`.
|
||||||
|
|
||||||
Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
|
Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
|
||||||
|
|
||||||
## Icinga 2
|
## Icinga 2
|
||||||
include "/etc/nano/icinga2.nanorc"
|
include "/usr/share/nano/icinga2.nanorc"
|
||||||
|
|
||||||
Test it:
|
Test it:
|
||||||
|
|
||||||
|
|
55
icinga2.spec
55
icinga2.spec
|
@ -253,6 +253,27 @@ Provides a GUI for the Icinga 2 API.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%package -n vim-icinga2
|
||||||
|
Summary: Vim syntax highlighting for icinga2
|
||||||
|
Group: Applications/System
|
||||||
|
%if "%{_vendor}" == "suse"
|
||||||
|
Requires: vim-data
|
||||||
|
%else
|
||||||
|
Requires: vim-filesystem
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description -n vim-icinga2
|
||||||
|
Vim syntax highlighting for icinga2
|
||||||
|
|
||||||
|
|
||||||
|
%package -n nano-icinga2
|
||||||
|
Summary: Nano syntax highlighting for icinga2
|
||||||
|
Group: Applications/System
|
||||||
|
Requires: nano
|
||||||
|
|
||||||
|
%description -n nano-icinga2
|
||||||
|
Nano syntax highlighting for icinga2
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%setup -q -n %{name}-%{version}
|
||||||
|
|
||||||
|
@ -378,6 +399,21 @@ mkdir -p %{buildroot}%{_prefix}/lib/firewalld/services
|
||||||
install -p -m 644 tools/firewalld/%{name}.xml %{buildroot}%{_prefix}/lib/firewalld/services
|
install -p -m 644 tools/firewalld/%{name}.xml %{buildroot}%{_prefix}/lib/firewalld/services
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if "%{_vendor}" == "suse"
|
||||||
|
%if 0%{?suse_version} >= 1310
|
||||||
|
install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/syntax/%{name}.vim
|
||||||
|
install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/ftdetect/%{name}.vim
|
||||||
|
%else
|
||||||
|
install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/syntax/%{name}.vim
|
||||||
|
install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/ftdetect/%{name}.vim
|
||||||
|
%endif
|
||||||
|
%else
|
||||||
|
install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim
|
||||||
|
install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
|
||||||
|
%endif
|
||||||
|
|
||||||
|
install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
|
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
|
||||||
|
|
||||||
|
@ -715,4 +751,23 @@ fi
|
||||||
%{_datadir}/applications/icinga2-studio.desktop
|
%{_datadir}/applications/icinga2-studio.desktop
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%files -n vim-icinga2
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%if "%{_vendor}" == "suse"
|
||||||
|
%if 0%{?suse_version} >= 1310
|
||||||
|
%{_datadir}/vim/vim74/syntax/%{name}.vim
|
||||||
|
%{_datadir}/vim/vim74/ftdetect/%{name}.vim
|
||||||
|
%else
|
||||||
|
%{_datadir}/vim/vim72/syntax/%{name}.vim
|
||||||
|
%{_datadir}/vim/vim72/ftdetect/%{name}.vim
|
||||||
|
%endif
|
||||||
|
%else
|
||||||
|
%{_datadir}/vim/vimfiles/syntax/%{name}.vim
|
||||||
|
%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files -n nano-icinga2
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%{_datadir}/nano/%{name}.nanorc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|
Loading…
Reference in New Issue