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
" Take <tab> for word complete only | |
" The 'complete' option controls where the keywords are searched (include files, tag files, buffers, and more). | |
" The 'completeopt' option controls how the completion occurs (for example, whether a menu is shown). | |
if exists('did_completes_me_loaded') || v:version < 700 | |
finish | |
endif | |
let did_completes_me_loaded = 1 | |
function! s:completes_me(shift_tab) |
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
// ES 15.2.3.6 Object.defineProperty ( O, P, Attributes ) | |
// Partial support for most common case - getters, setters, and values | |
!(function() { | |
if (!Object.defineProperty || | |
!(function () { try { Object.defineProperty({}, 'x', {}); return true; } catch (e) { return false; } } ())) { | |
var orig = Object.defineProperty; | |
Object.defineProperty = function (o, prop, desc) { | |
// In IE8 try built-in implementation for defining properties on DOM prototypes. | |
if (orig) { try { return orig(o, prop, desc); } catch (e) {} } |
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 {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: Open url under cursor or git repository of a module | |
" Author: Qiming Zhao <chemzqm@gmail.com> | |
" Licence: Vim licence | |
" Version: 0.1 | |
" Last Modified: January 16, 2016 | |
" ============================================================================ | |
if exists('did_open_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
" ============================================================================ | |
" Description: Insert pair charactor automaticly | |
" Author: Qiming Zhao <chemzqm@gmail.com> | |
" Licence: Vim licence | |
" Version: 0.1 | |
" Last Modified: Sep 13, 2016 | |
" ============================================================================ | |
if exists('did_simple_pairs_loaded') | finish | endif | |
let did_simple_pairs_loaded = 1 | |
let s:pairs = {'(': ')', '[': ']', '{': '}', '"': '"', "'": "'", '`' : '`'} |
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
// 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', |
NewerOlder