https://github.com/kuznetsss/shswitch
Vim plugin to switch between header and source
https://github.com/kuznetsss/shswitch
vim vim-plugin
Last synced: 11 months ago
JSON representation
Vim plugin to switch between header and source
- Host: GitHub
- URL: https://github.com/kuznetsss/shswitch
- Owner: kuznetsss
- License: mit
- Archived: true
- Created: 2020-02-02T19:17:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-16T09:59:05.000Z (over 6 years ago)
- Last Synced: 2024-08-07T18:46:09.398Z (almost 2 years ago)
- Topics: vim, vim-plugin
- Language: Vim script
- Size: 5.86 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: License.txt
Awesome Lists containing this project
README
# SHSwitch vim plugin
SHSwitch is a simple plugin to switch between header and source files. It assumes that header and source file has same name but may be located at different directories.
## Usage
SHSwitch provide only one command `:SHSwitch` to switch between header and source.
## Options
Available options and default values:
* `g:shswitch_source_extensions` - array of source files extensions. Default value: `['c', 'cpp']`
* `g:shswitch_header_extensions` - array of header files extensions. Default value: `['h', 'hpp']`
* `g:shswitch_root_flags` - array of project root files. Default value: `['CMakeLists.txt']`
## Algorithm of searching corresponding file
* Check if corresponding file is in current directory.
* Search upward for one of `g:shswitch_root_flags` in directory above current and assume that directory with found root flag is project root.
* Find corresponding file recursive in project root directory.
## Installation
To install via [Vim-Plug](https://github.com/junegunn/vim-plug) add line to your `vimrc` file:
`Plug 'kuznetsss/shswitch'`
I haven't tested but similar line should work with other vim plugin managers.