LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 08-18-2021, 11:34 AM   #1
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
Question 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:

https://www.vim.org/scripts/script.php?script_id=4520

BUT following the installation instruction demands another plugin, the vim-plug ("a minimalist Vim plugin manager": https://github.com/junegunn/vim-plug). So, i installed vim-plug by saving the file https://raw.githubusercontent.com/ju...aster/plug.vim into my ~/.vimrc/autoload/ folder.

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.
 
Old 08-18-2021, 11:45 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
No. Vim-plug only redownloads when you give it the :PlugUpdate command.
 
1 members found this post helpful.
Old 08-18-2021, 12:03 PM   #3
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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.
 
Old 08-18-2021, 03:02 PM   #4
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Thumbs up

Quote:
Originally Posted by computersavvy View Post
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 View Post
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.

Last edited by dedec0; 08-18-2021 at 03:12 PM.
 
Old 08-18-2021, 03:17 PM   #5
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by computersavvy View Post
[...] 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. (:
 
Old 08-27-2021, 08:47 PM   #6
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Thumbs down

Quote:
Originally Posted by dugan View Post
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:

Code:
' file 1
call plug#begin('~/.vim/plugged')
PlugInstall 'junegunn/vim-easy-align'
call plug#end()
Code:
' file 2
call plug#begin('~/.vim/plugged')
PlugUpdate 'junegunn/vim-easy-align'
call plug#end()
Code:
' file 3
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
PlugUpdate 'junegunn/vim-easy-align'
call plug#end()
For files 1 and 2, the error is "No plugin to install". For file 3, "No plugin to update". What is wrong?

And do you agree with me that vim-plug should change the text in install instructions about the 'Plug' command? The part i quoted in the first post:

Code:
" [MIDDLE PART] Shorthand notation; fetches 
" https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
Change the word "fetches" so something that points that 'Plug' command will not download anything? Or add this note, somehow.
 
Old 09-01-2021, 04:40 PM   #7
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Question Are you reading me?

Are you reading me? None is saying nothing about my previous post. What is wrong?
 
Old 09-05-2021, 06:55 AM   #8
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Exclamation Thread's title question is answered (download not repeated), but...

Thread's title question is answered (download not repeated), but i am still unable to download that plugin with vim-plug, as detailed in #6.

Can someone, please, say something?
 
  


Reply

Tags
plugin, vim



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fedora shows 'man vim' but when execute 'vim' got "bash: vim: command not found..." ? flash_os Linux - Newbie 19 01-03-2015 11:56 PM
In crontab, how can I schedule a command for every x months or every other DOW charlemagne-is-my-son Linux - Software 1 12-06-2014 10:53 PM
[SOLVED] How do you write <Esc> in the vim command line (:vim command). stf92 Linux - General 6 06-26-2011 05:33 AM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration