Cargo Info in Neovim, or How Simple Features Go a Long Way

TL;DR Open cargo info in Vim or neovim for the package under the cursor using these 4 lines of Lua. Cargo info Rust 1.82 was released a couple of days ago. It’s packed with improvements, but one in particular caught my eye. Cargo now has a info sub-command. It displays details about a package in the registry from the comfort of your terminal. Here is an example: $ cargo info lazy_static lazy_static #macro #lazy #static A macro for declaring lazily evaluated statics in Rust. version: 1.5.0 license: MIT OR Apache-2.0 rust-version: unknown documentation: https://docs.rs/lazy_static repository: https://github.com/rust-lang-nursery/lazy-static.rs crates.io: https://crates.io/crates/lazy_static/1.5.0 features: spin = [dep:spin] spin_no_std = [spin] note: to see how you depend on lazy_static, run `cargo tree --invert --package [email protected]` Vim and neovim generally composes well with other terminal tools. So how can we easily integrate cargo info and neovim? ...

October 21, 2024 · 4 min · Clément Joly

onedark-fast.nvim

 cljoly/onedark-fast.nvim ...

My Neovim Plugins

List of my plugins for the neovim text editor. ...

minimal-format.nvim

 cljoly/minimal-format.nvim ...

Luasnip and Treesitter for Smarter Snippets

TL;DR A context-aware snippet for Go error handling code, returning the right types, with the default values. Demo Snippet EDIT(2024-02-23): TJ DeVries made a video explaining an improved version of this snippet. You may still find the discussion on Go errors in this post interesting. Introduction Golang’s error handling is notoriously verbose. It was also the top pain point in the Go Developer Survey Q2 2022. Numerous proposals to simplify error handling have been written, but at the time of writing, none have been accepted. ...

August 30, 2023 · 10 min · Clément Joly

Generating Snippets with LuaSnip in Neovim

TL;DR When you have many variations of the same snippet, one option is to generate those with Lua code. The complete example is at the end. I’ve recently moved to LuaSnip as my snippets plugin for Neovim. When I first started, I sticked to the simplest features of LuaSnip, in particular the SnipMate-like syntax for snippets. But I have now started to explore the more distinctive features of LuaSnip, like Lua-defined snippets. It turns out that generating snippets with code can save tedious repetition. ...

July 31, 2022 · 4 min · Clément Joly

From UltiSnips to LuaSnip

TL;DR LuaSnip is fast and doesn’t have to be complicated. Give it a try! Even if that article shows how LuaSnip shines, I have great respect for the work that has gone into UltiSnips. It is still a reliable, reasonably fast plugin given the constraint it operates in (in particular, Vim compatibility requires a fair amount of Vimscript). I’ve written this article shortly after trying LuaSnip and I’m still very much evaluating it. ...

May 15, 2022 · 7 min · Clément Joly

bepo.nvim

 cljoly/bepo.nvim ...

Local NeoVim Plugin Development

2023-05-20: Updated to account for the features of NeoVim 0.9 and obsolete plugins You have found a (Neo)Vim plugin that you want to fiddle with, either to contribute changes upstream or for your own use. Sounds familiar? Here are some tips and tricks I use for my NeoVim plugin development. The aim of these small tricks is to iterate faster on changes, by loading your changes in a live NeoVim instance as quickly as possible. ...

November 2, 2021 · 3 min · Clément Joly

telescope-repo.nvim

 cljoly/telescope-repo.nvim ...

How I Got Started with NeoVim’s Lua Configuration

Four months ago I was still using SpaceVim when I stumbled upon a blog post on how to configure NeoVim with Lua. I then started to create my own configuration. In this post I’ll share the learnings acquired in the process. I hope you will find this useful to create your own configuration! Why create your own Vim config from scratch? Vim has been my daily driver for about ten years. Almost from the beginning, I used Vim distributions for ease of configuration. Spf13 vim first and then SpaceVim. With a distribution, one gets a lot of bells and whistle without spending too much time configuring things. So why spend hours setting up NeoVim from scratch? ...

July 18, 2021 · 9 min · Clément Joly