Fork me on GitHub

10/01/2011

[Vim] Vim installation on Windows and Mac

Windows (Use portable GVim)

1. Extract GVim_Portable.exe to Program Files
2. Rename GVimPortable.exe to vi.exe
3. Add path to environment variable PATH
4. Copy the pre-built cscope binary and related dll to folder where vi.exe exists
5. Put wombat.vim to C:\Program Files\GVimPortable\App\vim\vim71\colors
6. Add below at the top of vimrc

colorscheme wombat
set guifont=Monaco:h12

Note:
1. vimrc in C:\Program Files\GVimPortable\App\DefaultData\settings
2. put autoload_cscope.vim and cscope_maps.vim to C:\Program Files\GVimPortable\App\vim\vim71\plugin
3. Don't put the project root folder in path with spaces

MacOS (10.7.1)

1. Download macvim source from github: https://github.com/b4winckler/macvim
2. Download cscope from sourceforge: http://sourceforge.net/projects/cscope/files/
3. Refer the readme to build cscope, maybe you will get some errors like below:

if gcc -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -MT build.o -MD -MP -MF ".deps/build.Tpo" -c -o build.o build.c; \
    then mv -f ".deps/build.Tpo" ".deps/build.Po"; else rm -f ".deps/build.Tpo"; exit 1; fi
In file included from build.c:50:
/usr/include/ncurses.h:550:40: error: macro "cbreak" passed 1 arguments, but takes just 0
/usr/include/ncurses.h:575:44: error: macro "erasechar" passed 1 arguments, but takes just 0
/usr/include/ncurses.h:611:43: error: macro "killchar" passed 1 arguments, but takes just 0
make[2]: *** [build.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

4. How to fix it: Add the #undef and #define lines in the middle of this chunk of code in constants.h

#if (BSD || V9) && !__NetBSD__ && !__FreeBSD__
# define TERMINFO 0 /* no terminfo curses */
#else
# define TERMINFO 1
#endif

#undef TERMINFO
#define TERMINFO 1

#if !TERMINFO
# ifndef KEY_BREAK
# define KEY_BREAK 0400 /* easier to define than to add #if around the use */
# endif
# ifndef KEY_ENTER
# define KEY_ENTER 0401
# endif
# ifndef KEY_BACKSPACE
# define KEY_BACKSPACE 0402
# endif

# if !sun
# define cbreak() crmode() /* name change */
# endif

# if UNIXPC
# define erasechar() (_tty.c_cc[VERASE]) /* equivalent */
# define killchar() (_tty.c_cc[VKILL]) /* equivalent */
# else
# define erasechar() (_tty.sg_erase) /* equivalent */
# define killchar() (_tty.sg_kill) /* equivalent */
# endif /* if UNIXPC */
#endif /* if !TERMINFO */

5. Put the built cscope to usr/local/bin

...

No comments:

Post a Comment