From 6c2a9d9cc00e610699fb4340a74cf9a4f9d4ebfd Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 26 Jan 2023 21:03:12 -0800 Subject: [PATCH] Add README --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0fc7c59 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# revolver.nvim + +This Neovim plugin makes it easy to rotate between related files in a common directory. This enables "header flipping" +in C/C++ and other languages where semantically related information is split between different files. revolver.nvim +alternates between files that share a common prefix after stripping away one of the predetermined suffixes. This suffix +is typically the file extension, but can include a part of the filename as well. Classic Vim is not supported. + +## Configuration + +This plugin can be configured by calling the `setup` function. A set of file suffixes is provided to override the +defaults shown below. + +```lua +require('revolver').setup({ + '.c', + '.cpp', + '.h', + '.hpp', + '.inl' +}) +``` + +## Commands + +For the following examples, imagine that you have the files `foo.cpp`, `foo.h`, and `foo.inl` in a directory and are +currently editing `foo.cpp`. + +* `Revolver` \ + Invoking the `Revolver` command will open `foo.h`. Subsequent invocation will cause `foo.h` and `foo.inl` to open + before wrapping back around to `foo.cpp`. The order that files are opened in corresponds to the ordering of suffixes + provided to the `setup` function. + +* `RevolverBack` \ + This command is similar to `Revolver` with the difference being that suffix rotation occurs backwards. The first + file to be opened would be `foo.inl`, followed by `foo.h`, and finally `foo.cpp` again.