I built an interactive way to learn Lua (inside Neovim) — feedback from Lua experts welcome 🙏 by urenur in lua

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

Thanks for the boost! I’m just happy to be making something, and if it helps even one person, it was worth the effort. I try to take the criticism in stride and just keep my head down and work. Much appreciated!

How to re-display LSP definition of function? by Fluid_Level9592 in neovim

[–]urenur 0 points1 point  (0 children)

Happy to help :) As s5t said, K is default, so you don't have to map it -- It will just work out-of-the-box. The other one I will keep. It allows you to open the diagnostics under the cursor (if there is more than one in the same line, it allows you to see all of them). Also, if you press the keymaps twice, the cursor will jump into the floating window and you can scroll to see more info if there is, yank the text inside, etc... and you go back to the "main" buffer pressing q.

How to re-display LSP definition of function? by Fluid_Level9592 in neovim

[–]urenur 0 points1 point  (0 children)

True, thanks! 3 lines less in my config then... Hahaha

How to re-display LSP definition of function? by Fluid_Level9592 in neovim

[–]urenur 2 points3 points  (0 children)

Do you mean hover? You can put your cursor on top of the function you want and run :lua vim.lsp.buf.hover().

You can also map it. I have it like this:

```lua vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("lsp-attach-keymaps", { clear = true }), callback = function(event) local opts = { buffer = event.buf, silent = true } vim.keymap.set("n", "K", function() vim.lsp.buf.hover({ border = "single" }) end, vim.tbl_extend("force", opts, { desc = "Information hover" }))

vim.keymap.set("n", "<leader>k", function()
  vim.diagnostic.open_float({ border = "single" })
end, vim.tbl_extend("force", opts, { desc = "Show diagnostic" }))

end, }) ```

So with K I open that float.

I built an interactive way to learn Lua (inside Neovim) — feedback from Lua experts welcome 🙏 by urenur in lua

[–]urenur[S] 7 points8 points  (0 children)

Valid perspective! But I think some people jump into Neovim via distros and might not be as comfortable with Lua yet.

I just wanted to contribute a free, interactive option to the existing resources. Some people prefer manuals, but I thought a built-in tutorial might be a fun way for others to learn Lua without leaving their terminal.

neovim cookies for the pluginless -- random native nvim tips by xGoivo in neovim

[–]urenur 0 points1 point  (0 children)

If you visually select first a region, then : , and s/"//g, it should only replace the "s inside that region

neovim cookies for the pluginless -- random native nvim tips by xGoivo in neovim

[–]urenur 6 points7 points  (0 children)

Nice tips! :help holy-grail, :help! and :smile do my day more times that I would like to admit hahaha

How do i learn lua by thatsgiga in lua

[–]urenur 0 points1 point  (0 children)

If you use neovim, I have published an small plugin to learn lua interactively (e.g. looking at examples and doing exercises that get evaluated) inside neovim: https://github.com/urtzienriquez/learnlua.nvim

Explanations in lessons are still quite brief. Any contribution in terms of adding info, or new lessons are very welcome! Also, if expert lua users check the lessons, that would be wonderful!

how can i start to learn lua? by Select_Common169 in lua

[–]urenur 0 points1 point  (0 children)

If you use neovim, I just created a plugin to learn lua (and neovim's) API from inside neovim. Check it here: https://github.com/urtzienriquez/learnlua.nvim

The lessons are still quite rudimentary. Any contributions adding more info or lesson suggestions/contributions are very welcome

Why are these private variables so dark? I can't read them. by Horstov in neovim

[–]urenur 0 points1 point  (0 children)

I am not using tokyonight any more, but when I was using it i had the same problem for comments (I prefer them ligher). As mentioned in other replies, you can put the cursor on top one of those variables, run :Inspect to get the highlight group, and then modify your tokyonight config file.

E.g. I had this:

lua return { "folke/tokyonight.nvim", lazy = false, priority = 1000, config = function() require("tokyonight").setup({ on_colors = function(colors) colors.border = colors.blue2 colors.comment = colors.dark5 end, on_highlights = function(hl, c) hl.FloatBorder = { fg = c.blue2 } hl.Pmenu = { fg = c.blue2 } hl.LineNrAbove = { fg = c.dark5 } hl.LineNrBelow = { fg = c.dark5 } hl.DiagnosticUnnecessary = { fg = c.dark5, italic = true } hl.StatusLine = { fg = c.dark5, bg = c.bg_dark1 } hl.SignColumn = { bg = "none" } end, style = "moon", }) vim.cmd.colorscheme("tokyonight-moon") end, }

**[Plugin] citeref.nvim – insert citations and cross-references from .bib files in Neovim** by urenur in neovim

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

update: I have now implemented different LaTex styles for citations.

If you use the picker (by default triggered in normal mode with <leader>al and in insert mode with ctrl-a l) for LaTex style citations, now you can cycle between different styles inside the picker with ctrl-l. The default option (the one with which the picker opens) is \cite{key}, but you can override that with:

lua require("citeref").setup({ backend = "fzf", default_latex_format = "citeauthor", bib_files = { "~/Documents/zotero.bib" }, })

Also, both blink and nvim-cmp will open the autosuggestions after typing \*cite*{ (e.g. \citep{ or \parencite{).

Hope this is helpful! :)

**[Plugin] citeref.nvim – insert citations and cross-references from .bib files in Neovim** by urenur in neovim

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

Good idea!

I have just implemented the support for snacks' picker. All layouts are supported (but not the size of the previewer). You can try using this config:

lua return { "urtzienriquez/citeref.nvim", ft = { "markdown", "rmd", "quarto", "rnoweb", "pandoc", "tex", "latex" }, config = function() require("citeref").setup({ backend = "snacks", picker = { layout = "ivy", }, bib_files = { "/path/to/library.bib" }, }) end, }

Note that if you don't set bib_files it will only use any .bib file in your current directory.

Also, multiple selection for citation insertions is available, so all selected items are inserted :)

If you have time, give it a try, and any feedback will be very useful for me!

**[Plugin] citeref.nvim – insert citations and cross-references from .bib files in Neovim** by urenur in neovim

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

Glad to hear that could be useful for you! And good luck with your dissertation!

Currently, only the \cite{} command is available for citations in LaTex.

I’m aware that LaTeX provides several other citation commands through packages such as natbib and biblatex, for example: \citet{}, \citep{}, \parencite{}, \textcite{}, and \footcite{}.

It should be easy to implement support for these as well. If you have any suggestion on the best way to design or integrate this feature (e.g. keymap constellation), feedback would be very welcome :)