Add xmllint via ale to neovim
Maintain all dependencies via nix / home-manager. Load xsd schema file. Define nix xmllint for linting.
This commit is contained in:
parent
7d333c703b
commit
8448e85bb1
7
home.nix
7
home.nix
|
@ -146,6 +146,13 @@
|
|||
"borg/exclude".source = ./home/files/borg-exclude;
|
||||
};
|
||||
|
||||
xdg.dataFile = {
|
||||
"xsd/xliff-core-1.2-strict.xsd".source = pkgs.fetchurl {
|
||||
url = "https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd";
|
||||
sha256 = "nzevVk7NJ9X2kVTXz+e6jesfYgyBuUzw6rH0IFx01fg=";
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries = {
|
||||
networkmanager-dmenu = {
|
||||
type = "Application";
|
||||
|
|
|
@ -338,7 +338,12 @@ in {
|
|||
|
||||
{
|
||||
plugin = ale;
|
||||
config = pkgs.lib.fileContents ./neovim/plugins/ale.vim;
|
||||
config = pkgs.lib.fileContents(./neovim/plugins/ale.vim)
|
||||
# Keep line break as fileContents strips last EOL
|
||||
+ ''
|
||||
|
||||
let g:ale_xml_xmllint_executable = '${pkgs.libxml2}/bin/xmllint'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -5,9 +5,8 @@ syn spell toplevel
|
|||
syn region xmlString contained start=+"+ end=+"+ contains=xmlEntity,@NoSpell display
|
||||
syn region xmlString contained start=+'+ end=+'+ contains=xmlEntity,@NoSpell display
|
||||
|
||||
" TODO: Find a way to distribute the files
|
||||
" augroup xliff
|
||||
" autocmd!
|
||||
" autocmd BufEnter **/*.xlf :let g:syntastic_xml_xmllint_args = '-schema ~/.dotfiles/xsd/xliff-core-1.2-strict.xsd'
|
||||
" autocmd BufEnter **/*.xlf :let g:ale_xml_xmllint_options = '-schema ~/.dotfiles/xsd/xliff-core-1.2-strict.xsd'
|
||||
" augroup END
|
||||
augroup xliff
|
||||
autocmd!
|
||||
" xsd is installed via home manager
|
||||
autocmd BufEnter **/*.xlf :let g:ale_xml_xmllint_options = '-schema ~/.local/share/xsd/xliff-core-1.2-strict.xsd'
|
||||
augroup END
|
||||
|
|
Loading…
Reference in a new issue