# How to open VIM from a crystal program?

**URL:** <https://forum.crystal-lang.org/t/how-to-open-vim-from-a-crystal-program/1690>\
**Category:** Help & Support\
**Created:** [February 10, 2020, 8:40am UTC](https://forum.crystal-lang.org/t/how-to-open-vim-from-a-crystal-program/1690 "2020-02-10T08:40:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/oren/32/718_2.png) [@oren](https://forum.crystal-lang.org/u/oren)\
**Post date:** [February 10, 2020, 8:40am UTC](https://forum.crystal-lang.org/t/how-to-open-vim-from-a-crystal-program/1690/1 "2020-02-10T08:40:15Z")

</div>

I couldn’t find it on [https://crystal-lang.org/api/](https://crystal-lang.org/api/), [https://crystal-lang.org/reference](https://crystal-lang.org/reference), or [https://github.com/askn/crystal-by-example](https://github.com/askn/crystal-by-example) but someone on Gitter mentioned

```auto
Process.run(ENV\["EDITOR"\], args: {"myfile.txt"})

```

When I run `crystal src/note.cr` the program just terminated after about a second and I don’t see VIM.

---

<div class="post-metadata">

**Author:** ![oren](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/oren/32/718_2.png) [@oren](https://forum.crystal-lang.org/u/oren)\
**Post date:** [February 10, 2020, 8:45am UTC](https://forum.crystal-lang.org/t/how-to-open-vim-from-a-crystal-program/1690/2 "2020-02-10T08:45:59Z")

</div>

I posted it also on reddit so instead of commenting both here and there i’ll just link to the reddit discussion:

> **[r/crystal\_programming - How to open VIM from a crystal program?](https://www.reddit.com/r/crystal_programming/comments/f1n1e5/how_to_open_vim_from_a_crystal_program/)**
>
> 8 votes and 8 comments so far on Reddit

---

<div class="post-metadata">

**Author:** ![jhass](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jhass/32/1779_2.png) [@jhass](https://forum.crystal-lang.org/u/jhass)\
**Post date:** [February 10, 2020, 9:04am UTC](https://forum.crystal-lang.org/t/how-to-open-vim-from-a-crystal-program/1690/3 "2020-02-10T09:04:15Z")

</div>

`Process.run` does not connect stdout, stderr and stdin by default, you need to do it explicitly:

```auto

Process.run("vim", output: :inherit, error: :inherit, input: :inherit)

```

EDIT: Or actually just use `system`: `system("vim")`.
