Skip to content

This is Vim Plugin for supporting open alternate file.

Notifications You must be signed in to change notification settings

koara-local/next-alter.vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

NeoBundle 'mopp/next-alter.vim'

usage

Command is here.

:OpenNAlter
:OpenNAlter vertical

Mapping is here.

nmap <Leader>ano <Plug>(next-alter-open)
nnoremap <expr> <Leader>anb next_alter#open_mapexpr('vertical botright')
nnoremap <expr> <Leader>ant next_alter#open_mapexpr('vertical topleft')

setting

This is default values below.

" 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

About

This is Vim Plugin for supporting open alternate file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%