]> git.mdlowis.com Git - proto/pick.git/commitdiff
checkin pick.vim and pickfile for practical usage
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 24 Apr 2019 15:13:41 +0000 (11:13 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 24 Apr 2019 15:13:41 +0000 (11:13 -0400)
pick.vim [new file with mode: 0644]
pickfile [new file with mode: 0755]

diff --git a/pick.vim b/pick.vim
new file mode 100644 (file)
index 0000000..6118092
--- /dev/null
+++ b/pick.vim
@@ -0,0 +1,12 @@
+function! PickFile()
+  try
+    let files = systemlist("pickfile")
+    redraw!
+    if v:shell_error != 0 || len(files) == 0
+      return
+    endif
+    execute ":e ".fnameescape(files[0])
+  catch /Vim:Interrupt/
+    redraw!
+  endtry
+endfunction
diff --git a/pickfile b/pickfile
new file mode 100755 (executable)
index 0000000..b265255
--- /dev/null
+++ b/pickfile
@@ -0,0 +1,6 @@
+#!/bin/sh
+find . \( \
+    -name .git -o \
+    -name .svn -o \
+    -name node_modules \
+\) -prune -o -print | pick
\ No newline at end of file