johnsonjh / openvi Goto Github PK
View Code? Open in Web Editor NEWOpenVi: Portable OpenBSD vi for UNIX systems
Home Page: https://github.com/johnsonjh/OpenVi
License: Other
OpenVi: Portable OpenBSD vi for UNIX systems
Home Page: https://github.com/johnsonjh/OpenVi
License: Other
I will post this here in case it is of use to someone.
Feel free to move or purge it as you think appropriate ~
cd $HOME/Downloads
curl -LO https://github.com/johnsonjh/OpenVi/releases/latest
va=$( grep "Release OpenVi [0-9]" latest | sed '1!d' | awk '{ if ($3 ~ "[0-9]") { print $3 } else { next }}' )
# https://github.com/johnsonjh/OpenVi/releases/tag/7.3.22
vb=$( awk -F';' '/\/releases\/tag/ { print }' latest | sed 's/.*http/http/; s/\".*//' | grep -v -i assets | grep ^http | sort -u )
echo $va
echo $vb
# https://github.com/johnsonjh/OpenVi/archive/refs/tags/7.3.22.tar.gz
curl -LO https://github.com/johnsonjh/OpenVi/archive/refs/tags/"$va".tar.gz
tar -zxvf "$va".tar.gz
cd OpenVi-"$va"
ls -l
sudo apt -y install libncurses-dev gcc make
sudo env PREFIX=/usr/local make install
sudo update-alternatives --install /usr/bin/vi vi /usr/local/bin/ovi 0
sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/ovi 0
sudo update-alternatives --install /usr/bin/view view /usr/local/bin/oview 0
sudo update-alternatives --install /usr/bin/ex ex /usr/local/bin/oex 0
sudo update-alternatives --set vi /usr/local/bin/ovi
sudo update-alternatives --set editor /usr/local/bin/ovi
sudo update-alternatives --set view /usr/local/bin/oview
sudo update-alternatives --set ex /usr/local/bin/oex
#sudo apt -y remove nvi nvi-doc vim* nano*
Hi!,
I'm using OpenVi on Mac. It's great!
One big difference between OpenVi and OpenBSD's vi is when I use filec= to expand filenames.
On OpenVi I have to keep typing in an '*' and then push tab if I want to expand what I have so far.
On OpenBSD vi it seems like the '*' is assumed. All I have to do i keep hitting tab as i type more specific
filenames, and it keeps matching.
Can you think of a way that I can not have to enter the '*' char to match all like in OpenBSD vi ?
See lichray/nvi2#108 ... f1da676 adds this behavior here, currently compatible with nvi2
.
Submitted to nixpkgs in NixOS/nixpkgs#230014
Anyone who is unsure if an issue is related, please post or link it here.
Reported via email
Since macOS Ventura 13.x, OpenVI in a terminal session does not seem to "automatically redraw" after edits.
I would presume this is actually due to however (they) changed n/curses or whatever on macOS.
Obviously there is no :set redraw or the like to test - not that I'd expect that to do much on an "intelligent terminal."
Behavior is the same in the default Terminal and iTerm2; full-screen and windowed mode.
Any suggestions on what to check or how to troubleshoot?
OpenVI installed via Homebrew, FWIW.
Trying to build openvi 7.0.11 with GCC 4.6.4 on Linux with just make
:
$$ make
ld: bin/vi
cl/regcomp.o: In function `enlarge':
regcomp.c:(.text+0x21c): undefined reference to `reallocarray'
cl/regcomp.o: In function `p_bracket':
regcomp.c:(.text+0xd05): undefined reference to `reallocarray'
regcomp.c:(.text+0xd2e): undefined reference to `reallocarray'
cl/regcomp.o: In function `openbsd_regcomp':
regcomp.c:(.text+0x2532): undefined reference to `reallocarray'
regcomp.c:(.text+0x268f): undefined reference to `reallocarray'
cl/regexec.o:regexec.c:(.text+0x28ae): more undefined references to `reallocarray' follow
collect2: ld returned 1 exit status
GNUmakefile:356: recipe for target 'bin/vi' failed
make: *** [bin/vi] Error 1
Once I add -lbsd
to LDFLAGS, it compiles fine.
I'm not sure if this is a bug to bug compatibility issue with the original vi or something that is supposed to work exactly the way it does, but I recognized the following behavior:
If I have a file on the system, e.g. ~/hello.sh
and I open it in ovi
like,
ovi -c 'set wraplen=80' ~/hello.sh
and check all things set in ovi via :set
. I can see that the above command was correctly executed and wraplen=80
is set.
However, if ~/hello.sh
does not yet exist in the filesystem and I execute the same command wraplen
does not get set.
This is also true for mappings.
For context: I'm using a shell wrapper script over ovi
to set certain mappings and options depending on the file type. Right now, I'm working around the above limitation by creating the empty file with touch
before and deleting it afterwards if there was no write.
BDB0511 page sizes must be a power-of-2
(When using BDB 1.85 emulation)
Given:
$ printf ':version\n:set\n:q!\n' | ex -s
HP Version $ B.11.31 Oct 1 2008 02:03:25 $
noautoprint optimize noprompt term=dumb
And:
$ printf ':version\n:set\n:q!\n' | ex -s
Version 4.0 (gritter) 3/25/05
noautoprint noprompt term=dumb
Compare to:
$ printf ':version\n:set\n:q!\n' | oex -s
noautoprint noprompt term="xterm" nowarn
FWIW, this is probably some old nvi
bug:
$ printf ':version\n:set\n:q!\n' | nex -s
noautoprint noprompt term="xterm" nowarn
To strip, need to specify -X32, -X64, or -X32_64 or the command-line or set OBJECT_MODE=32_64 or similar in the environment.
Will allow to remove need for CHOWN=true
, as used in the Homebrew formula, etc.
I've been working on a Alpine package for this editor. I just submitted a few PRs around some aspects of the install target in the GNUmakefile to make that go a bit smoother. They are all independent, but I'm happy to mix and match them based on your preference.
Thanks for making this version of vi available: I've been enjoying it!
:preserve
does not seem to work with macOS/homebrew v7.4.26 using the default /var/tmp/vi.recover
location.
Low priority.
Works normally on GNU/Linux (compiled).
Simple missing directory:
$ ovi -r
Error: recdir: /var/tmp/vi.recover: No such file or directory
~
:pre
Preservation of this file not possible
:set recdir?
recdir="/var/tmp/vi.recover"
$ ls -la /var/tmp/vi*
ls: /var/tmp/vi*: No such file or directory
/var/tmp
does exist so maybe add mkdir -p /var/tmp/vi.recover
to the build process somehow?
Appears to work like I'd expect once I do that manually.
mkdir -p /home/kajukenbo/vi.recover
and set recdir="/home/kajukenbo/vi.recover"
also seems to work.
Thanks as always for keeping vi
alive.
#include_next
is non-POSIX (a GNU extension) and is currently used in:
include/bsd_stdlib.h
include/bsd_string.h
include/sys/types.h
include/sys/time.h
include/sys/stat.h
include/bsd_termios.h
include/bsd_fcntl.h
include/bsd_unistd.h
include/libgen.h
include/poll.h
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.