Vim plugin: does this download the plugin at every use of vim command?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Vim plugin: does this download the plugin at every use of vim command?
Hello,
I am trying to find a way to align a text conversation in a terminal window like we see them in Telegram, or some other instant message services. Id est: our messages are aligned to the right of the screen, with some margin to the left border for long lines; and other people messages just use a margin, so they do not touch the right screen border (this second one is easy with textwidth).
I found a promising plugin called vim-easy-align, which is found here:
Now, vim-plug wants me to put some new lines in my ~/.vimrc :
Code:
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" [MIDDLE PART] Shorthand notation; fetches
" https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
" Initialize plugin system
call plug#end()
" Is there something missing?
The middle part in the above code is where i have my doubt: will https://github.com/junegunn/vim-easy-align be downloaded every time i execute vim? Because it clearly says "fetches https://[...]", and i want to download it just one time.
Where does the "vim-easy-align" plugin get stored? Apparently from your post you can define that for vim. Find that then use an if - then construct to download only if it does not exist. I think on my system the main plugins are at /usr/share/vim/vimfiles/plugin/ . Yours may be different.
It seems from what you posted that you have to tell vim where your user downloaded plugins reside, and define which ones you have and where they come from. Theoretically it should only do the download if it is not already there, but without trying it I don't know. I do not have a ~/.vimrc file, nor have I downloaded any extra plugins so have no detail as to how that works.
Where does the "vim-easy-align" plugin get stored? Apparently from your post you can define that for vim. Find that then use an if - then construct to download only if it does not exist. I think on my system the main plugins are at /usr/share/vim/vimfiles/plugin/. Yours may be different.
Yes, the folder to store plugins is arbitrarily defined in the line:
Code:
call plug#begin('~/.vim/plugged')
The only "rule" is that we should avoid names that are potentially used by Vim itself. I mentioned that vim-plug was installed by me into ~/.vimrc/autoload/. I created this folder.
Quote:
Originally Posted by computersavvy
It seems from what you posted that you have to tell vim where your user downloaded plugins reside, and define which ones you have and where they come from. Theoretically it should only do the download if it is not already there, but without trying it I don't know. I do not have a ~/.vimrc file, nor have I downloaded any extra plugins so have no detail as to how that works.
Yes. I do not want that it tries to download the plugin until i decide to update it - if ever. But dugan said it pretty clear: it will not download it again, unless i use the command to install it.
Thank you both! I will just check that i install vim-easy-align successfully, and then i mark this thread as solved.
[...] I think on my system the main plugins are at [b][u]/usr/share/vim/vimfiles/plugin/ . Yours may be different.
This folder does not even exist in my Debian. Maybe it can exist to put globally installed vim plugins. However, there is no point for this idea, here. So, i will stick with my userwide plugin folder. (:
No. Vim-plug only redownloads when you give it the :PlugUpdate command.
I am still locked with this plugin. I made a script in a separate file to download and install the plugin. I do not make it in ~/.vimrc because i only want one download, as said. I tried to :source 3 files, and none worked:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.