Skip to content

Commit 9bb1bb8

Browse files
committed
Set a sensible g:sclandTerm when on Linux
This should allow Linux users to use their default terminal emulator, rather than having to explicitly set one. Or at least it will on Debian and Ubuntu based systems. I'm not sure what other systems use the x-terminal-emulator alias. I've also removed some trailing whitespace.
1 parent bfd5da5 commit 9bb1bb8

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
SCVim (> 3.5)
22
==============
33

4-
A vim plugin for supercollider.
4+
A vim plugin for supercollider.
55

66
This is based of the original scvim by Alex Norman (see:
7-
<http://www.x37v.info/scvim/>).
7+
<http://www.x37v.info/scvim/>).
88

9-
Features
9+
Features
1010

1111
* Syntax Highlighting
1212
* A faked REPL via the terminal
@@ -26,10 +26,10 @@ Installation:
2626

2727
It is highly recommended to use pathogen
2828
(<https://github.com/tpope/vim-pathogen>) to keep your .vim paths clean. See the
29-
supplied helpfile how to setup pathogen if you haven't used it before.
29+
supplied helpfile how to setup pathogen if you haven't used it before.
3030

3131
Make sure the folder is named 'scvim' and drop it into your "bundle" folder, e.g.
32-
"~/.vim/bundle/scvim".
32+
"~/.vim/bundle/scvim".
3333

3434
Or just do:
3535
`
@@ -73,15 +73,16 @@ Path to the tags file
7373
The following variables are available for configuration in your `.vimrc` file:
7474

7575
* `g:sclangTerm`: Command to open a terminal window. Defaults to `"open -a
76-
Terminal.app"`.
76+
Terminal.app"` on OSX, and `"x-terminal-emulator -e $SHELL -ic"` on Linux. On
77+
some Linux systems this value may need to changed.
7778
* `g:sclangPipeApp`: Absolute path to the plugin **start_pipe** script. Defaults
7879
to `"~/.vim/bundle/scvim/bin/start_pipe"`. Change it if you have installed
7980
the plugin in other location.
8081
* `g:sclangDispatcher`: Absolute path to the plugin **sc_dispatcher** script.
8182
Defaults to `"~/.vim/bundle/scvim/bin/sc_dispatcher"`. Change it if you
8283
have installed the plugin in other location.
8384

84-
Example `.vimrc` line for debian/ubuntu users:
85+
Example `.vimrc` line for gnome-terminal users:
8586

8687
let g:sclangTerm = "gnome-terminal -x $SHELL -ic"
8788

@@ -94,15 +95,15 @@ If for some reason vim can't find the path to the two launch scripts
9495
Using it:
9596
--------
9697
To start open a file with the right extension :e foo.sc(d)
97-
Enter `:SClangStart` and a terminal should open with a running sclang session.
98+
Enter `:SClangStart` and a terminal should open with a running sclang session.
9899

99-
See the commands reference for general usage.
100+
See the commands reference for general usage.
100101

101102
_ctags support_:
102103

103104
run `:SCTags` from vim or `SCVim.generateTagsFile()` from sclang
104105

105-
This gives you a couple of things:
106+
This gives you a couple of things:
106107

107108
* You can jump to any known class or method
108109
* You get tags completion with ctrl-x ctrl-] (use the vim supertab plugin if this is too

ftplugin/supercollider.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ endif
4343

4444
if exists("g:sclangTerm")
4545
let s:sclangTerm = g:sclangTerm
46+
elseif system('uname') =~ 'Linux'
47+
let s:sclangTerm = "x-terminal-emulator -e $SHELL -ic"
4648
else
4749
let s:sclangTerm = "open -a Terminal.app"
4850
endif
@@ -196,7 +198,7 @@ endfunction
196198
" ========================================================================================
197199

198200
function SClangStart()
199-
call system(s:sclangTerm . " " . s:sclangPipeApp)
201+
call system(s:sclangTerm . " " . s:sclangPipeApp . "&")
200202
endfunction
201203

202204
function SClangKill()

0 commit comments

Comments
 (0)