-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
set_repl_cmd.vim
153 lines (153 loc) · 4.75 KB
/
set_repl_cmd.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
if has('nvim') || has('terminal')
aug set_repl_cmd
au!
" Ruby and Rails
au FileType ruby,eruby
\ if executable('bundle') && filereadable('config/application.rb') |
\ call neoterm#repl#set('bundle exec rails console') |
\ elseif executable(g:neoterm_repl_ruby) |
\ call neoterm#repl#set(g:neoterm_repl_ruby) |
\ end
" Python
au FileType python
\ if neoterm#repl#python#is_valid(g:neoterm_repl_python) == 1 |
\ call neoterm#repl#set(g:neoterm_repl_python) |
\ elseif executable('ipython') |
\ call neoterm#repl#set('ipython --no-autoindent') |
\ elseif executable('python') |
\ call neoterm#repl#set('python') |
\ end
" JavaScript
au FileType javascript
\ if executable('node') |
\ call neoterm#repl#set('node') |
\ end
" Java
au FileType java
\ if executable('jshell') |
\ call neoterm#repl#set('jshell') |
\ end
" Elixir
au FileType elixir
\ if filereadable('config/config.exs') |
\ call neoterm#repl#set('iex -S mix') |
\ elseif &filetype == 'elixir' |
\ call neoterm#repl#set('iex') |
\ end
" Julia
au FileType julia
\ if executable('julia') |
\ call neoterm#repl#set('julia') |
\ end
" PARI/GP
au FileType gp
\ if executable('gp') |
\ call neoterm#repl#set('gp') |
\ end
" R
au FileType r,rmd
\ if executable(g:neoterm_repl_r) |
\ call neoterm#repl#set(g:neoterm_repl_r) |
\ elseif executable('R') |
\ call neoterm#repl#set('R') |
\ end
" Octave
au FileType octave
\ if executable('octave') |
\ if executable('octave-cli') |
\ if g:neoterm_repl_octave_qt |
\ call neoterm#repl#set('octave --no-gui') |
\ else |
\ call neoterm#repl#set('octave-cli') |
\ end |
\ else |
\ call neoterm#repl#set('octave') |
\ end |
\ end
" MATLAB
au FileType matlab
\ if executable('matlab') |
\ call neoterm#repl#set('matlab -nodesktop -nosplash') |
\ end
" Idris
au FileType idris,lidris
\ if executable('idris') |
\ call neoterm#repl#set('idris') |
\ end
" Haskell
au FileType haskell
\ if executable('stack') |
\ call neoterm#repl#set('stack ghci') |
\ elseif executable('ghci') |
\ call neoterm#repl#set('ghci') |
\ end
au FileType php
\ let s:argList = split(g:neoterm_repl_php) |
\ if len(s:argList) > 0 && executable(s:argList[0]) |
\ call neoterm#repl#set(g:neoterm_repl_php) |
\ elseif executable('psysh') |
\ call neoterm#repl#set('psysh') |
\ elseif executable('php') |
\ call neoterm#repl#set('php -a') |
\ end
" Clojure
au FileType clojure
\ if executable('lein') |
\ call neoterm#repl#set('lein repl') |
\ end
" Lua
au FileType lua
\ if executable('luap') |
\ let s:lua_repl='luap' |
\ elseif executable('lua') |
\ let s:lua_repl='lua' |
\ end |
\ if executable('luarocks') && exists('s:lua_repl') |
\ call neoterm#repl#set(s:lua_repl . ' -l"luarocks.require"') |
\ end
" TCL
au FileType tcl
\ if executable('tclsh') |
\ call neoterm#repl#set('tclsh') |
\ end
" Standard ML (SML)
au FileType sml
\ if executable('sml') |
\ if executable('rlwrap') |
\ call neoterm#repl#set('rlwrap sml') |
\ else |
\ call neoterm#repl#set('sml') |
\ end |
\ end
" Scala
au FileType scala
\ if executable('sbt') |
\ call neoterm#repl#set('sbt console') |
\ end
" Stata
au FileType stata
\ if executable('stata') |
\ call neoterm#repl#set('stata -q') |
\ end
" Racket
au FileType racket
\ if executable('racket') |
\ call neoterm#repl#set('racket') |
\ end
" Lisp Flavored Erlang
au FileType lfe
\ if executable('lfe') |
\ call neoterm#repl#set('lfe') |
\ end
" Rust
au FileType rust
\ if executable('evcxr') |
\ call neoterm#repl#set('evcxr') |
\ end
" Janet
au FileType janet
\ if executable('janet') |
\ call neoterm#repl#set('janet') |
\ end
aug END
end