summaryrefslogtreecommitdiffstats
path: root/autoload/cargo.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2018-02-06 11:15:01 +0800
committerAdam Stankiewicz <sheerun@sher.pl>2018-02-06 11:15:01 +0800
commit18efda3933a867dd21df483bbfeae52231783d46 (patch)
treea2af3be10f2140314656d1c2e0e53ef1a1c1b6c6 /autoload/cargo.vim
parentbfc6ed9fbafc0758aaab228df70a3656368d8497 (diff)
downloadvim-polyglot-18efda3933a867dd21df483bbfeae52231783d46.tar.gz
vim-polyglot-18efda3933a867dd21df483bbfeae52231783d46.zip
Update
Diffstat (limited to 'autoload/cargo.vim')
-rw-r--r--autoload/cargo.vim89
1 files changed, 89 insertions, 0 deletions
diff --git a/autoload/cargo.vim b/autoload/cargo.vim
new file mode 100644
index 00000000..e92da22b
--- /dev/null
+++ b/autoload/cargo.vim
@@ -0,0 +1,89 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
+
+function! cargo#cmd(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo ". a:args
+ else
+ echom "Missing arguments"
+ endif
+endfunction
+
+function! cargo#build(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo build " . a:args
+ else
+ execute "!" . "cargo build"
+ endif
+ silent! clear
+ execute "!" . "cargo build"
+endfunction
+
+function! cargo#clean(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo clean " . a:args
+ else
+ execute "!" . "cargo clean"
+ endif
+ silent! clear
+ execute "!" . "cargo clean"
+endfunction
+
+function! cargo#doc(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo doc " . a:args
+ else
+ execute "!" . "cargo doc"
+ endif
+endfunction
+
+function! cargo#new(args)
+ silent! clear
+ if !a:args
+ execute "!cargo new " . a:args
+ :cd `=a:args`
+ else
+ echom "Missing arguments"
+ endif
+endfunction
+
+function! cargo#init(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo init " . a:args
+ else
+ execute "!" . "cargo init"
+ endif
+endfunction
+
+function! cargo#run(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo run " . a:args
+ else
+ execute "!" . "cargo run"
+ endif
+endfunction
+
+function! cargo#test(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo test " . a:args
+ else
+ execute "!" . "cargo test"
+ endif
+endfunction
+
+function! cargo#bench(args)
+ silent! clear
+ if !a:args
+ execute "!" . "cargo bench " . a:args
+ else
+ execute "!" . "cargo bench"
+ endif
+endfunction
+
+endif