Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 8846

Questions about calling external (shell) commands from within Vi or Vim.

0 votes
2 answers
85 views

How to execute a shell script from a line in a file with `%` in it

I have a shell script on a line alone in a file which I would like to be able to easily execute from vim. Normally I could simply use Y:!^R", but this particular script has % in it, which is expanded …
1 vote

How to execute a shell script from a line in a file with `%` in it

Possible answer derived from https://vi.stackexchange.com/a/10211/8846 - doesn't function in quite the same way, but :.w !fish does send the text to a new shell literally and returns the correct answe …
Iiridayn's user avatar
  • 193
1 vote
Accepted

How to use the current filename in a shell command?

Konfekt answers at https://github.com/vim/vim/issues/5907#issuecomment-612667235 If the filename does not contain double quotation marks, then "%" will work. Or, if the Vim version is at least 7.4, t …
Iiridayn's user avatar
  • 193
2 votes
1 answer
709 views

How to use the current filename in a shell command?

I would like to run a shell command on the current file - ie, I saved an empty file and would like to delete it. I've found % represents the current filename, but when there are spaces in the filepath …