1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  1. mariourk

    mariourk New Member

    Messages:
    155
    Thanks Received:
    0
    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
     
  2. jrm

    jrm Member

    Messages:
    800
    Thanks Received:
    225
    Are you using your old ~/.vimrc?
     
  3. Beastie

    Beastie Active Member

    Messages:
    1,925
    Thanks Received:
    339
    For syntax highlighting add syntax on to ~/.vimrc.

    For the rest, I have no idea. It's working fine here.
     
  4. graudeejs

    graudeejs Well-Known Member

    Messages:
    4,594
    Thanks Received:
    632
    This is because on Linux you probably used preconfigured vim.
    On FreeBSD vim default to almost vi-like behavior

    You can try my vim config if you want
    https://github.com/graudeejs/dot.vim
    after cloning/extracting
    $ cd ~/vim/ && make to install my default plugin set
     
  5. Carpetsmoker

    Carpetsmoker Member

    Messages:
    938
    Thanks Received:
    136
    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).

    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
     
    peetaur thanks for this.
  6. mariourk

    mariourk New Member

    Messages:
    155
    Thanks Received:
    0
    The following command did the trick:
    cp /usr/local/share/vim/vim71/vimrc_example.vim /usr/local/share/vimrc

    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?
     
  7. graudeejs

    graudeejs Well-Known Member

    Messages:
    4,594
    Thanks Received:
    632
    in vim :help mouse
     
  8. mariourk

    mariourk New Member

    Messages:
    155
    Thanks Received:
    0
    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?
     
  9. graudeejs

    graudeejs Well-Known Member

    Messages:
    4,594
    Thanks Received:
    632
    vim :help mouse
     
  10. OH

    OH New Member

    Messages:
    209
    Thanks Received:
    32
    :set mouse=r