" Standard setup {{{1 " set non-compatible set nocompatible " set syntax highlighting syntax on " Enable netrw filetype plugin indent on " start pathogen call pathogen#infect() call pathogen#helptags() "Leaders {{{1 let mapleader = "," let maplocalleader = "\\" " Config {{{1 " Set auto read so a file is updated if externally changed set autoread " Turn on mouse Interaction set mouse=a " Set default split to be right or bottom set splitright set splitbelow " Tell vim it's a fast terminal set ttyfast " set relative ruler with current line as real line number set relativenumber set number " search in sub folders set path+=** " Display matching files when tab completing set wildmenu " set tabwidth set autoindent set smartindent set shiftwidth=4 set tabstop=4 " Add invisivle character reperesentation set list listchars=tab:»\ ,trail:\␣,eol:↩ " make search highlight as you type set incsearch " Make search case insensitive unless I type a capital letter set ignorecase smartcase " Make backspace work properly in insert mode set backspace=indent,eol,start " Show commands as you type them set showcmd " Make vim default to the plus register (system clipboard) when yanking etc. "set clipboard=unnamedplus " Plugin Options {{{1 let g:cssColorVimDoNotMessMyUpdatetime = 1 " Airline set laststatus=2 let g:airline_powerline_fonts = 1 let g:airline_theme='dark' " Functions {{{1 function! NextMark() execute "normal! /(<.>)\zvda(" execute "startinsert" endfunction function! NewHtml() read ~/Templates/html normal! ggdd setlocal filetype=html "call NextMark() endfunction " Mappings {{{1 " Move lines up/down using arrow keys nnoremap ddp nnoremap ddkP " Disable Scroll wheel noremap noremap " Make Ctrl C and Ctrl V work on system buffer " if in visual or insert mode respectively vnoremap "+y inoremap "+pa " Make atrl t open new tab nnoremap :tabnew " map gV to select previously pasted nnoremap gV "`[".getregtype(v:register)[0]."`]" " " Set :w!! to save with sudo cnoremap w!! w !sudo tee % "Run current line as command nnoremap Q !!$SHELL " Do Shebang line inoremap :sil exe ".!which " s/^/#!/ filetype detectYpDi " DO bullet points inoremap :exe "norm Ypf lDB\"A " edit vimrc nnoremap ev :vsplit $MYVIMRC nnoremap sv :source $MYVIMRC " Set double space in insert mode to go to next mark and enter insert mode inoremap :call NextMark() " Abreviations {{{1 iabbrev @@ jonathan@fellowshipproductions.co.uk iabbrev @@@ jonathan@lunarweb.co.uk " Start Screen Settings {{{1 fun! Start() " Don't run if: we have commandline arguments, we don't have an empty " buffer, if we've not invoked as vim or gvim, or if we'e start in insert mode if argc() || line2byte('$') != -1 || v:progname !~? '^[-gmnq]\=vim\=x\=\%[\.exe]$' || &insertmode return endif " Start a new buffer ... enew " ... and set some options for it setlocal \ bufhidden=wipe \ buftype=nofile \ nobuflisted \ nocursorcolumn \ nocursorline \ nolist \ nonumber \ noswapfile \ norelativenumber " Now we can just write to the buffer, whatever you want. call append('$', "") for line in split(system('fortune -a | cowsay'), '\n') call append('$', ' ' . l:line) endfor " No modifications to this buffer setlocal nomodifiable nomodified " When we go to insert mode start a new buffer, and start insert nnoremap e :enew nnoremap i :enew startinsert nnoremap o :enew startinsert endfun " Run after "doing all the startup stuff" " autocmd VimEnter * call Start() " File Type Specific {{{1 augroup file_web autocmd! autocmd FileType html,css,less,javascript,php setlocal foldmethod=indent foldenable augroup END augroup htmlShortcuts autocmd FileType html inoremap ;b (<.>)FbT>i autocmd FileType html inoremap ;i (<.>)FeT>i autocmd FileType html inoremap ;1

(<.>)2kf ;2

(<.>)2kf ;3

(<.>)2kf ;p

(<.>)02kf>a autocmd FileType html inoremap ;a href="">(<.>)(<.>)F"i autocmd FileType html inoremap ;ul
(<.>)03kf ;li o
  • F>a autocmd FileType html inoremap ;ol
    (<.>)03kf