Skip to content

Instantly share code, notes, and snippets.

@javier-lopez
Created September 24, 2016 21:14
Show Gist options
  • Save javier-lopez/880a02d9669b71d772d66eebdf3151e4 to your computer and use it in GitHub Desktop.
Save javier-lopez/880a02d9669b71d772d66eebdf3151e4 to your computer and use it in GitHub Desktop.
24 de Septiembre
@humus
Copy link

humus commented Sep 24, 2016

g9 y g0 para cambiar el tamaño de la fuente

fun! Fontsize_up() "{{{
  let font = &guifont
  let beforesize = font[0:matchend(font, '\v\.*\ze[^\d][[:digit:]]+')]
  let index = match(font, '\v[^:]\zs:\w+$') - len(font)
  let aftersize = font[index : ]
  let size = str2nr(matchstr(font, '\v.*[^[:digit:]]\zs[[:digit:]]+\ze:.*'))
  let size += 1
  let new_font = beforesize . size . aftersize
  execute 'set guifont=' . new_font
endfunction "}}}

fun! Fontsize_down() "{{{
  let font = &guifont
  let beforesize = font[0:matchend(font, '\v\.*\ze[^\d][[:digit:]]+')]
  let index = match(font, '\v[^:]\zs:\w+$') - len(font)
  let aftersize = font[index : ]
  let size = str2nr(matchstr(font, '\v.*[^[:digit:]]\zs[[:digit:]]+\ze:.*'))
  let size -= 1
  let new_font = beforesize . size . aftersize
  execute 'set guifont=' . new_font
endfunction "}}}

fun! Before_size() "{{{
  echo matchstr(&guifont, '\v^.+[^[:digit:]]\ze\d+:')
endfunction "}}}

fun! After_size() "{{{
  echo matchstr(&guifont, '\v[^[:digit:]]\d+\zs:\w+$')
endfunction "}}}


nnoremap <silent> g0 :call Fontsize_up()<cr>
nnoremap <silent> g9 :call Fontsize_down()<cr>
" vim: sw=2 ts=2 sts=2 et

@humus
Copy link

humus commented Sep 24, 2016

Revisar si tienes vim --remote-silent

echo has('clientserver')

@humus
Copy link

humus commented Sep 24, 2016

Utilizando features avanzados de vanilla vim

http://vimcasts.org/episodes/vimgolf-prime-numbers/

@humus
Copy link

humus commented Sep 24, 2016

Los macros son registros y se pueden editar en texto plano

Para pegar el macro w en el buffer actual:

"wp

Pasar texto al macro w (primero seleccionar en modo visual)

"wy

@humus
Copy link

humus commented Sep 24, 2016

modeline puedes verlo en :h modeline

" vim: sw=2 ts=2 sts=2 et

@humus
Copy link

humus commented Sep 24, 2016

Transmite en directo videos de programación:
https://www.twitch.tv/gary_bernhardt

@humus
Copy link

humus commented Sep 24, 2016

Undo persistente

set undodir=C:\vim2\tmp\undo
set noswf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment