Live data from Hacker News

Neovim 0.5 is overpowering

crispgm.com

211–220 of 429 posts

Re: Neovim 0.5 is overpowering

#211

It always feels really nice knowing that people are getting excited by your work. Thanks for the shoutout! (I'm tjdevries) Happy to answer any nvim questions while I'm here.

Is anyone in the nvim community working on unifying UI widgets (popovers and pickers) for eventual inclusion in nvim itself?

Consistent UI for users and great UI APIs for plugin devs would be a nice perk.

I have a couple of nvim plugins in flight and building the UI has been the hardest part so far. (A couple of examples: https://imgur.com/a/RZV2eYJ )

Re: Neovim 0.5 is overpowering

#212
I'm in the curiously rare position of being a long time Neo/vim user who doesn't use its modal features. Namely I have all my keybindings setup like a "normal" editor, CTRL+S to save etc.

I say it's curious because I've always been surprised that Neo/vim is mainly celebrated as "that modal editor". Whereas for me I celebrate it as the most feature-packed and lightweight terminal editor. Neo/vim is sooo much more than merely its modal editing.

With this new release of Neovim maybe there's renewed interest in what Vim is beyond the stereotypes. I wrote a plugin a few years ago that intelligently disables Neo/vim's NORMAL mode [1]. It always seemed such an obvious idea when the majority of editors have their own plugins to intelligently enable Vim-style modality.

1. https://github.com/tombh/novim-mode

Re: Neovim 0.5 is overpowering

#213

Earlier quoted context omitted.

I can never remember what all those different maps do: ':map', ':map!', ':nmap', ':vmap', ':imap', ':cmap', ':smap', ':xmap', ':omap', ':lmap', etc. do. There are bunch of questions on StackOverflow about different mapping options so I wouldn't say it's intuitive at all.

The differences that actually matter are self explanatory: map is for all modes, imap for insert mode, nmap for normal mode and vmap for visual mode (& tmap for terminal mode in NeoVim). The rest can be safely ignored as far as I can tell. Little confession: I have no idea what e.g. the difference between "nmap" and "nnoremap" is. But after years of randomly mixing them in hundreds of bindings without a noticeable di…

nnoremap is "non-recursive remap" since I think its possible to chain nmaps (`nmap A B, nmap B C` will map A to C)

Re: Neovim 0.5 is overpowering

#214

Earlier quoted context omitted.

Instead of counting, you can use :set relativenumber (vim/neovim builtin) to quickly see how far away lines are. (see https://jeffkreeftmeijer.com/vim-number/ )

In my opinion the real downside of using j and k to move isn't the counting part, it's the fact that k isn't a jump. That means it doesn't go into the jump list.

You can do something like this:

``` " Does: " For wrapped lines, does gj/gk " For large jumps, adds a spot on the jump list function! tj#jump_direction(letter) let jump_count = v:count

  if jump_count == 0
    call execute(printf('normal! g%s', a:letter))
    return
  endif

  if jump_count > 5
    call execute("normal! m'")
  endif

  call execute(printf('normal! %d%s', jump_count, a:letter))
endfunction ```

and map j and k to this

Re: Neovim 0.5 is overpowering

#215
post #212

I'm in the curiously rare position of being a long time Neo/vim user who doesn't use its modal features. Namely I have all my keybindings setup like a "normal" editor, CTRL+S to save etc. I say it's curious because I've always been surprised that Neo/vim is mainly celebrated as "that modal editor". Whereas for me I celebrate it as the most feature-packed and lightweight terminal editor. Neo/vim is sooo much more than…

Is this any different from vim's easy mode? I remember that being available as an extra shortcut by default when I tried gvim on windows (> 15 years ago).

Easy mode, aka 'evim': https://vonheikemen.github.io/devlog/tools/vim-easy-mode/

Re: Neovim 0.5 is overpowering

#216

Use what is in the standard distro. Don’t go too far downstream. MacVim/gVim

MacVim which you mention isn't part of any standard distro. But also: why should it matter really? If someone is a Neovim user, they'll have very little difficulty using vi/vim when that's all that's available. Basic no-plugins Vim is pretty indistinguishable from basic no-plugins Neovim, for the user.

Re: Neovim 0.5 is overpowering

#217

I'm most excited for the treesitter integration and its potential to amplify Vim's "killer feature": text editing as a language. Vim's editing language feels most powerful when I'm using its text objects: "ciw" means "change in word", "cis" means "change in sentence", and so on. But Vim's built-in text objects are not always a perfect match for the code you're editing. Suppose you want to change the first argument of…

I just wish Vim had proper S-expression structural editing support. Many editors have vim support but very few have smartparens/paredit with good integration. If Vim can extend its language to include some basic structural editing, then writing any type of tag based code e.g. JSX would become much more pleasant. For example in VS Code's Flutter plugin there is support for "delete surrounding widget" and "wrap child w…

Vim uses text objects for that kind of thing, t being the tag text object. `dat` deletes the JSX tag enclosing the cursor, `cit` deletes the contents of the tag and leaves you in insert mode, etc. Matchit (included in neovim) can also be configured to have % match tags as well as the default brackets/parens. LSP text objects are also available for more language specific structural editing.

Re: Neovim 0.5 is overpowering

#218

I'm most excited for the treesitter integration and its potential to amplify Vim's "killer feature": text editing as a language. Vim's editing language feels most powerful when I'm using its text objects: "ciw" means "change in word", "cis" means "change in sentence", and so on. But Vim's built-in text objects are not always a perfect match for the code you're editing. Suppose you want to change the first argument of…

Aren't these features are subject to external configuration to behave properly? For example, C/C++ and #defines. The user has to configure yet another file for this to work properly. If the build system/tree is so complicated that I can't figure out what the final #defs are (like building MBED programs with literally a thousand #defs), I end up shutting off this feature entirely. This kills me with VSCode & Sublime, but Eclipse derivatives are usually more tightly coupled. What about neovim?

Re: Neovim 0.5 is overpowering

#219

I don't want to be flamed or start a debate about the values of one or the other, but why should someone in 2021 go through the hassle of setting up (neo)vim or any other terminal or barebones editor (looking at you emacs) when there's perfect solutions out there that work out of the box with a lot of features that neovim has. For example VSCode uses LSP "natively" and even has an excellent vi emulator you can instal…

Using a modern IDE after tunning and mastering vim command and modes for years is a real struggle.

Re: Neovim 0.5 is overpowering

#220
post #187

Earlier quoted context omitted.

Yeah, just recently I had to edit text like this 'name1', 'name2', 'name3', to: 'name1': Enum.Name1, 'name2': Enum.Name2, 'name3': Enum.Name3, by the time I figured out a sequence of keyboard commands I'm pretty sure I could have multicursored it pretty easily, go to name1, create 2 cursors, select word & copy, start typing : Enum., paste selected word, select word, capitalize, type , In vim it was something like qdy…

I'm surprised everyone's forgetting vim already has a proto-multicursor mode. Go into Visual Block mode (Ctrl-V) select all the lines then it's just A : Enum.Name0, After that you can just select it again in visual mode and g Ctrl-A to get the right numbers. If anything the g Ctrl-A part makes Vim way better than most multicursor editors.

So the second time, you're entering Visual Block mode or plain Visual mode? What does the g Ctrl+A do?
Post reply on HN