vim-plugins: honor the plugin manager re filetype and syntax

Currently, all the filetype and syntax are enabled *after* all the plugins has
already been loaded. Whilst this is the case for Pathogen, it's not
recommended when using VAM.

This commit applies the recommendation for:
- VAM[0]: The filetype and syntax are enabled *before* the plugins are loaded.
- Pathogen[1]: The filetype and syntax are enabled *after* the plugins are loaded.
- Plug[2]: The filetype and syntax are automatically enabled.

[0]: d9e865f3c2 (recommended-setup)
[1]: a553410f1b/README.markdown (runtime-path-manipulation)
[2]: 2f5f74e5e6/README.md (usage)
This commit is contained in:
Wael M. Nasreddine 2020-01-06 14:47:44 -08:00 committed by Jon
parent 5f0327a6e0
commit 8dccb59bac

View File

@ -208,6 +208,8 @@ let
'' ''
let &rtp.=(empty(&rtp)?"":',')."${vimPlugins.pathogen.rtp}" let &rtp.=(empty(&rtp)?"":',')."${vimPlugins.pathogen.rtp}"
execute pathogen#infect('${pluginsEnv}/{}') execute pathogen#infect('${pluginsEnv}/{}')
filetype indent plugin on | syn on
''); '');
/* vim-plug is an extremely popular vim plugin manager. /* vim-plug is an extremely popular vim plugin manager.
@ -259,6 +261,8 @@ let
in assert builtins.hasAttr "vim-addon-manager" knownPlugins; in assert builtins.hasAttr "vim-addon-manager" knownPlugins;
'' ''
filetype indent plugin on | syn on
let g:nix_plugin_locations = {} let g:nix_plugin_locations = {}
${lib.concatMapStrings (plugin: '' ${lib.concatMapStrings (plugin: ''
let g:nix_plugin_locations['${plugin.pname}'] = "${plugin.rtp}" let g:nix_plugin_locations['${plugin.pname}'] = "${plugin.rtp}"
@ -329,10 +333,12 @@ let
set packpath-=~/.vim/after set packpath-=~/.vim/after
set packpath+=${packDir packages} set packpath+=${packDir packages}
set packpath+=~/.vim/after set packpath+=~/.vim/after
filetype indent plugin on | syn on
''); '');
in writeText "vimrc" '' in writeText "vimrc" ''
" minimal setup, generated by NIX " configuration generated by NIX
set nocompatible set nocompatible
${vamImpl} ${vamImpl}
@ -340,8 +346,6 @@ let
${plugImpl} ${plugImpl}
${nativeImpl} ${nativeImpl}
filetype indent plugin on | syn on
${customRC} ${customRC}
''; '';