I'm pretty new to writing stuff in my .vimrc, and I'm trying to understand how to use conditionals.
""" Split-Term terminal helpers Plug 'vimlab/split-term.vim' set splitbelow autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | 10Term | endif
This works. almost the way I expect. The terminal split opens and says
/bin/bash: -c: line 0: syntax error near unexpected token `|' /bin/bash: -c: line 0: `| endif' [Process exited 1]
Pretty clearly what's happening is the last couple words of the if-endif block are getting passed as additional arguments to
Term (which it's documented as accepting, it's just that these aren't valid shell commands and they're not supposed to get treated that way).
In fact, if I leave off the
| endif, then it really does work perfectly. Nvim doesn't yeild any kind of warning that I'm missing the
endif. The only weirdness is that I start in insert mode, which isn't ideal and suggests that I really am doing something wrong.
What's the right way to do this?