Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gojump.vim
Created October 31, 2015 01:59
augroup gojump
autocmd!
autocmd FileType go nnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(func\)\>','goDeclaration','b','n')<CR>
autocmd FileType go xnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(func\)\>','goDeclaration','b','v')<CR>
autocmd FileType go nnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(func\)\>','goDeclaration','','n')<CR>
autocmd FileType go xnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(func\)\>','goDeclaration','','v')<CR>
augroup END
function! s:searchsyn(pattern,syn,flags,mode)
norm! m'
let s:save_cpo = &cpo
set cpo&vim
" * queries: [(QueueLabel, QueueBody)]
" * logs: [String]
" * vp: vimproc dict
" * buffer_out, buffer_err: String
" * current buffered vp output/error
" * vars: dict
let s:_process_info = {}
# swith to sudo
sudo -i
# create swap
touch /2GiB.swap
chattr +C /2GiB.swap
fallocate -l 2048m /2GiB.swap
chmod 600 /2GiB.swap
mkswap /2GiB.swap
@rhysd
rhysd / inu-f.vim
Last active August 29, 2015 14:04
" このファイルを :so % なりで読み込んでから f{char} してみてください
function! s:inu_f()
let line = getline('.')
let col = col('.')-1
let target_chars = []
let lnum = line('.')
for end_col in reverse(range(col+1, len(line)-1))
let searching_area = line[col : end_col-1]
let ch = line[end_col]

PM1を使ったコードの改善、そしてPM2への移植

これがPM1用の元コード。sqlite3を使ってデータを追加するというもの。

let endpatterns= ['']

let P= vital#of('vital').import('ProcessManager')

call P.touch('ane', 'sqlite3 hoge.db')
let s:P = g:V.import('ProcessManager')
let s:p = s:P.of('qr', 'clojure-1.6')
nnoremap <Space>r :<C-u>call <SID>run()<Cr>
function! s:run()
if s:p.is_new()
call s:p.wait(['user=> '])
endif
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@millermedeiros
millermedeiros / osx_setup.md
Last active May 1, 2024 20:46
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@k-takata
k-takata / gist:5958877
Last active September 14, 2016 19:15
Vim 7.3.xxx patch author ranking
119 (Christian Brabandt)
109 (ZyX)
56 (Yasuhiro Matsumoto)
52 (Dominique Pelle)
47 (Ken Takata)
31 (Mike Williams)
30 (Lech Lorens)
27 (Yukihiro Nakadaira)
23 (Taro Muraoka)
12 (James Vega)
@DeaR
DeaR / map-alt-keys.vim
Last active December 17, 2015 05:49
Mapping Alt-keys for Terminal
" Mapping Alt-keys for Terminal
"
" Maintainer: DeaR <nayuri@kuonn.mydns.jp>
" Last Change: 01-Oct-2013.
" License: MIT License {{{
" Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
"
" Permission is hereby granted, free of charge, to any person obtaining a
" copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including