2

I have an exe program that checks for certain errors in a text file.

I want to create a shortcut (like \+M) to run that exe file against the text file.

My exe file's path is C:\Users\xyz\Documents\Checker\manager.exe, the text file's path is C:\Users\xyz\Desktop\mytextfile.txt.

The manager just needs the following command:

check [full filepath to the text file

Here is what I have tried in the VIM plugin file.

function! ExecuteManagerCheck(file)
    execute ':!start cmd /k "C:\Users\xyz\Documents\checker\manager check " g:file'
endfunction

nmap <leader>m :call ExecuteManagerCheck(expand('%:p')) <cr>

Can someone please help me get the full file path to the current text file open in Vim?

  • 1
    That should probably be a:file and not g:file – D. Ben Knoble Jun 15 '18 at 20:54
  • Your expand('%:p') should work, according to eval.txt, but the quotemarks in "C:\...\manager check " don't make sense. Do you see any error messages when you try to run the plugin? – JigglyNaga Sep 13 '18 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy