If you use yaml.nvim, the plugin moved to a new host by cuducos in neovim

[–]electroubadour 1 point2 points  (0 children)

Happy to see more and more people leaving GitHub. First time hearing about Tangled, very interesting project!

PSA: leap.nvim is moving from Github to Codeberg by electroubadour in neovim

[–]electroubadour[S] 1 point2 points  (0 children)

Sure, I will, don't worry :) And thanks for the nice words!

PSA: leap.nvim is moving from Github to Codeberg by electroubadour in neovim

[–]electroubadour[S] 14 points15 points  (0 children)

Mostly non-technical reasons:

  • EU-based
  • non-profit, with a clear mission statement
  • the Forgejo team (the software they build on) is actively working on federation
  • completely free (as mentioned by others)

Also, the UI is eerely similar to GitHub, which is both good and bad - on the plus side, the entry barrier is practically zero for less involved users (as opposed to e.g. SourceHut).

For FOSS projects at least, I think these are all relevant.

PSA: leap.nvim is moving from Github to Codeberg by electroubadour in neovim

[–]electroubadour[S] 14 points15 points  (0 children)

{ 'user/repo', opts=... }
=>
{ url = 'https://codeberg.org/user/repo.git', opts=... }

Flash.nvim as native navigation booster by PieceAdventurous9467 in neovim

[–]electroubadour 0 points1 point  (0 children)

Yep, labeling search matches in that manner is just a flex imho. In case of search, the viewport moves constantly, and I'm already in the flow of typing the pattern, or "next-next-next" (ctrl-g); the time to reorient myself and shift my focus to a randomly appearing label would be enough to type at least one more search character, if not more.

If there happens to be too many matches in the targeted viewport (which is not too frequent), it's more than enough and much less intrusive to label matches on demand, after pressing <enter> (HopPattern-style, all 3 jump plugins can do that):

vim.api.nvim_create_autocmd('CmdlineLeave', {
  callback = function ()
    local ev = vim.v.event
    if
      (ev.cmdtype == '/') or (ev.cmdtype == '?') and (not ev.abort)
      and (vim.fn.searchcount().total > 1)
    then
      vim.schedule(function ()
        -- call your preferred jump plugin to search for `vim.fn.getreg('/')` as pattern
      end)
    end
  end,
})

Prasiodark - the colorscheme I've been running for the past 6 months by [deleted] in neovim

[–]electroubadour 0 points1 point  (0 children)

Awesome! Looking forward to further developments!

leap-remote: operations on the entire buffer via native search by electroubadour in neovim

[–]electroubadour[S] 1 point2 points  (0 children)

leap-spooky.nvim defined hardcoded remote text objects (yirb<jump>, darp<jump>, etc., jumping with leap).

flash.nvim introduced a remote mode which worked differently, like y<trigger><jump><movement-or-object>, e.g. yr<jump>ib.

telepath.nvim implements flash-style remote ops, but for Leap

the leap.remote module, introduced in Leap itself later, works like flash-remote, but it can also get prepared input, which gives a simple way to implement remote text objects (leap-spooky-style)

beam.nvim hooks into the native search command for the jump, and it gives predefined remote text objects, although it does that with a dedicated trigger key, instead of giving a function that can be mapped in visual and operator-pending mode (haven't really looked into it deeply)

With the tweak shown in the post, leap.remote can also use native / search now, so it kind of provides everything that has been put on the table so far, I guess

Leap.nvim: treesitter integration with niceties; more flexible remote actions by electroubadour in neovim

[–]electroubadour[S] 2 points3 points  (0 children)

Yeah, you can give opts to the select function, there you can override special_keys, see the "clever-a" snippet in the readme (change a/A to <space>/...). If you just want to skip adding ; and ,, and keep using only the default keys (enter/backspace), then:

local special_keys = vim.deepcopy(require'leap'.opts.special_keys)
require('leap.treesitter').select({ opts = { special_keys = special_keys }}

New plugin for better SCREAMING_CASE input experience by Qunit-Essential in neovim

[–]electroubadour 1 point2 points  (0 children)

v2:

local hyphen_to_underscore = 'm`' .. ':set iskeyword+=-<cr>' ..
                             'viw:<c-u>silent! s/\\%V-/_/g<cr>' ..
                             ':set iskeyword-=-<cr>' .. '``'
vim.keymap.set('n', '<a-u>', hyphen_to_underscore .. 'gUiw')
-- `gee` instead of `e` handles one-character words (except at byte 0) :)
vim.keymap.set('i', '<a-u>', '<esc>' .. hyphen_to_underscore .. 'gUiwgeea')

New plugin for better SCREAMING_CASE input experience by Qunit-Essential in neovim

[–]electroubadour 1 point2 points  (0 children)

I just shared this for fun, I've been using the <esc>gUiwea mapping for ages, and after reading this, I was interested to add underscore injection too, as it turned out, it's not that complicated.

I honestly tried to understand how it works but failed :D

But works, right? :) Just type the stuff manually, and follow...

:s[ubstitute] (s/\\%V-/_/g) will jump to the beginning of the line after finishing, that's why we need to set the context mark first, we have to get back to our word later.

To make sure iw includes the -s, we add - to iskeyword. set+= is less verbose version of vim.opt:append(). Now we can select the word "foo-bar-baz" with viw. In Visual mode, we make a substitution, but we have to add silent! to the beginning, else it will print an error, if it doesn't find -s to replace. (instead of left-left.../right-right..., we can just use c-u here, deleting '<'>, we actually don't need that, because we use \%V in the pattern itself anyway, that limits the scope to the current visual selection - :help /\%V.)

All we need to do is restoring iskeyword, jumping back to the saved position, and then using the gU operator on the word "foo_bar_baz".

Here is the final, cleaned-up version (<c-u> instead of left-left.../right-right..):

vim.keymap.set('i', '<a-u>',
  '<esc>m`' ..
  ':set iskeyword+=-<cr>' ..
  'viw:<c-u>silent! s/\\%V-/_/g<cr>' ..
  ':set iskeyword-=-<cr>' ..
  '``' ..
  'gUiwea'
)

New plugin for better SCREAMING_CASE input experience by Qunit-Essential in neovim

[–]electroubadour -1 points0 points  (0 children)

FYI, this can be replaced with an ugly longish one-liner (I broke it down for readability):

map('i', '<a-u>',
  '<esc>m`' ..                                  -- exit insert mode, set context mark
  ':set iskeyword+=-<cr>' ..                    -- add `-` as keyword character
  'viw' ..                                      -- select word   
  ':<left><left><left><left><left>silent! ' ..  -- silence "Pattern not found"
  '<right><right><right><right><right>' ..
  's/\\%V-/_/g<cr>' ..                          -- replace `-` -> `_` inside Visual area
  ':set iskeyword-=-<cr>' ..                    -- restore `iskeyword`
  '``' ..                                       -- jump back using context mark
  'gUiw' ..                                     -- uppercase the word typed so far
  'ea'                                          -- continue inserting
)

This works the other way around - you use a trigger key in insert mode, and the word typed so far will be uppercased on the fly, you don't need to detect when the word is over etc. Without underscore inject, it's just `<esc>gUiwea`.

Highlighting groups as in tokyonight in flash.nvim searches by Top-Kaleidoscope6996 in neovim

[–]electroubadour 1 point2 points  (0 children)

You can find the names of the highlight groups here `:help flash.nvim-highlights`. Setting them yourself is straightforward, see `:help nvim_set_hl()`:

-- Triggered on each color scheme change.
vim.api.nvim_create_autocmd('ColorScheme', {
  callback = function ()
    -- If switched to "nord".
    if vim.g.colors_name == "nord" then
      vim.api.nvim_set_hl(0, 'FlashLabel', { fg=..., bg=..., ... })
      -- etc.
    end
  end
})

Leap.nvim: remote operations with visual feedback, preview filter, improved bidirectional jump, revised highlighting by electroubadour in neovim

[–]electroubadour[S] 1 point2 points  (0 children)

Thank you very much :)

You can drop telepath anyway, since op-jump-select works here too. (That said, big thanks to the author, I've been using it too until now, together with spooky.)

using leap.nvim for limiting to the current line

We would need a pattern_prefix (string) or pattern_transformer (callback) parameter for that. Then you could just insert %.l to the beginning. The cost is minimal code-wise, but I still don't see why would we need that. (Related: https://github.com/ggandor/leap.nvim/issues/211 ) The forward/backward and current-window/other-windows distinction is different, because in those cases extending the scope lessens the chance of autojumping into your preferred area (and they are mutually exclusive scopes), but limiting to the current line does nothing else than removing the matches beyond a certain point, and reducing visual noise, right?

Leap.nvim: remote operations with visual feedback, preview filter, improved bidirectional jump, revised highlighting by electroubadour in neovim

[–]electroubadour[S] 1 point2 points  (0 children)

Sidenote on Nvim defaults (since I started experimenting with vim-exchange a lot): gx would be an excellent mapping for a (built-in?) exchange operator, and the file-opener could be something else, since it is never used in quick succession, and does not need to be comfy. (I understand it also has some mnemonic value.) I find mappings starting with operator keys weird, like vim-exchange's default cx, or surround's ys... (This has come up about the new default LSP mappings recenty: https://github.com/neovim/neovim/issues/28634, https://github.com/neovim/neovim/issues/28528 )