Hi,
nice project.
But the plugins/drupal.vim overwrite my settings in .vimrc.

I think this plugin should only loaded if i edit Drupal/php sources. I dosnt like your settings if i edit other sources like python. I know, i can delete this file - but i dosnt want touch the files.

My current vim configs https://github.com/ozon/dotfiles
I added this project as a submodule to .vim/bundle/drupal

Comments

benjifisher’s picture

Instead of giving a link to your vimrc file, please say which settings you do not like.

benjifisher’s picture

Status: Active » Postponed (maintainer needs more info)

I forgot to change the status.

Adding the project as a submodule should work fine.

It is easy enough to move settings from plugin/drupal.vim to ftplugin/drupal.vim so that they only affect Drupal files. As I said in #1, I need to know which settings are bothering you.

ozon’s picture

I am a little confused... ;)
What is the goal of this project? A plugin for Vim or a Vim-Distribution for Drupal Developer? The Project name taught that there is a plugin.

I think if there is a plugin, the plugin should not overwrite user settings of the vimrc.
http://drupalcode.org/project/vimrc.git/blame/27343ed439167b508d79052c2f... at the moment.
Sample fileformats=unix - sure thats the best option for Windows Users?
Sample linebreak - dont like linebreaks ;)
Sample pastetoggle=<F2> - mh... want use F2 for other actions ;)
But it is not the individual settings. It generally goes with the question whether it makes sense to define user settings / override.
And if there is a distribution, then please shipped with .vimrc ;)

What have I done for me? I merged your codebase and settings to my vim dotfiles. Clone it and say what you do not like:).

Anyway. I think a focus on the vim distribution is better.
I like and respect your work.

benjifisher’s picture

I agree with most or all of what you say. I opened the issue #1305998: Setting 'fileformats' to "unix" breaks some files. in the hopes of getting a discussion started, but if it happens here, that is fine with me.

Sorry, I do not have time to look through your dotfiles, or anyone else's. If you want to improve this project for the benefit of the Vim/Drupal community, please make specific suggestions. Patches are welcome.

The goal of the project should be pretty clear. We changed the name once, and we may change it again. Again, specific suggestions are more helpful. Do you think "Vim distribution for Drupal" would be better?

My personal branch of this project contains new features that have not yet been committed, but it also makes changes along the lines you suggest, moving several questionable or personal settings into sample vimrc files. This afternoon, if I have time, I will post a patch as a basis for further discussion.

benjifisher’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.6 KB
new37 bytes
new126 bytes
new1.7 KB

I have attached a patch file that removes most option settings from plugin/drupal.vim. Maybe I have removed too much, but probably I removed everything that bothered you. Perhaps some of these options should be added to ftplugin/drupal.vim.

I also attached three sample vimrc files: minimal, standard, and one with most of the options I removed from plugin/drupal.vim. It might be a good idea to add (not to the minimal one)
call pathogen#infect()
since we are recommending that people install our project with pathogen.

I would have made these changes months ago, but I want some consensus before removing a big part of what was in this project before I joined it.

I have marked #1305998: Setting 'fileformats' to "unix" breaks some files. as a duplicate.

benjifisher’s picture

naught101’s picture

Patch is a nice start. That would fix all my problems, I think. But why do you put set nocompatible in the minimal.vim? That's basically an options nuke (see #1435142: Move all non-drupal specific settings to an optional settings file.), which is potentially ok, if you tell users to put it at the top of their .vimrc. But why do you need it anyway?

benjifisher’s picture

The vimrc_*.vim files are there for the sake of users who are new to vim or have never bothered to configure it before. The intention is that such a user could copy one of these to ~/.vimrc (or $HOME\_vimrc on Windows). In that context, :set nocompatible is a good thing.

This project started out as one file, to be used as a vimrc file by such users. Most of what the project contained before it was reorganized is in vimrc_timplunkett.vim. We should come up with a more descriptive name for that file. Maybe put all of them in an examples/ folder.

Of course, 'nocompatible' is set as soon as vim finds a vimrc file. (:help startup) We do not really need to :set it if people follow our advice and create a vimrc file (whether using one of the examples or some other way), but since when can you count on people to follow advice? ;)

I should probably add a line to these files to invoke pathogen.

We should definitely say something in the docs about creating a vimrc file.

grota’s picture

as far as it's worth, +1 on removing those lines from the code.

alanmackenzie’s picture

The correct thing to do is to put your own configuration in: ~/.vim/after/plugin/*.vim

example:

I prefer relative line numbers so in ~/.vim/after/plugin/after-plugins.vim

" Overriden settings from the drupal-vim module.

" Relative number is much better.
set relativenumber

We should probably add a notice to this effect in the documentation, if the maintainers are happy with this then I'll create a patch.

benjifisher’s picture

@grota: Are you inclined to mark the patch in #5 as RTBC? That would be clearer than a +1 in a comment.

@alanmackenzie: First, we should make sure that our "defaults are carefully chosen". (:help design-flexible) After that, if there are still tweaks that individual users want to make, they should use the after/ directory. If you would like to create a documentation patch with a pointer to :help ftplugin-overrule then I will include it.

alanmackenzie’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #5 works as expected.

On the subject of example .vimrc files I would add bothcall pathogen#infect() and call pathogen#helptags() to the standard one.

Perhaps it's better to discuss that in a separate issue given the age of this one.

benjifisher’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new5.14 KB

I committed the patch and the sample vimrc files from #5. I also edited doc/drupal.txt. (I do not think that documentation patches need to be reviewed as carefully as code patches.) Here is the commit record: c9d9e0e. For the record, I am attaching the final patch.

Let's discuss pathogen in another issue: perhaps #1145580: Add installer? or perhaps a new one. I do not really like the idea of running pathogen#helptags() every time I start up vim.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.