Skip to content

Instantly share code, notes, and snippets.

View kawarimidoll's full-sized avatar
🦕
#Deno

カワリミ人形 kawarimidoll

🦕
#Deno
View GitHub Profile
@kawarimidoll
kawarimidoll / which-key-ins-completion.lua
Last active July 10, 2022 05:44
Show sources of ins-completion by which-key.nvim
local wk = require("which-key")
wk.setup()
-- :h ins-completion
wk.register({
["<C-l>"] = 'Whole lines',
["<C-n>"] = 'keywords in the current file',
["<C-k>"] = 'keywords in dictionary',
["<C-t>"] = 'keywords in thesaurus',
@kawarimidoll
kawarimidoll / highlight_extra_whitespaces.vim
Last active August 13, 2022 23:44
Highlight extra whitespaces in Vim
" Highlight extra whitespaces
" https://zenn.dev/kawarimidoll/articles/450a1c7754bde6
" u00A0 ' ' no-break space
" u2000 ' ' en quad
" u2001 ' ' em quad
" u2002 ' ' en space
" u2003 ' ' em space
" u2004 ' ' three-per em space
" u2005 ' ' four-per em space
" u2006 ' ' six-per em space
@kawarimidoll
kawarimidoll / README.md
Last active November 28, 2022 02:40
Wrap around the edges of the quickfix list.

CCycle

An expanded qprevious and qnext that wrap around the edges of the quickfix list.

Type [q to open previous quickfix, type ]q to open next quickfix. You can use counts, for example, type 2[q to open second previous quickfix.

You can use old revision if you don't need counts.

@kawarimidoll
kawarimidoll / lazy-treesitter.vim
Created June 22, 2022 23:10
lazy load nvim-treesitter using vim-plug
" vim-plug
call plug#begin(stdpath('config') . '/plugged')
Plug 'catppuccin/nvim', {'as': 'catppuccin'}
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate', 'on': [] }
Plug 'andymass/vim-matchup', { 'on': [] }
call plug#end()
" enable treesitter-integrated colorscheme
colorscheme catppuccin
@kawarimidoll
kawarimidoll / README.md
Last active January 19, 2022 04:40
Number formatter for display in Japanese

jpNumberFormat.js

数値を日本語の文章中で見やすい形式に桁区切りします。

  • 4桁ごとになどの日本語の区切りを挟みます。
    • までしか用意していないので、それより大きな数値は正しく表現できません。
    • 小数点以下はそのまま表示します。
  • 千の桁には,を追加します。
    • これが不要である場合、出力結果に.replaceAll(",", "")を適用することで削除できます。
@kawarimidoll
kawarimidoll / README.md
Last active December 3, 2022 11:13
Define keymappings for multiple modes at once in Vim or Neovim

multiple_keymap.vim

Define keymappings for multiple modes at once in Vim or Neovim.

Installation

Put codes in your configuration file, such as .vimrc or init.vim.

Usage

@kawarimidoll
kawarimidoll / MergeHighlight.vim
Last active December 9, 2021 00:59
Merge highlight in Vim or Neovim
command! -nargs=+ -complete=highlight MergeHighlight call s:MergeHighlight(<q-args>)
function! s:MergeHighlight(args) abort "{{{
let l:args = split(a:args)
if len(l:args) < 2
echoerr '[MergeHighlight] At least 2 arguments are required.'
echoerr 'New highlight name and source highlight names.'
return
endif
" skip 'links' and 'cleared'
@kawarimidoll
kawarimidoll / README.md
Last active November 26, 2021 16:28
get DENO_DIR
@kawarimidoll
kawarimidoll / README.md
Last active November 27, 2021 01:55
Auto Run Deno in Neovim

Auto Run Deno in Neovim

Copy DenoRun in your init.vim.

When you run :DenoRun in Deno script file, deno run will be started the terminal window. If the name of the file is match with Deno test files, deno test will be started instead of deno run. It automatically add -A --no-check --unstable --watch for productivity. Use this only in your own files for your security.

This works only in Neovim, not Vim, because Vim has different terminal API.

@kawarimidoll
kawarimidoll / arg_opt_sample.sh
Last active March 10, 2024 15:00
Process arguments and options in shell script
#!/bin/bash
usage() {
cat << EOS >&2
sample.sh
USAGE:
bash arg_opt_sample.sh [options] <arg1> [arg2]
ARGS: