This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"--------------------------------------- | |
" Search | |
set incsearch nohlsearch | |
set noignorecase nosmartcase | |
nnoremap [Space]hl :<C-u>call util#toggle_option("hlsearch") | |
cnoremap <expr> / getcmdtype() == '/' ? '\/' : '/' | |
cnoremap <expr> ? getcmdtype() == '?' ? '\?' : '?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"----------------------------------------------------------------------------- | |
" Comment-out | |
let g:commentout_schemes = { | |
\ '#': { | |
\ 1: { 'type': 'lhs', 'leader': '#' }, | |
\ }, | |
\ 'c': { | |
\ 1: { 'type': 'wrap', 'leader': '/*', 'trailer': '*/' }, | |
\ 3: { 'type': 'block', 'leader': '/*', 'trailer': '*/' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" NOTE: THIS FILE CONTAINS MANY EXPERIMENTAL CODES! | |
"----------------------------------------------------------------------------- | |
" Abbrev | |
function! util#abbrev(words) | |
let table = {} | |
let seen = {} | |
for word in a:words | |
let abbrev = substitute(word, '.$', '', '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"--------------------------------------- | |
" Replace | |
set report=0 | |
xnoremap S <Nop> | |
" replace the user input in the current line | |
nnoremap s :<C-u>s//g "<Left><Left><Left><Left> | |
" replace the cword in the current line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"--------------------------------------- | |
" Escape | |
" html | |
xnoremap <silent> eh :<C-u>call <SID>selection_escape_html()<CR> | |
xnoremap <silent> uh :<C-u>call <SID>selection_unescape_html()<CR> | |
function! s:selection_escape_html() | |
call util#filter_selection("ruby -rcgi -pe '$_ = CGI.escapeHTML($_)'") | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Base { | |
virtual void f() {}; | |
}; | |
class Derived: public Base { | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <typeinfo> | |
using namespace std; | |
class Base { | |
virtual void f() {}; | |
}; | |
class Derived1: public Base { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, const char *argv[]) | |
{ | |
const char *p[] = { "foo", "bar", "baz" }; | |
char * const q[] = { "foo", "bar", "baz" }; | |
const char * const r[] = { "foo", "bar", "baz" }; | |
/**** const type *var ****/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class BaseV | |
{ | |
public: | |
BaseV() { cout << "constructor of BaseV\n"; } | |
~BaseV() { cout << "destructor of BaseV\n"; } | |
}; |