Skip to content

vim plugin that help to navigate between source and header files.

License

Notifications You must be signed in to change notification settings

tdakhran/vim-swapfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

vim-swapfiles uses user defined list of patterns to cycle between files in VIM. This helps in programming languages like C++ to cycle between source and header files.

Example

If you have src/somefile.cpp currently opened in VIM buffer and next variable defined in .vimrc

let g:swap_files_groups = [['src/{}.cpp', 'include/{}.h']]

calling function in VIM command line

:SwapFiles

will open new/existing buffer with include/somefile.h, if file exists. Calling the SwapFiles again will open src/somefile.cpp.

Configuration

Set g:swap_files_groups to define patterns. {} is a wildcard for filename.

let g:swap_files_groups = [['src/{}.cpp', 'include/{}.h'], ['{}.cuh', '{}.cu']]

Jumping Between Files

Call :SwapFiles to cycle between files.

Installation

Requirements

VIM needs to support python3. Check the output of the :version to verify.

Install using vim-plug

  • Add next line into .vimrc
Plug 'tdakhran/vim-swapfiles'
  • Execute vim +PlugInstall +qall

Configure

let g:swap_files_groups = [['src/{}.cpp', 'include/{}.h']]

About

vim plugin that help to navigate between source and header files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published