Skip to content

Instantly share code, notes, and snippets.

View mopp's full-sized avatar
💜
Power is power

mopp mopp

💜
Power is power
View GitHub Profile
// インストールディレクトリを作成
$ mkdir -p ~/.vim/bundle
// githubのリポジトリから引っ張ってくる
$ git clone git://github.com/Shougo/neobundle.vim
\ ~/.vim/bundle/neobundle.vim
// vimrcへ追記
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim
endif
call neobundle#rc()
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle ‘入れたいプラギン名’“ ←リポジトリ名
filetype plugin indent on “ ← 必須
“ NeoComplete
NeoBundle 'Shougo/neocomplete.vim'
NeoBundle 'Shougo/context_filetype.vim'
let g:neocomplete#enable_at_startup = 1
“ NeoComplCache
NeoBundle 'Shougo/neocomplcache'
let g:neocomplcache_enable_at_startup = 1
NeoBundle 'Shougo/neosnippet'
“インサートモードのマッピング
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
set conceallevel=2 concealcursor=i
@mopp
mopp / smart!.vim
Last active December 21, 2015 06:18
let lst = [ ['<', "smartchr#loop(' < ', ' << ', '<')" ],
\ ['>', "smartchr#loop(' > ', ' >> ', ' >>> ', '>')"],
\ ['+', "smartchr#loop(' + ', ' ++ ', '+')"],
\ ['-', "smartchr#loop(' - ', ' -- ', '-')"],
\ ['/', "smartchr#loop(' / ', '//', '/')"],
\ ['&', "smartchr#loop(' & ', ' && ', '&')"],
\ ['%', "smartchr#loop(' % ', '%')"],
\ ['*', "smartchr#loop(' * ', '*')"],
\ ['<Bar>', "smartchr#loop(' | ', ' || ', '|')"],
\ [',', "smartchr#loop(', ', ',')"]]
$ の行はターミナルで実行するコマンドです
まずcygwin内でvimを起動し.vimrcを作成
$ vim ~/.vimrc
以下の囲われている所をコピペ
--------------------------------------------------
set nocompatible " Be iMproved
if has('vim_starting')
@mopp
mopp / inOne.vim
Created September 17, 2013 06:05
" Installation
" NeoBundle 'gist:mopp/6590603', { 'name': 'inOne.vim', 'script_type': 'plugin'}
let s:buf_name = 'AllInOne'
let s:signature = '=====DELIMITER====='
function! s:write()
" echomsg 'call write'
call cursor(1, 0)
let now_line = 0
@mopp
mopp / test.c
Last active December 25, 2015 13:49
#include <stdio.h>
int main(void) {
char buf[100];
printf("mopp test\n");
fflush(stdout);
scanf("%s", buf);
printf("%s\n", buf);
@mopp
mopp / twi.vim
Last active December 25, 2015 13:49
let ps = vimproc#popen3('path/to/t_sample')
call ps.stdin.write('write_test!')
call ps.stdin.close()
" close無しだと以下のreadで空
let output = ps.stdout.read()
echomsg " 2 stdout echos " . output
" finish
@mopp
mopp / Aizu Advent Calendar 2013 - 1.c
Last active December 30, 2015 08:59
Aizu Advent Calendar 2013. 1
Segment_descriptor *gdt = (Segment_descriptor*)0x270000;
/* 全セグメントを初期化 */
for (int i = 0; i < GDT_MAX_NUM; ++i) {
set_segment_descriptor(gdt + i, 0, 0, 0, 0, 0, 0, 0, 0);
}