VIM-Crypt help

148 views
Skip to first unread message

KasperH

unread,
Nov 23, 2010, 5:14:57 PM11/23/10
to vim_use
Hi,

I am using a (vi -x) crypted file with my passwords, copying it for
backup to various systems.
I created this file in a CygWin environment on WinXP
I expected, that I could open it on other linux/unix platforms. It
works on hp-ux for example.
Now I migrated one XP/Cygwin environment to Fedora 14, and to my
suprise, vi does not know option -x.....

[kas@fedje ~]$ vi -x
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 16 2010 17:05:33)
Unknown option argument: "-x"
More info with: "vim -h"
[kas@fedje ~]$ vim -h
Command not found.

I already noticed a similar situation on my little Ubuntu 8.04 server,
but ignored it, since I had the XP/Cygwin.

I am really surprised that two products from the RedHat stable have
different implementations of vi/vim

what do I need to do, to be able to do my familiar 'vi -x' on the
Fedora 14 (and possibly Ubuntu 8.04)

thanks for your time
Kasper

Anurag Priyam

unread,
Nov 24, 2010, 12:23:30 AM11/24/10
to vim...@googlegroups.com
> what do I need to do, to be able to do my familiar 'vi -x' on the
> Fedora 14 (and possibly Ubuntu 8.04)

Are you sure you are running "vim"/"vim-enhanced" and not
"vim-tiny"/"vim-minimal" (Debian/Fedora)?

--
Anurag Priyam,
3rd Year Undergraduate,
Department of Mechanical Engineering,
IIT Kharagpur.
+91-9775550642

KasperH

unread,
Nov 24, 2010, 1:42:02 AM11/24/10
to vim_use
How do I find out if I do? I installed the "default"

Anurag Priyam

unread,
Nov 24, 2010, 1:55:21 AM11/24/10
to vim...@googlegroups.com
> How do I find out if I do? I installed the "default"

Use your package manager. On Ubuntu, "sudo aptitude show vim" will
bring up all the vim packages. An 'i' on the first column indicates
that the package is installed on your system. So you could very well
do "sudo aptitude show vim | grep '^i'". See if vim, appears in that
list or vim-tiny.

Don't know about Fedora.

KasperH

unread,
Nov 24, 2010, 3:40:32 AM11/24/10
to vim_use
for completeness, CygWin:
$ vi -k
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 11 2010 17:36:58)
Unknown option argument: "-k"
More info with: "vim -h"


root@my-ubuntu:~# aptitude show vim
Package: vim
State: not installed
Version: 1:7.1-138+1ubuntu3.1
Priority: optioneel
Section: editors
Maintainer: Ubuntu Core Developers <ubuntu-devel-
dis...@lists.ubuntu.com>
Uncompressed Size: 1589k
Depends: libc6 (>= 2.4), libgpmg1 (>= 1.19.6-1), libncurses5 (>=
5.6+20071006-3), python2.5 (>= 2.5), vim-common (=
1:7.1-138+1ubuntu3.1), vim-runtime (= 1:7.1-138+1ubuntu3.1)
Suggests: ctags, vim-doc, vim-scripts
Provides: editor
Description: Vi IMproved - enhanced vi editor
Vim is an almost compatible version of the UNIX editor Vi.

Many new features have been added: multi level undo, syntax
highlighting,
command line history, on-line help, filename completion, block
operations,
folding, Unicode support, etc.

This package contain a version of vim compiled with a rather standard
set of
features. This package does not provide a GUI version of Vim. See
the other
vim-* packages if you need more (or less).
Homepage: http://www.vim.org/


so vim is not installed, but vi reports it is: " VIM - Vi IMproved "

right...
now I am confused, even more, since www.vim.org reports 7.3 to be the
last version, and fedora 14 reports 7.5.....

bill lam

unread,
Nov 24, 2010, 4:01:42 AM11/24/10
to vim_use
vim should be a meta package.
try
sudo aptitude search vim

vim-tiny should already installed. choose either vim-gtk (with gvim) or
vim-nox (without gvim) should provide big or huge feature.

and please don't top post.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

Christian Brabandt

unread,
Nov 24, 2010, 4:16:07 AM11/24/10
to vim...@googlegroups.com
(Please don't top post).

On Wed, November 24, 2010 9:40 am, KasperH wrote:
> for completeness, CygWin:
> $ vi -k
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 11 2010 17:36:58)
> Unknown option argument: "-k"
> More info with: "vim -h"

There is no option -k.

Please show the output of :version. That should give us some
information, which vi clone is installed and in case of vim,
how it was compiled. For vim, to support -x, it needs at least
a normal build (that is no small or tiny version, see output of
:version)

> root@my-ubuntu:~# aptitude show vim

On a Debian derived distribution, use something like
~$ dpkg -l 'vim*' |grep '^ii'

I don't know for rpm-based distributions.

regards,
Christian

KasperH

unread,
Nov 24, 2010, 5:36:44 AM11/24/10
to vim_use
I know -k is invalid, it gives me the brief version output.
I 've looked at the output of "vi --version" on all three,
turns out:

Cygwin:
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 11 2010 17:36:58)
Included patches: 1-264
Compiled by http://cygwin.com/
Huge version without GUI. Features included (+) or not (-):
<...>

Ubuntu 8.04:
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 8 2009 02:12:14)
Included patches: 1-138
Compiled by bui...@rothera.buildd
Small version without GUI. Features included (+) or not (-):

Fedora 14:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 16 2010 17:05:33)
Included patches: 1-56
Modified by <bugz...@redhat.com>
Compiled by <bugz...@redhat.com>
Small version without GUI. Features included (+) or not (-):


So I have the Small versions on Ubuntu and Fedora
I do not want to polute this thread with all the +'s and -'s, too bad
I cannot attach a text file with the whole script(1) output.

I'll have a look at vim.org for the "Huge" versions

Christian Brabandt

unread,
Nov 24, 2010, 6:30:37 AM11/24/10
to vim...@googlegroups.com
On Wed, November 24, 2010 11:36 am, KasperH wrote:
> I know -k is invalid, it gives me the brief version output.

Ah, clever.

> I 've looked at the output of "vi --version" on all three,
> turns out:
>
> Cygwin:
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 11 2010 17:36:58)
> Included patches: 1-264
> Compiled by http://cygwin.com/
> Huge version without GUI. Features included (+) or not (-):
> <...>
>
> Ubuntu 8.04:
> VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 8 2009 02:12:14)
> Included patches: 1-138
> Compiled by bui...@rothera.buildd
> Small version without GUI. Features included (+) or not (-):

Try apt-get install vim-gtk or vim-nox for huge versions,
or simply vim for a standard (I believe a normal) build.

> Fedora 14:
> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 16 2010 17:05:33)
> Included patches: 1-56
> Modified by <bugz...@redhat.com>
> Compiled by <bugz...@redhat.com>
> Small version without GUI. Features included (+) or not (-):

I think, fedoras version is called vim-enhanced or vim-x11 for the
gui support.

> So I have the Small versions on Ubuntu and Fedora
> I do not want to polute this thread with all the +'s and -'s, too bad
> I cannot attach a text file with the whole script(1) output.

Attaching files should work here.

> I'll have a look at vim.org for the "Huge" versions

You should prefer using packages provided by your distribution.

regards,
Christian

KasperH

unread,
Nov 24, 2010, 7:12:50 AM11/24/10
to vim_use
> try
> sudo aptitude search vim
>
> vim-tiny should already installed.  choose either vim-gtk (with gvim) or
> vim-nox (without gvim) should provide big or huge feature.
>
> and please don't top post.
got it

indeed vim-tiny and vim-common are installed.
on Ubuntu: apt-get install vim-nox
gives me the Huge version, containing -x option
now I like to fix it on Fedora 14, but cannot find the right bundle/
package

KasperH

unread,
Nov 24, 2010, 7:23:13 AM11/24/10
to vim_use
> I think, fedoras version is called vim-enhanced or vim-x11 for the
> gui support.
>
> > So I have the Small versions on Ubuntu and Fedora
> > I do not want to polute this thread with all the +'s and -'s, too bad
> > I cannot attach a text file with the whole script(1) output.
>
> Attaching files should work here.
>
> > I'll have a look at vim.org for the "Huge" versions
>
> You should prefer using packages provided by your distribution.

YES! vim-enhanced is the package for Fedora 14, I've got the Huge
version on both systems now, and can decrypt my crypted file with "vi -
x"

I preffer distribution provided packages too, but if it is not
available, then..
how/where could I have discovered the existance of vim-enhanced. I've
been searching for some time now (apparently not in the right
direction)

Greetz,
Kasper

Anurag Priyam

unread,
Nov 24, 2010, 7:33:04 AM11/24/10
to vim...@googlegroups.com
> I preffer distribution provided packages too, but if it is not
> available, then..
> how/where could I have discovered the existance of vim-enhanced. I've
> been searching for some time now (apparently not in the right
> direction)

Get source and compile it. AFAIK, vim-tiy, vim-nox, or vim-gui are
compiled from the same source with different flags. So, different vim
exists only in a distribution's package system. I might be wrong on
this though.

Tim Chase

unread,
Nov 24, 2010, 8:12:13 AM11/24/10
to vim...@googlegroups.com, KasperH
On 11/24/2010 06:23 AM, KasperH wrote:
> I preffer distribution provided packages too, but if it is
> not available, then.. how/where could I have discovered the
> existance of vim-enhanced. I've been searching for some time
> now (apparently not in the right direction)

Unfortunately, the process generally runs exactly as it played
out here for you.

1) You discover "why doesn't vim's $USEFUL_FEATURE work"?

2) you take a look at the output of :version

3) you see it's missing LOTS of stuff in the compile-time flags
(lots of "-option" entries)

4) you note that the description contains something like "small
version, compiled without GUI"

5) you go rummage around in your package-manager for other
possible "non-small" versions of vim & install it


Additionally, on my Debian-lineage boxes, the update-alternatives
script allows me to have multiple versions of vim installed
(vim.tiny, vim.gtk, etc) and then specify which one is executed
when I run "vi". So sometimes when I've done an upgrade,
something usurps my preference (vim.gtk in this case) and rebinds
it to vim.tiny so I have to re-run "update-alternatives" (as root
or under sudo) to restore my preference.

Most distros come with a stripped-down version, leaving more room
on the install-media for other stuff. They figure that if you're
a power-vi-user, you'll either use it as vi or download a
souped-up version of vim if you want it. Especially as fewer
folks know vi/vim these days (with other editors like nano, kate,
jed, etc that are kinder to beginners).

-tim

Christian Brabandt

unread,
Nov 24, 2010, 8:13:47 AM11/24/10
to vim...@googlegroups.com
On Wed, November 24, 2010 1:23 pm, KasperH wrote:
> YES! vim-enhanced is the package for Fedora 14, I've got the Huge
> version on both systems now, and can decrypt my crypted file with "vi -
> x"
>
[...]

> how/where could I have discovered the existance of vim-enhanced. I've
> been searching for some time now (apparently not in the right
> direction)

That was pretty easy. I was googling for vim packages fedora
and the first link was somewhere on admin.fedoraproject.org
Then on the left side, I clicked on "Packages" and followed
the navigation to vim.

regards,
Christian

KasperH

unread,
Dec 26, 2011, 7:12:03 AM12/26/11
to vim...@googlegroups.com
On Wednesday, November 24, 2010 1:23:13 PM UTC+1, KasperH wrote:

YES!  vim-enhanced is the package for Fedora 14, I've got the Huge
version on both systems now, and can decrypt my crypted file with "vi -x"

<..> 

on a newly installed Fedora 14 system (running Amahi, headless),
I have another issue. I did not notice it on the previously used Ubuntu and Fedora 14 systems. they do not exist anymore, so no reference.

considering the solution to my primairy issue, I installed vim-enhanced.
for "vi -x" it works fine, however view(1) does not prompt for a password, and immediately shows the garbage

when I want to edit the crypted file, I use "vi", not "vim"

[root@hda ~]# ll /bin/vi
-rwxr-xr-x 1 root root 787200 Sep 21 11:27 /bin/vi
[root@hda ~]# ll /bin/view
lrwxrwxrwx. 1 root root 2 Nov 11 21:55 /bin/view -> vi
[root@hda ~]# ll /usr/bin/vim
-rwxr-xr-x 1 root root 2105272 Sep 21 11:27 /usr/bin/vim
[root@hda ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@hda ~]#


so when I "vi" a file, it use vim(1), although PATH hits /bin before /usr/bin

/bin/vi --version  shows it is the Small version
/usr/bin/vim --version shows it is the Huge version

I'm lost, my goal is to use view(1) in "Huge mode" and not corrupt the package structure




Tony Mechelynck

unread,
Dec 26, 2011, 7:42:49 AM12/26/11
to vim...@googlegroups.com, KasperH

To use the vim executable by default:

cd /usr/bin
ln -sv vim view
ln -sv vim vimdiff

etc., see :help ex

(don't link gvim, gview, etc. unless your vim is GUI-enabled of course).
This way, /usr/bin/view (-> vim in the same directory) will be found
before /bin/view (-> vi in the same directory), so no need to remove the
other symlink.


Best regards,
Tony.
--
"When you have to kill a man it costs nothing to be polite."
-- Winston Curchill, On formal declarations of war

KasperH

unread,
Dec 26, 2011, 3:53:29 PM12/26/11
to vim_use
On 26 dec, 13:42, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 26/12/11 13:12, KasperH wrote:
> > on a newly installed Fedora 14 system (running Amahi, headless),
> > I have another issue. I did not notice it on the previously used Ubuntu
> > and Fedora 14 systems. they do not exist anymore, so no reference.
>
> > considering the solution to my primairy issue, I installedvim-enhanced.
> > for "vi -x" it works fine, however view(1) does not prompt for a
> > password, and immediately shows the garbage
>
> > when I want to edit the crypted file, I use "vi", not "vim"
>
> > [root@hda ~]# ll /bin/vi
> > -rwxr-xr-x 1 root root 787200 Sep 21 11:27 /bin/vi
> > [root@hda ~]# ll /bin/view
> > lrwxrwxrwx. 1 root root 2 Nov 11 21:55 /bin/view -> vi
> > [root@hda ~]# ll /usr/bin/vim
> > -rwxr-xr-x 1 root root 2105272 Sep 21 11:27 /usr/bin/vim
> > [root@hda ~]# echo $PATH
> > /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
> > [root@hda ~]#
>
> > so when I "vi" a file, it usevim(1), although PATH hits /bin before
> > /usr/bin
>
> > /bin/vi --version shows it is the Small version
> > /usr/bin/vim--version shows it is the Huge version
>
> > I'm lost, my goal is to use view(1) in "Huge mode" and not corrupt the
> > package structure
>
> To use thevimexecutable by default:
>
> cd /usr/bin
> ln -svvimview
> ln -svvimvimdiff
>
> etc., see :help ex
>
> (don't link gvim, gview, etc. unless yourvimis GUI-enabled of course).
> This way, /usr/bin/view (->vimin the same directory) will be found
> before /bin/view (-> vi in the same directory), so no need to remove the
> other symlink.
>
> Best regards,
> Tony.
> --
> "When you have to kill a man it costs nothing to be polite."
>                 -- Winston Curchill, On formal declarations of war



Thanks Tony for the prompt response, however..
it did not work.

I did the "ll's" (ll /bin/vi) as root, after a "which(1)", so in fact:
[root@hda ~]# ll `which vi`
-rwxr-xr-x 1 root root 787200 Sep 21 11:27 /bin/vi
[root@hda ~]# ll `which vim`
-rwxr-xr-x 1 root root 2105272 Sep 21 11:27 /usr/bin/vim
[root@hda ~]# ll `which view`
lrwxrwxrwx. 1 root root 2 Nov 11 21:55 /bin/view -> vi
[root@hda ~]#
now as regular user (kas):
[kas@hda ~]$ ll `which vi`
ls: cannot access alias: No such file or directory
ls: cannot access vi='vim': No such file or directory
-rwxr-xr-x 1 root root 2105272 Sep 21 11:27 /usr/bin/vim
[kas@hda ~]$ ll `which vim`
-rwxr-xr-x 1 root root 2105272 Sep 21 11:27 /usr/bin/vim
[kas@hda ~]$ ll `which view`
lrwxrwxrwx. 1 root root 2 Nov 11 21:55 /bin/view -> vi
[kas@hda ~]$

so it is the alias, that precedes the PATH and gives me /usr/bin/
vim(1), when I type vi(1), but /bin/view when I type view(1)
alias view='vim' now view opens the crypted file in expected way,
but.. in RW mode
alias view='/usr/bin/view' (the /usr/bin/vim linked) opens the crypted
in expected way, and ReadOnly

on another F14 Amahi system, that had not yet vim-enhanced installed:

login as: kas
password:
[kas@localhost ~]$ ll `which vi`
-rwxr-xr-x 1 root root 787200 Sep 21 11:27 /bin/vi
[kas@localhost ~]$ ll `which view`
lrwxrwxrwx. 1 root root 2 Dec 4 11:28 /bin/view -> vi
[kas@localhost ~]$ ll `which vim`
/usr/bin/which: no vim in (/usr/local/bin:/bin:/usr/bin:/usr/local/
sbin:/usr/sbin:/sbin:/home/kas/bin)
[kas@localhost ~]$ su -
Password:
[root@localhost ~]# yum install vim-enhanced
<..>
Running Transaction
Installing : gpm-
libs-1.20.6-11.fc14.x86_64 1/4
Installing : 2:vim-
filesystem-7.3.315-1.fc14.x86_64 2/4
Installing : 2:vim-
common-7.3.315-1.fc14.x86_64 3/4
Installing : 2:vim-
enhanced-7.3.315-1.fc14.x86_64 4/4

Installed:
vim-enhanced.x86_64 2:7.3.315-1.fc14

Dependency Installed:
gpm-libs.x86_64 0:1.20.6-11.fc14 vim-common.x86_64
2:7.3.315-1.fc14
vim-filesystem.x86_64 2:7.3.315-1.fc14

Complete!
[root@localhost ~]# su - kas
[kas@localhost ~]$ alias
<..>
alias vi='vim'
<..>
[kas@localhost ~]$ ll `which vim`
-rwxr-xr-x 1 root root 2064504 Sep 21 11:27 /usr/bin/vim
[kas@localhost ~]$ ll /usr/bin/vi*
-rwxr-xr-x 1 root root 2064504 Sep 21 11:27 /usr/bin/vim
lrwxrwxrwx 1 root root 3 Dec 26 21:33 /usr/bin/vimdiff -> vim
-rwxr-xr-x 1 root root 2084 Sep 21 11:27 /usr/bin/vimtutor
[kas@localhost ~]$


so /usr/bin/view is not there (yet), and it is (offcourse) not alias-
ed

I've added the following to /etc/profile.d/vim.sh

alias view >/dev/null 2>&1 || alias view=/usr/bin/view


and

[ `//usr/bin/id -u` -gt 200 ] && alias view /usr/bin/vim for /etc/
profile.d/vim.csh


Cheers,
Kasper

Tony Mechelynck

unread,
Dec 26, 2011, 10:18:55 PM12/26/11
to vim...@googlegroups.com, KasperH

What you you mean, "it didn't work"?
- Do you mean you tried to make the link as I said (yes, destination
first, and then link name) and got an error
- Do you mean that you forgot to cd to /usr/bin before running the ln
command?
- Do you mean that you did set the links and "which" couldn't see them?
- Do you mean that you made the links in the wrong direction (with "ln
-s view vim" where "ls -sv vim view", with the spaces, and of course
after cd to the correct /usr/bindirectory, would have answered: `view'
-> `vim')?
- Do you mean that your non-root $PATH doesn't include /usr/bin ?

So now it works IIUC? I would have left these aliases out (finding them
in your shell startup files and deleting them if necessary) leaving the
job to the softlinks. But if it works, it works: if it ain't broke
(anymore), don' fix it.

Also, "which" doesn't know about shell builtins or aliases, but "type"
(a bash builtin, with optional -a switch for "all") does, e.g.:

linux:~ # which ll
which: no ll in
(/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin)
linux:~ # type ll
ll is aliased to `ls -l'
linux:~ # which -a kill
/bin/kill
linux:~ # type -a kill
kill is a shell builtin
kill is /bin/kill

Best regards,
Tony.
--
"Right now I'm having amnesia and /d�ja vu/ at the same time."
-- Steven Wright

KasperH

unread,
Dec 27, 2011, 3:39:41 PM12/27/11
to vim_use
On 27 dec, 04:18, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 26/12/11 21:53, KasperH wrote:
> > Thanks Tony for the prompt response, however..
> > it did not work.
>
> What you you mean, "it didn't work"?

the linking went fine, but it had no effect
view(1) would still open the file without asking the passwd

the heart of my view(1) issue is, that since there was no alias,
throuogh $PATH /bin/view would be found before /usr/bin/view
since I need /usr/bin/view I need an alias

if my modifications to /etc/profile.d/vim.* are ruined by an upgrade/
update/fix of vim-enhanced
I will be able to recover from that by reading what I did in this
thread ;)

thanks again, for thinking along
Reply all
Reply to author
Forward
0 new messages