2013-12-20 44 views
0

我剛安裝了VIM和一些插件,其中一個是vim壁爐。我遇到的一個問題是,壁爐找不到我的clojure代碼。我把我的clojure代碼放在vimfiles/bundle下(我正在運行windows)。設置vim壁爐,連接clojure代碼

我按照以上說明:

http://kevinmccarthy.org/blog/2013/10/12/setting-up-vim-for-clojure/

當運行在命令行的示例的Clojure函數(我去使用CQC),我得到以下錯誤:

Error detected while processing function <SNR>20_inputeval... foreplay#echo_session_eval..foreplay#session_eval...<SNR>20_eval...6: 
line 38 
E605: Exception not caught: Error running clojure:Error:Could not find or load main class clojure.main^@ 
Error detected while processing function <SNR>20_inputeval: 
line 4 
E71:missing :endif 

這是我的.vimrc:

set nocompatible 
source $VIMRUNTIME/vimrc_example.vim 
source $VIMRUNTIME/mswin.vim 
behave mswin 

syntax on 
filetype plugin indent on 
execute pathogen#infect() 
set nobackup 
set nowritebackup 

set diffexpr=MyDiff() 
function MyDiff() 
    let opt = '-a --binary ' 
    if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif 
    if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif 
    let arg1 = v:fname_in 
    if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif 
    let arg2 = v:fname_new 
    if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif 
    let arg3 = v:fname_out 
    if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif 
    let eq = '' 
    if $VIMRUNTIME =~ ' ' 
    if &sh =~ '\<cmd' 
     let cmd = '""' . $VIMRUNTIME . '\diff"' 
     let eq = '"' 
    else 
     let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' 
    endif 
    else 
    let cmd = $VIMRUNTIME . '\diff' 
    endif 
    silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq 
endfunction 

回答

1

壁爐不能設置classpath,這可能是因爲你沒有使用lein項目。但這不是必需的,您可以始終連接到正在運行的nrepl(可通過lein repl啓動),並使用:Connect nrepl://localhost:port從vim連接到它。

+0

當我輸入「lein nrep」時,出現同樣的錯誤。另外,由於計算機上的安全限制,我無法確定我的端口。 – animalcroc

+0

請嘗試「lein repl」關注它的REPL而不是NREPL。此外,端口在repl啓動時打印。 – FUD

+0

我試過「lein repl」,但得到相同的錯誤。之前你寫過「lein nrep」,這就是爲什麼我嘗試過。 – animalcroc