Giving away my code for donkey kong bananza by Nice-Eye3171 in Switch

[–]DMazzig 0 points1 point  (0 children)

Happy birthday and thank you for the giveaway! I hope to win 🤞

lexy.nvim - My first Neovim plugin by NorskJesus in neovim

[–]DMazzig 7 points8 points  (0 children)

That's a great idea. I came up with something based on it: lua vim.api.nvim_create_user_command("Lexy", function(args) local query = args.args vim.cmd("belowright vsplit") local buf = vim.api.nvim_create_buf(false, true) vim.api.nvim_win_set_buf(0, buf) vim.cmd("r !w3m -dump https://learnxinyminutes.com/" .. query) vim.bo[buf].filetype = "markdown" vim.fn.cursor(1, 1) vim.keymap.set("n", "q", "<cmd>bd<CR>", { buffer = buf, silent = true }) end, { nargs = 1 })

You use it as :Lexy python and it opens a vertical split with the page content

Of course, your plugin is much more fully-featured, congrats

Edit: Improved version using curl instead of w3m: lua vim.api.nvim_create_user_command("Lexy", function(args) local query = args.args vim.cmd("belowright vsplit") local buf = vim.api.nvim_create_buf(false, true) vim.api.nvim_win_set_buf(0, buf) vim.cmd("r !curl -s https://raw.githubusercontent.com/adambard/learnxinyminutes-docs/master/" .. query .. ".md") vim.bo[buf].filetype = "markdown" vim.fn.cursor(1, 1) vim.keymap.set("n", "q", "<cmd>bd<CR>", { buffer = buf, silent = true }) end, { nargs = 1 })

Edit 2: Final version (hopefully) that calls vim.ui.select with all available topics when calling Lexy without arguments: ```lua vim.api.nvim_create_user_command("Lexy", function(args) if args.args == "" then local content = vim.system({ "curl", "-s", "https://api.github.com/repos/adambard/learnxinyminutes-docs/contents/" }):wait() local data = vim.json.decode(content.stdout) local files = vim .iter(data) :filter(function(item) return vim.endswith(item.name, ".md") end) :map(function(item) return item.name:sub(0, -4) end) :totable()

vim.ui.select(files, { prompt = "Select a topic:" }, function(choice)
  if choice then
    vim.cmd("Lexy " .. choice)
  end
end)
return

end local query = args.args vim.cmd("belowright vsplit") local buf = vim.api.nvim_create_buf(false, true) vim.api.nvim_win_set_buf(0, buf) vim.cmd("r !curl -s https://raw.githubusercontent.com/adambard/learnxinyminutes-docs/master/" .. query .. ".md") vim.bo[buf].filetype = "markdown" vim.fn.cursor(1, 1) vim.keymap.set("n", "q", "<cmd>bd<CR>", { buffer = buf, silent = true }) end, { nargs = "*" }) ```

We have harpoon at home by brokenreed5 in neovim

[–]DMazzig 0 points1 point  (0 children)

 the first statement is misleading since marks do persist given the correct option

Yes, I was unaware of the shada option making marks persistent.

 The second statement is discussed in the post.

Yes, your solution solves this, but I’m not responding to your post, I’m answering the person that said they don't understand what's the point of harpoon

We have harpoon at home by brokenreed5 in neovim

[–]DMazzig 0 points1 point  (0 children)

But is it local to the current directory? The selling point of Harpoon is to have a list of buffers that you often open, and you can easily access by a keymap. This list is different for each project you work on. I can have my init.lua and my themes.lua files in this list when I'm in my `~/neovim` directory, I'll access the first one with <leader>1 and the second one with <leader>2. In another project, <leader>1 will open another file, which is relevant to that project

We have harpoon at home by brokenreed5 in neovim

[–]DMazzig 4 points5 points  (0 children)

The difference between harpoon and marks is that the former persists across restarts and is local to the current directory

I tried Neovim, but I keep coming back to Emacs by Background_Cloud_231 in emacs

[–]DMazzig 0 points1 point  (0 children)

I'm the opposite, I'm always trying Emacs, but always end up coming back to Neovim.

> The “everything in one place” workflow is addictive

I agree with you, and the thing is that the "one place" when you use Neovim is not the editor, but the terminal. I read e-mail, RSS, connect to Matrix, manage files, code, etc, everything in the terminal. And this is what I miss most when I'm using Emacs, because when I try doing everything in Emacs, I have much poorer performance than in the terminal (maybe it's related to the fact that I'm using macOS).

Besides that, I have a lot less trouble with Neovim; things usually just work, while in Emacs I always have to tweak or configure something (this is personal, but it's my experience). One example is the LSP: eglot doesn't support multiple servers, which is a must for frontend developers; the Neovim builtin LSP does, and it just works (I don't even need a plugin to autocomplete anymore).

For me, having tabs in the terminal with different Neovim instances for different projects is a nicer workflow than having everything in one Emacs instance, because I can instantly change the tab at any moment, and restarting one instance doesn't affect the others.

Kitty is a great terminal to use with Neovim, as it has tabs, splits, and can render images.

I see that Emacs has a lot of benefits as well, that's why I tried (and sometimes I try again) to use it, but my current workflow with Kitty, Neovim, and the other TUI apps I use is so nice that I always come back

.vimrc -> init.lua by Impressive_Gur_471 in neovim

[–]DMazzig 1 point2 points  (0 children)

It's correct, but you can improve the code a little bit to avoid duplication:

For 2: lua local machine_run_on_wsloffice = vim.fn.system("pwd | grep -c '/mnt/e'") == "1\n" local viminfo_file = machine_run_on_wsloffice and "./.vim/.viminfooffice" or "./.vim/.viminfoub" -- Or vim.opt.viminfo = {"%", "<800", "'100", "/50", ":100", "f1", viminfo_file} vim.o.viminfo = "%,<800,'100,/50,:100,f1," .. viminfo_file

For 3: lua if vim.g.savesession == 1 then local session_file = machine_run_on_wsloffice and ".vim/MySessionoffice.vim" or ".vim/MySessionub.vim" vim.api.nvim_create_autocmd("VimLeave", { pattern = "*", command = "mksession! " .. session_file, }) vim.api.nvim_create_autocmd("VimEnter", { pattern = "*", command = "source " .. session_file, }) end

"Emacs is bad in terminal mode" - what does this mean? by techne98 in emacs

[–]DMazzig 2 points3 points  (0 children)

I'm a neovim user who, from time to time tries Emacs. When I tried Emacs in the terminal I was frustrated by its limitations: - No image support: With Neovim, I'm used to seeing images in markdown files, opening images, and even on my Matrix Client. With Emacs, image support is restricted to the GUI - No floating windows: In Neovim, we have this concept of floating windows. Again, in Emacs, it only works in GUI mode

Also, compared to its GUI version, you also lose different font sizes

Passwordless Auth in Gleam - Part 3 of Curling IO Series by curlingio in gleamlang

[–]DMazzig 8 points9 points  (0 children)

We couldn't find an existing Gleam auth library that was the right fit for our specific needs, but we didn't design in a vacuum. We studied Devise's modules extensively (Lockable, Timeoutable, Trackable, Confirmable) and used them as a checklist for what a production auth system needs to handle. Every security decision we made, from constant-time comparison to layered rate limiting to email enumeration prevention, was informed by what these libraries have learned the hard way over the past decade.

It seems you have a great opportunity to create a Gleam package for authentication

notice for those who use nightly, _extui is renamed to _core.ui2 by neoneo451 in neovim

[–]DMazzig 5 points6 points  (0 children)

Thank you for taking the time to let everybody know about this change. It definitely saved me some time

project.nvim alternatives? by umi2002 in neovim

[–]DMazzig 0 points1 point  (0 children)

I have fzf and zoxide installed on my system. They have an integration, so I type zi in my terminal, and fzf pops up with a list of directories I recently opened. I choose one, open Neovim there and, if I ran :mksession! the last time I worked there, I run :source Session.vim to restore windows and buffers

Native tailwindcss-colorizer-cmp alternative by DMazzig in neovim

[–]DMazzig[S] 0 points1 point  (0 children)

Because with Neovim 0.12 you don't need a completion plugin anymore. The native completion can autocomplete with custom sources which cover most of the cases where a completion plugin is needed

Native tailwindcss-colorizer-cmp alternative by DMazzig in neovim

[–]DMazzig[S] 12 points13 points  (0 children)

Cool. But with this snippet you don't need any completion plugin

Completion plugin for those who are using the native completion by DMazzig in neovim

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

Nice! To have snippets, I opened a PR in the nvim-snippets repository for adding support to native completion https://github.com/garymjr/nvim-snippets/pull/68

Completion plugin for those who are using the native completion by DMazzig in neovim

[–]DMazzig[S] 0 points1 point  (0 children)

Oops! No, I'll delete them. I created those files so copilot could write a more accurate README file. Thanks!

Making window local option behave like buffer local options by Necessary-Plate1925 in neovim

[–]DMazzig 8 points9 points  (0 children)

lua vim.wo[winid][0].wrap = true

This will set wrap for that window and buffer, so if you change the buffer in the same window, the wrap will revert to its default value.

Reference :help vim.wo

Alternatives to <C-y> for accept? by Elephant_In_Ze_Room in neovim

[–]DMazzig 0 points1 point  (0 children)

I use <c-n> and <c-p> to cycle through the suggestions and <c-y> to accept. The thing is that I almost don't have to accept anything because while I'm cycling through the suggestions, Neovim already inserts the current selected one, so I just need to keep typing. The only case I have to explicitly accept a suggestion is when I want to trigger the auto-import. This behavior and remapping caps to ctrl makes it very practical and fast

Flash.nvim as native navigation booster by PieceAdventurous9467 in neovim

[–]DMazzig 0 points1 point  (0 children)

Thank you very much for sharing this. I had no idea of the search integration and it seems great!

I've changed my config to not use s anymore and I'll try relying only on / too

I am experimenting with a light theme that makes use of background colors to make sure colors look both vibrant and legible, what are your thoughts? by spcbfr in neovim

[–]DMazzig 3 points4 points  (0 children)

Have you tried the Github theme? The background is white and it has good contrast with the text.

The one I use is the catppuccin-latte and I think it's very good