From 44410fd77f6db7d730f146cfdd95ef75e4899185 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 2 Mar 2011 02:46:41 -0600 Subject: allow reloading functions more easily --- vimrc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index f4c3365..d180d9d 100644 --- a/vimrc +++ b/vimrc @@ -256,7 +256,7 @@ autocmd BufWritePost * if filereadable('tags') | silent exe "!ctags -a %" | redr " }}} " Prompt to create directories if they don't exist {{{ autocmd BufNewFile * :call ensure_dir_exists() -function s:ensure_dir_exists () +function! s:ensure_dir_exists () let required_dir = expand("%:h") if !isdirectory(required_dir) call ask_quit("Directory '" . required_dir . "' doesn't exist.", "&Create it?") @@ -268,7 +268,7 @@ function s:ensure_dir_exists () endtry endif endfunction -function s:ask_quit (msg, proposed_action) +function! s:ask_quit (msg, proposed_action) if confirm(a:msg, "&Quit?\n" . a:proposed_action) == 1 exit endif @@ -336,7 +336,7 @@ map :makek imap :makek " }}} " Painless spell checking (F11) {{{ -function s:spell() +function! s:spell() if !exists("s:spell_check") || s:spell_check == 0 echo "Spell check on" let s:spell_check = 1 @@ -354,7 +354,7 @@ imap :call spell() let s:foldmethod = &foldmethod let s:foldenable = &foldenable let s:diffwindow = 0 -function s:diffstart(read_cmd) +function! s:diffstart(read_cmd) if s:diffwindow != 0 return endif @@ -380,7 +380,7 @@ function s:diffstart(read_cmd) " why does this not happen automatically? normal zM endfunction -function s:diffstop() +function! s:diffstop() if s:diffwindow == 0 return endif @@ -394,7 +394,7 @@ function s:diffstop() endif let s:diffwindow = 0 endfunction -function s:vcs_orig(file) +function! s:vcs_orig(file) " XXX: would be nice to use a:file rather than # here... let dir = expand('#:p:h') if filewritable(dir . '/.svn') == 2 @@ -463,7 +463,7 @@ nmap p :call nopaste(0) xmap p :call nopaste(1) " }}} " better version of keywordprg {{{ -function Help(visual, iskeyword, command) +function! Help(visual, iskeyword, command) let iskeyword = &iskeyword for kw in a:iskeyword exe 'set iskeyword+=' . kw @@ -493,7 +493,7 @@ function Help(visual, iskeyword, command) set nobuflisted set nomodifiable endfunction -function s:man(word) +function! s:man(word) exe 'silent read! man -Pcat ' . a:word set ft=man endfunction @@ -501,7 +501,7 @@ nmap K :call Help(0, [], 'man') xmap K :call Help(1, [], 'man') " }}} " ;= to align = signs {{{ -function s:align_assignments() +function! s:align_assignments() " Patterns needed to locate assignment operators... let ASSIGN_OP = '[-+*/%|&]\?=\@