Skip to content

Open (and set) the alternative file for the current buffer with fewest keystrokes possible.

Notifications You must be signed in to change notification settings

FotiadisM/other.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

other.nvim

Open (and set) the alternative file for the current buffer with fewest keystrokes possible.

The problem

I love harpoon, it gives me speed and sanity. However, I found myself harpooning similar files. What I mean with similar files? bugless_code.c and bugless_code.h or vscode_bad.go and vscode_bad_test.go.

The solution

This plugin duh.

Usage

other-nvim.webm

When I want to jump to the other file I use require("other").open(). If I have already registered the other file then it opens it and I can toggle between the two using the same command, if not, then a fuzzy finder will open for me to pick a file.

The state is stored on disk similarly to harpoon so you set the other file once and forget it.

This plugin does not try to be smart and guess the alternative file, and I think it's better this way.

-- this is required
require("other").setup()

vim.keymap.set("n", "<space>o", require("other").open, {
	noremap = true,
	silent = true,
	desc = "open other file"
})

vim.keymap.set("n", "<space><space>o", require("other").clear, {
	noremap = true,
	silent = true,
	desc = "clear other file"
})

About

Open (and set) the alternative file for the current buffer with fewest keystrokes possible.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages