]> git.madduck.net Git - etc/vim.git/blobdiff - test/vimrc

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Lines which start with '-' are needed in foldexpr
[etc/vim.git] / test / vimrc
index 86020ed369bdddc52f69f5a01df0b0801c390dc4..44df1b6140b309adbe1c80ce40a0ac9e9714a428 100644 (file)
@@ -6,3 +6,19 @@ filetype on
 filetype plugin on
 filetype indent on
 syntax on
+
+function! Markdown_GetScriptID(fname) abort
+    let a:snlist = ''
+    redir => a:snlist
+    silent! scriptnames
+    redir END
+    let a:mx = '^\s*\(\d\+\):\s*\(.*\)$'
+    for a:line in split(a:snlist, "\n")
+        if stridx(a:line, a:fname) >= 0
+            return substitute(a:line, a:mx, '\1', '')
+        endif
+    endfor
+endfunction
+function! Markdown_GetFunc(fname, funcname) abort
+    return function('<SNR>' . Markdown_GetScriptID(a:fname) . '_' . a:funcname)
+endfunction