Skip to content

Instantly share code, notes, and snippets.

View fmoralesc's full-sized avatar

Felipe Morales fmoralesc

  • Leuven, Belgium
View GitHub Profile
@fmoralesc
fmoralesc / convert.vim
Created January 11, 2015 16:26
vim function to make conversions
function! Convert(pat, factor, orig_unit, conv_unit) range abort
try
execute a:firstline.','.a:lastline. 's/\('.a:pat.'\)\ze\s\?'.a:orig_unit. '/\=submatch(1)*'.string(a:factor).'/g'
execute a:firstline.','.a:lastline. 's/'.a:orig_unit. '/'.a:conv_unit.'/g'
catch
endtry
endfunction
@fmoralesc
fmoralesc / italics.vim
Last active January 10, 2018 20:21
vim + italics
" cd to the folder where you have xterm-256color.terminfo, run
" $ tic xterm-256color.terminfo
" and add the following to your vimrc.
set t_ZH=
set t_ZR=
let g:entering_tab = 0
function! NewStartifyTab(afile)
if a:afile == '' && &filetype !~ 'help' || &modifiable
if g:entering_tab == 1
call startify#insane_in_the_membrane()
let g:entering_tab = 0
endif
endif
endfunction
@fmoralesc
fmoralesc / windows.vim
Created September 3, 2014 20:53
get current windows.
function! WindowsData()
let data = []
let i = 1
let i_win_width = winwidth(i)
let i_win_height = winheight(i)
while i_win_width != -1 || i_win_height != -1
call add(data, {'nr': i, 'width': i_win_width, 'height': i_win_height})
let i += 1
let i_win_width = winwidth(i)
let i_win_height = winheight(i)

A guide on syn region and conceal.

First, when is it appropiate to use syn region instead of syn match? As a rule of thumb: whenever you would expect the matched text to span several lines (and you don't know how many). If you see yourself using .* in the middle of a syn match rule, you should probably consider using syn region instead.

So let's suppose we want to highlight "{{{begin ... end}}}" blocks, such as this:

{{{begin "But I must explain to you how all this mistaken idea of

@fmoralesc
fmoralesc / juanamolina.txt
Created July 11, 2014 20:25
juana molina y las influencias - draft
% Juana Molina y las influencias
% Felipe Morales
¿Qué significa que un artista tenga una influencia? ¿Qué significa que un
artista reconozca una influencia? ¿Qué significa que un artista *no* reconozca
una influencia?
Juana Molina ha dicho, tratando de explicar su éxito fuera de Argentina, que lo
que hace "no se parece a nada"[^1], y esta expresión se ha repetido bastante en
los medios, y en la opinión de los fans. Sin embargo, uno puede apreciar en su
@fmoralesc
fmoralesc / vim_acme_prototype1.vim
Created June 21, 2014 14:45
acme middle mouse double target prototyppe
noremap <MiddleMouse> <nop>
noremap <MiddleRelease> :call AcmeMiddle()<cr>
function! AcmeMiddle() range "{{{2
let star=getreg("*")
exe "normal \<leftmouse>"
let cw=expand("<cWORD>")
let s_f_line = split(star, "\n")[0]
let f_line = getline(a:firstline)
let s_f_byte = line2byte(a:firstline + stridx(f_line, s_f_line))
#!/usr/bin/env python2
import sys
import re
import shlex
import getopt
import mpd
from subprocess import Popen, PIPE
def get():
/ada.vim
/apache.vim
/asm.vim
/asn.vim
/aspperl.vim
/awk.vim
/bib.vim
/changelog.vim
/clojure.vim
/cmake.vim
[Settings]
gtk-application-prefer-dark-theme=1