A plugin for neovim for switching between specification and implementation
Go to file
2024-10-13 20:14:46 +02:00
lua/SpecSwitcher Add the switch function and config options 2024-10-12 21:43:49 +02:00
LICENSE Initial commit 2024-09-29 17:57:28 +02:00
README.md highlight code sections 2024-10-13 20:14:46 +02:00

Specification Switcher

TOC

  1. Installation
  2. Getting Started

Installation

SpecSwitcher is not yet hosted on Github, so installing the plugin may need some additional steps. Additionaly, the minimum version for each API call hasn't been tracked yet so for now the official supported neovim version is v0.10+

Install using packer

Packer allows the use of a complete URL, which can then be renamed for ease of use.

use {
    'https://git.folkert-kevelam.nl/folkert/Neovim-SpecSwitcher.git',
    as = 'SpecSwitcher'
}

Getting Started

The plugin consists of two public functions: setup() and Switch(). setup() is required since it sets the extension mapping and allowed descend directories.

Quick Note

As of the moment of writing, the setup() functions already sets a keymap for the switch: <leader>n. If you want a different shortcut, the option switch_shortcut in the setup can be used.

Basic Setup

require('SpecSwitcher').setup({
    descend_dirs={
        "include",
        "src"
    },
    extensions={
        {"ads", "adb"},
        {"c", {"h", "H", "hh"}},
        {"C", {"H", "HH"}},
    },
    switch_shortcut="<leader>sw"
})