Vi/vim annoyances

Noticed something that really “peeves” (understatement) me…

When using “vim” (not vimtiny) in a raspberry Pi running Buster or Bullseye, in a terminal window (same behaviour in gnome terminal and gnome console) - i.e. remote - I no longer get an “I” bar cursor, and can no longer use the X-select buffer (e.g. select some text in another application [or even from the same terminal window!], e.g. web page, text document, other terminal and then middle-button click to paste from the X-select buffer).

Removed VIM and the problem went away, but vimtiny is ugly - no syntax highlighting…

Note - this only happens on Raspbian builds of VIM on Buster and Bullseye… Doesn’t happen on Stretch, doesn’t happen on RHEL or Ubuntu… And I don’t have Buster or Bullseye running on any intel (x86_64 or i386) systems to verify…

Note - default “vi” on Buster and Bullseye (RaspiOS / Raspbian variants) is vimtiny (I NEVER type “vim” it’s always just “vi” and I still call it “vi”) - if I want syntax highlighting I have to install vim (sudo apt install vim). When I apt remove vim, it re-instates alternatives

Anyone encountered this hideousness before? I’m quite apprehensive, 'cause I can see a future where some gobshite on the Gnome dev team (or maybe the Wayland people) makes a decision to completely remove the X Select buffer (i.e. remove middle button paste). I use the x select buffer approximate 65536 x more often than the actual “clipboard”. Tried using xclip or whatever it’s called for a white, but it was cumbersome…

Just read up on wayland - there’s only one buffer - the clipboard… This article (admittedly from 2015) discusses it :
https://wiki.gnome.org/Initiatives/Wayland/PrimarySelection

FFS - EVERY wheel mouse has a middle mouse button ya moron! Since about at least 20 years ago!

This is the reason DEC and SGI and SUN workstations came with three button mouses… I assume IBM RS/6000’s and similar HP UNIX workstations were similar…

1 Like

Me too.
If that happened I could no longer function in Linux
I absolutely have to have middle button paste.
and it has to work in vi and in normal xterms.

I remember some distro in the past where it was turned off, and I had to fiddle some setting to get it working. Cant remember details, but it was off everywhere, not just in vi.

1 Like

They also came with copy and paste keys on the keyboard

I found one reference

But I think there is something you can do in .vimrc…
to specifically allow or disallow mouse operations in vi.
Need to look at my systems, one of them , I think Void, has vi patched

:set mouse=r

Seems to fix the BROKENSHITTYNESS of vi/vim in Raspbian… But WHY? Whose idea was this? Doesn’t happen in Ubuntu vi/vim - only Raspbian’s that I’m aware of (don’t have x86 Debian Bullseye to test)… Also doesn’t happen in vi/vim on RHEL 8…

Just happened to me again this morning, trying to copy+paste .* config settings from a Pi Zero W to a newly arrived Pi Zero 2 W I’m “commissioning”…

I really don’t want to have f–king MICRO-F__KING-MANAGE .vimrc files on every F–KING computer I use… and making it a symlink to a file in a shared file could break other shit…

Seriously - whose IDEA was this? I’d like to shirt FRONT the (rhymes with previous word but one) ____!


Grabbing an x86_64 netinstall image to test on VirtualBox to see if it’s Debian’s fault or the Pi Foundation…


Edit : update - just booted and installed i386 Bullseye (11.4) netinstall - and - by default VI enables the text cursor and stuff, I can select text, and paste with middle mouse button, in the same window, or anothery…

So - it’s something those NONGS and DRONGOS at the Pi Foundation bake INTO Raspbian!

At least that narrows down the number of machines I might have to tweak and manage my ~/.vimrc on…

Maybe it’s something for the kiddies doing STEM stuff on their Pi SBCs at home or at school? I dunno…


One step forward and THREE F–KING BACKWARDS!

If I create a ~/.vimrc and have “:set mouse=r” in it, it F–KING DISABLES SYNTAX HIGHLIGHTING!

Grrrrrr ! ! ! :rage:

And NO the answer is NOT f–king NANO or emacs! I’d rather be dead than have to use nano… it’s AWFUL… and I’ve used vi the last 30 years or so, probably don’t have time to learn emacs :smiley:


okay - progress :

╭─x@mimas ~  
╰─➤  cat .vimrc
syntax on
set mouse-=a
set ttymouse=

Seems having a .vimrc DISABLES syntax highlighting? Who’d A thunk it? Note - I’ve NEVER done customisation of vi or vim - ever, never had to - was always happy with the out of the box configuration - UNTIL NOW :rage: … Sometimes I like numbers next to stuff I’m editing - so I just :set n and I get numbers… but even that’s rare…


nano is so utterly ghastly - I just tried to run visudo on my i386 debian instance, and it defaults to nano! Yegods! I have more trouble exiting nano than I do vi / vim).

I’m sure some swear by nano, nearly all the howtos on the intertubes these days default to using nano (another point : busybox and rescue mode in debian - ONLY has nano, not even vimtiny!). And I was just thinking about “ed”, yet another text editor, and was reminded of “edlin” in DOS - anyone remember edlin? Talk about obtuse! 10,000x harder to use than “vi”… Another thing I just discovered in Bullseye, if installed from netinstall, it doesn’t even had SUDO installed… it prompts for setting the root password, prompts to create another user, but never grants that user sudo, because it doesn’t install sudo… In many ways I kinda prefer the Red Hat family :

  1. rescue mode busybox includes “vI”
  2. “visudo” launches vi
  3. installs sudo by default…

There was another text editor, I remember back from my Slackware 3 days in the mid 1990’s, “joe” - at least joe had things like wordstar key bindings, so wordstar users could use it easily… Me? I got more than comfy using vi, I’m sure in my grave, my wasting muscle tissue will still be reaching for “ESC”, then jk, hm, to move about in my coffin (muscle memory).

2 Likes

Yes I vaguely remember edlin.
There also used to be Ex… the thing that is part of vi

I am stuck on vi like you.
My recent issue has been
working away in vi in insert mode
then move the mouse out of the window to copy and paste something
go back to the vi window and it has dropped out of insert mode
so I have to setup insert mode all over again before I can paste
It never used to do that?

One thing I’ll never understand, is how when I haven’t even gone into insert mode, but accidentally middle click, somehow, into the wrong terminal window, one of the characters in that text stream ORDERS vi to go into insert mode, even if that clipboard entry is a bitmap!

Sorry - not “ed” but “ex” yeah - that was there before vi…

But edlin was truly awful… The first HTML page I ever created and put online (1994/5), was mostly done in vi, but just for shits and giggles, I edited it in edlin in MS-DOS and made a comment to that effect… I think I still have that HTML document somewhere (and while I’m there I f–king hate it when people call HTML “code” or programming - it’s NOT never WAS!).

Yes, people call tex programming too. Github even lists it as code.

one of the characters in that text stream ORDERS vi to go into insert mode

Try typing random stuff at vi. Sooner or later you hit something that switches it into insert mode… or does something more drastic if you are unlucky.

I think that’s useful for practicability purposes. If something is identified as “Code”, you can filter files, that contain this type of “Code”, etc. Additionally, it’s probably wrong to call it “Code” in the first place. YAML is in that list, too. As well as Smarty, JSON, XML, HTML, Go Templating, etc… So, it’s not really “Code” to begin with. It contains all technologies like that, which are usually related to programming, in general.

2 Likes

Gosh Darn it - it’s spreading like a cancer :

FreeBSD 12.2 in TrueNAS Core 12.0 now does this by default - disables a text mode X cursor!

I had to edit my .vimrc on my ZSH shell on TrueNAS (formerly FreeNAS) - this is annoying! Who asked for this? IT NEVER used to do this on FreeBSD 11.3 as FreeNAS…

Why change it? To stop morons accidentally pasting with a middle button click? Such morons shouldn’t be allowed near crayons, never mind computers!

1 Like