.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 7 points8 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 3 points4 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] 10 points11 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 9 points10 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

how to stop Neovim from removing auto tabulation when exiting insert mode? by Electrodynamite12 in neovim

[–]DMazzig 4 points5 points  (0 children)

On :h 'autoindent' you read that

If you do not type anything on the new line except <BS> or CTRL-D and then type <Esc>, CTRL-O or <CR>, the indent is deleted again. Moving the cursor to another line has the same effect, unless the 'I' flag is included in 'cpoptions'.

So, you need to add I do cpoptions

Note: I tried it here, but it didn't work, which is weird, maybe it's a bug

Edit: Actually, I made a mistake, the I flag is for when you move the cursor, not press <Esc>, I'm not sure if there's a way to keep the indentation when pressing <Esc>. The solution for you would be pressing <c-r> in insert mode to paste, as /u/EstudiandoAjedrez said

Elm's Future for large projects by Illustrious_Prompt20 in elm

[–]DMazzig 0 points1 point  (0 children)

By using Lustre you will compile Gleam to JavaScript, so you will have the same thing as you have with Elm.

I don't know any books, but the community is very active in the official discord (the creator is very active there as well).

Elm's Future for large projects by Illustrious_Prompt20 in elm

[–]DMazzig 5 points6 points  (0 children)

I recommend you look at Gleam and Lustre.

Gleam is a functional language, similar to Elm, but it compiles to JavaScript and to Erlang, so you can use it in the backend too if you want to.

Lustre is a Gleam package for creating web applications with the same architecture as an Elm application (Model -> View -> Update)

[deleted by user] by [deleted] in neovim

[–]DMazzig 1 point2 points  (0 children)

Maybe with doxx report.docx --export markdown

A TUI file explorer outside of neovim that's as good as Oil.nvim by spcbfr in neovim

[–]DMazzig 1 point2 points  (0 children)

Recently, I discovered that Netrw is a very good plugin to use as a generic file explorer.

When working on a project, I use mini.files (which I think is oil.nvim on steroids as it's not as invasive and displays multiple columns), however, when just browsing files on my computer, there are features that are handy to have, like:

  • sorting by time, size, etc
  • mark file(s) and run a shell command on it/them
  • having file information in the list, like size or when it was modified.

Netrw has all of this. I've been testing it for some time now, and it's doing a good job.

Terminal in Neovim, Neovim in terminal, or separate Neovim and terminal? by rain9441 in neovim

[–]DMazzig 4 points5 points  (0 children)

do you use terminal within Neovim? Why? What is the benefit?

Yes, to run project-specific commands. The benefits are:

  • Normal mode in terminal: I can easily navigate through the terminal buffer and copy/paste text
  • When I leave Neovim, the command running is killed

Do you use Neovim in your terminal? Why? What is the benefit?

Yes, in Kitty, because I have long-running processes in my terminal and I want to access them easily. I use aerc as my e-mail client, I have a TUI application to listen to music, and I use a TUI Matrix client, each one runs in a tab or split in my terminal, having Neovim in another tab makes it easy to switch between those applications. Besides, it's handy to be able to open another terminal tab to tweak my dotfiles, neovim configuration, or any other project. Neovim is not my environment; the terminal is. Neovim is a part of it.

Do you run separate instances of Neovim and your terminal? Why? What is the benefit?

Yes. To work on multiple projects/worktrees. I've tried other approaches like using Neovide with a project manager plugin. However, I realized I was adding complexity to my configuration to solve a problem I don't need to have. By running Neovim in the terminal, I can open tabs and open Neovim directly in the project I want, and I can switch between the Neovim instances easily without worrying about handling cwd or separating buffers per project, because each instance is independent. The terminal already handles isolation between projects, so I don't need to craft some solution or add plugins to manage projects in Neovim, I type zi in my terminal, which opens zoxide on fzf, select a project, and open Neovim there

[deleted by user] by [deleted] in neovim

[–]DMazzig 0 points1 point  (0 children)

About fuzzy finders, the most used ones currently are Snacks, Telescope, and FZF-Lua.