DEV Community

Cover image for My first neovim plugin: Opener.nvim - quickly open directories/folders
William Bille Meyling
William Bille Meyling

Posted on

My first neovim plugin: Opener.nvim - quickly open directories/folders

A very simple yet useful plugin. Opener.nvim lets you open directories / folders in neovim like in mainstream editors (vscode, atom, ...). Essentially, it changes the cwd (current working directory, like :cd) and clears all buffers, tabs and windows (of course respecting any unsaved buffers). This was you can use the same editor instance for different workspaces / projects / directories without reopening neovim. This is especially useful for people using a neovim GUI such as neovide, where it is time consuming to reopen the editor. Also, it may be useful for people using project-management plugins or session -management plugins, to open projects, which has not been open before.

Bonus: naturally opener.nvim has a built-in telescope.nvim extension for choosing directories.

Repository: https://github.com/willthbill/opener.nvim

Showcase of opener.nvim

Bonus 2: you can setup hooks to run before and after opening a directory.

I posted on reddit too: reddit

Top comments (2)

Collapse
 
lai32290 profile image
Lai Xuancheng

Hey Willian, that's cool! Congrats! Maybe I'm not installing it right now, but I probably is gonna have a look at your source code to know how the thing works.

By the way, what that cursor moving animation effect that you have in the gif? That's pretty cool too, can you tell us the name of the plugin (if it is a plugin)

Collapse
 
willthbill profile image
William Bille Meyling

Thanks.
I use a neovim-gui called neovide github.com/neovide/neovide :)