0

When I'm programming. My structure is based on a simple tree.

.
├── index.js
└── Pages
    ├── blog
    │   └── index.js
    ├── career
    ├── contacts
    │   └── index.js
    ├── dashboard
    ├── home
    │   └── index.js
    ├── Layouts
    ├── Menus
    └── portfolio
        └── index.js

9 directories, 5 files

A tree from my actual project.

Whenever I need a feature I make a directory for it and when I create a file inside vim I need to always

TabooRename %basename%

of the file so in portfolio/index.js file's tab is read "Portfolio" and all files follow this convention.

I need to somehow allow this feature in my Taboo settings so I won't have to set it every time.

Looking at their example in setting it's naming convention here I couldn't find a perfect fit for me.

I tried

let g:taboo_tab_format="%p%m"

But this set my tabs to a very long path from the root of my system. But I only need from the basename of the current file I'm editing.

2

According to the doc you linked %p (lower case pee) displays the tab's current working directory which may be a full path. %P (upper case pee) displays only the last component of that directory (it's "tail"). For directory /foo/bar/baz that would show just baz.

Note that when you open a new file/buffer Vim won't by default change the current working directory to the location of that file. If you want that add set autochdir in your vimrc. (FYI, the help for this option says "Note: When this option is on some plugins may not work.")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.