Recent

Author Topic: NeoVim - Interesting Vim Rethink  (Read 4796 times)

jwhitten

  • Jr. Member
  • **
  • Posts: 61
NeoVim - Interesting Vim Rethink
« on: March 09, 2021, 05:40:20 am »
Hello,

Has anybody here ever used NeoVim? I ran across it today and looked through its features and design goals, and it looks like it could be the basis for an interesting Lazarus component.

Here's the URL: https://neovim.io/

Here's what Stackshare has to say about it: https://stackshare.io/stackups/neovim-vs-vim

And the Github Readme: https://github.com/neovim/neovim

Some programmers seem Blaise about Pascal...

zbyna

  • Jr. Member
  • **
  • Posts: 52
Re: NeoVim - Interesting Vim Rethink
« Reply #1 on: June 13, 2021, 07:19:40 pm »
I agree, it has interesting possibilities for embedding. When I am not using pascal I prefer vim like editing. It is an easy task with:

  - vimium-c https://addons.mozilla.org/en-US/firefox/addon/vimium-c/
  - vscode  https://marketplace.visualstudio.com/items?itemName=vscodevim.vim
  - Visual Studio  https://marketplace.visualstudio.com/items?itemName=JaredParMSFT.VsVim
  - text editor anywhere https://www.listary.com/text-editor-anywhere
    redirected to gVim
  - CapsUnlocked https://github.com/kshenoy/CapsUnlocked

I had problems with a pain in my right hand according to the using of mouse. So I decided to get rid of mouse as much as possible and because I am able to type with ten fingers I tried vim like editing and after some struggling it serves me well and what is the most important that pain in my wrist is away  :)

As for Lazarus nvim embedding, I am quite skeptic. Vim like editing is not quite popular among pascal developers - Delphi does not support it - and embedding takes its time. To tell truth I can not afford to participate in such project at present.

zbyna

  • Jr. Member
  • **
  • Posts: 52
Re: NeoVim - Interesting Vim Rethink
« Reply #2 on: June 14, 2021, 01:43:17 am »
Here are some information I gathered some time ago when I was thinking to begin with embedding nvim to Lazarus :) :
How it works in vscode
VScode connects to neovim instance
 - When opening a some file, a scratch buffer is created in nvim and being init with text content from vscode
 - Normal/visual mode commands are being sent directly to neovim. The extension listens for buffer events and
   applies edits from neovim
 - When entering the insert mode, the extensions stops listen for keystroke events and delegates typing mode
   to vscode (no neovim communication is being performed here)
 - After pressing escape key from the insert mode, extension sends changes obtained from the insert mode to
   neovim

dbannon

  • Hero Member
  • *****
  • Posts: 1485
    • tomboy-ng, a rewrite of the classic Tomboy
Re: NeoVim - Interesting Vim Rethink
« Reply #3 on: June 14, 2021, 02:55:42 am »
While vim is my preferred editor, I don't use it for Pascal work because its syntax highlighting is based, I assume, on some very early Pascal spec and is quite unusable.

Do you keep your code compatible with vim's view of syntax or do you disable syntax highlighting all together ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Kays

  • Sr. Member
  • ****
  • Posts: 329
  • Whasup!?
    • KaiBurghardt.de
Re: NeoVim - Interesting Vim Rethink
« Reply #4 on: June 14, 2021, 11:02:00 am »
[…] Has anybody here ever used NeoVim? […]
I once gave it a try, but–I don’t know what exactly–there were many things that didn’t work out of the box (like plugins or other configuration settings) which I was already used to from using in “classic” vim, and, frankly, I just didn’t (and don’t) want “relearn” vim, you know what I mean?
While vim is my preferred editor, I don't use it for Pascal work because its syntax highlighting is […] quite unusable. […]
On the contrary, it is quite usable. Sure it doesn’t add fancy colors to the latest language additions, like generics or type helpers, but that shouldn’t be deal breaker, you know.

By the way, see also: https://wiki.freepascal.org/vim
Yours Sincerely
Kai Burghardt

MarkMLl

  • Hero Member
  • *****
  • Posts: 2844
Re: NeoVim - Interesting Vim Rethink
« Reply #5 on: June 14, 2021, 11:57:41 am »
Has anybody here ever used NeoVim? I ran across it today and looked through its features and design goals, and it looks like it could be the basis for an interesting Lazarus component.

Frankly, I don't see the relevance since it's C-based.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

zbyna

  • Jr. Member
  • **
  • Posts: 52
Re: NeoVim - Interesting Vim Rethink
« Reply #6 on: June 15, 2021, 02:58:02 am »

Frankly, I don't see the relevance since it's C-based.

MarkMLl

I do not want to start flame wars, but simply your statement  could be successfully questioned.
Editing in vim is not only c-based.
It is highly customizable.  Please see: https://github.com/mattia72/vim-delphi

Among others, it enables:
     - Select all in a block and yes block is begin ... end
     - Select a whole block 
     - Put ';' to the end of the line
     - Jump to the first or second 'uses' clause in file
     - Jump to the 'implementation' or 'interface' section
     - Jump to the previous 'var' section,
     - Jump to the previous 'begin' or to the next 'end'
     - matching words to jump between words with %
         "begin", "end"
         "repeat", "until"
         "try", "finally"
         "unit", "interface", "implementation", "end."
...
Everything without mouse with all your fingers on keyboard.

Embedding nvim means that all available vim plugins are at your disposal in the host system.


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9442
  • FPC developer.
Re: NeoVim - Interesting Vim Rethink
« Reply #7 on: June 15, 2021, 08:02:20 am »
I never use a mouse during delphi editing.  Delphi already has two sets for editing, native, and wordstar.

Joe users might find wordstar mode appealing.

MarkMLl

  • Hero Member
  • *****
  • Posts: 2844
Re: NeoVim - Interesting Vim Rethink
« Reply #8 on: June 15, 2021, 09:05:23 am »

Frankly, I don't see the relevance since it's C-based.

MarkMLl

I do not want to start flame wars, but simply your statement  could be successfully questioned.
Editing in vim is not only c-based.
It is highly customizable.  Please see: https://github.com/mattia72/vim-delphi

I am fully aware of the capabilities of the Vi family, and have been using it for decades (Emacs sucks, let's not go there :-)

But the project cited is written in C, and therefore is not viable as a Lazarus plugin or for that matter as an "extra" shipped with either Lazarus or FPC.

MarkMLl
« Last Edit: June 15, 2021, 09:18:27 am by MarkMLl »
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 2844
Re: NeoVim - Interesting Vim Rethink
« Reply #9 on: June 15, 2021, 09:26:26 am »
I never use a mouse during delphi editing.  Delphi already has two sets for editing, native, and wordstar.

Joe users might find wordstar mode appealing.

I use the mouse (actually a trackball) to some extent, but most common Lazarus activities are on a gamer's keypad. "When I have time" I'll take a look at integrating that into the IDE, but I find the learning curve extreme so for the moment am relying on mapping buttons to keypresses.

The best editor I've used by far was the DOS version of Multi-Edit. However an honourable mention must go to Logitech's "Point" editor... but despite the fact that this was shipped with their Modula-2 compilers it turns out to be written in C.

There've obviously been various attempts to "prettify" Vi and Emacs over the years, but I've never really got on with them.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9442
  • FPC developer.
Re: NeoVim - Interesting Vim Rethink
« Reply #10 on: June 15, 2021, 12:05:14 pm »
I really missed the Topspeed M2 (3.x) editor when I migrated. It is probably where I got the tendency to prefer wordstar commands.

However that is all (17-20) years ago, and nowadays I'm really addicted to good quality source navigation (jump to identifier etc).

dbannon

  • Hero Member
  • *****
  • Posts: 1485
    • tomboy-ng, a rewrite of the classic Tomboy
Re: NeoVim - Interesting Vim Rethink
« Reply #11 on: June 15, 2021, 01:18:01 pm »
While vim is my preferred editor, I don't use it for Pascal work because its syntax highlighting is […] quite unusable. […]
On the contrary, it is quite usable. Sure it doesn’t add fancy colors to the latest language additions, like generics or type helpers, but that shouldn’t be deal breaker, you know.

Vim in the Ubuntu world at least does not understand that "//" start a comment ....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

MarkMLl

  • Hero Member
  • *****
  • Posts: 2844
Re: NeoVim - Interesting Vim Rethink
« Reply #12 on: June 15, 2021, 01:19:03 pm »
I really missed the Topspeed M2 (3.x) editor when I migrated. It is probably where I got the tendency to prefer wordstar commands.

However that is all (17-20) years ago, and nowadays I'm really addicted to good quality source navigation (jump to identifier etc).

I occasionally look around to see whether the TopSpeed toolset has appeared anywhere as "abandonware": it really was very good and stuff you could do at the pragma level was second-to-none. It was actually used by Psion for their last organiser before they started using ARM, and I think that developers who wrote for that platform needed to buy a copy... but that wasn't widely discussed, and by now recollection is fuzzy.

I actually went looking for Logitech's Point sources a few weeks ago, since I recalled writing demo extensions in Modula-2 and was interested to see what it was itself written in... alas, it turned out to be C since apparently they were trying to showcase their early mice rather than their compilers.

I've never really got to grips with modern assistive editors, and find excessive popups etc. intensely distracting. But there again, I'm the sort of person who still thinks that a digital watch is a fairly cool idea **

MarkMLl

** Particularly when it's big enough to have a legible display and tough enough to use as a hammer http://www.spovan-en.com/product-detail/2281015225025536.html
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Kays

  • Sr. Member
  • ****
  • Posts: 329
  • Whasup!?
    • KaiBurghardt.de
Re: NeoVim - Interesting Vim Rethink
« Reply #13 on: June 15, 2021, 02:42:09 pm »
Vim in the Ubuntu world at least does not understand that "//" start a comment ....
Read :help pascal.vim or simply take a look at /usr/share/vim/vim82/syntax/pascal.vim: You will notice that it will need :let g:pascal_fpc=true (or g:pascal_delphi) for certain branches to apply.
Yours Sincerely
Kai Burghardt

dbannon

  • Hero Member
  • *****
  • Posts: 1485
    • tomboy-ng, a rewrite of the classic Tomboy
Re: NeoVim - Interesting Vim Rethink
« Reply #14 on: June 16, 2021, 10:14:24 am »
You will notice that it will need :let g:pascal_fpc=true (or g:pascal_delphi) for certain branches to apply.

You are right Kays, thanks for that indeed !

I added
Code: Pascal  [Select][+][-]
  1. :let pascal_fpc=1

To my .vimrc file and suddenly, no messed up syntax !  (note its '1' rather than 'true', in my case, true does not seem to be defined.  I have always used '1' or '0' in vi variables in the past.)

Thanks, that makes my life just a little be easier. I will add a note to the wiki page. EDIT: no I won't, its already there.

Davo
« Last Edit: June 16, 2021, 10:35:57 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018