Dec 22

vim vi snow leopardThe default vim isĀ  pretty bland and unimpressive. I would share a few of the settings I have found or plundered from Linux installations in order to make vim more usable.

This can go in your .vimrc or in a global location such as /usr/share/vim/vimrc.
I would be interested in what other command line and vim users do to improve Snow Leopard.

step 1. Add following code to /usr/share/vim/vimrc

set nocompatible " Use Vim defaults
set bs=2 " backspacing over everything in insert mode
set ai " Auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position

set viminfo='20,\"200 " keep a .viminfo file

syntax on " syntax highlighting
set hlsearch " highlight the last searched term

filetype plugin on " use the file type plugins

" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

step 2. Make alias vi = vim

open ~/.bash_profile and add following code

alias vi=vim
1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...


6 Responses to “VIM: Making it Work on Leopard”

  1. 1.b_dubb Says:

    when i try to write changes to the vimrc at … /usr/share/vim/vimrc … i can’t because of permissions. even if i use sudo …

    b

  2. 2.Chuck Says:

    Very good post!, thank you.

  3. 3.Bill Says:

    Thanks so much for this. I have looked everywhere for this simple solution of returning to the last line from a previous session. The rest is a great plus!

  4. 4.Estefan Says:

    Because of permissions it must be done as a root user.

  5. 5.Dwayne Says:

    Thank you for posting this. I don’t know why they don’t configure OSX with the .vimrc file / already installed and configured like this.

  6. 6.Karen Says:

    THANK YOU!!!!
    I really appreciate the time you took to post this, and I now have my vim configured correctly with color on snow leopard.

Leave a Reply

This is website related to mac 0R windows platform?