Created
April 9, 2016 16:10
-
-
Save Baekalfen/487b07570502332182091bc8c5d9235c to your computer and use it in GitHub Desktop.
iTerm 2 beta 3.0 find exact line and column of error in Rust and go to error in Vim
This file contains 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 characters
iTerm: | |
Trigger regex: ^([a-zA-Z0-9+/.-]+):([0-9]+):([0-9]+): ([0-9]+):[0-9]+ (?:error): | |
Trigger action: Capture Output | |
Trigger parameter: echo ":call GetTabOrOpenFile(\"\1\")"; echo "$[\2 - 1]G\3|" | |
For .vimrc: | |
set swb=usetab | |
function! GetTabOrOpenFile(file) | |
try | |
execute "tab sb ".a:file | |
catch /^Vim\%((\a\+)\)\=:E94/ | |
execute "tabnew" | |
execute "e ".a:file | |
" execute "tabe ".a:file | |
endtry | |
1 | |
endfunction | |
Put this in .zshrc to make suspending Vim easier, but it's not required: | |
fancy-ctrl-z () { | |
if [[ $#BUFFER -eq 0 ]]; then | |
BUFFER="fg" | |
zle accept-line | |
else | |
zle push-input | |
zle clear-screen | |
fi | |
} | |
zle -N fancy-ctrl-z | |
bindkey '^Z' fancy-ctrl-z | |
How to use it: | |
Press shift+cmd+b to show toolbox | |
Build a Rust project | |
See the errors come up in Capture Output in toolbox | |
Open Vim | |
Double-click error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credit to https://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ for fancy-ctrl-z