summaryrefslogtreecommitdiff
path: root/d/tools/vim/plugin/utils.vim
blob: a9ccd1101bafa9da913eea42f493afaea13879e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
" Name:		ni-utils
" Author:	Nicolas Schodet <schodet@efrei.fr>
" Last Update:	2005-07-23
" Description:	Utilitaires divers
" License:	Domaine public.
" Installation:	Mettre le script dans &runtimepath/plugin.

if exists('g:ni_utils_plugin') | finish | endif
let g:ni_utils_plugin = 1

" Recherche README dans `.' et `..' pour y lire le nom du prog et sa
" 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