Skip to content

Instantly share code, notes, and snippets.

View mhinz's full-sized avatar

Marco Hinz mhinz

View GitHub Profile
let g:startify_custom_header = [
\ ' ________ __ __ ',
\ ' __ /\_____ \/\ \\ \ ',
\ ' __ __ /\_\ ___ ___ \/___//''/''\ \ \\ \ ',
\ ' /\ \/\ \\/\ \ /'' __` __`\ /'' /'' \ \ \\ \_ ',
\ ' \ \ \_/ |\ \ \/\ \/\ \/\ \ /'' /''__ \ \__ ,__\',
\ ' \ \___/ \ \_\ \_\ \_\ \_\ /\_/ /\_\ \/_/\_\_/ ',
\ ' \/__/ \/_/\/_/\/_/\/_/ \// \/_/ \/_/ ',
\ '',
\ '',
@mhinz
mhinz / gist:6107828
Last active December 20, 2015 09:29
for cs in ['zenburn', 'tango256', 'default']
try
execute 'colorscheme' cs
break
catch
endtry
endfor
@mhinz
mhinz / gist:6282134
Last active December 21, 2015 08:59
function! sy#repo#get_stats() abort
if !exists('g:sy_path') || !has_key(g:sy, g:sy_path)
return [-1, -1, -1]
endif
return g:sy[g:sy_path].stats
endfunction
function! s:count_characters(bang) range abort
let nchars = 0
let lines = a:bang ? range(1, line('$')) : range(a:firstline, a:lastline)
for line in lines
let nchars += strlen(getline(line))
endfor
if a:bang
echomsg '>>> The file contains '. nchars .' characters.'
function! GoTags() abort
let files = substitute(glob('`find -name "*.go" -not -path "*/goeg/*" 2> /dev/null`'), '\n', ' ', '')
let tempfile = tempname()
call system('gotags '. files .' > '. tempfile)
call rename(tempfile, 'tags')
echom '>> Go tags updated!'
endfunction
command Gotags :call GoTags()
package main
import "fmt"
func main() {
fmt.
}
autocmd BufRead,BufNewFile ~/foobar/quux/something_else/*
\ if &filetype == 'gitcommit' |
\ setlocal textwidth=72 |
\ else |
\ setlocal textwidth=120 |
\ endif
fun! Foo() range
execute a:firstline .','. a:lastline .'normal IOH NOES'
endfun
com! -range Foo <line1>,<line2>call Foo()
" style 1
if exists('b:loaded')
finish
endif
let b:loaded = 1
" style 2
if exists('s:counter')
" style 1
if exists('b:loaded')
finish
endif
let b:loaded = 1
" style 2
if exists('s:counter')