8

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?

  • What kind of OS (or distro) is this? Are you sure it's disabled? What does ":version" say? – Keith Jan 3 '11 at 0:35
  • 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 Jan 3 '11 at 0:46
  • 1
    So you're sure the sysadmin can't take 2 seconds to type yum install vim-enhanced ? – Keith Jan 3 '11 at 1:34
  • @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 Jan 3 '11 at 8:26
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!!
  • 3
    While 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 Jan 2 '11 at 23:06
  • @Heptite Thanks! I added your comment into my answer. – squircle Jan 2 '11 at 23:27
  • 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 Jan 2 '11 at 23:37
  • @German I don't know that much about it... maybe somebody else can help. – squircle Jan 2 '11 at 23:59
  • 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 Jan 3 '11 at 1:04
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.

  • 1
    Nope, 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 Jan 2 '11 at 23:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.