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
)
You're looking for fnamemodify()
-> fnamemodify(getcwd(), ':t')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With