X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=plugin%2Fcodecomm.vim;h=00efad25d0c739e6296c3ed315137dd817999bd2;hb=c4fcc9f7fcd4d929a1d9f61f858a531d74d6fff5;hp=a2fde108a428c48bdefb5d7be0f371f1834a167a;hpb=4587ba9741ba217f71e608801abd34d9bc317d8e;p=codecomm.git diff --git a/plugin/codecomm.vim b/plugin/codecomm.vim index a2fde10..00efad2 100644 --- a/plugin/codecomm.vim +++ b/plugin/codecomm.vim @@ -6,7 +6,9 @@ if exists("g:loaded_codecomm") | finish | endif let g:loaded_codecomm = 1 if !exists("g:codecomm_file") - let g:codecomm_file = "/tmp/codecomm.txt" + let tmpdir = getenv("TMPDIR") + if tmpdir == v:null | let tmpdir = "/tmp" | endif + let g:codecomm_file = tmpdir . "/" . "codecomm.txt" endif if !exists("g:codecomm_count") | let g:codecomm_count = 0 | endif @@ -83,5 +85,6 @@ function! s:CodeCommClear() endfunction command! CodeCommClear call CodeCommClear() +command! CodeCommEdit :execute "edit " . g:codecomm_file command! -range CodeComm , call CodeComm() vnoremap cc :call CodeComm()