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
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
bfredl / nvim-terminal-edit.py
Last active Jan 28, 2019 — forked from tarruda/nvim-terminal-edit.py
Edit file in host Neovim instance from a :terminal buffer
View nvim-terminal-edit.py
#!/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:
View polltest.py
import zmq
import neovim
import threading
from time import sleep
@neovim.plugin
class PollTest(object):
def __init__(self, vim):
self.vim = vim
self.ctx = zmq.Context.instance()
View nvim_clipboard.py
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'):
View nvim_clipboard_xclip.py
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):
View testcase.py
import sys
import neovim
from threading import Thread
from time import sleep
vim = neovim.connect(sys.argv[1])
buf = vim.current.buffer
def thread():
sleep(0.2)
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/__init__.py", 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/plugin_host.py", line 46, in __enter__
self.install_plugins()
File "/home/bjorn/.local/lib/python2.7/site-packages/neovim-0.0.6-py2.7.egg/neovim/plugin_host.py", line 69, in install_plugins
self.discover_plugins()
You can’t perform that action at this time.