Last active
October 24, 2016 17:21
-
-
Save javier-lopez/18dd89c32365b99636558f10b8413074 to your computer and use it in GitHub Desktop.
Vim CDMX VI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://sanctum.geek.nz/arabesque/vim-anti-patterns/ #Antipatrones de Vim |
No me funcionó https://gist.github.com/chilicuil/880a02d9669b71d772d66eebdf3151e4#gistcomment-1882224 así que dejo una implementación alternativa.
fun! Fontsize_up() "{{{
let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole + 1
let l:new_font_size = ' '.l:gf_size_whole
let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
endfunction "}}}
fun! Fontsize_down() "{{{
let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole - 1
let l:new_font_size = ' '.l:gf_size_whole
let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
endfunction "}}}
nnoremap <silent> g0 :call Fontsize_up()<cr>
nnoremap <silent> g9 :call Fontsize_down()<cr>
Agrega :h modeline
al archivo actual.
function! AppendModeLine()
let save_cursor = getpos('.')
let append = ' vim: set ts='.&tabstop.' sw='.&shiftwidth.' tw='.&textwidth.' ft='.&filetype.' :'
$put =substitute(&commentstring, '%s', append, '')
call setpos('.', save_cursor)
redraw!
echo "Added modeline :)"
endfunction
nnoremap <silent> m0 :call AppendModeLine()<cr>
Limpia búsqueda actual
nmap <silent> <leader>/ :nohlsearch<cr>
Instala dependencias en plugins instalados con vim-plug
Bundle 'majutsushi/tagbar' , { 'on': 'TagbarToggle', 'do': 'wget --no-check-certificate https://raw.githubusercontent.com/chilicuil/learn/master/python/mkd2ctags && chmod +x mkd2ctags' }
:%d
elimina todo el contenido del buffer activo
Una revisión al administrador de paquetes nativo de Vim 8, a la Pathogen:
https://shapeshed.com/vim-packages/
En mi opinión muy inferior a las alternativas actuales, vundle, vim-plug y con dependencia en Vim >= 8, incluso si la implementación nativa fuera increible pasaran muchos años antes de vim 8 se encuentre instalado por defecto en sistemas Unix.
Spacemacs para vim?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://vimcasts.org/episodes/simple-calculations-with-vims-expression-register/
Registro '='