From 96b18bce32bb3ff67d297f9214908a0aa8bc5f82 Mon Sep 17 00:00:00 2001 From: Akelge Date: Sat, 1 Feb 2014 11:40:37 +0000 Subject: [PATCH] Fixed for Linux/Mac --- vim/gvimrc | 12 ++++++--- vim/plugin/myFunx.vim | 2 +- vim/vimrc | 63 ++++++++++++++++++++++++++++++------------- 3 files changed, 54 insertions(+), 23 deletions(-) diff --git a/vim/gvimrc b/vim/gvimrc index 2bb1fd8..1d64579 100644 --- a/vim/gvimrc +++ b/vim/gvimrc @@ -4,10 +4,10 @@ " $Id$ " -set guifont=Monaco:h13 +set guifont=Monaco\ 11 set anti set lines=50 -set columns=132 +set columns=120 set mousefocus set errorbells set visualbell @@ -16,13 +16,17 @@ set guicursor=a:block-blinkon0 set showtabline=2 set guitablabel=%!GuiTabLabel() set guitabtooltip=%!GuiTabToolTip() -set fuoptions=maxvert,maxhorz + +if has('mac') || has('macunix') + set guifont=Monaco:h11 + set fuoptions=maxvert,maxhorz + set transparency=4 +endif set guioptions-=T set guioptions+=a if &background == "dark" hi normal guibg=black - set transparency=4 endif " colorscheme railscasts diff --git a/vim/plugin/myFunx.vim b/vim/plugin/myFunx.vim index b5debd0..d86e847 100644 --- a/vim/plugin/myFunx.vim +++ b/vim/plugin/myFunx.vim @@ -2,7 +2,7 @@ " Use substitute() (not printf()) to handle '%%s' modeline in LaTeX files. function! AppendModeline() let save_cursor = getpos('.') - let append = ' vim: set ts='.&tabstop.' sw='.&shiftwidth.' tw='.&textwidth.' ft='.&filetype.' : ' + let append = ' vim: set ts='.&tabstop.' sw='.&shiftwidth.' tw='.&textwidth.' ft='.&filetype.' :' $put =substitute(&commentstring, '%s', append, '') call setpos('.', save_cursor) endfunction diff --git a/vim/vimrc b/vim/vimrc index b8bef2c..81e852c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,7 +2,9 @@ " General Setup " " $Id$ - +" +" First of all determine the OS we are on +" Can be Linux or Darwin set nocompatible " Use Vim defaults (much better!) set backspace=indent,eol,start " allow backspacing over everything set textwidth=0 " Textwidth 0 usually, we set it to 79 later @@ -13,7 +15,7 @@ set nohlsearch set nostartofline " set paste set autochdir -" set clipboard=unnamed +set clipboard+=unnamed " Let's go to 256 colors set t_Co=256 @@ -43,7 +45,7 @@ set background=dark set title set browsedir=buffer -" set autochdir +set autochdir set cpoptions=aAcF$ set modeline set modelines=1 @@ -58,12 +60,18 @@ set showmatch " Show matching brackets. set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make " set statusline=%<%f\ %H%m%r%=%-14.(%l,%c%)\ %P\ Buf.%n -set showtabline=1 +" set showtabline=2 set backupcopy=yes set fileformats=unix,mac,dos set fileformat=unix set mouse=a -set printfont=Monaco:h14 + +if has('mac') || has('macunix') + set printfont=Monaco:h12 +else + set printfont=Monaco\ 12 +endif + " colorscheme wombat256 colorscheme railscasts @@ -180,7 +188,7 @@ inoremap :m .-2==gi vnoremap :m '>+1gv=gv vnoremap :m '<-2gv=gv -" Terminal/Filemanager +" Terminal/Filemanager " nnoremap :OpenTerminal " nnoremap :OpenFilemanager nnoremap of :OpenFilemanager @@ -193,16 +201,35 @@ let g:ConqueTerm_CloseOnEnd = 1 let g:ConqueTerm_SendVisKey = ',tp' " Tab selection by number -nnoremap 1gt -nnoremap 2gt -nnoremap 3gt -nnoremap 4gt -nnoremap 5gt -nnoremap 6gt -nnoremap 7gt -nnoremap 8gt -nnoremap 9gt -nnoremap 10gt +if has('mac') || has('macunix') + nnoremap 1gt + nnoremap 2gt + nnoremap 3gt + nnoremap 4gt + nnoremap 5gt + nnoremap 6gt + nnoremap 7gt + nnoremap 8gt + nnoremap 9gt + nnoremap 10gt +else + nnoremap 1gt + nnoremap 2gt + nnoremap 3gt + nnoremap 4gt + nnoremap 5gt + nnoremap 6gt + nnoremap 7gt + nnoremap 8gt + nnoremap 9gt + nnoremap 10gt +endif + +" Map Ctrl-T to new tab and Ctrl-W to close tab +if !(has('mac') || has('macunix')) + nnoremap :tabnew + nnoremap :tabclose +endif " hh opens my help file nnoremap hh :help akmap @@ -224,7 +251,7 @@ if has("autocmd") autocmd! BufRead,BufNewFile *.mako setfiletype mako autocmd BufWinEnter *.mako setfiletype mako autocmd FileType mako set textwidth=0 - + " Python autocmd FileType python set textwidth=79 autocmd FileType python set omnifunc=pythoncomplete#Complete @@ -309,4 +336,4 @@ if filereadable($HOME."/.vim/vimrc.local") source $HOME/.vim/vimrc.local endif -" vim: set ts=4 sw=4 tw=78 ft=vim : +" vim: set ts=4 sw=4 tw=78 ft=vim :