Thats it, what I have in my vimrc and I would like it to work is :
set makeprg=python\ %
nmap <F5> :silent make | copen
It doesnt work, it echoes :silent make and doesnt run or report errors in script. But if I just type in Vim
:silent make | copen
I get my desired result.
I'm using GVim 7.4 on windows vista
You are executing your python code not linting it. A quick google shows pylint and Python - check syntax and run script . There is also synstastic.vim if you want a heavier handed approach.
You mapping has the following problems:
|
, is not escaped. Use <bar>
instead. *noremap
unless using <Plug>
mappings <cr>
at the end :autocmd
to execute :cwindow
/ :copen
after :make
. eg autocmd QuickFixCmdPost * cwindow
command! -nargs=* Smake silent make <args>
command! -nargs=* Smake silent make <args>
. Now you can do :Smake
instead of :make
Your new mapping:
nnoremap <F5> :silent make <bar> copen<cr>
For more help see:
:h :map
:h <bar>
:h :au
:h QuickFixCmdPost
:h :cwindow
:h :cope
:h :compiler
:h write-compiler-plugin
我认为这是因为map
命令不接受将竖线字符作为命令分隔符并将其作为输入,因此您可以将其替换为<bar>
,例如:
:nmap <F5> :silent make <bar> copen<CR>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.