From: Nicolas Boisselier Date: Fri, 6 Feb 2015 22:05:58 +0000 (+0000) Subject: vimplate-dump fix X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=378da78ab83e74b895599d31efac289632aca6cd;p=nb.git vimplate-dump fix --- diff --git a/etc/bashrc b/etc/bashrc index 0695cd27..2ab34643 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -2,7 +2,7 @@ . "${BASH_SOURCE%/*}/bashrc.alias" ################################################################################# # -# VARS +# ENVS # ################################################################################# NB_ROOT=$(realpath ${BASH_SOURCE%/*}/..) @@ -11,12 +11,6 @@ NB_ROOT=$(realpath ${BASH_SOURCE%/*}/..) [ -z "$USER" ] && USER=`whoami` [ -z "$HOME" ] && HOME=`realpath ~/` -################################################################################# -# -# ENV -# -################################################################################# - # # PATH # diff --git a/etc/bashrc.alias b/etc/bashrc.alias index fcbaa85a..e0675848 100644 --- a/etc/bashrc.alias +++ b/etc/bashrc.alias @@ -106,6 +106,7 @@ case "$OSTYPE" in darwin*) alias mac-top-proc="echo 'TOP PROCESSES:'; ps -Aro'%cpu, ucomm, user' | grep $USER | grep -v ' 0.0 '" alias mac-automount='sudo automount -v' alias mac-vlc-playlists="open -a vlc --args /home/nico/Music/*/*.m3u" + alias mac-mount-nfs="sudo mount -o resvport -t nfs" esac diff --git a/etc/vim/source/functions.vim b/etc/vim/source/functions.vim index d94027d3..42278d76 100644 --- a/etc/vim/source/functions.vim +++ b/etc/vim/source/functions.vim @@ -53,12 +53,20 @@ func! FileVimplate() let $BASH_ENV = bashenv endfunc +let $FileInit = '' func! FileInit(...) + + " One load per file + let CurrentFile = expand('%:p') + if $FileInit == CurrentFile + return + endif + let $FileInit = CurrentFile + call Debug('FileInit()') + let bashenv = $BASH_ENV let $BASH_ENV = "" - - let vimplate = $VIMHOME."/vimplate-dump" - " NB 18.02.14 let tmp = vimplate .".vim.tmp" + let vimplate = $VIMHOME."/vimplate-dump ".$VIMPLATERC let tmp = '/tmp/vimplate-dump.tmp' call system(vimplate ." > ". tmp) @@ -196,14 +204,13 @@ func! Debug(...) return g:DebugMsgs endif - let msg = strftime('%F %T') . ' ' . a:1 + let msg = strftime('%F %T') . ': ' . a:1 call add(g:DebugMsgs,msg) if g:Debug == 1 echo "DEBUG:" msg endif - " echo string(g:DebugMsgs) return g:Debug diff --git a/etc/vim/vimplate-dump b/etc/vim/vimplate-dump index 0ab5e110..6e84c104 100755 --- a/etc/vim/vimplate-dump +++ b/etc/vim/vimplate-dump @@ -1,5 +1,5 @@ #!/usr/bin/env perl -require $ENV{HOME}.'/.vimplaterc'; +require ( @ARGV ? $ARGV[0] : $ENV{HOME}.'/.vimplaterc' ); print map {