Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mopp/next-alter.vim
This is Vim Plugin for supporting open alternate file.
https://github.com/mopp/next-alter.vim
Last synced: 2 days ago
JSON representation
This is Vim Plugin for supporting open alternate file.
- Host: GitHub
- URL: https://github.com/mopp/next-alter.vim
- Owner: mopp
- Created: 2014-03-02T13:25:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-04T14:54:17.000Z (almost 11 years ago)
- Last Synced: 2024-05-02T00:22:00.811Z (9 months ago)
- Language: VimL
- Size: 1.11 MB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## next-alter.vim
This is Vim Plugin for supporting open alternate file.
For example, There are **hoge.c**.
You execute **:OpenNAlter.** then it opens **hoge.h**.
And it opens **hoge.c** when you edit **hoge.h**So, **it can switch c <-> h, cpp <-> hpp and etc.**
In particular, when you open vim plugin file.
**It will switch "autoload/hoge.vim" <-> "plugin/hoge.vim".**## installation
```vim
NeoBundle 'mopp/next-alter.vim'
```## usage
Command is here.
```vim
:OpenNAlter
:OpenNAlter vertical
```Mapping is here.
```vim
nmap ano (next-alter-open)
nnoremap anb next_alter#open_mapexpr('vertical botright')
nnoremap ant next_alter#open_mapexpr('vertical topleft')
```## setting
This is default values below.
```vim
" key is file extension, value is alternate file extension.
let g:next_alter#pair_extension = {
\ 'c' : [ 'h' ],
\ 'C' : [ 'H' ],
\ 'cc' : [ 'h' ],
\ 'CC' : [ 'H', 'h'],
\ 'cpp' : [ 'h', 'hpp' ],
\ 'CPP' : [ 'H', 'HPP' ],
\ 'cxx' : [ 'h', 'hpp' ],
\ 'CXX' : [ 'H', 'HPP' ],
\ 'h' : [ 'c', 'cpp', 'cxx' ],
\ 'H' : [ 'C', 'CPP', 'CXX' ],
\ 'hpp' : [ 'cpp', 'cxx'],
\ 'HPP' : [ 'CPP', 'CXX'],
\ }" this list shows search directory to find alternate file.
let g:next_alter#search_dir = [ '.' , '..', './include', '../include' ]" this is used when it opens alternate file buffer.
let g:next_alter#open_option = 'vertical topleft'
```## screenshot
![SS](./ss.gif)