NeoVim - Interesting Vim Rethink lazarus / 21-General ---------------------------------------------------------------------- jwhitten · 2021-03-09 04:40 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 ---------------------------------------------------------------------- zbyna · 2021-06-13 17:19 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 · 2021-06-13 23:43 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 · 2021-06-14 00:55 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 ---------------------------------------------------------------------- Kays · 2021-06-14 09:02 Quote from: jwhitten on March 09, 2021, 05:40:20 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? Quote from: dbannon on June 14, 2021, 02:55:42 amWhile 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 ---------------------------------------------------------------------- MarkMLl · 2021-06-14 09:57 Quote from: jwhitten on March 09, 2021, 05:40:20 amHas 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 ---------------------------------------------------------------------- zbyna · 2021-06-15 00:58 Quote from: MarkMLl on June 14, 2021, 11:57:41 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 · 2021-06-15 06:02 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 · 2021-06-15 07:05 Quote from: zbyna on June 15, 2021, 02:58:02 amQuote from: MarkMLl on June 14, 2021, 11:57:41 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 ---------------------------------------------------------------------- MarkMLl · 2021-06-15 07:26 Quote from: marcov on June 15, 2021, 08:02:20 amI 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 ---------------------------------------------------------------------- marcov · 2021-06-15 10:05 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 · 2021-06-15 11:18 Quote from: Kays on June 14, 2021, 11:02:00 amQuote from: dbannon on June 14, 2021, 02:55:42 amWhile 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 ---------------------------------------------------------------------- MarkMLl · 2021-06-15 11:19 Quote from: marcov on June 15, 2021, 12:05:14 pmI 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 ---------------------------------------------------------------------- Kays · 2021-06-15 12:42 Quote from: dbannon on June 15, 2021, 01:18:01 pmVim 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. ---------------------------------------------------------------------- dbannon · 2021-06-16 08:14 Quote from: Kays on June 15, 2021, 02:42:09 pm 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i :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