Skip to content

Commit 4786376

Browse files
committed
added a script for iterm
1 parent 2de0788 commit 4786376

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

plugin/vim-arduino-serial-iterm

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
port=$(ls /dev/tty.* | grep usb)
4+
5+
osascript -e \
6+
"
7+
tell application \"iTerm2-.9\"
8+
tell current session of current window
9+
set newTab to (split horizontally with default profile)
10+
select newTab
11+
tell newTab
12+
write text \"screen -S arduino-serial $port\"
13+
end tell
14+
end tell
15+
end tell
16+
"

plugin/vim-arduino.vim

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ if !exists('g:vim_arduino_ino_cmd')
1414
let g:vim_arduino_ino_cmd = 'ino'
1515
endif
1616

17+
if !exists('g:vim_arduino_serial_terminal_script')
18+
let g:vim_arduino_serial_terminal_script = 'vim-arduino-serial'
19+
endif
20+
1721
let s:helper_dir = expand("<sfile>:h")
1822

1923
function! s:PrintStatus(result)
@@ -50,7 +54,7 @@ endfunction
5054
"
5155
" Returns nothing.
5256
function! s:ArduinoKillMonitor()
53-
let output = system("screen -X -S arduino-serial quit")
57+
let output = system("screen -X -S" . g:vim_arduino_serial_terminal_script . "quit")
5458
endfunction
5559

5660
" Public: Compile the current pde file.
@@ -76,7 +80,7 @@ endfunction
7680
"
7781
" Returns nothing.
7882
function! ArduinoSerialMonitor()
79-
echo system(s:helper_dir."/vim-arduino-serial")
83+
echo system(s:helper_dir."/".g:vim_arduino_serial_terminal_script)
8084
endfunction
8185

8286
if !exists('g:vim_arduino_map_keys')

0 commit comments

Comments
 (0)