Skip to content

Instantly share code, notes, and snippets.

View waldson's full-sized avatar

Waldson Patrício waldson

  • Natal, RN
View GitHub Profile
@waldson
waldson / .vimrc
Created April 22, 2019 11:18
Minimal .vimrc
filetype plugin indent on
set encoding=utf-8
set fileencoding=utf-8
set shiftwidth=4
set tabstop=4
set number
set relativenumber
inoremap jk <esc>

Teste PHP

Crie uma página de contato que contém os seguintes campos:

  • Nome
  • E-mail
  • Telefone
  • Mensagem
  • Arquivo Anexo
@waldson
waldson / php.vim
Created July 18, 2018 17:14
FZF + Ultisnips to generate method completion
"ftplugins/php.vim
function! s:createSnippet(line)
let l:signature = matchstr(a:line, '\v\s+[a-z0-9A-Z_]+\s*\(.*\)')
let l:methodName = substitute(substitute(l:signature, '(.*$', '', 'g'), '\s', '', 'g')
let l:paramList = []
let l:params = substitute(l:signature, '\$[a-zA-Z0-9_]\+', '\=add(l:paramList, submatch(0))', 'g')
let l:templateParams = []
for p in l:paramList