Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

I'm writing a map to toggle the presence of extra columns in both panes:

noremap b :if &viewcolumns == "-{name},6{size},11{perms}" |
        \ :windo set viewcolumns="-{name}" | else |
        \ :windo set viewcolumns="-{name},6{size},11{perms}" | endif<CR>

But I get

Missing :endif

when I give it a try. It works just fine without the :windo though.

Could you help me understanding what is wrong and how to fix it? Thanks.

1 Answer

+1 vote
by
selected by
 
Best answer

See :help vifm-:bar, :windo doesn't end at |. You need to wrap it in :execute:

noremap b :if &viewcolumns == "-{name},6{size},11{perms}" |
        \ :execute 'windo set viewcolumns="-{name}"' | else |
        \ :execute 'windo set viewcolumns="-{name},6{size},11{perms}"' | endif<CR>
If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...