JSX/TSX text-objects and motions. Contribute to mawkler/jsx-element.nvim development by creating an account on GitHub.
Link Actions
Hi! I built this small plugin that adds JSX/TSX text-objects and motions using Treesitter: jsx-element.nvim. I was surprised that it (to my knowledge) doesn't exist yet.
From the README:
Use ]t/[t to go to the next/previous JSX/TSX element.
Use it/at to use JSX/TSX elements as text-objects. For example dit for "delete inside tag". This works with self-closing elements:
undefined
<Checkbox value="checkedA" />
╰───── it ─────╯
╰─────────── at ────────────╯
It also works with paired elements:
undefined
<Button variant="text">This is a button</Button>
╰───── it ─────╯
╰───────────────────── at ─────────────────────╯
I've been using Neovim for about eight years, but I knever knew about :help o_CTRL-V until today. It lets you perform a command over a column.
I had the code below and wanted to remove all trailing colons:
undefined
foo:
bar:
baz:
faz:
What I meant to do was to do was (with the cursor on the first line) $<C-v>3jd to visually select all colons and then delete them. But I accidentally did $d<C-v>3j, which, to my surprise, did the same thing.
I did know about :help o_V, which lets you turn a characterwise operation like di{ into a line-wise one by doing dVi{. But it never occurred to me that I could do the same thing with <C-v>.
Neovim plugin that adds H/M/L indicators to your line numbers - mawkler/hml.nvim
Link Actions
By default in Neovim, H/M/L jump to the highest, middle, and lowest line in the current visible window. If you have scrolloff set, it can be dificult to tell exactly which lines they correspond to. I made this plugin to visually guide you.
Like most companies, the one I work for will happilly pay for any employee's license to a proprietary IDE without batting an eye. Therefore, I argued that I should be able to spend that budget on a donation to an open source tool that I use daily instead. After a lot of back and forth I finally got them to donate an amount that would correspond to what they would pay for a yearly subscription to a proprietary tool to Neovim.
Do you use Neovim at work? If so, I urge you to do the same thing! That way the core team can continue to deliver awesome new features to the editor we all love. Here's a link to where you can donate.
I now got my work to pay a $400 yearly "Neovim subscription" for the second time.
To those wondering how I did it, I basically just argue
Jump to next/previous LSP reference for item under cursor with ]r/[r - mawkler/refjump.nvim
Link Actions
Hi! I've created refjump.nvim which is a plugin that lets you use ]r/[r to jump to the next/previous LSP reference in the current buffer for the item under the cursor.
The plugin also automatically integrates with demicolon.nvim if you have it installed, which I recently posted about. This means that you can also repeat the jumps forward/backward with ;/,.
Overloaded ; and , keys in Neovim. Contribute to mawkler/demicolon.nvim development by creating an account on GitHub.
Link Actions
demicolon.nvim is a plugin that lets you use ;/, to repeat more jumps than just t/T/f/F like diagnostic jumps with ]d/[d and treesitter text-object jumps like ]f/[f to next/previous function.
When using LuaSnip together with nvim-cmp and a snippet library like friendly-snippets or luasnip-snippets you get a lot of duplicated snippets. That's because the language server also servers snippets. Also, you might want to create your own custom snippet that happens to share the name of a snippet that already exists.
For example, with the setup mention above, let's say that I also have a custom fn snippet for Rust files. When I type fn, nvim-cmp suggests three snippets: one from rust-analyzer, one from friendly-snippets and my custom one.
The solution to overriding friendly-snippets with your custom ones suggested in this open LuaSnip issue is to create your own fork of friendly-snippets. However, this is not ideal because it adds a lot of extra work to ea
Overloaded ; and , keys in Neovim. Contribute to mawkler/demicolon.nvim development by creating an account on GitHub.
Link Actions
Hi everyone! I've created a new Neovim plugin: demicolon.nvim. It lets you use ; and , keys to not only repeat t/T/f/F motions, but also to repeat diagnostic motions like ]w (jump to next warning) as well as jumps to nvim-treesitter-textobjects like ]f (jump to next function).
Hi! I've created a CLI tool for downloading Rust web books (like The Rust Programming Language) as EPUB, so that you can easily read them on your e-book reader. The tool is heavily based on this gist and a lot of proompting.
Rust Book to EPUB converter. Contribute to mawkler/rust-book-to-epub development by creating an account on GitHub.
Link Actions
Hi! I've created a CLI tool for downloading Rust web books (like The Rust Programming Language) as EPUB, so that you can easily read them on your e-book reader. The tool is heavily based on this gist and a lot of proompting.
I would recommend just learning the default surround behavior since it's more versatile. For example surround -> text-object -> character, siw) (surround word in parentheses) can be repeated with . (dot).
It should be noted that as long as you're on Neovim you can still keep your VimScript plugins and your VimScript config and gradually start using Lua plugins and Lua scripting. You don't need to do a complete rewrite over night.
There's no real downside to switching to Neovim. It's basically a superset of Vim, only with better defaults and more capabilities that you can opt-in to if you'd like (Treesitter, native LSP client, Lua, etc.).