" Pathogen packaging
call pathogen#infect()
syntax on
filetype plugin indent on
" Force 256 colours
set t_Co=256
colorscheme freya
" full vim mode
set nocompatible
" Folding for UI
set mouse=a
set foldcolumn=1
" Show statusline
set laststatus=2
" Show command
set showcmd
" Better colours
set background=dark
set ignorecase
set smartcase
set cursorline
set incsearch
" All tabs to 4 characters
set tabstop=4
set shiftwidth=4
set softtabstop=4
" Use tabs for indenting, spaces for alignment
" (Using smart tab plugin)
set noexpandtab
" visible tabs
set list
set listchars=tab:\≫\
set encoding=utf-8
" Backspace can delete everything
set backspace=indent,eol,start
set autoindent
set preserveindent
" No automatic wrapping
set nowrap
" Line unmbers
set number
" GUI OPTIONS
" Allow selection buffer pasting
set go+=a
" Console options instead of GUI
set go+=c
" Show tabs
set go+=e
" No menu
set go-=m
" No toolbar
set go-=T
" No right scrollbar
set go-=r
" Scroll within 5 lines of edge
set scrolloff=5
" Tab completion with command lines
set wildmode=longest,list
set wildmenu
" Show trailing whitespace and spaces before tabs
hi link localWhitespaceError Error
au Syntax * syn match localWhitespaceError /\(\zs\%#\|\s\)\+$/ display
au Syntax * syn match localWhitespaceError / \+\ze\t/ display
" Keep tmp and swap files local
set backupdir=~/.vim/tmp/backup
set directory=~/.vim/tmp/swp
" Perl specific stuff
let perl_include_pod = 1
let perl_extended_vars = 1
let perl_sync_dist = 1000
let perl_fold = 1
"let perl_fold_blocks = 1
" Tidy selected lines (or entire file) with _t:
nnoremap <silent> _t :%!perltidy -q<Enter>
vnoremap <silent> _t :!perltidy -q<Enter>
" check syntax NO IDEA IF THESE WORK
nnoremap <buffer> <silent> _c :w<Enter>:!perl -wc %<Enter>
" initial GUI window size
if has("gui_running")
" GUI is running or is about to start.
" Maximize gvim window.
set lines=61 columns=123
endif