vim isn't working as expected
jez.hancock at munk.nu
Sat May 3 18:31:18 PDT 2003
On Sat, May 03, 2003 at 09:08:31PM -0400, William O'Higgins wrote:
> I am a new user of FreeBSD migrating from Red Hat Linux. There are a
> few differences that I am having trouble with.
> vi - my editor of choice, and it doesn't work in the ways I expect it
> to. I am used to vi being aliased to vim (which I have done in FreeBSD)
> and having syntax highlighting, arrow keys, and a tell-tale line at the
> bottom of the xterm to remind me which mode I'm in, which line and
> position, and how much file I'm looking at. All these things are gone in
> FreeBSD. Could someone tell me what I'm missing? Thanks.
You'll probably want to setup a .vimrc file in your home dir (or in
/usr/local/share/vim/vimrc for globally set vim options).
For what it's worth here's my .vimrc file:
" nice status line
" Set 'g' substitute flag on.
" keeps cursor in middle of screen
" set vim to use 'short messages'.
" showmatch: Show the matching bracket for the last ')'?
" Last Modified
map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
filetype plugin on
let s:word = input("Replace " . expand('<cword>') . " with:")
:exe 'bufdo! %s/' . expand('<cword>') . '/' . s:word . '/ge'
map \r :call Replace()<CR>
although I'm still a newbie to vim (who isn't :).
If you want certain options for certain types of file, I believe (take
with handful of salt!) you can 'override' options in a extension.vim file inside
~/.vim/ftplugins (which take effect only if you have the 'filetype plugin on' option set).
So for example my ~/.vim/ftplugins/sh.vim file looks like:
(to stop shell scripts from breaking at 72 cols whilst I'm working on
There's stacks of tips at www.vim.org as well - a good idea is to
download the whole tips database fle and when you need to find out how to do
something just grep in the file for the keyword.
Hope that helps,
More information about the freebsd-questions