Check if current tab is empty in vim

前端 未结 3 1252
南方客
南方客 2021-01-12 20:05

I am writing a vim plugin in which I need to check if the current tab the user is looking at is empty. If it is not empty, like say the user is already viewing a buffer or h

3条回答
  •  攒了一身酷
    2021-01-12 20:43

    Maybe I'm not understanding the question, but to check if a tab has no buffer do this:

    if bufname("%") == ""
    

提交回复
热议问题