1

I am developing a command line application that uses Vim to edit an existing file. Think visudo or crontab -e.

Is there any command line option that I can pass to Vim to disable shell commands?

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
LiamF
  • 185
  • 7
  • 1
    Could you provide some more detail about what you're trying to do, to demonstrate the problem? What is being escaped, and why don't you want it escaped? – JigglyNaga Feb 07 '18 at 14:32
  • Just FYI, the term "shell escaping" is usually used in Vim to refer to the practice of altering string-format commands in order that they are interpreted correctly by the shell. See :help shellescape(). What I think you're talking about is usually referred to as "shell commands" or sometimes "shelling out". – Rich Feb 08 '18 at 11:06

1 Answers1

2

The -Z (restricted mode) command line option is what I'm looking for. This provides sufficient protection against :! being used. Thanks to Rich and B Layer for pointing this out in my sister question, "Prevent saving buffer with new name"

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
LiamF
  • 185
  • 7