summaryrefslogtreecommitdiff
path: root/tools/vim/plugin/utils.vim
diff options
context:
space:
mode:
Diffstat (limited to 'tools/vim/plugin/utils.vim')
-rw-r--r--tools/vim/plugin/utils.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/vim/plugin/utils.vim b/tools/vim/plugin/utils.vim
new file mode 100644
index 00000000..be99551b
--- /dev/null
+++ b/tools/vim/plugin/utils.vim
@@ -0,0 +1,25 @@
+" Name: ni-utils
+" Author: Nicolas Schodet <nico at ni.fr.eu.org>
+" Last Update: 2008-01-28
+" Description: Misc utils.
+" License: Public domain.
+" Installation: Put it in &runtimepath/plugin.
+
+if exists('g:ni_utils_plugin') | finish | endif
+let g:ni_utils_plugin = 1
+
+" Look up README file in '.' and '..' to find a program description.
+function! GetReadme()
+ if filereadable ('README')
+ let readme = 'README'
+ elseif filereadable ('../README')
+ let readme = '../README'
+ endif
+ if exists ('readme')
+ let progname = substitute (system ('head -1 ' . readme), "\n", '', '')
+ else
+ let progname = ''
+ endif
+ return progname
+endfunction
+