Is it possible to install vim for a user?

8

1

I have a SSH Login to a dev computer (used for hosting PHP and Python files). It has vim installed, but a stripped down version of it - it has syntax and whole lot of other stuff disabled .

So, my question is - can I install my own "local" vim without a superuser account?

German Rumm

Posted 2011-01-02T22:20:57.257

Reputation: 183

Question was closed 2016-10-26T21:55:38.390

What kind of OS (or distro) is this? Are you sure it's disabled? What does ":version" say? – Keith – 2011-01-03T00:35:10.560

I'm on CentOS5.5 (according to /etc/issue), or Red Hat 4.1.2-4.6 (according to /proc/version). Yeah, I'm sure it's disabled - I used :version to check it – German Rumm – 2011-01-03T00:46:22.367

1So you're sure the sysadmin can't take 2 seconds to type yum install vim-enhanced ? – Keith – 2011-01-03T01:34:13.527

@Keith, my thoughts exactly. I'm on Ubuntu myself and use package manager exclusively. But our sysadmin apparently doesn't trust repositories, or prefers building from source - because even asking him to reconfigure PHP meets strong resistance. – German Rumm – 2011-01-03T08:26:10.723

Answers

10

  1. Download Vim
  2. Change the prefix:
    1. When compiling, use the option --prefix=/home/myaccount (or whatever you want), or
    2. Edit the prefix option in src/makefile to something like /home/myaccount or just $(HOME) (thanks Heptite!)
  3. When you run make install, it will install the files using the prefix you specified (e.g. binaries will be installed to /home/myaccount/bin)
  4. Change your prefix to include /home/myaccount/bin in .bash_profile or .profile.
  5. Success!!

squircle

Posted 2011-01-02T22:20:57.257

Reputation: 6 365

Looks like #prefix = $(HOME) has been added to the Makefile by default now, so you (supposedly) only need to uncomment it for this to work. – user5359531 – 2017-06-07T19:49:03.880

3While most sources prefer you to run configure by hand, the preferred way to do this kind of thing for Vim is to edit the src/Makefile and change the "prefix" variable to something like $(HOME) – Heptite – 2011-01-02T23:06:37.503

@Heptite Thanks! I added your comment into my answer. – squircle – 2011-01-02T23:27:33.217

Thanks, @thepurplepixel, I tried your solution and it almost worked, but ./configure complains about missing terminal library. I installed ncurses5 using --prefix and tried running vim's configure again, but it still complains. I tried --with-tlib option and without – German Rumm – 2011-01-02T23:37:04.147

@German I don't know that much about it... maybe somebody else can help. – squircle – 2011-01-02T23:59:13.910

3@German Rumm: You need to tell Vim's configure where to find your ncurses installation. Execute export CPPFLAGS="-I/ncursesprefix/include" and export LDFLAGS="-L/ncursesprefix/lib", where /ncursesprefix is the prefix you used to build ncurses. You may need to add the option --with-tlib=ncurses to Vim's configure options. Doing so anyway won't hurt. Then running ./configure ... and make should build Vim with your ncurses library. @Heptite: How is modifying src/Makefile the "preferred" method of changing the prefix? I've always used ./configure --prefix=.... – garyjohn – 2011-01-03T01:04:06.170

@garyjohn the CPPFLAGS/LDFLAGS piece really helped me. You should consider making is a separate answer or edit this one. It's too easy to miss in a comment. Thank you! – Oren S – 2013-01-08T10:00:53.257

1

Maybe copying a binary to the server and chmoding it to executable?

Perhaps you should contect your sysadmin or host to see if they can enable these features for you.

Mike

Posted 2011-01-02T22:20:57.257

Reputation: 11

1Nope, tried that, complains about missing libraries/shared objects. Can't ask sysadmin - he's lazy and kinda stupid (installing svn for 2 months already) – German Rumm – 2011-01-02T23:06:33.990