Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/psychollama/alternaut.nvim
Jump between your test and source files.
https://github.com/psychollama/alternaut.nvim
navigation tdd testing vim-plugin
Last synced: about 1 month ago
JSON representation
Jump between your test and source files.
- Host: GitHub
- URL: https://github.com/psychollama/alternaut.nvim
- Owner: PsychoLlama
- License: mit
- Created: 2020-01-31T20:46:59.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-26T22:24:48.000Z (about 2 months ago)
- Last Synced: 2024-11-26T23:25:05.164Z (about 2 months ago)
- Topics: navigation, tdd, testing, vim-plugin
- Language: Vim Script
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Example
Say you've got a project structure like this:
```
src/
__tests__/
logic.test.js
foo.test.js
logic.js
foo.js
```and you're editing `src/foo.js`. You want to open the test file.
That's where alternaut comes in. Hit the keybinding and you're in
`src/__tests__/foo.test.js`. Toggle again and you're right back in the other
file.## Configuration
Alternaut doesn't make any assumptions about your project structure. You need
to tell it your conventions. What do you name your test directories? What do
you name your test files? That kind of thing.```viml
" A typical JavaScript setup.
let alternaut#conventions = {}
let alternaut#conventions['javascript'] = {
\ 'directory_naming_conventions': ['__tests__', 'tests'],
\ 'file_naming_conventions': ['{name}.test.{ext}', '{name}.spec.{ext}'],
\ 'file_extensions': ['js', 'jsx'],
\ }
```Once that's registered, create a mapping:
```viml
nmap a (alternaut-toggle)
```Any time you open a `javascript` file, press `a` and it'll toggle
between the corresponding test and source file.## [Documentation](https://github.com/PsychoLlama/alternaut.nvim/blob/main/doc/alternaut.txt)
The way of our people is [help files](https://github.com/PsychoLlama/alternaut.nvim/blob/main/doc/alternaut.txt).
```viml
:help alternaut
```