Skip to content

Instantly share code, notes, and snippets.

setopt prompt_subst
zmodload -i zsh/parameter
: ${SUSP_JOBS_MAX:=3}
: ${SUSP_JOBS_ICON:=$'\u23F8'}
: ${SUSP_JOBS_COLOR:='%F{yellow}'}
typeset -g SUSP_JOBS_RPROMPT=""
export COMMAND_BUFFER_STACK=''
typeset -a buffer_stack_arr
function make-p-buffer-stack() {
if [[ ! $#buffer_stack_arr -gt 0 ]]; then
COMMAND_BUFFER_STACK=''
return
fi
COMMAND_BUFFER_STACK="%F{cyan}<Stack:$buffer_stack_arr>%f"
}
#! /usr/bin/env zsh
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER=" fg"
zle accept-line
else
zle push-input
zle clear-screen
fi
@yuki-yano
yuki-yano / counter.ts
Created November 30, 2022 07:51
deno redux-toolkit counter
import { default as redux } from "npm:@reduxjs/[email protected]";
import type { PayloadAction } from "npm:@reduxjs/[email protected]";
import { default as logger } from "npm:[email protected]";
import { default as Logger } from "npm:@types/[email protected]";
const { configureStore, createSlice } = redux;
const { createLogger } = logger as typeof Logger;
type CounterState = {
count: number;
@yuki-yano
yuki-yano / fuzzy_match.vim
Created January 5, 2022 04:48
searchx + fuzzy-motion
function! s:has(list, value) abort
return index(a:list, a:value) isnot -1
endfunction
function! s:_get_unary_caller(f) abort
return type(a:f) is type(function('function'))
\ ? function('call')
\ : function('s:_call_string_expr')
endfunction
@yuki-yano
yuki-yano / .vimrc
Last active December 2, 2021 23:19
ddc-fzf-matcher sample
let s:DEIN_BASE_PATH = $HOME . '/.cache/vim/tmp_bundle/'
let s:DEIN_PATH = expand(s:DEIN_BASE_PATH . 'repos/github.com/Shougo/dein.vim')
if !isdirectory(s:DEIN_PATH)
execute '!git clone --depth=1 https://github.com/Shougo/dein.vim' s:DEIN_PATH
endif
let &runtimepath .= ',' . s:DEIN_PATH
if dein#load_state(s:DEIN_BASE_PATH)
call dein#begin(s:DEIN_BASE_PATH)
@yuki-yano
yuki-yano / coc-skkeleton-completion.vim
Created October 5, 2021 04:56
coc + skkeleton + ddc
" ddc {{{3
if dein#tap('ddc.vim')
function! SetupDdc() abort
call ddc#enable()
endfunction
function DdcSettings() abort
call ddc#custom#patch_global('autoCompleteEvents', ['InsertEnter', 'TextChangedI', 'TextChangedP'])
call ddc#custom#patch_global('sources', ['skkeleton'])
call ddc#custom#patch_global('sourceOptions', {
let s:DEIN_BASE_PATH = $HOME . '/.vim/bundle/'
let s:DEIN_PATH = expand(s:DEIN_BASE_PATH . 'repos/github.com/Shougo/dein.vim')
if !isdirectory(s:DEIN_PATH)
if executable('git')
execute '!git clone --depth=1 https://github.com/Shougo/dein.vim' s:DEIN_PATH
endif
endif
let &runtimepath .= ',' . s:DEIN_PATH
@yuki-yano
yuki-yano / fzf_cmdline.vim
Created July 21, 2020 03:25
fzf command line completion
function! s:hoge() abort
let cl = getcmdline()
function! s:sink(line) abort closure
call feedkeys(":" .. cl .. a:line, "n")
endfunction
function! s:run(...) abort closure
call fzf#run({'source': 'ls -1', 'sink': funcref("s:sink")})
endfunction
call timer_start(0, funcref("s:run"))
redraw
@yuki-yano
yuki-yano / init.vim
Last active July 28, 2020 05:04
fzf-preview minimal settings
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'ryanoasis/vim-devicons'
call plug#end()
let g:coc_global_extensions = ['coc-fzf-preview']