试图使用时“ ZSH:1:没有此类文件或目录”:compilerun invim

问题描述 投票:0回答:1

I刚刚开始使用VIM作为我的主要IDE,并设置了一些诸如语法之类的插件。 但是,当我尝试编译和运行我的程序在the the

:CompileRun
命令中,我会得到此错误:

zsh:1: no such file or directory:.//mnt/Storage/C++/EX/test.cpp

我是我的

.vimrc

set number

call plug#begin('~/.vim/plugged')

Plug 'preservim/nerdtree'                             
Plug 'airblade/vim-gitgutter'                         
Plug 'scrooloose/nerdcommenter'                       
Plug 'vim-airline/vim-airline'                         
Plug 'vim-airline/vim-airline-themes'                  
Plug 'ycm-core/YouCompleteMe'                         
Plug 'tmux-plugins/vim-tmux', { 'branch': 'master' }
Plug '[email protected]:cpp0x/vim-cpp-modern.git'                            

Plug 'vim-syntastic/syntastic'
command! CompileRun execute './"%:p:r".out'


" Enable clangd for C++ support (for autocompletion, diagnostics)
let g:coc_global_extensions = ['coc-clangd']
let g:syntastic_mode_map = { 'mode': 'active' }
let g:syntastic_cpp_checkers = ['gcc']


call plug#end()

我试图用正确的一条线替换

command!
线,并尝试了多个事情,但它没有起作用。

vim ide vim-plugin
1个回答
0
投票
错误是在

'./"%:p:r".out'

%:p
返回文件系统根的完整路径,但是您预处了
./
并破坏了完整的路径。只需删除
./

command! CompileRun execute '"%:p:r".out'
    
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.