Skip to content

Instantly share code, notes, and snippets.

View chemzqm's full-sized avatar
🇨🇳
Focusing

Qiming zhao chemzqm

🇨🇳
Focusing
View GitHub Profile
@chemzqm
chemzqm / complete.vim
Last active April 4, 2024 07:21
My supertab, complex plugin completion is quite confusing
" 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)
@chemzqm
chemzqm / focusmacvim
Last active December 26, 2015 11:41
some osascript
#!/bin/sh
osascript <<END
tell application "MacVim"
activate
end tell
END
@chemzqm
chemzqm / iterm.diff
Last active July 15, 2016 09:19
iterm2
diff --git a/autoload/dispatch/iterm.vim b/autoload/dispatch/iterm.vim
index 7b52012..068f95f 100644
--- a/autoload/dispatch/iterm.vim
+++ b/autoload/dispatch/iterm.vim
@@ -21,22 +21,23 @@ function! dispatch#iterm#handle(request) abort
endfunction
function! dispatch#iterm#spawn(command, request, activate) abort
- let script = dispatch#isolate([], dispatch#set_title(a:request), a:command)
+ let script = s:isolate(a:request.command)
@chemzqm
chemzqm / statusline.vim
Created January 2, 2016 19:20
my statusline plugin
function! MyStatusSyntaxItem()
return synIDattr(synID(line("."),col("."),1),"name")
endfunction
function! MyStatusLine()
return "%2*%3.3{MyStatusModeMap()}%*"
\. s:GetPaste()
\. "%4*%0{MyStatusBranch()}%*"
\. " %f " . s:GetModifySymbol()
@chemzqm
chemzqm / error-parser.js
Created January 3, 2016 15:53
Send mocha error msg back to macvim quickfix
#!/usr/bin/env node
// Warning: clientserver feature required for MacVim, check it by `:echo has('clientserver')` in MacVim
'use strict'
var lstream = require('./lstream')
var stream = new lstream()
var exec = require('child_process').exec
var hasError = false
stream.on('line', function (line) {
if (line.length) {
@chemzqm
chemzqm / open.vim
Last active May 9, 2019 16:28
Open url in vim
" ============================================================================
" 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
@chemzqm
chemzqm / system.vim
Last active January 19, 2016 06:32
Some system commands for vim
" ============================================================================
" Description: Some system commands for vim
" Author: Qiming Zhao <chemzqm@gmail.com>
" Licence: Vim licence
" Version: 0.2
" Last Modified: January 19, 2016
" ============================================================================
if exists('did_system_loaded') || v:version < 700
finish
@chemzqm
chemzqm / Qdo.vim
Created January 16, 2016 08:30
Add Qdo and Qargs command used for replaceAll
" ============================================================================
" Description: Add Qdo and Qargs command used for replaceAll
" Author: Qiming Zhao <chemzqm@gmail.com>
" Licence: Vim licence
" Version: 0.1
" Last Modified: December 31, 2015
" ============================================================================
if exists('did_qdo_loaded') || v:version < 700
finish
endif
@chemzqm
chemzqm / chrome.sh
Last active January 29, 2016 19:20
Fixed open url for Chrome
#!/usr/bin/env bash
if [[ $1 =~ ^http.* ]]; then
file=$1
else
file=file://`realpath $1`
fi
cat << EOF | sed "s+full_path+$file+" | osascript -
if application "Google Chrome" is not running then
@chemzqm
chemzqm / simple_pairs.vim
Last active May 9, 2019 16:28
Fixed simple_pairs
" ============================================================================
" 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 = {'(': ')', '[': ']', '{': '}', '"': '"', "'": "'", '`' : '`'}