数値を日本語の文章中で見やすい形式に桁区切りします。
- 4桁ごとに
万
、億
などの日本語の区切りを挟みます。穣
までしか用意していないので、それより大きな数値は正しく表現できません。- 小数点以下はそのまま表示します。
- 千の桁には
,
を追加します。- これが不要である場合、出力結果に
.replaceAll(",", "")
を適用することで削除できます。
- これが不要である場合、出力結果に
" 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 |
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.
" 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 |
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', |
export function threeCharactersTimestamp(date?: Date) { | |
if (!date) { | |
date = new Date(); | |
} | |
const [h, m, s] = [date.getHours(), date.getMinutes(), date.getSeconds()]; | |
// min & sec eatch 4 seconds | |
const ms = Math.floor((m * 60 + s) / 4); | |
const [m2, s2] = [Math.floor(ms / 30), ms % 30]; |
#!/bin/bash | |
# Save this file as `git-sw` in your $PATH and run `chmod +x git-sw`. | |
# Run `git sw -` to switch to last branch. | |
# Run `git sw` to select branch using fzf. | |
# Run `git sw branch-name` to pass query to fzf. | |
# If the argument is matched to existing branch, change to that immediately. | |
# Create new branch when query is not matched by `fzf --print-query | tail -1`. | |
# ref: https://github.com/junegunn/fzf/issues/1693#issuecomment-699642792 |
-- https://support.microsoft.com/ja-jp/topic/%E3%83%AD%E3%83%BC%E3%83%9E%E5%AD%97%E5%85%A5%E5%8A%9B%E3%81%AE%E3%81%A4%E3%81%A5%E3%82%8A%E4%B8%80%E8%A6%A7%E8%A1%A8%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%A6%E3%81%BF%E3%82%88%E3%81%86-bcc0ad7e-2781-cc9a-e524-7de506d8fdae | |
local roman_kana_table = { | |
-- common symbols in japanese writings | |
['~'] = '~', [','] = '、', ['.'] = '。', ['/'] = '・', | |
['-'] = 'ー', ['['] = '「', [']'] = '」', | |
-- other full-space symbols | |
-- ['!']='!', ['"']='”', ['#']='#', ['$']='$', ['%']='%', | |
-- ['&']='&', [''']='’', ['(']='(', [')']=')', ['*']='*', | |
-- ['+']='+', [',']=',', ['-']='-', ['.']='.', ['/']='/', |
let col = getcurpos('.')[2] | |
let line = getline('.') | |
let pre = substitute(line[:col-1], '^.*[^0-9A-Za-z_.]', '', '') | |
let post = substitute(line[col:], '[^0-9A-Za-z_.].*$', '', '') | |
echo pre .. post |
# define in your .bashrc or .zshrc | |
# fuzzy edit gist | |
fest() { | |
gh gist list "$@" | fzf --with-nth=-2,-4,-3,2..-5 | awk '{print $1}' \ | |
| xargs --no-run-if-empty --open-tty gh gist edit | |
} | |
# view web gist | |
vest() { |