vim

I just installed vim on my brand new FreeBSD server, so I can edit some configuration-files the way I'm used to do on my Linux servers. However, vim behaves oddly. Certainly not the way I'm used to. :(

I'm missing the syntax highlighting. When I press insert there is no way I can see that I just went into editing-mode. When I press insert, I assume I'm actually in editing-mode, right? :q When I'm in editing mode and press the cursors, to move around in the text/code, A's, B's, C's and D's show up.

What am I doing wrong? :r
 
Many (almost all) Linux distributions modify configuration files in their packages, this means you can never rely on the same defaults, or even on relatively sane defaults for that matter...

FreeBSD, on the other hand, almost never modifies the default configuration files beyond what is absolutely necessary, usually the only things that are changed are the various filesystem locations.

So what you have now, are the default Vim settings, instead of a Linux package maintainers choice of "defaults" for that specific distribution.

I don't know what you're used to, but here are a few basic options you will probably want to set in your ~/.vimrc

Code:
set nocompatible        " Use Vim settings, rather then Vi settings
set backspace=indent,eol,start  " allow backspacing over everything
set ruler               " show the cursor position all the time
set incsearch           " do incremental searching
set hlsearch            " highlight the last used search pattern.
set autoindent          " always set auto indenting on
set lbr                 " Wrap at word
set tabstop=2           " Tabs are 2 spaces wide
set shiftwidth=2        " Auto-indent 2 spaces wide
set softtabstop=2       " Still 2...
set encoding=utf-8      " Default encoding
syntax on               " Switch syntax highlighting on

This should fix the syntax highlighting (with syntax on) and add the INSERT when in insert mode (with set ruler).

When I'm in editing mode and press the cursors, to move around in the text/code, A's, B's, C's and D's show up...

If setting nocompatible doesn't help, you're probably using the wrong TERM environment variable. For xterm and most other modern terminal emulators, this should is usually set to xterm-color.

In tcsh you use: # setenv TERM xterm-color
And in sh/bash/zsh/ksh: # export TERM=xterm-color
 
The following command did the trick:
[cmd=]cp /usr/local/share/vim/vim71/vimrc_example.vim /usr/local/share/vimrc[/cmd]

However, I'm used to selecting text with the left mouse-button and pasting it by clicking the mouse-wheel. This doesn't work for some reason. And I find that very annoying. Does someone know how to fix this?
 
When I select something with the mouse, vim jumps to visual mode. I think that's causing the problem. Is there some way to turn this off?
 
mariourk said:
When I select something with the mouse, vim jumps to visual mode. I think that's causing the problem. Is there some way to turn this off?

:set mouse=r
 
Back
Top