aboutsummaryrefslogtreecommitdiff
path: root/vim-plugin/plugin
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-27 12:40:42 +0100
committerAkshay <[email protected]>2021-10-27 12:43:23 +0100
commitf909b20c540ea99dddfd04b8439ee35b8dd703b8 (patch)
treecc9a60108f975419bf2621262739071a5f0a1be6 /vim-plugin/plugin
parented1ee66b06add4c22e4922ffa762f097355c7431 (diff)
allow stdin input to statix-single, vim pluginv0.2.2
Diffstat (limited to 'vim-plugin/plugin')
-rw-r--r--vim-plugin/plugin/statix.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/vim-plugin/plugin/statix.vim b/vim-plugin/plugin/statix.vim
new file mode 100644
index 0000000..736cce2
--- /dev/null
+++ b/vim-plugin/plugin/statix.vim
@@ -0,0 +1,14 @@
1function! ApplyStatixSuggestion()
2 let l:l = line('.')
3 let l:c = col('.')
4 let l:filter = "%!statix single -p " . l . "," . c . ""
5 execute l:filter
6
7 silent if v:shell_error == 1
8 undo
9 endif
10
11 call cursor(l, c)
12endfunction
13
14nnoremap gf :call ApplyStatixSuggestion()<cr>