Skip to content

dtagarev/cppautodefine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ auto-define

About

A simple vim plugin to automatically define C++ functions. It is designed to relieve you from the burden of always switching between header and cpp files. With this plugin you can manage the function definitions inside both files and easily create new functions. No need to create the corresponding files, they will be automatically created.

Installation

Download with your favorite package manager.

call plug#begin()

" Cpp auto-define 
Plug 'dtagarev/cppautodefine'

" If you want it to only load when C++ file is opened
Plug 'dtagarev/cppautodefine', { 'for': 'cpp' }

call plug#end()
use "dtagarev/cppautodefine"

Usage

Using the plugin is pretty simple. Type the command, get the job done. The commands work both in header and cpp files.

  • For the plugin to work correctly the files must be in the same directory. Otherwise a new file will be created the current directory

Commands

Command Description
DefineFunc Defines the function under the cursor. If the corresponding file doesn't exist, one is created. If you are inside a header file it teleports you to the cpp file so you can start typing right away.
DefineAllFunc Defines all functions in the current file. If the corresponding file doesn't exist, one is created.
MirrorFunc Renames the function under the cursor in both the header and the cpp file.

Example mappings

"C++ auto-define
nmap df :DefineFunc<CR>
nmap da :DefineAllFunc<CR>
nmap mr :MirrorFunc<CR>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published