-1

After starting to use Ubuntu 16.04, I find that many reasonable vi settings are off (before that I was on Scientific Linux, don't remember which version). This includes things like language highlighting, remembering the cursor's last line, search highlighting, remembering the last search, line number at screen bottom...

I tried to remedy some of these in ~/.vimrc and in /etc/vim/vimrc, which didn't always work.

Before I go on tackling each of the problems individually, I wonder if there is something big that I'm missing which might account for lacking all of these?

Edit: It was suggested that this is a duplicate of this question. Not exactly. It turns out that the answers in that question give a partial answer to this question if they are combined with the answers to a third question. Therefore, I add all this as an answer, since it would be useful to anyone else facing the same problem.

Helen
  • 101
  • 9
  • Comments are not for extended discussion; this conversation has been moved to chat. – terdon Apr 15 '17 at 15:27
  • @EricCarvalho: tl;dr The OP cannot know in advance that the linked question (partially) answers this one. Long reply: This has been debated a lot in the removed comments. I very strongly suggest to not mark this as a duplicate. The reason is that a part of the answer to this question can be found in the linked one, but there are more parts in the answer to this question, and if someone asks this question then they can't know that the answer hides in the other one which presupposes a different background by the person who asks the question. – Helen Apr 16 '17 at 03:58

2 Answers2

2

Check that you have the full vim package installed, and not just vim-tiny.

vim-tiny is a compact version of vim without many plugins.

Once you install the proper vim package you'll get the usual set of included vim plugins. You may still have to add :set nocompatible to your .vimrc to use its full functionality.

thomasrutter
  • 36,774
  • Thanks, this actually should also involve changing the default to vim (actually I was going to edit my own answer to include this). However, there are still many features missing, to my dismay. – Helen Apr 11 '17 at 06:31
  • 1
    It may be that the vim defaults are just very plain, with much of the good stuff disabled unless you turn it on. Try the vim-sensible project which provides a good set of default settings - some distros and vim clones will use defaults like those (indeed neovim uses the ones from vim-sensible). – thomasrutter Apr 11 '17 at 11:40
  • https://github.com/tpope/vim-sensible – thomasrutter Apr 11 '17 at 11:41
  • I'll check this out! – Helen Apr 12 '17 at 04:05
0

Two answers were pointed out in the comments which, when combined, seem to form a kind of answer:

vi now actually invokes vim-tiny (explained here), which has only a few features enabled by default (explained here).

One can change this default by doing

sudo update-alternatives --config vi

I still don't know if everything could be amended in one single move, though. (Using vim "out of the box" still lacks many of those "standard" features.)

Helen
  • 101
  • 9
  • Syntax highlighting, search highlighting, etc. have to be enabled, and remembering the last position as well. It might be your previous distro or system administrator kept default vimrc that enabled lots of stuff (I know I did), but the default configuration is minimal. – muru Apr 11 '17 at 06:23
  • @muru: I see. It's a little weird however that my /etc/vim/vimrc came with very few options, so it's not just uncommenting them, I actively have to include them. (E.g. no search highlighting.) – Helen Apr 11 '17 at 06:39
  • 1
    @Helen adding detail to this answer explaining how you are actively including these options mentioned in your question, IMHO would have a positive impact on this answer. – Elder Geek Apr 14 '17 at 16:25
  • Agreed, I'll deal with it soon. – Helen Apr 15 '17 at 02:47