(Insert TipProposed template + minor manual clean)
Line 1:
Line 1:
−
I added the following to my .vimrc to be able to run the matlab script under edition usign a single <F5> stroke (with shift-F6 you run Matlab in a terminal):
+
{{TipProposed
+
|id=0
+
|previous=0
+
|next=0
+
|created=July 30, 2012
+
|complexity=basic
+
|author=
+
|version=7.0
+
|subpage=/201207
+
|category1=Matlab
+
|category2=
+
}}
+
I added the following to my [[vimrc]] to be able to run a Matlab script by pressing F5 (with Shift-F6 you run Matlab in a terminal):
We have not yet decided whether to keep this tip as its own page or merge it somewhere else. If you have a suggestion on the tip content, please edit this page or add your comments below (do not use the discussion page).
Please discuss whether to keep this as a new tip, or whether to merge it into an existing tip, on the new tips discussion page.
created July 30, 2012 · complexity basic · version 7.0
I added the following to my vimrc to be able to run a Matlab script by pressing F5 (with Shift-F6 you run Matlab in a terminal):
#!/usr/bin/python2
from subprocess import call
from subprocess import check_output
import sys
wcmd = ["xdotool","search","--name","MatlabT"]
w = check_output(wcmd)
w = w.replace('\n','')
if len(sys.argv) > 1:
s = sys.argv[1]
cmd = ["xdotool","key","--window",w]
for i in range(len(s)):
cmd.append(s[i])
cmd.append("Return")
call(cmd)