Reputation: 6263
I'm tuning my vimrc
and I'd like to show in my airline bar the folder where I started vim (usually my project folder).
As the vim airline help says, I use let g:airline_section_b = '%{getcwd()}'
but then I get a complete path while I'd like to get the last folder.
I've tried with :t but doesn't work:
let g:airline_section_b = '%{getcwd()}:t
. It just shows /home/vivo/myproject:t
(while I want just myproject
)
Upvotes: 5
Views: 927
Reputation: 32946
You're looking for fnamemodify()
-> fnamemodify(getcwd(), ':t')
Upvotes: 9