Created
September 15, 2016 18:37
-
-
Save humus/b7492f82ef76c1450130e7a3ea2348fc to your computer and use it in GitHub Desktop.
Script for working with java functions
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
fun! Fqcn() "{{{ | |
let s:lnum = search('\v^package[^;]+;\s*$', 'n') | |
let s:strline = getline(s:lnum) | |
let s:packagename=matchstr(s:strline, '\v^package\s+\zs[^;]+\ze;') | |
return s:packagename . '.' . expand('%:t:r') | |
endfunction "}}} | |
fun! Compile() "{{{ | |
execute 'silent! !tmux send-keys "cpjar_javac ' . expand('%:t:r') . '" c-m' | |
redraw! | |
endfunction "}}} | |
fun! Execute() "{{{ | |
execute 'silent! !tmux send-keys "cpjar_javax ' . Fqcn() . '" c-m' | |
redraw! | |
endfunction "}}} | |
fun! Execute_test() "{{{ | |
execute 'silent! !tmux send-keys "cpjar_junit ' . Fqcn() . '" c-m' | |
redraw! | |
endfunction "}}} | |
noremap! <buffer> ,,c <C-r>=Fqcn()<cr> | |
noremap <buffer> ,,c :call Compile()<cr> | |
noremap <buffer> ,,x :call Execute()<cr> | |
noremap <buffer> ,,t :call Execute_test()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment