News for hackers. Stuff that matters.
Re:Onivim 2: Lightweight, Modal Code Editor by rudolph9 on Wednesday June 24, 2020 @08:41AM (#23627190)
I feel like a curmudgeon when say this but tools that make me leave my terminal ultimately never sit well. It always feels so limiting when you hit the point where you’re digging through the guts of some framework that basically a web app packaged as a desktop app.

I see why people use it and maybe it not even a web app but I’m old enough to know vim gets me everything I need and using some ide desktop app is going to cost me more time in the long run.

For context, one of my biggest pet peeve is my dependence on desktop web browser. I wish I could actually be productive using something lynx.

Re:Onivim 2: Lightweight, Modal Code Editor by ravenide on Wednesday June 24, 2020 @08:57AM (#23627304)
I love vim and have never met someone who used it more fluently than me. Yet I find it lacking. I can never get IDE features like code navigation and completion to really work. I use YouCompleteMe like everyone else but it’s just not as good as Jetbrains. It randomly stops working. Parameter hints don’t really work. This is for C++, by the way. The JavaScript situation is even worse.

My dream is also for vim to be the integrated, full-featured software package you describe, but at the moment I find it falls short.

Re:Onivim 2: Lightweight, Modal Code Editor by typon on Wednesday June 24, 2020 @09:03AM (#23627357)
I find CoC to be much better than YouCompleteMe for both C++ and Python. Regardless, it's still not as good as Jetbrains. I don't know if it's a fundamental limitation of the underlying language Server (ccls) or CoC has issues with itself, but i experience random breakages in the autocompletion all the time too.
Re:Onivim 2: Lightweight, Modal Code Editor by mttrms on Wednesday June 24, 2020 @10:52AM (#23628486)
I love Vim, but since I started working in TypeScript/React every day it is basically unusable (syntax highlighting / code formatting cannot match VSCode) so I'm now running VSCode + Vim extension which is kinda meh, but serviceable.

One of these days I will get around to contributing to a Vim plugin or two to help improve Typescript / TSX support.

Re:Onivim 2: Lightweight, Modal Code Editor by 7786655 on Wednesday June 24, 2020 @04:22PM (#23633390)
I've had a different experience. Neovim + coc-tsserver and a syntax highlighting plugin works really well, and VSCode + Vim extension is unbelievably slow on my machine.
Re:Onivim 2: Lightweight, Modal Code Editor by mttrms on Wednesday June 24, 2020 @05:40PM (#23634188)
Which syntax highlighting plugin(s) are you using? Do you have syntax highlighting for functional components/hooks in .tsx files / can you share a config? Would love to give it a try.

I have spent many hours trying to get that work with no success. I've searched public .vimrc configs on github using typescript plugins and none of them gave me any type of syntax highlighting that compared to VSCode.

Re:Onivim 2: Lightweight, Modal Code Editor by 7786655 on Wednesday June 24, 2020 @08:29PM (#23635458)
I haven't used VSCode enough to consider myself knowledgeable about it's syntax highlighting or auto-indentation, so caveat emptor.

I use CoC.nvim using the coc-tsserver plugin to get Typescript completion/jump to definition etc, ALE to get ESLint warnings, HerringtonDarkholme/yats.vim (A Typescript syntax, Neovim comes bundled with this, but the bundled version might be out of date), and maxmellon/vim-jsx-pretty for JSX syntax highlighting and indentation (vim-jsx-pretty's auto indentation is not 100%, but it works well enough).

My colorscheme is tomasiser/vim-code-dark, in case that matters. Example screenshot: https://i.imgur.com/6UzKtU2.png

Re:Onivim 2: Lightweight, Modal Code Editor by mttrms on Wednesday June 24, 2020 @11:34PM (#23636629)
Thanks for sharing! My current setup is:

Plug 'HerringtonDarkholme/yats.vim'

Plug 'mhartington/nvim-typescript', { 'do': './install.sh' }

Plug 'pangloss/vim-javascript'

Plug 'maxmellon/vim-jsx-pretty'

Not too far off, but different.

I'll adjust a bit and see how it looks on some production code.

Re:Onivim 2: Lightweight, Modal Code Editor by lefrenchy on Thursday June 25, 2020 @01:12AM (#23637133)
I’ve had success with my config, it’s kind of large and i’m slowly slimming it down. But maybe it will help.

https://github.com/monsonjeremy/dotfiles/tree/master/config/...

Re:Onivim 2: Lightweight, Modal Code Editor by jamil7 on Wednesday June 24, 2020 @10:03AM (#23627981)
Try CoC and whatever language servers you need. Nvim becomes really powerful with this combo.
Re:Onivim 2: Lightweight, Modal Code Editor by mtts on Wednesday June 24, 2020 @10:03AM (#23627975)
> Yet I find it lacking. I can never get IDE features like code navigation and completion to really work.

Same here. In the end I just gave up and installed Emacs with vim key bindings (evil mode). Took a while to set things up, though, albeit not so much the vim bits, which were fine, but the IDE features.

Vim is fine as a framework for text editing but as an application it's a bit lacking.

Re:Onivim 2: Lightweight, Modal Code Editor by city41 on Wednesday June 24, 2020 @10:11AM (#23628063)
I agree. I've been using vim for about a decade now. I love the editing experience. I really dislike the "IDE" experience (plugins, file navigation, etc).

I've been seriously considering writing a new vim clone in go and build what I would consider the ultimate editor. Basically as if vim had been written today.

Re:Onivim 2: Lightweight, Modal Code Editor by bryphe on Wednesday June 24, 2020 @11:40AM (#23629220)
Onivim might not be for you :) But our project under the hood, libvim [1], might be useful for you to start (if it's easy to create bindings from C in Go).

There's a cool non-Onivim usage of it called Paravim [2] (and the same author also used it for Vim-Cubed [3])

- [1] https://github.com/onivim/libvim/blob/master/src/libvim.h

- [2] https://github.com/paranim/paravim

- [3] https://github.com/oakes/vim_cubed

Re:Onivim 2: Lightweight, Modal Code Editor by city41 on Wednesday June 24, 2020 @11:48AM (#23629331)
Just to be clear, I was making my comment more in the context of vim than Onivim. I maybe should have said that originally, my bad. I backed Onivim and am keeping a close eye on it. Maybe I won't need to (try to) make my editor :)
Re:Onivim 2: Lightweight, Modal Code Editor by bryphe on Wednesday June 24, 2020 @11:58AM (#23629498)
Ah, sorry I misread :) Thanks for supporting the project, really appreciate it!
Re:Onivim 2: Lightweight, Modal Code Editor by suprfnk on Wednesday June 24, 2020 @04:02PM (#23633169)
Have you tried emacs with evil-mode? It could save you a lot of trouble, as the ultimate editor is already written. ;-)
Re:Onivim 2: Lightweight, Modal Code Editor by city41 on Wednesday June 24, 2020 @04:09PM (#23633249)
Oh them's fightin' words. Actually I have tried evil mode. Although it's been years since I last did. I remember it being one of the better vim emulators out there. I should give it another go.
Re:Onivim 2: Lightweight, Modal Code Editor by fouc on Wednesday June 24, 2020 @10:43AM (#23628393)
why not write in a system language like rust rather than go?
Re:Onivim 2: Lightweight, Modal Code Editor by city41 on Wednesday June 24, 2020 @10:50AM (#23628468)
I am considering that too. For me Go is appealing because I can learn/steal a lot from Micro, a nice text editor written in Go.
Re:Onivim 2: Lightweight, Modal Code Editor by cercatrova on Wednesday June 24, 2020 @09:05AM (#23627378)
I want to use Vim, but I don't want to set up all the plugins and figure all that out. I want it to "just work" like VSCode does. VSCode's Vim emulation isn't that great, though.

Onivim 2 for the record is not a web app, it's a completely native app built in ReasonML (OCaml) and they even had to build their own GUI framework (Revery) to make this editor. It's extremely fast.

Re:Onivim 2: Lightweight, Modal Code Editor by lawn on Wednesday June 24, 2020 @11:25AM (#23628943)
You can embed neovim inside VSCode nowadays, you should check it out.
Re:Onivim 2: Lightweight, Modal Code Editor by tombert on Wednesday June 24, 2020 @10:10AM (#23628049)
You know, I'm not even 30, and I'm somewhat in the same camp; I pretty much live inside tmux whenever I can, and I feel like I'm relatively productive with it.

With my current job, I'm forced to use IntelliJ (a lot of the build scripts depend on it, and the project is too big for Eclim), and while there's nothing wrong with IntelliJ, I simply don't feel half as productive with it as I do within Vim and tmux.

Re:Onivim 2: Lightweight, Modal Code Editor by GekkePrutser on Wednesday June 24, 2020 @10:18AM (#23628125)
I feel the same way, though I would want something a bit heavier than VIM. Something with syntax hinting/completion, and a file browser on the left.

Basically just VS Code but in a terminal window. Really wish something like that existed (or maybe it does but I don't know about it).

Re:Onivim 2: Lightweight, Modal Code Editor by mcjiggerlog on Wednesday June 24, 2020 @11:21AM (#23628899)
You can have all that in vim - it just takes some set up.

syntax highlighting: https://github.com/sheerun/vim-polyglot

completion: https://github.com/neoclide/coc.nvim

file browser: https://github.com/preservim/nerdtree

how to install these plugins: https://github.com/junegunn/vim-plug

Re:Onivim 2: Lightweight, Modal Code Editor by GekkePrutser on Wednesday June 24, 2020 @11:36AM (#23629136)
Thank you so much! Will try this out.
Re:Onivim 2: Lightweight, Modal Code Editor by nchase on Wednesday June 24, 2020 @09:08AM (#23627405)
This is how I feel as well. But I know a lot of folks use the terminal inside of e.g. VS Code for this.

I wonder what they'd say in response?

For me, a lot of the value is in having a single app that I can turn to for most of my dev tasks. That app happens to be a terminal (with different projects contained in different tmux sessions).

Re:Onivim 2: Lightweight, Modal Code Editor by mumblemumble on Wednesday June 24, 2020 @09:33AM (#23627671)
For my part, I use IntelliJ for Java, vscode for everything else, and iterm2 for more intensive terminal work, all running in fullscreen mode and/or tiled using Rectangle. On OS X.

It gives something very close to the "hands never leave the keyboard" experience that I like about living in the terminal, while also letting me fall back to a mouse when that would be quicker or easier. It also gets me the nice things that I expect are only possible to do well in a graphical environment, such as minimaps and displaying graphical information like plots or dependency graphs.

I do find that my text-mode editor skills are weakening over time, and that does have an impact on my productivity when I have to do a decent whack of work on a remote server. But that's not something that I personally have to do often enough to be a major concern.

Re:Onivim 2: Lightweight, Modal Code Editor by bauerd on Wednesday June 24, 2020 @08:45AM (#23627220)
Fully agree. Primary reason I use emacs is because I can run it in my terminal (and I never got the hang of modal editing). All my readline shortcuts just work everywhere there, and copypasting from the tmux scrollback buffer is a breeze
Re:Onivim 2: Lightweight, Modal Code Editor by lapinot on Wednesday June 24, 2020 @08:59AM (#23627327)
Ever tried https://github.com/jyp/boon? Modal editing for emacs, describing itself as ergonomic and respecting emacs conventions. Disclaimer: not using myself, i'm a happy http://kakoune.org/ user.