Generally speaking ideavim can handle consuming of native vimrc. That's because it doesn't actually parse it as vimscript. It just does pattern matching so anything non-compatible is skipped over. Most people get away with this just fine...
source ~/.vimrc
And that command is recommended on ideamvim's github homepage.
Unfortunately, if you want to pick and choose parts of vimrc to include there's no proper way. But there is a workaround based on the aforementioned fact that ideavim isn't a vimscript parser....you can source things in vimrc that you don't want sourced by ideamvim using this:
exe "source ~/someconfig.vim"
Ideavim will skip over such lines so you could have common stuff in vimrc and source vim-only stuff by way of the above command. Then you can safely source vimrc in ideavim.
Update: To reiterate, ideavim does not have a vimscript/VimL interpreter. It does a simple pattern-based scan of any sourced vimrc file, recognizing a few directives/commands...
Currently IdeaVim parses several .vimrc commands (:set, :map, :source,
etc.) via pattern matching, i. e. it doesn't fully understand syntax
of Vim configuration files.
The above quote is from an issue in the ideavim bug tracker that is requesting more expansive capabilities in this area.
Until/unless there are any such enhancements made, the things OP would like to do (e.g. conditional sourcing based on environment via something like if has('win32') ... endif
) are not possible except to the limited extent that I mention above and which is also discussed on Stack Overflow How To Include Only Some of Vimrc in IdeaVimrc
basename "/"$(ps -f -p $(cut -d \ -f 4 < /proc/$$/stat) | sed -n '$ s/^.* //p')
But then I looked at it a little closer...are you trying to parseps
output for the parent of the current process? Then for that part, depending on environment, you may just needps -f -p $PPID
!