The same .vimrc file gets complained only when remote login themachine

This is a discussion on The same .vimrc file gets complained only when remote login themachine within the Editors forums in Theory and Concepts category; Hi, I have a function defined in .vimrc to customize VIM tab, it works fine when I work directly on my office Linux machine. When I remote login to the machine from home, each time I start VIM, I get an error message: Error detected while processing /home/<login>/.vimrc: line 31: E18: Unexpected characters before '=' line 41: E121: Undefined variable: buflist E116: Invalid arguments for function bufname(buflist[tabpagewinnr(v:lnum) - 1]) E15: Invalid expression: bufname(buflist[tabpagewinnr(v:lnum) - 1]) line 42: E121: Undefined variable: n E116: Invalid arguments for function fnamemodify(n, ':t') E15: Invalid expression: fnamemodify(n, ':t') line 44: E133: :return not inside a ...

Go Back   Application Development Forum > Theory and Concepts > Editors

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-24-2008, 08:17 PM
linq936@hotmail.com
Guest
 
Default The same .vimrc file gets complained only when remote login themachine

Hi,

I have a function defined in .vimrc to customize VIM tab, it works
fine when I work directly on my office Linux machine. When I remote
login to the machine from home, each time I start VIM, I get an error
message:

Error detected while processing /home/<login>/.vimrc:
line 31:
E18: Unexpected characters before '='
line 41:
E121: Undefined variable: buflist
E116: Invalid arguments for function
bufname(buflist[tabpagewinnr(v:lnum) - 1])
E15: Invalid expression: bufname(buflist[tabpagewinnr(v:lnum) - 1])
line 42:
E121: Undefined variable: n
E116: Invalid arguments for function fnamemodify(n, ':t')
E15: Invalid expression: fnamemodify(n, ':t')
line 44:
E133: :return not inside a function
line 45:
E193: :endfunction not inside a function
line 47:
E518: Unknown option: guitablabel=%{GuiTabLabel()}
Hit ENTER or type command to continue


Here is the the rc file:

set shiftwidth=3
set tabstop=3
set expandtab
:if &term == "xterm"
set t_kb=
fixdel
endif
set autoindent
set showcmd
set hlsearch
set ruler
syntax on
set backup
set backupdir=~/tmp
set tags=tags;
set cindent

function! GuiTabLabel()
" add the tab number
let label = '['.tabpagenr()

" modified since the last save?
let buflist = tabpagebuflist(v:lnum)
for bufnr in buflist
if getbufvar(bufnr, '&modified')
let label .= '+'
break
endif
endfor

let label .= '] '

" count number of open windows in the tab
"let wincount = tabpagewinnr(v:lnum, '$')margin: 0 auto
"if wincount > 1
" let label .= ', '.wincount
"endif
"let label .= '] '

" add the file name without path information
let n = bufname(buflist[tabpagewinnr(v:lnum) - 1])
let label .= fnamemodify(n, ':t')

return label
endfunction

set guitablabel=%{GuiTabLabel()}


Any idea?
Reply With Quote
  #2  
Old 08-25-2008, 02:34 PM
Gary Johnson
Guest
 
Default Re: The same .vimrc file gets complained only when remote login the machine

linq936@hotmail.com <linq936@hotmail.com> wrote:
> Hi,
>
> I have a function defined in .vimrc to customize VIM tab, it works
> fine when I work directly on my office Linux machine. When I remote
> login to the machine from home, each time I start VIM, I get an error
> message:


[...]

> Any idea?


My first thought is that the vim you execute while remotely logged in is
different from the one you execute while directly logged in, perhaps
because your PATH is set differently for the two cases. Assuming that
"vim" is not an alias, you can find which instance of vim the "vim"
command executes by executing

which vim

at your shell prompt. You can determine which version of vim you are
using either by executing

vim --version

at the shell prompt or by executing

:version

within vim.

--
Gary Johnson
Reply With Quote
  #3  
Old 08-26-2008, 12:51 AM
Tony Mechelynck
Guest
 
Default Re: The same .vimrc file gets complained only when remote login themachine

On 25/08/08 02:17, linq936@hotmail.com wrote:
> Hi,
>
> I have a function defined in .vimrc to customize VIM tab, it works
> fine when I work directly on my office Linux machine. When I remote
> login to the machine from home, each time I start VIM, I get an error
> message:
>
> Error detected while processing /home/<login>/.vimrc:
> line 31:
> E18: Unexpected characters before '='
> line 41:
> E121: Undefined variable: buflist
> E116: Invalid arguments for function
> bufname(buflist[tabpagewinnr(v:lnum) - 1])
> E15: Invalid expression: bufname(buflist[tabpagewinnr(v:lnum) - 1])
> line 42:
> E121: Undefined variable: n
> E116: Invalid arguments for function fnamemodify(n, ':t')
> E15: Invalid expression: fnamemodify(n, ':t')
> line 44:
> E133: :return not inside a function
> line 45:
> E193: :endfunction not inside a function
> line 47:
> E518: Unknown option: guitablabel=%{GuiTabLabel()}
> Hit ENTER or type command to continue
>
>
> Here is the the rc file:
>
> set shiftwidth=3
> set tabstop=3
> set expandtab
> :if&term == "xterm"
> set t_kb=
> fixdel
> endif
> set autoindent
> set showcmd
> set hlsearch
> set ruler
> syntax on
> set backup
> set backupdir=~/tmp
> set tags=tags;
> set cindent
>
> function! GuiTabLabel()
> " add the tab number
> let label = '['.tabpagenr()
>
> " modified since the last save?
> let buflist = tabpagebuflist(v:lnum)
> for bufnr in buflist
> if getbufvar(bufnr, '&modified')
> let label .= '+'
> break
> endif
> endfor
>
> let label .= '] '
>
> " count number of open windows in the tab
> "let wincount = tabpagewinnr(v:lnum, '$')margin: 0 auto
> "if wincount> 1
> " let label .= ', '.wincount
> "endif
> "let label .= '] '
>
> " add the file name without path information
> let n = bufname(buflist[tabpagewinnr(v:lnum) - 1])
> let label .= fnamemodify(n, ':t')
>
> return label
> endfunction
>
> set guitablabel=%{GuiTabLabel()}
>
>
> Any idea?


Hm... Not sure. Do you get the same answer when you type

:version

when seated at your desk at the office, and after a remote login from
home? If you do, does

:echo $HOME

give the same result?

(See ":help :redir" about how to capture the output of a command.)


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
146. You experience ACTUAL physical withdrawal symptoms when away
from your 'puter and the net.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:50 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.