Solved vi visual mode

base vi from pkg
I do not understand that. If I just install FreeBSD, with no packages at all, then there's a vi in base. No ports or packages involved at all. (Unless this is to do with 15.x and pkgbase?)

I don't think base vi has ever supported visual mode - visual mode comes from vim or similar.

I don't think it's my imagination e.g. https://hugodaniel.com/posts/vi-is-not-vim/ talks about there not being a visual mode in vi itself, you need vim or similar.
 
I do not understand that. If I just install FreeBSD, with no packages at all, then there's a vi in base. No ports or packages involved at all. (Unless this is to do with 15.x and pkgbase?)

I don't think base vi has ever supported visual mode - visual mode comes from vim or similar.

I don't think it's my imagination e.g. https://hugodaniel.com/posts/vi-is-not-vim/ talks about there not being a visual mode in vi itself, you need vim or similar.
i'm confused too , maybe base has been updated via pkg ? I dont know but v command use to work I only use vi base I know it work before pkg upgrade but now it doesnt I used to use it to edit wireguard conf, now I get v isnt a command
 
vi(1) has never had a visual mode via the 'v' key. Using PkgBase or otherwise, you are likely misremembering.

Most Linux distros ship with vim in the default install (or vim-tiny or vim-minimal or some other randomness). This *does* have the 'v' visual feature you were looking for because its part of vim.
 
I've definitely been confused when jumping onto a Linux box and getting vim features working in "base" vi but as kpedersen said above, that's because "base" vi in some Linux distros is actually vim. But on BSDs (OpenBSD and FreeBSD) vi is vi, and there's no visual command.

So maybe as JohnK suggests above you've had vi aliased to an installed vim or something like that?
 
I've definitely been confused when jumping onto a Linux box and getting vim features working in "base" vi but as kpedersen said above, that's because "base" vi in some Linux distros is actually vim. But on BSDs (OpenBSD and FreeBSD) vi is vi, and there's no visual command.

So maybe as JohnK suggests above you've had vi aliased to an installed vim or something like that?
yes this is the only explanation that make sense, but I didn't make this alias my self .. anyway thanks for the help. I'm gonna close it now.
 
I typically have this in all my ~/.cshrc (I always use tcsh(1)).
Code:
if ( -x /usr/local/bin/vim ) then
        setenv EDITOR vim
        alias vi vim
else
        setenv  EDITOR  vi
endif

You could do something similar with ~/.shrc or some other config file appropriate for your preferred shell. I also set the EDITOR variable, that's useful for vipw(8) for example, or for merges during freebsd-update(8).
 
Back
Top