This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Uri, commands, workspace, window, Mutex} = require('coc.nvim') | |
const path = require('path') | |
const programMap = { | |
javascript: 'node', | |
typescript: 'ts-node', | |
python: 'python' | |
} | |
let global_id = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const fs = require('fs') | |
const { execSync } = require('child_process') | |
let file = path.join(process.cwd(), 'core.wxvpkg') | |
if (fs.existsSync(file)) { | |
execSync(`rmtrash ${file}`) | |
} | |
let fd = fs.openSync(file, 'w') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Save the file to ~/.vim/coc-extensions | |
// Usage: xmap <silent> <TAB> <Plug>(coc-repl-sendtext) | |
const {commands, workspace} = require('coc.nvim') | |
exports.activate = context => { | |
let {nvim} = workspace | |
let terminal | |
context.subscriptions.push(commands.registerCommand('repl.openTerminal', async () => { | |
let filetype = await nvim.eval('&filetype') | |
let prog = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {sources} = require('coc.nvim') | |
const {spawn} = require('child_process') | |
const readline = require('readline') | |
exports.activate = async context => { | |
context.subscriptions.push( | |
sources.createSource({ | |
// unique id | |
name: 'address', | |
// unsed in menu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ============================================================================ | |
" Description: Some system commands for vim | |
" Author: Qiming Zhao <chemzqm@gmail.com> | |
" Licence: Vim licence | |
" Version: 0.3 | |
" Last Modified: Jul 07, 2018 | |
" ============================================================================ | |
if exists('did_system_loaded') || v:version < 700 | |
finish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brew install ag | |
# brew install fzy | |
# Usage: e [part of filename] | |
function e | |
set -l file (ag . --silent -l -g '' | fzy -q $argv) | |
if test -z $file | |
return | |
else | |
nvim $file | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var exec = require('child_process').exec | |
var Branch = new Promise(function(resolve, reject) { | |
exec('git symbolic-ref -q HEAD | cut -c 12-', function (err, stdout) { | |
if (err) return reject(err) | |
if (stdout.length) return resolve(stdout.replace('\n', '')) | |
exec('git rev-parse --short HEAD', function (err, stdout) { | |
if (err) return reject(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PENDING = 'pending' | |
var SEALED = 'sealed' | |
var FULFILLED = 'fulfilled' | |
var REJECTED = 'rejected' | |
var NOOP = function(){} | |
function isArray(value) { | |
return Object.prototype.toString.call(value) === '[object Array]' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys | |
if (!Object.keys) { | |
Object.keys = (function() { | |
'use strict'; | |
var hasOwnProperty = Object.prototype.hasOwnProperty, | |
hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), | |
dontEnums = [ | |
'toString', | |
'toLocaleString', | |
'valueOf', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Command used: nvim --startuptime tmp.txt | |
# no autocmd and no g:python... | |
times in msec | |
clock self+sourced self: sourced script | |
clock elapsed: other lines | |
000.009 000.009: --- NVIM STARTING --- | |
000.592 000.583: locale set |
NewerOlder