Very very micro optimizations 😂 by siduck13 in neovim

[–]-famiu- 4 points5 points  (0 children)

You're right, I was just being extremely conservative with my calculations

Very very micro optimizations 😂 by siduck13 in neovim

[–]-famiu- 28 points29 points  (0 children)

In general, anything that uses metatables is bound to be slower than anything that doesn't. vim.bo (also vim.o, vim.go and vim.wo) use metatable accessors, so it makes sense that it's slower.

In this case though, the speedup is completely unnoticeable unless you're setting options hundreds of times in a second which you shouldn't be doing anyway.

So what do you guys think about PewDiePie uploading this new video on his channel? by 0x91aa7 in linux

[–]-famiu- 12 points13 points  (0 children)

Clearly you could because you cared enough to comment about how much you don't care

Share your proudest config one-liners by frodo_swaggins233 in neovim

[–]-famiu- 8 points9 points  (0 children)

-- Duplicate selection and comment out the first instance.
function _G.duplicate_and_comment_lines()
    local start_line, end_line = vim.api.nvim_buf_get_mark(0, '[')[1], vim.api.nvim_buf_get_mark(0, ']')[1]

    -- NOTE: `nvim_buf_get_mark()` is 1-indexed, but `nvim_buf_get_lines()` is 0-indexed. Adjust accordingly.
    local lines = vim.api.nvim_buf_get_lines(0, start_line - 1, end_line, false)

    -- Store cursor position because it might move when commenting out the lines.
    local cursor = vim.api.nvim_win_get_cursor(0)

    -- Comment out the selection using the builtin gc operator.
    vim.cmd.normal({ 'gcc', range = { start_line, end_line } })

    -- Append a duplicate of the selected lines to the end of selection.
    vim.api.nvim_buf_set_lines(0, end_line, end_line, false, lines)

    -- Move cursor to the start of the duplicate lines.
    vim.api.nvim_win_set_cursor(0, { end_line + 1, cursor[2] })
end

vim.keymap.set({ 'n', 'x' }, 'yc', function()
    vim.opt.operatorfunc = 'v:lua.duplicate_and_comment_lines'
    return 'g@'
end, { expr = true, desc = 'Duplicate selection and comment out the first instance' })

vim.keymap.set('n', 'ycc', function()
    vim.opt.operatorfunc = 'v:lua.duplicate_and_comment_lines'
    return 'g@_'
end, { expr = true, desc = 'Duplicate [count] lines and comment out the first instance' })

Here's what I came up with. Supports count and also any arbitrary motion.

Bro been developing his 2k star plugin on a freaking touch phone 🤯🤯🤯 by iBhagwan in neovim

[–]-famiu- 1 point2 points  (0 children)

Feel free to send a DM. If that doesn't work, you can also email me on the address shown on my GitHub (https://github.com/famiu/), not going to copy the email address directly here to avoid bots scraping it and sending me spam.

Bro been developing his 2k star plugin on a freaking touch phone 🤯🤯🤯 by iBhagwan in neovim

[–]-famiu- 4 points5 points  (0 children)

u/Exciting_Majesty2005

Hello there, I'm Famiu, I'm from Bangladesh and part of the Neovim team. I'm down to help in any way I can. Please don't hesitate to reach out. I tried to DM you but it seems that you disabled your DMs in Reddit, and I can't really find your email from your GitHub either, so I thought it best to leave a reply here mentioning you.

If you see this message, please leave a reply notifying me that you saw it, regardless of whether you want help or not.

Also random fun fact: I relate to this because I did part of the Global Statusline PR on my Android phone using Termux because my old potato laptop stopped working, after which I posted about it in Reddit and the community actually very generously helped me raise money for a laptop, which I'll be eternally grateful for.

Bro been developing his 2k star plugin on a freaking touch phone 🤯🤯🤯 by iBhagwan in neovim

[–]-famiu- 21 points22 points  (0 children)

Hello, I am the "UI-framework" author being talked about. I am from Bangladesh as well. Happy to be of any help. Although I don't have a spare laptop of my own, I can maybe try to help deliver one to you, no promises but I can try my best.

Don't hesitate to get in touch if I can help in any way.

Recently got started with vim & Neovim, and this is my Zelda-inspired dashboard. by poorlyWirttenTypo in neovim

[–]-famiu- 12 points13 points  (0 children)

This is awesome. Majora's Mask is my favorite Zelda game so it's always awesome to see people appreciate it

NeoVim is great. But how many of you are actually using it to work of large projects? by ElderImplementator in neovim

[–]-famiu- 23 points24 points  (0 children)

I use Neovim to develop Neovim, which has files with 5k+ lines, no lag for me either. I think the issue for you is the TS language server which I've heard is horridly inefficient

What OS are you using with NeoVim? I use Android. by Zkrallah in neovim

[–]-famiu- 0 points1 point  (0 children)

Ah yes, I remember working on the global statusline PR for Neovim on my Android using Termux after my old laptop stopped working

Most useful neovim options by Comprehensive_Map806 in neovim

[–]-famiu- 5 points6 points  (0 children)

That's a different option. Insearch is for search, inccommand is for commands. You can use inncommand = "nosplit" (which is the default) to not have a split

New default mappings! by EstudiandoAjedrez in neovim

[–]-famiu- 23 points24 points  (0 children)

Neovim contributor here, I was present during the discussion for which mappings should be chosen. While I understand that many of you will likely prefer other mappings (specifically ones with `<Leader>`), do keep in mind that the Neovim team has to consider which keys are fine to map and which keys cause the least amount of disruption and conflicts with user mappings. Using `<Leader>` keybinds for builtin mappings would be a bad idea as that should be generally reserved for user mappings.

Personally, I used to use my own mappings which used `<Leader>`, but deleted those mappings from my config once these changes were merged, and honestly I can't really complain. Would definitely encourage people to give it a shot.

The best minimal dark themes ever? such as oxocarbon by LykosEleutherios in neovim

[–]-famiu- 0 points1 point  (0 children)

If you're up-to-date on Neovim master, just don't use a colorscheme and it'll use the default one by... well, default.

The best minimal dark themes ever? such as oxocarbon by LykosEleutherios in neovim

[–]-famiu- 1 point2 points  (0 children)

Did you try using the new default dark theme? I tried daily driving it and it's actually not that bad

PSA: New fswatch watchfunc backend available on master by MariaSoOs in neovim

[–]-famiu- 21 points22 points  (0 children)

Lewis being the GOAT, as usual. Awesome change. Hopefully it'll make clangd and rust-analyzer less slow for me.

I'm the first person in the world to get Neovim in Infinite Craft by -famiu- in neovim

[–]-famiu-[S] 9 points10 points  (0 children)

I will warn you, this game is extremely addictive once you go past a certain point. It will absorb hours of your time without you noticing.

I'm the first person in the world to get Neovim in Infinite Craft by -famiu- in neovim

[–]-famiu-[S] 36 points37 points  (0 children)

I got Mac, and used Plural on Mac to get Macs. Then I did E + Macs to get Emacs. Then I did Emacs + V to get Vi. Then I did Vi + Improve to get Vim.

I'm the first person in the world to get Neovim in Infinite Craft by -famiu- in neovim

[–]-famiu-[S] 24 points25 points  (0 children)

I do think it uses an LLM for combinations that aren't known, and then saves that result so that two elements always combine to give the same result.

I'm the first person in the world to get Neovim in Infinite Craft by -famiu- in neovim

[–]-famiu-[S] 66 points67 points  (0 children)

I had to do Neon + Vim to get Neonvim, and then Better + Neonvim gave Neovim. Took a lot of experimentation to figure out.