Skip to content

Instantly share code, notes, and snippets.

View vinicio's full-sized avatar

Vinício Augusto vinicio

  • Belo Horizonte, Minas Gerais, Brazil
View GitHub Profile
imap jj <esc>
set clipboard+=unnamed
" enable vim-surround
set surround
set ignorecase
set smartcase " Case insensitive search with lowercase terms, sensitive with uppercase
set scrolloff=7
@vinicio
vinicio / init.vim
Last active October 14, 2019 17:10
call plug#begin('~/.local/share/nvim/plugged')
Plug 'ajh17/spacegray.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'ekalinin/dockerfile.vim'
Plug 'fatih/vim-go'
Plug 'godlygeek/tabular'
Plug 'isobit/vim-caddyfile'
Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'evanmiller/nginx-vim-syntax'
Plug 'fatih/vim-go'
Plug 'jiangmiao/auto-pairs'
@vinicio
vinicio / wp_remove_p_around_img.php
Created November 4, 2016 00:28
Remove paragraph tags around images in WordPress post/page content
<?php
/**
* Move image inside <p> tag above the <p> tag while preserving any link around image.
* Can be prevented by adding any attribute or whitespace to <p> tag, e.g. <p class="yolo"> or even <p >
*/
function remove_p_around_img($content)
{
$contentWithFixedPTags = preg_replace_callback('/<p>((?:.(?!p>))*?)(<a[^>]*>)?\s*(<img[^>]+>)(<\/a>)?(.*?)<\/p>/is', function($matches) {
$image = $matches[2] . $matches[3] . $matches[4];