u/NazgulResebo

Configure ripgrep with just 15 lines of lua code (without telescope)
▲ 48 r/neovim

Configure ripgrep with just 15 lines of lua code (without telescope)

I was looking for a way to integrate Ripgrep into Neovim without using plugins, and I was quite surprised by how easy it is.

Video with details:
https://youtu.be/6Ok8n70syUw?si=G7LTKffFjShjK6ea

My repo:
https://github.com/FractalCodeRicardo/dev-config/blob/master/nvim/lua/my/ripgrep.lua

Code:

local function ripgrep(search)
  local result = vim.fn.systemlist("rg --vimgrep " .. search)
  vim.fn.setqflist({}, "r", {
    title = "Results",
    lines = result
  })
  vim.cmd("copen")
end

vim.api.nvim_create_user_command("Rg", function(args)
  ripgrep(args.args)
  end,
  { nargs = 1 })

https://reddit.com/link/1thtg3v/video/i9bypll9m42h1/player

reddit.com
u/NazgulResebo — 3 days ago
▲ 11 r/raylib

My first raylib code

Hi, everyone! Im really enjoying the games/animations/simulations in this subreddit. So, I decided to give it a try to Raylib.

This is my first program, I made the classic particle system moving randomly.

Hope you like it!

Source code:
https://github.com/FractalCodeRicardo/hangover-programming/tree/main/raylib-particles

Video of the programming sesion:
https://youtu.be/s57u2mZcADs?si=wlNeIRmFXkgHDMuH

https://reddit.com/link/1tgr1fc/video/siokxjkr4x1h1/player

reddit.com
u/NazgulResebo — 4 days ago
▲ 2 r/neovim

I created a small project to send commands from a mobile app to a Neovim server. I wanted to explore using Neovim as a server.

Do you see any practical applications for this?

In the demo:

  • I run a Neovim server
  • I run a Node.js web API
  • I send commands from an Android app

This is the flow:

  • A command is sent from the Android app
  • The web API receives the command and sends it to the Neovim server
  • The Neovim server sends back a response

Video with details:
https://www.youtube.com/watch?v=w2glXSDJ_ZM

https://reddit.com/link/1t1vou3/video/v0jicd66aryg1/player

reddit.com
u/NazgulResebo — 20 days ago
▲ 34 r/neovim

I really enjoyed coding this cursor animation. I use just basic stuff of the neovim api:

  • nvim_set_hl for group highlights
  • nvim_buf_set_extmark to set marks
  • nvim_win_get_cursor to get cursor position
  • nvim_create_autocmd - CursorMoved to track the cursor

The script:

https://github.com/FractalCodeRicardo/dev-config/blob/master/nvim/lua/my/cursor-animation.lua

My config:

https://github.com/FractalCodeRicardo/dev-config/tree/master

Video of coding session:

https://www.youtube.com/watch?v=j4XUQMUguNc

https://reddit.com/link/1szflig/video/ilegw7tmt7yg1/player

reddit.com
u/NazgulResebo — 22 days ago