GithubHelp home page GithubHelp logo

johnsonjh / openvi Goto Github PK

View Code? Open in Web Editor NEW
151.0 5.0 12.0 4.07 MB

OpenVi: Portable OpenBSD vi for UNIX systems

Home Page: https://github.com/johnsonjh/OpenVi

License: Other

Makefile 1.32% C 98.44% Perl 0.19% Awk 0.05%
openbsd vi openvi c editor nvi bsd vim

openvi's Issues

Debian / Ubuntu build guide

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/\&quot.*//' |  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*

Difference with OpenBSD vi on handling filename completion

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 ?

Screen does not seem to "automatically redraw" after edits on macOS 13/14 (Homebrew-built binary)

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.

Unable to build on Linux without libbsd

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.

Expandtab/shell command related issue

Whenever a shell command is executed via the ex command '!', and only when the option expandtab is set, vi reports Error: unable to retrieve line 0.

The next screenshot shows the ouput of the !ls command before and after setting the expandtab option.

2023-11-13-173418_944x245_scrot

CMD via -c Flag is not executed if the file doesn't already exist

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.

Unexpected behavior with ':version' via `oex -s`

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

make strip fails on AIX

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.

PRs from Alpine packaging activity

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!

:pre not working on macOS, missing /var/tmp/vi.recover

: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.

Avoid using `#include_next` GNU extension ...

  • #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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.