Skip to content

Instantly share code, notes, and snippets.

View justinpage's full-sized avatar

Justin Page justinpage

View GitHub Profile
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
" Prepare a new PHP class
function! s:Class()
let name = input('Class name: ')
let namespace = input('Any Namespace: ')
if strlen(namespace)
exec 'normal i<?php namespace ' . namespace . '; x27'
else
exec 'normal i<?php x27'
endif
@mattstauffer
mattstauffer / .vimrc
Last active July 7, 2016 03:23
Vimscripts to easily create PHP class and easily add dependency to PHP class Tweaked versions of a script by Jeffrey Way
" Note: To add this to your .vimrc, you'll have to delete any character that is written with a caret (e.g. "^M") and enter the real value; to enter ^M, enter insert mode and type CTRL-V CTRL-M.
" Easily create class.
function! Class()
let name = input('Class Name? ')
let namespace = input('Any Namespace? ')
if strlen(namespace)
exec 'normal i<?php namespace ' . namespace . ';^M^M^['
else