Skip to content

Instantly share code, notes, and snippets.

@erw7
erw7 / nc2nbc.lua
Last active November 30, 2020 10:15
Dump terminfo hashed database
if #arg < 1 then
io.stderr:write('usage: ' .. arg[0] .. " [lib] term.h\n")
os.exit(1)
end
local lib = #arg > 1 and arg[1] or 'ncurses'
local file = #arg > 1 and arg[2] or arg[1]
local ffi = require('ffi')
ffi.cdef[[
static int encode_vim_to_nothing(
const void *const ignored,
typval_T *const tv, const char *const objname)
__attribute__((nonnull(2, 3))) __attribute__((warn_unused_result));
static int encode_vim_to_nothing(
const void *const ignored,
typval_T *const top_tv, const char *const objname)
{
const int copyID = get_copyID();
--- Makefile.orig 2017-11-04 03:26:56.000000000 +0900
+++ Makefile 2019-12-18 14:04:56.544140000 +0900
@@ -149,9 +149,9 @@
echo install -d -m 0755 $(PREFIX)/bin; \
fi
install -s -m 0755 $(PROGRAM) $(PREFIX)/bin
- @if [ ! -e $(PREFIX)/man/man1 ]; then \
- echo install -d -m 0755 $(PREFIX)/man/man1; \
- install -d -m 0755 $(PREFIX)/man/man1; \
+ @if [ ! -e $(PREFIX)/share/man/man1 ]; then \
==2185== Memcheck, a memory error detector
==2185== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2185== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2185== Command: /opt/neovim-0.5.0-bff42cd/bin/nvim -u NORC
==2185==
==2185== error calling PR_SET_PTRACER, vgdb might block
--2185-- WARNING: unhandled amd64-linux syscall: 332
--2185-- You may be able to write your own handler.
--2185-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--2185-- Nevertheless we consider this a bug. Please report
--- src/main.c.orig Sat Nov 23 12:49:05 2019
+++ src/main.c Sat Nov 23 13:25:49 2019
@@ -124,7 +124,7 @@
void fixkeypad();
#endif
-#if defined(KEY_RESIZE) && !defined(__DJGPP__)
+#if defined(KEY_RESIZE) && !defined(__DJGPP__) && !defined(_WIN32)
void
sigwinch_handler(int sig, siginfo_t *info, void *unused)
function! s:formatprocs(pid, prefix)
let result = ''
let result .= a:prefix . printf("%-24.24s%6s %12.12s %s\n",
\ s:procs[a:pid]['name'],
\ a:pid,
\ s:procs[a:pid]['Session Name'],
\ s:procs[a:pid]['Session'])
if has_key(s:procs[a:pid], 'children')
for pid in s:procs[a:pid]['children']
let result .= s:formatprocs(pid, a:prefix . ' ')

oldtest

test42.in

When set ff=unix on line 20 of test42.in, the line feed code is changed(^M is displayed) and it does not work.

test52.in

  • vim
  • fileencordings=ucs-bom,utf-8,default,latin1
@erw7
erw7 / implove-creation-of-uri.patch
Created December 3, 2018 10:31
Patch for Built-in LSP Support on Windows
diff --git a/runtime/lua/lsp/server.lua b/runtime/lua/lsp/server.lua
index eeb6ce578..eaf384056 100644
--- a/runtime/lua/lsp/server.lua
+++ b/runtime/lua/lsp/server.lua
@@ -76,7 +76,8 @@ end
server.default_callbacks = {
root_uri = function()
- return 'file://' .. (vim.api.nvim_call_function('getcwd', { }) or '/tmp/')
+ return lsp_util.get_uri(
@erw7
erw7 / windows.ti
Last active November 4, 2018 09:49
libuv+basekey|vt100 base function key for libuv,
kb2=\E[G, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D,
kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~,
libuv+exkey|vt100 extend function key for libuv,

Libuv Control Sequence on Windows

Sequence Description
ESC [ Control Sequence Introducer(CSI)
ESC c Full reset
ESC 7 Save cursor position and text attributes
ESC 8 Restore cursor position and text attributes