let g:context_mtxrun = 'PATH=$HOME/context/context-osx-64/tex/texmf-osx-64/bin:$PATH mtxrun'

nnoremap <leader>å :ConTeXt<CR>
nnoremap <silent><buffer> <leader>ö :<c-u>call tex#preview()<cr>
nnoremap <silent><buffer> <leader>ä
    \ :<c-u>call tex#goto_texshop(expand("%:p"), line('.'), col('.'), 1, 1)<cr>

Here is my snippet from my personal context.vim file

I see that you have :! and that means that you instruct vim to execute a shell command.

Just write :ConTeXt<CR> and it should work fine

13 dec. 2021 kl. 14:30 skrev Jeong Dal via ntg-context <ntg-context@ntg.nl>:

Dear John, Nicola,

I created a file context.vim under the folder ~/.vim/after/ftplugin/ which contains

map <C-h>><Esc> :w<CR>:!ConTeXt<CR>
let g:context_mtxrun = 'PATH=$HOME/ConTeXtLM/tex/texmf-osx-64/bin:$PATH mtxrun'
let g:tex_flavor = "context"

The result is
1. using “:ConTeXt”   issued an error message:  “E492: not an editor command: ConTeXt
2. using “make” issued an error message: "No targets specified and no makefile found. …" 
Pressing C-h, compiling started and succesfully ended. However, it use /usr/local/texlive/… not LMTX tex folder.

Without context.vim, “:ConTeXt" and “:make" worked fine.

I’ll do more test. 

Thank you.
Best regards,

Dalyoung

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________