Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

69 lines (48 sloc) 1.472 kB
" {{{ Settings
" Auto expand tabs to spaces
set expandtab
" Auto indent after a {
set autoindent
set smartindent
" Linewidth to endless
set textwidth=0
" Do not wrap lines automatically
set nowrap
" Correct indentation after opening a phpdocblock and automatic * on every
" line
set formatoptions=qroct
" }}} Settings
" {{{ Automatic close char mapping
" More common in PEAR coding standard
inoremap { {<CR>}<C-O>O
" Maybe this way in other coding standards
" inoremap { <CR>{<CR>}<C-O>O
inoremap [ []<LEFT>
" Standard mapping after PEAR coding standard
inoremap ( ()<LEFT>
" Maybe this way in other coding standards
" inoremap ( ( )<LEFT><LEFT>
inoremap " ""<LEFT>
inoremap ' ''<LEFT>
" }}} Automatic close char mapping
" {{{ Wrap visual selections with chars
:vnoremap ( "zdi(<C-R>z)<ESC>
:vnoremap { "zdi{<C-R>z}<ESC>
:vnoremap [ "zdi[<C-R>z]<ESC>
:vnoremap ' "zdi'<C-R>z'<ESC>
:vnoremap " "zdi"<C-R>z"<ESC>
" }}} Wrap visual selections with chars
" {{{ Autocompletion using the TAB key
" This function determines, wether we are on the start of the line text (then tab indents) or
" if we want to try autocompletion
func! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
" Remap the tab key to select action with InsertTabWrapper
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
" }}} Autocompletion using the TAB key
Jump to Line
Something went wrong with that request. Please try again.