sponsor Vim development Vim logo Vim Book Ad

vim-branch-stack : plugin helping to find the branching path to current line of code

 script karma  Rating 0/0, Downloaded by 85  Comments, bugs, improvements  Vim wiki

created by
Alexander Serebryakov
 
script type
utility
 
description
vim-branch-stack
================

*vim-branch-stack* is a Vim plugin helping to find the branching path to current line of code.

Introduction
------------

`vim-branch-stack` plugin is intended to help working on legacy C/C++ code where
functions are long and have many nested branches (`if-else`, `switch-case`,
`try-catch`, `while`, `for`).



Usage
-----

The stack is shown in the location window after `BranchStack` command
execuiton while cursor is placed on the target line.

#### Example
##### main.cpp
```
int main ()
{
    const int meaning = 42;
    const int pi_floor = 3;
    
    if (meaning)
    {
        if (pi_floor == 4)
        {
            // Do the stuff
        }
        else
        {
            // Cursor is here
        }
    }
    
    return 0;
}
```

##### Location window

```
1 main.cpp |6| if (meaning)
2 main.cpp |12| + else
```


Limitations
-----------

The plugin has the following limitations:

  * Commented out code is not supported
  * `goto` is not supported
  * `do-while` is not supported
  * Preprocessing is not supported


Contribution
------------

Source code and issues are hosted on GitHub:

```
https://github.com/aserebryakov/vim-branch-stack
```

License
-------

[MIT License](https://opensource.org/licenses/MIT)
 
install details

#### Requirements

* python3

#### Vim 8+

```
$ cd ~/.vim/pack/directory_name/start/
$ git clone --recurse-submodules https://github.com/aserebryakov/vim-branch-stack.git
```

#### Pathogen

```
$ cd ~/.vim/bundle
$ git clone --recurse-submodules https://github.com/aserebryakov/vim-branch-stack.git
```

#### NeoBundle

```
NeoBundle 'aserebryakov/vim-branch-stack'
```

Without plugin manager:

Clone or download this repository and copy its contents to your ~/.vim/
directory.

 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-branch-stack-0.1.1.zip 0.1.1 2018-08-26 8.0 Alexander Serebryakov * Fixed handling of single line comments
vim-branch-stack-0.1.0.zip 0.1.0 2018-08-24 8.0 Alexander Serebryakov Initial upload
ip used for rating: 54.81.69.220

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
OSDN.net Logo