Skip to content

Commit 1f41e25

Browse files
feat(editing-support): add other-nvim
1 parent f9456d3 commit 1f41e25

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# other-nvim
2+
3+
Open alternative files for the current buffer, e.g. toggle between test and implementation.
4+
5+
Supported Languages:
6+
7+
- built-in: livewire, angular, laravel, rails, golang, python, react, rust, elixir
8+
- custom: clojure
9+
10+
**Repository:** <https://github.com/rgroli/other.nvim>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
return {
2+
"rgroli/other.nvim",
3+
ft = {
4+
-- built-in mapping support
5+
"livewire",
6+
"angular",
7+
"laravel",
8+
"rails",
9+
"golang",
10+
"python",
11+
"react",
12+
"rust",
13+
"elixir",
14+
-- custom (defined in opts > mappings)
15+
"clojure",
16+
},
17+
main = "other-nvim",
18+
opts = {
19+
mappings = {
20+
{ -- clojure unit test files
21+
pattern = function(path)
22+
local match = vim.fn.matchlist(path, "\\v^(.*)/src/(.{-}_test)@!(.{-}).clj(.?)")
23+
if #match > 0 then return match end
24+
end,
25+
target = "%2/test/%4_test.clj%5",
26+
context = "test",
27+
},
28+
{ -- clojure source code
29+
pattern = "(.*)/test/(.*)_test.clj(.?)$",
30+
target = "%1/src/%2.clj%3",
31+
context = "implementation",
32+
},
33+
},
34+
},
35+
}

0 commit comments

Comments
 (0)