Last active
August 29, 2015 14:26
Revisions
-
ggarza revised this gist
Jul 28, 2015 . 1 changed file with 15 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ on run argv set command to item 1 of argv tell application "iTerm" --make new terminal tell the current terminal --activate current session --launch session "Default Session" tell the last session write text command end tell end tell end tell end run -
ggarza created this gist
Jul 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ " Vim filetype plugin file " Language: julia autocmd! BufLeave,FocusLost * nested silent! update nmap <buffer> <silent> <space> <esc>:call Send_to_iterm()<cr>j noremap <leader>ae <esc>:w<cr>:call Send_input_file_to_iterm()<cr> noremap <leader>rf <esc>:w<cr>:call New_julia_repl()<cr> noremap <leader>pd <esc>:w<cr>:call Get_paragraph()<cr> function! Send_to_iterm() let current_line= getline('.') silent exec "!osascript ~/.vim/scripts/sendtoiterm.applescript " . shellescape(current_line, 1) endfunction function! Send_input_file_to_iterm() let current_file = '"' . "%:p" . '"' let include_file = "include\(" . current_file . "\)" let include_file = "'" . include_file . "'" silent exec "!osascript ~/.vim/scripts/sendtoiterm.applescript " . include_file endfunction function! New_julia_repl() let current_directory = "%:p:h" silent exec "!open -a iTerm %:p:h" silent exec "!osascript ~/.vim/scripts/sendtoiterm.applescript julia" endfunction function! Get_paragraph() let start = line('.') let end = search("^$") let lines = getline(start, end) for line in lines silent exec "!osascript ~/.vim/scripts/sendtoiterm.applescript " . shellescape(line, 1) endfor endfunction