Skip to content

Instantly share code, notes, and snippets.

View yen3's full-sized avatar

Yen3 yen3

  • Taiwan
View GitHub Profile
@yen3
yen3 / gist:8c0f7dd012cd8b3b9b07b6992c82e96f
Last active December 2, 2019 03:33 — forked from ram535/gist:b1b7af6cd7769ec0481eb2eed549ea23
Reuse the same terminal in neovim. (Open the terminal in below)
" With this function you can reuse the same terminal in neovim.
" You can toggle the terminal and also send a command to the same terminal.
let s:monkey_terminal_window = -1
let s:monkey_terminal_buffer = -1
let s:monkey_terminal_job_id = -1
function! MonkeyTerminalOpen()
" Check if buffer exists, if not create a window and a buffer
if !bufexists(s:monkey_terminal_buffer)
@yen3
yen3 / striter.py
Created March 9, 2018 09:31 — forked from anacrolix/striter.py
A Python IO class wrapping an iterable of strings.
import io
class StringIteratorIO(io.TextIOBase):
def __init__(self, iter):
self._iter = iter
self._left = ''
def readable(self):
return True
@yen3
yen3 / gist:3a264578e79e213a692135f98bd1a2a2
Created June 14, 2016 05:54 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote