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

Looks like you need a library plugin that other plugins can depend on. So far the best way to have library plugins is through autoload plugin files. These files are lazily loaded, they are loaded on demand. EDIT: IOW, the following will be enough " library plugin: autoload/colorname.vim let g:colornames#red = 'rouge' " client plugin let red = g:...


2

Without newish packages feature you can use ~/.vim/plugin/ folder. All vim files you have in this folder are auto sourced using :h :runtime: I do exactly this for my settings: main vimrc is ~45 lines having only core options separate ~/.vim/plugin/mappings.vim file for mappings and commands other separate vim files (foldtext setup, terminal setup etc) ...


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

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

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

You must escape spaces in directory names using a backslash. Also note that "autoload" subdirectory is not a proper place to put your python files.


1

I do now have .vim/bundle/plugin/fetch.vim which I tried adding to my .vimrc, but it fails. If you want to manually install the plug-in by unpacking the files into locations your Vim will find, then you should store the plugin/fetch.vim into ~/.vim/plugin/fetch.vim (no bundle/ element there.) And the plug-in also depends on the autoload/ component, so you ...


1

I would not suggest to use vimball installation if you plan to update/remove plugin later. If you don't want to use plugin managers (all of them are git based afaik) just download plugin source files and put them into ~/.vim/pack/plugins/start/ folder. (Assuming you have not that old vim with packages support :h packages). Or if you have git installed you ...


1

I'm pretty sure it stands for "plugin."


1

The issue was with the "restore-view" plugin. Disabling it solved the issue. I was only using it for saving my folds. That can be achieved my using :mkview and :loadview.


1

So the mistake I had was that in my .gitconfig file instead of having the repos as https://github .... it would have git@github.... I deleted the line that did this and things started to begin cloning


1

The solution that finally worked for me (suggested in comments) was to add the following to my vimrc file: set termguicolors Apparently Vim was not using the full range of colors available to it.


1

With the help of @Matt, we were able to get my new plugins loaded, and markdown folds working. Open vim with the session file vim -S Session.vim Modify sessionoptions by removing options and folds from the sesion options -- :set sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize,terminal ++ :set sessionoptions=blank,buffers,curdir,...


1

It's mainly a pre-plugin manager era thing that permits to prevent a plugin file from being loaded. For people that still install those files directly into ~/.vim/plugin, it still makes sense. It could still make sense if you distribute a plugin (in the new sense:) made of several files that defines different things. But honestly, it'd be simpler in that ...


1

Well, such sort of questions tends to be too vague. But here are a couple of thoughts. If it's solely "for private use", I could even consider modifying $VIMRUNTIME/rgb.txt. Sure, it feels dirty, but if no one else can see it then why the hell is not? You can simply use global variables, as it's "for private use" only. Declare them in your vimrc and they ...


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