Skip to content

Instantly share code, notes, and snippets.

@h1mesuke
h1mesuke / commentout.vim
Created June 23, 2010 06:16
Vim - My keymaps for commenting out source codes
"-----------------------------------------------------------------------------
" Commenting-out
" derived from:
" http://nanasi.jp/articles/vim/commentout_source.html
" <prefix><x> - encomment
" <prefix><prefix><x> - encomment with copy
" <prefix>c - decomment
@h1mesuke
h1mesuke / search_and_replace.vim
Created June 23, 2010 08:11
Vim - My keymaps for searching and replacing text
"---------------------------------------
" Replace
" eregex.vim
" http://www.vector.co.jp/soft/unix/writing/se265654.html
" NOTE: :S and :M commands accept Perl-compatible regexp notation
let g:eregex_meta_chars = '^$()|[]{}.*+?\/'
let g:vregex_meta_chars = '^$|[].*\/'
@h1mesuke
h1mesuke / conque_term_ftplugin.vim
Created June 23, 2010 23:06
Vim - My filetype plugin for ConqueTerm
" FileType Plugin for conque_term
"" Keymaps
if g:ConqueTerm_CWInsert
inoremap <silent><buffer> <C-w>= <Esc><C-w>=i
imap <silent><buffer> <C-w>+ <Esc><C-w>+i
imap <silent><buffer> <C-w>- <Esc><C-w>-i
imap <silent><buffer> <C-w>@ <Esc><C-w>@i
" " defined at autoload/conque_term.vim
@h1mesuke
h1mesuke / conque_term_settings.vim
Created June 23, 2010 23:07
Vim - My current settings for ConqueTerm
" Conque
" http://www.vim.org/scripts/script.php?script_id=2771
" ~/.vim/after/ftplugin/conque_term.vim
augroup MyConqueTerm
autocmd!
" start Insert mode on BufEnter
autocmd BufEnter *
\ if &l:filetype ==# 'conque_term' |
@h1mesuke
h1mesuke / align_keymaps.vim
Created June 24, 2010 16:50
Vim - My keymaps for Align.vim
"---------------------------------------
" Align
" Align.vim
" http://www.vim.org/scripts/script.php?script_id=294
let g:Align_xstrlen = 3
augroup MyAlignDefault
autocmd!
@h1mesuke
h1mesuke / neocomplcache_settings.vim
Created June 25, 2010 17:05
Vim - My current settings of neocomplcache
" neocomplcache
" http://github.com/Shougo/neocomplcache
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_max_list = 100
let g:neocomplcache_max_keyword_width = 50
let g:neocomplcache_max_filename_width = 15
let g:neocomplcache_auto_completion_start_length = 2
@h1mesuke
h1mesuke / javascript.vim
Created June 30, 2010 23:02
Vim - Indentation script for JavaScript
" DERIVED FROM:
"
" Vim indent file
" Language: JavaScript
" Author: id:gnarl(http://d.hatena.ne.jp/gnarl)
" URL: -
" Last Change: 2007 aug 4
"
" oritinal author: Ryan (ryanthe) Fabella <ryanthe at gmail dot com>
" original file: http://www.vim.org/scripts/script.php?script_id=1936
@h1mesuke
h1mesuke / multi_inherit.cpp
Created July 25, 2010 22:03
C++ - 多重継承時のコンストラクタ/デストラクタの呼び出し順序
#include <iostream>
using namespace std;
class BaseA
{
public:
BaseA() { cout << "constructor of BaseA\n"; }
~BaseA() { cout << "destructor of BaseA\n"; }
};
@h1mesuke
h1mesuke / multi_inherit_v.cpp
Created July 26, 2010 03:01
C++ - 多重継承時のコンストラクタ/デストラクタの呼び出し順序2
#include <iostream>
using namespace std;
class BaseV
{
public:
BaseV() { cout << "constructor of BaseV\n"; }
~BaseV() { cout << "destructor of BaseV\n"; }
};
@h1mesuke
h1mesuke / const.c
Created July 27, 2010 13:39
C - ポインタ変数に対するconst宣言
#include <stdio.h>
int main(int argc, const char *argv[])
{
int i = 10;
int j = 20;
const int *p = &i;
int * const q = &i;
const int * const r = &i;