Skip to content

Instantly share code, notes, and snippets.

@Milly
Milly / _generated.ts
Last active April 14, 2023 22:25
deno jsdoc test
// NOTE: This file is generated. Do NOT modify it manually.
// deno-lint-ignore-file camelcase
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts";
/**
* Return the absolute value of **{expr}**. When **{expr}** evaluates to
* a `Float` abs() returns a `Float`. When **{expr}** can be
* converted to a `Number` abs() returns a `Number`. Otherwise
* abs() gives an error message and returns -1.
* Examples:
@Milly
Milly / callbackfreeze.ts
Last active April 3, 2023 19:33
ddu-source-callbackfreeze
// denops/@ddu-sources/callbackfreeze.ts
import {
BaseSource,
type GatherArguments,
type OnInitArguments,
} from "https://deno.land/x/[email protected]/base/source.ts";
import { type Denops } from "https://deno.land/x/[email protected]/deps.ts";
import type { Item } from "https://deno.land/x/[email protected]/types.ts";
import * as lambda from "https://deno.land/x/[email protected]/lambda/mod.ts";
@Milly
Milly / ddu.vim
Last active May 28, 2022 06:21
Grep command with ddu.vim
" autoload/my/ddu.vim
"
" plugins:
" https://github.com/Shougo/ddu.vim
" https://github.com/Shougo/ddu-filter-matcher_substring
" https://github.com/Shougo/ddu-ui-ff
" https://github.com/Shougo/ddu-kind-file
" https://github.com/shun/ddu-source-rg
let s:rg_highlights = {
zstyle ':vcs_info:git+set-message:*' hooks git_compute_vars
function __git_eread() {
[[ -r "$1" ]] && IFS=$'\r\n' read "$2" <"$1"
}
function __git_config_hash() {
local _reg="$1"
local _out="$(git config -z --get-regexp "$_reg" 2>/dev/null|tr '\0\n' '\n ')"
local _k _v
@Milly
Milly / lightline.vim
Created October 19, 2020 10:59
My autoload/my/lightline.vim
" autoload: my/lightline
function! my#lightline#setup(...) abort
let g:enable_powerline_font = get(g:, 'enable_powerline_font',
\ exists('$ENABLE_POWERLINE_FONT') && $ENABLE_POWERLINE_FONT !=# '')
if g:enable_powerline_font && exists('&ambiwidth')
set ambiwidth=double
endif
let c = g:enable_powerline_font ?
\ { 'Branch': "\ue0a0 ", 'LineNo': "\ue0a1", 'ReadOnly': "\ue0a2",
@Milly
Milly / cdcurrent.vim
Created August 26, 2020 15:25
Vim plugin that add chdir commands to current file's directory or fern path.
" Vim plugin file - cdcurrent
"
" Purpose: Setup chdir commands
"=============================================================================
let s:is_windows = has('win32') || has('win64')
" cd to current file's directory
command! -bang Ccd call s:chdir_current('cd<bang>')
command! -bang Clcd call s:chdir_current('lcd<bang>')
{
"root": true,
"env": {
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
@Milly
Milly / netrw_open_custom.vim
Created April 24, 2020 10:29
Open path with VSCode in windows+vim+netrw
let g:netrw_open_custom_prog = '"vscode://file/%s"'
function! Netrw_open_custom(file) abort
let l:path = a:file
if exists('b:netrw_curdir')
let l:path = b:netrw_curdir . '/' . a:file
endif
if glob(l:path) != ''
execute '!start' printf(g:netrw_open_custom_prog, l:path)
endif
@Milly
Milly / fix-ctrl-h-wt-clink.vim
Last active April 24, 2020 10:28
Fix Ctrl-H key broken in Windows Terminal + Vim.exe
@Milly
Milly / vopen.cmd
Last active April 13, 2020 08:11
Open file with existence vim instance.
@echo off
setlocal
set target=%~1
if "" == "%target%" set target=.
if not "" == "%VIM_TERMINAL%" (
echo | set /p=]51;["drop","%target:\=\\%"]
) else if not "" == "%VIM_SERVERNAME%" (
gvim --servername %VIM_SERVERNAME% --remote-silent "%target%"