vim 显示问题

Vim、Emacs配置和使用
回复
jeff1
帖子: 7
注册时间: 2014-04-24 16:40
系统: Ubuntu 14.10
联系:

vim 显示问题

#1

帖子 jeff1 » 2014-05-21 22:05

vim 无法完全显示运行结果, 如图
头像
astolia
论坛版主
帖子: 6514
注册时间: 2008-09-18 13:11

Re: vim 显示问题

#2

帖子 astolia » 2014-05-22 11:35

图没贴上来
jeff1
帖子: 7
注册时间: 2014-04-24 16:40
系统: Ubuntu 14.10
联系:

Re: vim 显示问题

#3

帖子 jeff1 » 2014-05-22 23:28

说明图片
说明图片
astolia 写了:图没贴上来
尼玛图挂了
简单描述一下吧 就是我写个c程序 用的是while函数 然后一键编译运行后 显示的结果只有后几十个 前面的显示不出
头像
astolia
论坛版主
帖子: 6514
注册时间: 2008-09-18 13:11

Re: vim 显示问题

#4

帖子 astolia » 2014-05-24 11:24

直接在ex mode下输出?你为什么不用less呢?
:!./yourprogram | less
jeff1
帖子: 7
注册时间: 2014-04-24 16:40
系统: Ubuntu 14.10
联系:

Re: vim 显示问题

#5

帖子 jeff1 » 2014-05-24 15:54

astolia 写了:直接在ex mode下输出?你为什么不用less呢?
:!./yourprogram | less
提示 warning: terminal is not fully functional
另外我用的一键编译运行设置,帮看看怎么改, 谢谢. :em01

代码: 全选

"单个文件编译
map <F5> :call Do_OneFileMake()<CR>
imap <F5> <ESC> call Do_OneFileMake()<CR>
function Do_OneFileMake()
    
    if expand("%:p:h")!=getcwd()
        echohl WarningMsg | echo "Fail to make! This file is not in the current dir! Press <F7> to redirect to the dir of this file." | echohl None
        return
    endif
    let sourcefileename=expand("%:t")
    if (sourcefileename=="" || (&filetype!="cpp" && &filetype!="c"))
        echohl WarningMsg | echo "Fail to make! Please select the right file!" | echohl None
        return
    endif
    let deletedspacefilename=substitute(sourcefileename,' ','','g')
    if strlen(deletedspacefilename)!=strlen(sourcefileename)
        echohl WarningMsg | echo "Fail to make! Please delete the spaces in the filename!" | echohl None
        return
    endif
    exe ":ccl"
    exe ":update"
    if &filetype=="c"
        if g:iswindows==1
            set makeprg=gcc\ -g\ -o\ %<.exe\ %
        else
            set makeprg=gcc\ -g\ -o\ %<\ %
        endif
    elseif &filetype=="cpp"
        if g:iswindows==1
            set makeprg=g++\ -g\ -o\ %<.exe\ %
        else
            set makeprg=g++\ -g\ -o\ %<\ %
        endif
        "elseif &filetype=="cs"
        "set makeprg=csc\ \/nologo\ \/out:%<.exe\ %
    endif
    if(g:iswindows==1)
        let outfilename=substitute(sourcefileename,'\(\.[^.]*\)' ,'.exe','g')
        let toexename=outfilename
    else
        let outfilename=substitute(sourcefileename,'\(\.[^.]*\)' ,'','g')
        let toexename=outfilename
    endif
    if filereadable(outfilename)
        if(g:iswindows==1)
            let outdeletedsuccess=delete(getcwd()."\\".outfilename)
        else
            let outdeletedsuccess=delete("./".outfilename)
        endif
        if(outdeletedsuccess!=0)
            set makeprg=make
            echohl WarningMsg | echo "Fail to make! I cannot delete the ".outfilename | echohl None
            return
        endif
    endif
    execute "silent make"
    set makeprg=make
    execute "normal :"
    if filereadable(outfilename)
        if(g:iswindows==1)
            execute "!".toexename
        else
            execute "!./".toexename
        endif
    endif
    execute "copen"
endfunction
"进行make的设置
map <F6> :call Do_make()<CR>
map <c-F6> :silent make clean<CR>
function Do_make()
    set makeprg=make
    execute "silent make"
    execute "copen"
endfunction
头像
astolia
论坛版主
帖子: 6514
注册时间: 2008-09-18 13:11

Re: vim 显示问题

#6

帖子 astolia » 2014-05-25 21:09

你是在什么系统环境下用的vim?你用的终端vim不支持。

没兴趣看那么长一段脚本,写makefile才是正途
jeff1
帖子: 7
注册时间: 2014-04-24 16:40
系统: Ubuntu 14.10
联系:

Re: vim 显示问题

#7

帖子 jeff1 » 2014-05-26 10:15

astolia 写了:你是在什么系统环境下用的vim?你用的终端vim不支持。

没兴趣看那么长一段脚本,写makefile才是正途
ubuntu14.10
回复