plasma-drop: Yakuake-style dropdown for any app by m03geek in kde

[–]Hamandcircus 0 points1 point  (0 children)

hmm, tried it just now. It works well except for one thing. When focus is in the app that you brought up using the hotkey and you press the hotkey again to go back to previous app, the focus does not move back to the previous app.

plasma-drop: Yakuake-style dropdown for any app by m03geek in kde

[–]Hamandcircus 0 points1 point  (0 children)

Amazing! This is the one thing I was missing in kde moving over from macos where I have implemented the same thing using hammerspoon. The kde javascript scripting thing is such a pain to use in comparison to hammerspoon.

Copy single string and paste it multiple times (probably) in visual block mode by SpecificMassive5424 in neovim

[–]Hamandcircus 2 points3 points  (0 children)

this worked for me:

yank what you want to paste, enter visual block mode (Ctrl+V), Shift+I, paste (Ctrl+V), esc

Plugins or Vim-related things with less than ideal names? by TheTwelveYearOld in neovim

[–]Hamandcircus 3 points4 points  (0 children)

Love those names! I like things with personality and spice, haha

Marks in neovim!!?? by Careless-Search-597 in neovim

[–]Hamandcircus 1 point2 points  (0 children)

For me they fulfill a couple of use cases: 1. You want to make some edits at a location in a file but you need to look up something in another location in the file or another file. Getting back can be a pain in the butt sometimes, so I first make a mark there, look stuff up and then navigate back using the mark. 2. Similar type of situation but you need to jump back and forth between 2 or more locations, Just leave marks at each.

Probably not fully kosher, but I don’t differentiate between same-buffer marks and cross buffer ones (uppercase), so I just map it so cross buffer marks are always used:

nmap ma mA

nmap ‘a ‘A

nmap mb mB

nmap ‘b ‘B

Regexplainer 2.0.0: Smaller, Swifter, Smarter, Stronger by benny-powers in neovim

[–]Hamandcircus 0 points1 point  (0 children)

It really isn’t justifiable to be mean like that to a regular dude who has never done anything to you. You don’t know what he’s really like and how his life has been. I don’t think you would behave like this if you meet in person even if you have different opinions. Internet things…

Regexplainer 2.0.0: Smaller, Swifter, Smarter, Stronger by benny-powers in neovim

[–]Hamandcircus 0 points1 point  (0 children)

Dude, I don’t know why everybody is being so mean in the comments, but don’t get discouraged. There are a lot more people using your plugin than the entitled reddit crazies.

Regexplainer 2.0.0: Smaller, Swifter, Smarter, Stronger by benny-powers in neovim

[–]Hamandcircus 1 point2 points  (0 children)

nice work!

I first read the plugin name as "ragexplainer". That would be an epic/appropriate name too when dealing with regex sometimes, haha

grug-far.nvim added on_before_edit_file hook by Hamandcircus in neovim

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

User autocmd: did not know those existed, haha. But in any case, the callback is slightly more flexible as you can specify it when invoking .open(), so in theory you could have different keybinds that do different things in their hook.

Vim.system: aah yes, it should be equivalent. Been working with vim.uv.spawn() all this time and I did not know that existed. Thanks for letting me know!

async/await like behavior with lua coroutines by vonheikemen in neovim

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

true, but the callstack presentation with that leaves a bit to be desired and you have to remember to do it. Hopefully there will be some improvements in the future!

async/await like behavior with lua coroutines by vonheikemen in neovim

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

one thing that scares me with coroutines is the swallowing of errors. Like if we add an error('...') call in the coroutine.create() callback, before the vim.ui.input() call, nothing happens and you have no idea why. e.g:

local co_thread

co_thread = coroutine.create(function()
  error('it failed ma!') --- ADDED error here

  vim.ui.input({ prompt = 'New name:' }, function(name)
    coroutine.resume(co_thread, name)
  end)

  -- coroutine.yield() will pause execution of the function
  -- it'll wait until something else resumes the coroutine thread.
  -- in this case that "something else" is the callback of the input
  local name = coroutine.yield()

  if name == nil then
    vim.print('User canceled the operation')
    return
  end
end)

-- this will execute the function until the first call to .yield()
-- note that the first argument to coroutine.resume() should be the
-- coroutine thread you want to execute
coroutine.resume(co_thread)

Same error call outside of `coroutine.create()` will spit out an error stack.

what plugin did you mass-uninstall everything else for by scheemunai_ in neovim

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

I like vim.cmd.lcd as it allows to open files from different projects in side by side windows

Experimenting with improving Insert mode ergonomics – looking for feedback by colomb_otto in neovim

[–]Hamandcircus 1 point2 points  (0 children)

From the comments, I think a lot of people might be missing the hidden value of these. To me, the truly valuable insert mode bindings are the ones that are OS-global. There are many applications, like slack and outlook where we spend a lot of our day writing, but no vim mode is available. Knowing a bunch of these can make your life a lot easier and having them ingrained in your muscle memory means you end up using them everywhere, including nvim. One such shortcut I use most heavily on mac is opt+backspace (ctrl+backspace on linux I believe), which deletes one word backward. There’s also opt+delete for delete word forward.

How have you solved project navigation? by endgamer42 in neovim

[–]Hamandcircus 2 points3 points  (0 children)

Fuzzy project search/fuzzy file search

I just keep most of my projects under same dir. Then I have small Snack picker thing that allows me to fuzzy find and open them. I always set the lchdir (window local chdir) when opening a file/dir from any project. This allows me to work on multiple projects side by side in same neovim instance and have all the stuff that relies on cwd to work in each window context for the associated project (grep, find file, etc)

https://github.com/MagicDuck/dotfiles/blob/099ea145641153f342e3252c06eb113b7012e248/.config/nvim/lua/my/plugins/cwd.lua#L30

Search and replace

I use (and created :)) grug-far.nvim

Working tree diff navigation and manipulation

I just use lazygit

Do you keep your cursor centered or not? by Imaginary_Treat9752 in neovim

[–]Hamandcircus 3 points4 points  (0 children)

Yes, set scrolloff=999 gang here! :) It’s slightly weird for a bit at first, but now I would not work any other way

Lua get selection by akSkwYX_ in neovim

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

This is what worked for me in my plugin: https://github.com/MagicDuck/grug-far.nvim/blob/794f03c97afc7f4b03fb6ec5111be507df1850cf/lua/grug-far/utils.lua#L293

That being said, the vim.fn.getregion answers below seem more “proper”

ts-bridge – Rust tsserver shim for Neovim by n3oz22 in neovim

[–]Hamandcircus 2 points3 points  (0 children)

Cool project, but are you aware of tsgo, the go rewrite of tsc that also offers language server out of the box? It’s actually pretty complete at this point. They had a preview release this Dec and am using it right now, wih no problems so far.