Skip to content

Instantly share code, notes, and snippets.

View delphinus's full-sized avatar

JINNOUCHI Yasushi delphinus

View GitHub Profile
@delphinus
delphinus / Dockerfile
Last active October 12, 2019 14:50
deoplete-lsp testing
FROM golang:latest
RUN apt-get update && apt-get install -y \
ninja-build gettext libtool libtool-bin autoconf automake cmake g++ \
pkg-config unzip \
git python3 python3-dev python3-pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --single-branch --branch lsp https://github.com/h-michael/neovim ~/neovim \
@delphinus
delphinus / min-ale.vim
Created September 17, 2019 09:45
Minimum vimrc to use ALE + pyls with floating windows
set runtimepath-=~/.vim
set runtimepath+=~/test/deoplete.nvim
set runtimepath+=~/test/float-preview.nvim
set runtimepath+=~/test/ale
set completeopt-=preview " This is needed to avoid messages dup.
let g:deoplete#enable_at_startup = 1
let g:float_preview#docked = 0
let g:ale_linters = {
\ 'python': ['pyls'],
\ }
@delphinus
delphinus / min-deoplete-jedi.vim
Created September 17, 2019 09:43
Minimum vimrc to use deoplete-jedi with floating windows
set runtimepath-=~/.vim
set runtimepath+=~/test/deoplete.nvim
set runtimepath+=~/test/float-preview.nvim
set runtimepath+=~/test/deoplete-jedi
set runtimepath+=~/test/jedi
set completeopt-=preview " This is needed to avoid messages dup.
let g:deoplete#enable_at_startup = 1
let g:float_preview#docked = 0
@delphinus
delphinus / colorwheel.vim
Last active November 10, 2024 19:35
Draw color wheel in NeoVim
const s:pi2 = 2 * 3.14159265
" pixel_ratio means the ratio of the character size.
const s:pixel_ratio = 2.0 / 1.0
" ColorWheel draws a color wheel
function! ColorWheel() abort
const [center_x, center_y] = [&columns / 2.0, &lines / 2.0]
const radius = min([&columns, &lines]) / 8.0 * 3
" loop over the distance multiplied by pixel_ratio in the horizontal
" direction because the character has a rectangular shape.
@delphinus
delphinus / colorwheel.vim
Created June 29, 2019 04:33
Draw color wheel in NeoVim
" Draw color circle in the middle of the window.
function! ColorCircle() abort
let center = [&columns / 2.0, &lines / 2.0]
" Radius will be 3/8 of width or height.
let radius = min([&columns, &lines]) / 8.0 * 3.0
let angle = 0.0
" drawn is a dict that indicates already drawn dots.
let drawn = {}
" loop over 0° to 360°
while angle < 360
@delphinus
delphinus / file0.sh
Last active July 4, 2020 07:27
SF Mono を使って最高のプログラミング用フォントを作った話 ref: https://qiita.com/delphinus/items/f472eb04ff91daf44274
brew tap delphinus/sfmono-square
brew install sfmono-square
# /usr/local/opt/sfmono-square/share/fonts にフォントが作成されます
@delphinus
delphinus / Dockerfile
Last active November 26, 2018 05:20
Dockerfile for debugging Vim
FROM centos/devtoolset-7-toolchain-centos7
USER 0
RUN yum -y install \
git \
ncurses-devel \
@'Development Tools' \
&& yum clean all -y
USER 1001
RUN git clone https://github.com/vim/vim
#include <stdio.h>
void hello()
{
for (int i = 0; i < 3; i++)
{
printf("Hello World\n");
}
}
@delphinus
delphinus / vim-debug.diff
Last active November 25, 2018 02:49
Diff for debugging Vim
diff --git a/src/Makefile b/src/Makefile
index 5b25e033f..4b3f5642c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -592,6 +592,7 @@ CClink = $(CC)
# statically linked executable.
# When not defined, configure will try to use -O2 -g for gcc and -O for cc.
#CFLAGS = -g
+CFLAGS = -ggdb3
#CFLAGS = -O
@delphinus
delphinus / file0.txt
Last active August 13, 2019 05:52
iTerm2 にステータスバーが付いた ref: https://qiita.com/delphinus/items/1748937aefeb241bdcee
#!/usr/bin/env python3
from iterm2 import Connection, StatusBarComponent, StatusBarRPC, run_forever
from iterm2.statusbar import Knob
from math import floor
from subprocess import CalledProcessError, check_output
from typing import List
import re
chars = ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"]