set nocompatible call pathogen#infect() call pathogen#runtime_append_all_bundles() let mapleader="§" set hidden " Hides buffers instead of closing set nowrap " don't wrap lines set tabstop=4 set backspace=indent,eol,start set autoindent set copyindent set shiftwidth=4 set showmatch set ignorecase set smartcase set smarttab set hlsearch set incsearch set history=1000 set undolevels=1000 set wildignore=*.swp,*.bal,*.pyc,*.class set title set visualbell set noerrorbells set nowritebackup set nobackup set noswapfile filetype plugin indent on "set expandtab syntax on set list set listchars=tab:>.,trail:.,extends:#,nbsp:. " default listchars=eol:$ if has('autocmd') autocmd filetype python,perl set expandtab autocmd filetype html,xml set listchars-=tab:>. endif set pastetoggle= set ruler set complete-=i set relativenumber " To avoid "Hit ENTER to continue" set shortmess=at set cmdheight=2 nnoremap j gj nnoremap k gk map h map j map k map l nmap :set invrelativenumber nmap h :nohlsearch nmap b :BufExplorer if has("gui_running") " set guifont=Monaco:h12 set guifont=Source\ Code\ Pro:h12 set stal=2 set toolbar= set guioptions-=T " set columns=84 endif colorscheme default set bg=dark " " BMS maps " nnoremap :NERDTreeToggle nnoremap qs :call QuoteWord("'") nnoremap qd :call QuoteWord('"') nnoremap q( :call QuoteWord('()') nnoremap q[ :call QuoteWord('[]') nnoremap q{ :call QuoteWord('{}') vnoremap qs di'pa' vnoremap qd di"pa" vnoremap q( di(pa) vnoremap q[ di[pa] vnoremap q{ di{pa} nnoremap _t mt:%!perltidy -q'tzz vnoremap _t :!perltidy -q " set compiler to perlcritic; make for current file; open error window nnoremap _pc :compiler perlcritic:make:cope nnoremap ç nnoremap Ç function! LoadVimpyre() python << EOF import os import subprocess import vim try: subprocess.check_call(['which', 'vimpyre'], stdout=open(os.devnull, "w")) vim.command('call pathogen#runtime_append_all_bundles("vimpyre")') if vim.eval('has("gui_running")'): vim.command('colorscheme solarized') except subprocess.CalledProcessError: print "Vimpyre not found" vim.command("return 1") EOF endfunction function! QuoteWord(delimiter) python << EOF import re import vim delimiter = vim.eval("a:delimiter") if len(delimiter) == 2: start = delimiter[0] end = delimiter[1] else: start = end = delimiter cw = vim.current.window cb = vim.current.buffer (row, col) = cw.cursor line = cb[row-1] line_1 = line[:col] line_2 = line[col:] newline = '' mo = re.search(r'^(.*\b)(\w+)$', line_1) if mo is not None: newline = mo.group(1) + start + mo.group(2) elif len(line_1) > 0: newline = line_1 + start else: newline = '%s' % start mo = re.search(r'^(\w+)(\b.*)$', line_2) if mo is not None: newline += mo.group(1) + end + mo.group(2) cb[row-1] = newline vim.command("return 1") EOF endfunction call LoadVimpyre() let g:bufExplorerSortBy='fullpath' let g:bufExplorerSplitOutPathName=0 let g:bufExplorerShowRelativePath=1