3

It's described in :h startup/§:h load-plugins. You'll see that indeed plugin files are loaded only once. Yet, most plugin files have guards. They mainly serve to permit end-user to not load an installed plugin file. This was particularly useful in the old days when we didn't have 'runtimepath' managers (aka plugin managers), nor vim 8 packages, or when ...


2

To just add a bit more to this, take a look at :help expression-syntax specifically expr9 which shows you can use &option to evaluate the option to its numerical value. In Vimscript, 0 is false and non-zero is true. With that said, cp is an abbreviation of compatible and that means the if condition is checking the numeric value of the boolean compatible ...


2

You have a few options, though some depend on plugin-authors to follow best-practices. vim --noplugin is kind of a nuclear option. You can combine with -Nu NONE or other -u options to get varying levels of "just my config" (though, if you put config files in ~/.vim/plugin/ like me, this will disable those too) let g:loaded_<plugin> = 1: most ...


2

VimScript is still standard. It's supported by both Vim and Neovim and doesn't need any external dependencies or setup. This makes it #1 choice under any circumstances. However, as VimScript is purely interpreted, it could become very slow on loops with a huge number of iterations (or, better to say, other languages can use JIT-compilers etc. not to get so ...


2

Well, we're looking at two different cases with the examples you provided: when the file type is recognized by Vim and when it's not. Combined with the fact that Vim gives you four ways to deal with file types that haven't yet been identified and some confusion is understandable. Before answering the question of why the filetypedetect method isn't used, let'...


2

Looks like your ~/.vim/plugin/localvimrc.vim is an older version (pre v3.1.0) of the embear/vim-localvimrc plug-in. A recent commit (well, from over a year ago, but released as v3.1.0) fixed an issue such as the one you described. See commit 7974cd4872. Before that commit, line 491 used to have: catch ^Vim\%((\a\+)\)\=:E48 After that commit, code was ...


2

Most “core” filetype features are covered by autocommands, so disabling them will have the effect that you want. But we only want to disable them when opening a particular file, so :noautocmd edit {file} I’ll update with more information on the autocommands and features when I get to my laptop.


2

To load regular plugin files: runtime! plugin/**/*.vim (from :help startup, under :help load-plugins) For packages, the story is a bit more complex. What I can suss out: :packloadall loads non-optional (i.e., start) packages; use the ! to force it ("Packages will be loaded only once. […] When the optional ! is added this command will load packages ...


1

There are two related options: packpath and runtimepath. If you set packpath then all plugins sub-trees must reside under pack/<bundle>/{start,opt} to comply with :h packages. If you set runtimepath directly then you must add every separate plugin subtree to runtimepath (and then also runtime! plugin/**/*.vim manually in case you have any). Also, you'...


1

Those are trailing whitespaces highlighted as error. Most probably they are from vim-polyglot plugin: https://github.com/sheerun/vim-polyglot/blob/4af1321588c7dcb718022226cb27ec325973c2f0/syntax/python.vim#L160 To "fix" it: Either remove those spaces from the file Or add let g:python_highlight_space_errors = 0 to your config.


1

You shouldn't alter the base vim configuration. Instead, you should put this in your user's vim configuration directory, which on macOS would be ~/.vim i.e. ~/.vim/autoload/plug.vim. To answer you actual question as to why it is removed as soon as it is downloaded, how are you trying to write to that directory? As you mention "save file as" I can ...


1

The syntax rules are typically named after the 'filetype' set for the buffer, which in turn is typically detected (based on file extension, file name, or file contents) and usually set automatically. If you want to extend syntax highlighting for Python, then you should typically name your script after the "python" filetype. When Vim loads syntax ...


1

That's an interesting question! To my knowledge, there is no option to do so. I think it's better to let the user chose his own mapping to avoid collisions. This is the reason why some plugins use <Plug> for their features (see :help using-<Plug>). I am happy to see that you are keen on plugins (they are really useful), but I suggest you to not ...


1

using the command runtime! syntax/java.vim will execute all the commands from the specified syntax file. It does the trick but the syntax variable is still set to the filetype as explained by the answer of mMontu


1

Two solutions: On a current windows 10 machine that I have access to for work with a user account only, I was able to sucessfully install the standard vim version, named 'self-installing executeable' that is available here: https://ftp.nluug.nl/pub/vim/pc/gvim82.exe Administrator access was not required. This version comes with an autoload folder (unlike ...


Only top voted, non community-wiki answers of a minimum length are eligible