| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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? |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.