Skip to content

Instantly share code, notes, and snippets.

View tamago324's full-sized avatar
⌨️
Enjoy Keeb!

tamago324 tamago324

⌨️
Enjoy Keeb!
  • japan
View GitHub Profile
import sys
from pyls_jsonrpc import dispatchers, streams, endpoint
class LangServer(dispatchers.MethodDispatcher):
def __init__(self):
# sys.stdin.buffer を使うと、バイト列で入出力できる
# python-language-server も sys.stdin.buffer と sys.stdout.buffer を使っていた
self.jsonrpc_stream_reader = streams.JsonRpcStreamReader(sys.stdin.buffer)
self.jsonrpc_stream_writer = streams.JsonRpcStreamWriter(sys.stdout.buffer)
scriptencoding utf-8
" 書き方は以下を参照
" * https://github.com/Yggdroot/LeaderF/issues/144#issuecomment-540008950
" * http://bit.ly/2NdiX1x
" :Leaderf packadd
" :Leaderf git_checkout
" :Leaderf mrw
" :Leaderf todo
@tamago324
tamago324 / bitly.vim
Last active December 8, 2019 02:17
bitly を使って URL を短くする
scriptencoding utf-8
" bitly を使って URL を短くする
" https://dev.bitly.com/v4_documentation.html
let s:HTTP = vital#vital#import('Web.HTTP')
let s:JSON = vital#vital#import('Web.JSON')
let s:base_url = 'https://api-ssl.bitly.com/v4'
let s:default_token = '4c0464b927dc17e9c824ca0f2e01695adf3d26cc'
@tamago324
tamago324 / fav_helps.vim
Last active November 22, 2019 00:54
お気に入りのヘルプをポップアップで表示してジャンプ
command! FavoriteHelps call FavoriteHelps()
" 順序を保持するため、リスト
let s:fav_helps = []
call add(s:fav_helps, ['function-list', '関数一覧'])
call add(s:fav_helps, ['user-commands', 'command の書き方'])
call add(s:fav_helps, ['autocmd-events', 'autocmd 一覧'])
call add(s:fav_helps, ['E500', '<cword> とか <afile> とか'])
call add(s:fav_helps, ['usr_41', 'Vim script 基本'])
@tamago324
tamago324 / dl_plugins.sh
Last active November 18, 2019 15:10
docker_on_nvim
#!/bin/bash
cd ~
# ここは、試したいプラグインによる
git clone https://github.com/Shougo/denite.nvim
git clone https://github.com/roxma/nvim-yarp
git clone https://github.com/roxma/vim-hug-neovim-rpc
@tamago324
tamago324 / docker_on_vagrant_Vagrantfile
Created November 15, 2019 18:31
docker on vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
set encoding=utf-8
scriptencoding utf-8
syntax enable
filetype plugin indent on
set nocompatible
" cd ~
" " git clone https://github.com/Shougo/defx.nvim
@tamago324
tamago324 / vimrc_minimal
Last active November 15, 2019 16:04
defx の defx#do_action('new_file') して、input のところで <C-c> をしてしまうと、クラッシュしてしまう問題をしめるための vimrc
set encoding=utf-8
scriptencoding utf-8
syntax enable
filetype plugin indent on
set nocompatible
set runtimepath+=~/vimfiles/plugged/defx.nvim,~/vimfiles/plugged/nvim-yarp,~/vimfiles/plugged/vim-hug-neovim-rpc
@tamago324
tamago324 / popup_window_basic.vim
Last active September 12, 2019 10:15
popup window の標準的な処理を書いてみる
let s:winid = 0
function! s:open_pop() abort
if s:winid != 0
call s:show_pop()
return
endif
let s:winid = popup_create('', {
@tamago324
tamago324 / i_love_vim_popup.vim
Created September 12, 2019 04:25
popup window のテキストを変更する例
let s:winid = popup_notification('I love Vim!', {
\ 'line': 4
\ })
let s:text = ['I love Vim!']
function! s:set_text(timer) abort
call add(s:text, 'I love Vim!')
call popup_settext(s:winid, s:text)
endfunction