Skip to content

Instantly share code, notes, and snippets.

@koturn
koturn / destroy.vim
Last active August 29, 2015 14:25
編集中のファイルを(ほぼ)二度と読めなくするコマンド
" Joke!
if has('cryptv')
function! s:destroy_file(has_bang) abort
if !filereadable(expand('%:p'))
echoerr 'Current buffer is not write out to file'
return
endif
if !a:has_bang
echoerr "Must to add '!' to destroy this file"
return
@koturn
koturn / .vimrc
Last active August 29, 2015 14:26
無理矢理NeoBundleのautoloadのcommandの補完関数にスクリプトローカル関数を指定する例
set encoding=utf-8
scriptencoding utf-8
if has('vim_starting')
set rtp+=~/.vim/bundle/neobundle.vim
endif
call neobundle#begin()
NeoBundleFetch 'Shougo/neobundle.vim'
let g:neobundle#default_options = {'_': {'verbose': 1}}
@koturn
koturn / commit_chmod.sh
Created October 13, 2015 19:08
Windows(Cygwin)でgitを用いるときに、WIndows側が作るファイルのデフォルトのパーミッションが気になるので、それを修正するアレ
#!/bin/sh
find . -type d -name '.git' -prune -o -type f -exec chmod 644 {} \;
find . -type d -name '.git' -prune -o -type d -exec chmod 755 {} \;
@koturn
koturn / template01.vim
Last active October 24, 2015 13:48
ctrlp.vimのエクステンションのテンプレート
scriptencoding utf-8
" オーソドックスなctrlp.vimのエクステンションのテンプレート
let s:save_cpo = &cpo
set cpo&vim
if exists('g:loaded_ctrlp_template01') && g:loaded_ctrlp_template01
finish
endif
let g:loaded_ctrlp_template01 = 1
let s:ctrlp_builtins = ctrlp#getvar('g:ctrlp_builtins')
@koturn
koturn / buildvim.bat
Created November 11, 2015 19:02
WindowsでMSVCを用いてVimをビルドするためのバッチファイル
@echo off
git clone https://github.com/vim/vim.git
cd vim
git clone https://github.com/koron/vim-kaoriya-patches.git
git apply --check vim-kaoriya-patches/master/*.diff
git apply vim-kaoriya-patches/master/*.diff
cd src
set LUA_PATH=C:\CommonUtil\lua
set LUA_VERSION=5.2
@koturn
koturn / .vimrc
Created December 2, 2015 19:03
vim-nijiをNeoBundleLazyしたときに,初回から機能させる設定
if has('vim_starting')
set rtp+=~/.vim/bundle/neobundle.vim
endif
call neobundle#begin()
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundleLazy 'losingkeys/vim-niji', {
\ 'autoload': {
\ 'filetypes': ['lisp', 'scheme']
\ }
\}
@koturn
koturn / a.c
Created December 5, 2015 23:07
/*!
* @brief Template C-source file
*
* This is a template C-source file
* @author koturn
* @date 2015 12/06
* @file a.c
* @version 0.1
*/
#include <stdio.h>
@koturn
koturn / cvpragmalink.h
Created December 7, 2015 06:42
OpenCV関係をまとめたインクルード用のMakefileと,MSVCのプラグマリンク用のヘッダファイル
@koturn
koturn / apply_patch.bat
Last active May 25, 2016 10:48
Vimのビルド用スクリプト等
@echo off
if not exist "vim-kaoriya-patches" (
git clone https://github.com/koron/vim-kaoriya-patches.git
)
git apply --check vim-kaoriya-patches/master/*.diff
git apply vim-kaoriya-patches/master/*.diff
@koturn
koturn / myshell.c
Created December 9, 2015 13:34
クソコードなシェル実装
/*!
* @file shell.c
* @brief 簡易シェル実装
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>