Skip to content

Instantly share code, notes, and snippets.

View mhinz's full-sized avatar

Marco Hinz mhinz

View GitHub Profile
function! s:foo()
cclose
endfunction
autocmd FileType qf call s:foo()
let &makeprg = 'ag --vimgrep'
let &errorformat = '%f:%l:%m'
Make foo
@mhinz
mhinz / foo.c
Created January 13, 2016 17:22
struct buffer_head ** bh, *bc;
struct buffer_head * bh, **bc;
struct buffer_head ****** bh, **bc;
struct buffer_head * bh, *bc;
struct buffer_head foo, bh, bc;
struct foo blah;
kpfs_attribute_header *attr_header;
int b;
kpfs_block_header *block_header;
void *data;
@mhinz
mhinz / blubb.vim
Last active December 10, 2015 23:11
command! Foo call fzf#run({
\ 'source': map(getqflist(), 'bufname(v:val.bufnr).":".v:val.lnum.":".v:val.text'),
\ 'sink': function('<sid>open')
\ })
function! s:open(entry)
let [file, linenr] = matchlist(a:entry, '\v([^:]*):([^:]*)')[1:2]
execute 'edit +'.linenr file
endfunction
@mhinz
mhinz / foo.py
Last active December 2, 2015 23:38
#!/usr/bin/env python3
"""
Start the "server" instance:
$ NVIM_LISTEN_ADDRESS=/tmp/nvimsocket nvim
Open any file. Then use this script:
./foo <filename> <line>
@mhinz
mhinz / foo.h
Created November 20, 2015 14:28
typedef struct {
Object *items;
size_t size;
size_t capacity;
} Array;
typedef struct {
ObjectType type;
union {
Array array;
1447428367.941773 server started (33132): socket /private/tmp/tmux-501/test, protocol 8
1447428367.942018 continuing cmdq 0x7ff5e2509a80: flags 0, client 0x0
1447428367.942032 cmdq 0x7ff5e2509a80: bind-key C-b send-prefix
1447428367.942062 continuing cmdq 0x7ff5e2509a80: flags 0, client 0x0
1447428367.942068 cmdq 0x7ff5e2509a80: bind-key C-o rotate-window
1447428367.942083 continuing cmdq 0x7ff5e2509a80: flags 0, client 0x0
1447428367.942088 cmdq 0x7ff5e2509a80: bind-key C-z suspend-client
1447428367.942104 continuing cmdq 0x7ff5e2509a80: flags 0, client 0x0
1447428367.942110 cmdq 0x7ff5e2509a80: bind-key Space next-layout
1447428367.942126 continuing cmdq 0x7ff5e2509a80: flags 0, client 0x0
λ MANPAGER= man man
sh: -c: line 0: syntax error near unexpected token `||'
sh: -c: line 0: `(cd '/usr/share/man' && (echo ".ll 16.0i"; echo ".nr LL 16.0i"; /bin/cat '/usr/share/man/man1/man.1') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | ( || true))'
Error executing formatting or display command.
System command (cd '/usr/share/man' && (echo ".ll 16.0i"; echo ".nr LL 16.0i"; /bin/cat '/usr/share/man/man1/man.1') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | ( || true)) exited with status 512.
No manual entry for man
[1] 17937 exit 1 MANPAGER= man man
@mhinz
mhinz / test.lua
Last active November 10, 2015 14:15
local Helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
local buf = Helpers.curbufmeths
local command = Helpers.command
local eq = Helpers.eq
local execute = Helpers.execute
local feed = Helpers.feed
local nvim = Helpers.nvim
local nvim_prog = Helpers.nvim_prog
/*
* buf_write() - write to file "fname" lines "start" through "end"
*
* We do our own buffering here because fwrite() is so slow.
*
* If "forceit" is true, we don't care for errors when attempting backups.
* In case of an error everything possible is done to restore the original
* file. But when "forceit" is TRUE, we risk losing it.
*
* When "reset_changed" is TRUE and "append" == FALSE and "start" == 1 and
local h = require('test.functional.helpers')
local clear = h.clear
local command = h.command
local eq = h.eq
local insert = h.insert
local nvim = h.nvim
-- local meths = h.meths