Page MenuHomeFreeBSD

Default vim config for users.
ClosedPublic

Authored by alfred on Nov 15 2014, 12:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 28 2024, 9:54 AM
Unknown Object (File)
Dec 20 2023, 12:38 AM
Unknown Object (File)
Nov 9 2023, 4:38 PM
Unknown Object (File)
Nov 7 2023, 4:29 PM
Unknown Object (File)
Nov 7 2023, 10:31 AM
Unknown Object (File)
Nov 5 2023, 9:12 PM
Unknown Object (File)
Nov 5 2023, 1:37 PM
Unknown Object (File)
Oct 10 2023, 1:12 PM

Details

Summary

This port has nice configuration defaults for users.

Without it a user logging into a FreeBSD box with vim installed will get vim's "compatible" mode where vim tries to act like 20 years old vi.

This usually results in users making sad faces and switching to other OS's. (Seriously, happened twice at work).

I plan on making this port a dependency of vim and vim-lite next.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

alfred retitled this revision from to Default vim config for users..
alfred updated this object.
alfred edited the test plan for this revision. (Show Details)
alfred added reviewers: bapt, bdrewery, sunpoet.
alfred set the repository for this revision to rP FreeBSD ports repository.
  • Optionally depend on editors/vim-config for better UX.
  • Whitespace fix.

I think this should really belong to editors/vim instead...

editors/vim-config/Makefile
1 ↗(On Diff #2413)

Did he really created it?

  • Properly set Makefile author.
In D1166#6, @delphij wrote:

I think this should really belong to editors/vim instead...

I've fixed makefile author.

About belonging to editors/vim, I really want to avoid the bikeshed of that. Hence making a separate package... That said I can make it part of the vim port if people want.... Only concern is that:

vim port wants to put things under /usr/local/share/vim/vim74 ... however for some reason vim port wants to read its default config from /usr/local/share/vim/vimrc ! I haven't been able to figure out how to fix this in a short time, so it just made more sense to go with this helper port.

Let me know if you feel strongly and I'll just put it into regular vim port. If I put into regular vim port, then I would still like to install it into /usr/local/share/vim/vimrc to avoid difficulties hacking on patching the port...

Alfred,

See the vim man page, /usr/local/share/vim/vimrc is the default vimrc.
Thanks for doing this.

Sunpoet,

Please accept the vimrc that Alfred created in this port and make it a default part of the vim
port. It is such a small change, but hugely improves the usability of vim, especially for people
used to using vim on Linux.

On Ubuntu, vim is split up into vim, vim-common, vim-runtime, vim-tiny.
The default vim uses a vimrc similar to what Alfred contributed in this patch.

On an Ubuntu system, If a user invokes vi instead of vim, vi is a symlink to /usr/bin/vim.basic,
and this uses vimrc.tiny, which is a stripped down config which tries to set compatibility with the legacy vi.

Since on FreeBSD, our /usr/bin/vi is the original vi, we do not need to do all the complexities of Ubuntu to have a "legacy compatible vi"
for vim.

Let's just improve the usability of our vim, and include Alfred's vimrc, which is similar to Ubuntu's.

It is such a small improvement, but greatly improves usability and makes our vim behave more like
Ubuntu and MacOS X.

I do agree with @delphij here this should belong to the vim ports in the form of an @sample.
@rodrigc what you propose would obly be doable when one will have added an equivalent of update-alternative (which is what handle the symlink in debian)

I'm not proposing that we do all the things from Ubuntu with vim.basic and the symlinks. I was just giving it as an example

What I am proposing is that we take Alfred's vimrc and make it the default /usr/local/share/vimrc
for the vim port. That way when a user installs the vim port, they get an out of the box experience
that is like vim on Linux or MacOS X, without having to create a $HOME/.vimrc file.

Making it the default is better than having it as a sample file
which the user then has to copy to /usr/local/share/vim/vimrc,
because it improves the out of the box user experience, comparable
to Linux and MacOS X.

vim is a very basic but very common utility. The more we can make vim behave out of the box like on Linux and MacOS X, that
improves the usability of FreeBSD for many people. The people in Alfred's office are typical users, like whom I encounter
in my office.

I copied Alfred's vimrc to /usr/local/share/vimrc on my system, and I immediately noticed that vim
looked and felt like vim on Ubuntu, which was really nice.

I am saying really we need an equivalent of update-alternative, I'm not saying we should do the same as $yourfavoritelinuxdistro, just we do need to be able to handle alternatives!

update-alternative sounds like a fine thing to implement for the
FreeBSD ports system.

But since we don't have that right now, I still think that
making Alfred's vimrc the /usr/local/share/vimrc for the editors/vim port should
be allowed.

If that isn't allowed, then the entire new editors/vim-config should be allowed,
so people can optionally install it if they want (which is a shame, because
it would be nice to have this behavior out of the box).

This is a very small change, but super useful.

alfred edited edge metadata.
  • Move vim-config into vim port.

*thumbs up on this change* Thanks alfred@!

This revision is now accepted and ready to land.Nov 16 2014, 12:19 AM
ngie added a reviewer: ngie.

Commited in several revs, last rev was r372677