Skip to content

Instantly share code, notes, and snippets.

View justinmk's full-sized avatar
💦

Justin M. Keyes justinmk

💦
View GitHub Profile
@justinmk
justinmk / t_xx.c
Created October 1, 2016 19:54
Vim t_xx option snippet
#include <stdlib.h>
#include <stdio.h>
#define TERMCAP2KEY(a, b) (-((a) + ((int)(b) << 8)))
#define KEY2TERMCAP0(x) ((-(x)) & 0xff)
#define KEY2TERMCAP1(x) (((unsigned)(-(x)) >> 8) & 0xff)
int main(int argc, char **argv) {
int t_vi = TERMCAP2KEY('v', 'i');
unsigned int keyname[2] = { 0 };
http://invisible-island.net/xterm/
XTerm Control Sequences
Edward Moy
University of California, Berkeley
Revised by
@justinmk
justinmk / callgrind-c354205
Last active April 13, 2017 12:14
nvim callgrind v0.2.0-996 / c354205 (before #5119)
Reading data from 'callgrind.out.1466'...
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.1466' (creator: callgrind-3.10.1)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 10950653
Trigger: Program termination
Profiled target: build/bin/nvim -n -u NONE -i NONE +:e ~/.local/share/nvim/bundle/vim-sexp/plugin/sexp.vim +so % (PID 1466, part 1)
@justinmk
justinmk / callgrind-c60e409
Last active April 13, 2017 12:15
nvim callgrind c60e409 (#5119)
Reading data from 'callgrind.out.2458'...
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.2458' (creator: callgrind-3.10.1)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 15854000
Trigger: Program termination
Profiled target: build/bin/nvim -n -u NONE -i NONE +:e ~/.local/share/nvim/bundle/vim-sexp/plugin/sexp.vim +so % (PID 2458, part 1)
Reading data from 'callgrind.out.31506'...
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.31506' (creator: callgrind-3.10.1)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 15885896
Trigger: Program termination
Profiled target: build/bin/nvim -n -u NONE -i NONE +:e ~/.local/share/nvim/bundle/vim-sexp/plugin/sexp.vim +so % (PID 31506, part 1)
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
{'types': {'Window': {'id': 1, 'prefix': {'_TYPE': [], '_VAL':
['nvim_win_']}}, 'Tabpage': {'id': 2, 'prefix': {'_TYPE': [], '_VAL':
['nvim_tabpage_']}}, 'Buffer': {'id': 0, 'prefix': {'_TYPE': [], '_VAL':
['nvim_buf_']}}}, 'functions': [{'method': v:true, 'name': {'_TYPE': [],
'_VAL': ['nvim_buf_line_count']}, 'return_type': {'_TYPE': [], '_VAL':
['Integer']}, 'parameters': [[{'_TYPE': [], '_VAL': ['Buffer']}, {'_TYPE':
[], '_VAL': ['buffer']}]], 'since': 1}, {'method': v:false,
'deprecated_since': 1, 'name': {'_TYPE': [], '_VAL': ['buffer_get_line']},
'return_type': {'_TYPE': [], '_VAL': ['String']}, 'parameters': [[{'_TYPE':
[], '_VAL': ['Buffer']}, {'_TYPE': [], '_VAL': ['buffer']}], [{'_TYPE': [],
{'nvim_feedkeys': {'data': {'_TYPE': [], '_VAL': ['&handle_nvim_feedkeys']},
'func': {'_TYPE': [], '_VAL': ['api_wrapper']}, 'args': 3}, 'mkdir': {'args':
[1, 3]}, 'getcompletion': {'args': [2, 3]}, 'jobstop': {'args': 1},
'nvim_buf_set_lines': {'data': {'_TYPE': [], '_VAL':
['&handle_nvim_buf_set_lines']}, 'func': {'_TYPE': [], '_VAL':
['api_wrapper']}, 'args': 5}, 'assert_notmatch': {'args': [2, 3]},
'nvim_win_is_valid': {'data': {'_TYPE': [], '_VAL':
['&handle_nvim_win_is_valid']}, 'func': {'_TYPE': [], '_VAL':
['api_wrapper']}, 'args': 1}, 'empty': {'args': 1}, 'getftype': {'args': 1},
'nvim_list_tabpages': {'data': {'_TYPE': [], '_VAL':
/*
* Catch v1.10.0
* Generated: 2017-08-26 15:16:46.676990
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
@justinmk
justinmk / tui.c.patch
Created May 20, 2018 19:01
tui.c Windows console patch
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 65957626cbc9..86987a56ad07 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1834,6 +1834,8 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value,
// for mouse input, which by accident only supports X10 protocol.
// Force libtermkey to fallback to its CSI driver (driver-csi.c). #7948
return NULL;
+ } else if (strequal(name, "key_home")) {
+ return "\x1b[1~";