Skip to content

Instantly share code, notes, and snippets.

Björn Linse bfredl

  • Lund, Sweden
Block or report user

Report or block bfredl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:733060ff6965c917d73626ae57bc4884
diff --git a/pangoterm.c b/pangoterm.c
index 5985b51..7d93af6 100644
--- a/pangoterm.c
+++ b/pangoterm.c
@@ -2187,8 +2187,8 @@ void pangoterm_init_font(PangoTerm *pt) {
int height = pango_font_metrics_get_ascent(metrics) + pango_font_metrics_get_descent(metrics);
- pt->cell_width_pango = width;
pt->cell_width = PANGO_PIXELS_CEIL(width);
View tshl.lua
cquery = [[
(ERROR) @ErrorMsg
"break" @keyword
"case" @keyword
"continue" @keyword
"do" @keyword
"else" @keyword
"for" @keyword
"if" @keyword
bfredl / tree_test.c
Last active Aug 7, 2016
kbtree itr test
View tree_test.c
#include "kbtree.h"
#include <stdlib.h>
#include <stdbool.h>
KBTREE_INIT(test, int, kb_generic_cmp)
#define N 5000
int main() {
kbtree_t(test) *b = kb_init(test, KB_DEFAULT_SIZE);
int nums[N];
kbitr_t itr;
bfredl /
Last active Jan 28, 2019 — forked from tarruda/
Edit file in host Neovim instance from a :terminal buffer
#!/usr/bin/env python
"""Edit a file in the host nvim instance."""
from __future__ import print_function
import os
import sys
from neovim import attach
args = sys.argv[1:]
if not args:
import zmq
import neovim
import threading
from time import sleep
class PollTest(object):
def __init__(self, vim):
self.vim = vim
self.ctx = zmq.Context.instance()
import xerox
class NvimClipboard(object):
def __init__(self, vim):
self.provides = ['clipboard']
def clipboard_get(self, reg):
txt = xerox.paste()
# emulate vim behavior
if txt.endswith('\n'):
from subprocess import Popen, PIPE
class NvimClipboard(object):
def __init__(self, vim):
self.provides = ['clipboard']
def sel_name(self, reg):
return 'clipboard' if reg == '+' else 'primary'
def clipboard_get(self, reg):
import sys
import neovim
from threading import Thread
from time import sleep
vim = neovim.connect(sys.argv[1])
buf = vim.current.buffer
def thread():
for i in range(100):
View gist:92d698fc2c40bac5fd28
" Vundle {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Plugin 'gmarik/vundle'
Plugin 'SirVer/ultisnips'
filetype plugin indent on
" }}}
View nvim_traceback
Error detected while processing /home/bjorn/config/vim/nvimrc:
line 337:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/bjorn/.local/lib/python2.7/site-packages/neovim-0.0.6-py2.7.egg/neovim/", line 34, in start_host
with PluginHost(vim, discovered_plugins=[ScriptHost]) as host:
File "/home/bjorn/.local/lib/python2.7/site-packages/neovim-0.0.6-py2.7.egg/neovim/", line 46, in __enter__
File "/home/bjorn/.local/lib/python2.7/site-packages/neovim-0.0.6-py2.7.egg/neovim/", line 69, in install_plugins
You can’t perform that action at this time.