I often use the : sh command when using vim (e.g. for grep).
But sometimes I forget that I had a vim running after my shell.
Is there a command to detect that I have a vim that works behind my shell?
You can see if the Vim shell variables are set:
$ echo $VIM $ echo $VIMRUNTIME $ echo $MYVIMRC
You should have a set of environment variables called VIM , you can see if this value is set
VIM
$ echo $VIM
Note that it is also possible (unlikely) that $ VIM is installed when you are just in your shell.
You can check the parent process:
$ ps -p $PPID -o cmd= vi file
Or be independent of environment variables:
$ ps -p $(ps -p $$ -o ppid=) -o cmd= vi file
Source: https://habr.com/ru/post/1206708/More articles:How to use Angular form validation for other elements like div? - javascriptParse Json data in jQuery - jsonHow to use identifier or class instead of using name in bootstrap validator - javascriptGoogle Polymer with 4 rails - ruby-on-railsMeteor Sass uses basic sass from deeper files - sassHow to scale on a high DPI image of a Windows Form button? - dpiUsing REST to retrieve SharePoint view items - restNavigation Box: Gmail vs AppCompatv7 v21 - androidhadaop datanode not starting - installError using NSWindowController - objective-cAll Articles