Skip to content

misc/vim: update instructions #3308

@gopherbot

Description

@gopherbot

by brennan.vincent:

What steps will reproduce the problem?
1. Follow the steps at the top of $GOROOT/misc/vim/readme.txt to enable all plugins
2. vim foo.go
3. :echo &filetype

What is the expected output?
go


What do you see instead?
nothing

Which operating system are you using?
Fedora Core 16

Which revision are you using?  (hg identify)
927ed13f91eb tip

Please provide any additional information below.
The instructions in readme.txt are as follows:
To use all the Vim plugins, add these lines to your vimrc.

  set rtp+=$GOROOT/misc/vim
  filetype plugin indent on
  syntax on


The issue seems to me to be that Fedora already includes a file /etc/vimrc that executes
"filetype plugin on" before ~/.vimrc is ever executed, thus before
$GOROOT/misc/vim is ever added to the runtime path (rtp). Since filetype the
"filetype plugin indent on" line in ~/.vimrc does not trigger the loading of
all the files in the ftdetect folder under all folders in the runtime path, as the
instructions in the readme require. Thus the instructions need to be improved.

Adding "filetype off" before "filetype plugin indent on" in ~/.vimrc
resolves the issue, as does simply copying over the gofiletype.vim file to
~/.vim/ftdetect, but both of these solutions seem ugly to me. I don't know enough about
vim to come up with a better solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions