This file contains hidden or 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
| set clipboard=unnamed | |
| set hlsearch | |
| set incsearch | |
| set virtualedit=block | |
| set whichwrap=b,s,h,l,<,>,[,] | |
| set ignorecase smartcase | |
| set scrolloff=5 | |
| nnoremap c "_c | |
| nnoremap x "_x | |
| nnoremap n nzz |
This file contains hidden or 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
| cmake_minimum_required(VERSION 3.1) | |
| project(CMakeProject CXX) | |
| set(CMAKE_C_STANDARD 11) | |
| set(CMAKE_C_STANDARD_REQUIRED ON) | |
| set(CMAKE_C_EXTENSIONS OFF) | |
| set(CMAKE_CXX_STANDARD 17) | |
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
| set(CMAKE_CXX_EXTENSIONS OFF) |
This file contains hidden or 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
| " dependsはVim用なので,neovimでは不要 | |
| call dein#add('Shougo/defx.nvim', { | |
| \ 'depends': ['nvim-yarp', 'vim-hug-neovim-rpc'], | |
| \ 'on_cmd': 'Defx', | |
| \ 'on_func': 'defx' | |
| \}) | |
| if dein#tap('defx.nvim') " {{{ |
This file contains hidden or 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
| function! s:create_winid2bufnr_dict() abort " {{{ | |
| let winid2bufnr_dict = {} | |
| for bnr in filter(range(1, bufnr('$')), 'v:val') | |
| for wid in win_findbuf(bnr) | |
| let winid2bufnr_dict[wid] = bnr | |
| endfor | |
| endfor | |
| return winid2bufnr_dict | |
| endfunction " }}} |
This file contains hidden or 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
| if exists('*win_gotoid') | |
| function! s:buf_open_existing(bname) abort " {{{ | |
| let bnr = bufnr(a:bname) | |
| if bnr == -1 | |
| echoerr 'Buffer not found:' a:bname | |
| return | |
| endif | |
| let wids = win_findbuf(bnr) | |
| if empty(wids) | |
| new |
This file contains hidden or 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
| " 参考: http://secret-garden.hatenablog.com/entry/2017/11/14/113127 | |
| " 既に開いているターミナルを開く(バッファに移動) | |
| " 開いているターミナルが無い場合は新規に起動 | |
| if has('terminal') | |
| function! s:complete_term_bufname(arglead, cmdline, cursorpos) abort " {{{ | |
| let arglead = tolower(a:arglead) | |
| return filter(map(term_list(), 'bufname(v:val)'), '!stridx(tolower(v:val), arglead)') | |
| endfunction " }}} | |
| function! s:term_open_existing(...) abort " {{{ |
This file contains hidden or 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
| if &compatible | |
| set nocompatible | |
| endif | |
| function! s:hint_n_m() abort " {{{ | |
| redir => str | |
| :marks | |
| redir END | |
| echo str |
This file contains hidden or 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
| if &compatible | |
| set nocompatible | |
| endif | |
| let s:compl_key_dict = { | |
| \ char2nr("\<C-l>"): "\<C-x>\<C-l>", | |
| \ char2nr("\<C-n>"): "\<C-x>\<C-n>", | |
| \ char2nr("\<C-p>"): "\<C-x>\<C-p>", | |
| \ char2nr("\<C-k>"): "\<C-x>\<C-k>", | |
| \ char2nr("\<C-t>"): "\<C-x>\<C-t>", | |
| \ char2nr("\<C-i>"): "\<C-x>\<C-i>", |
This file contains hidden or 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> | |
| #if defined(_MSC_VER) | |
| # pragma section(".text", read, execute) | |
| __declspec(allocate(".text")) | |
| #elif defined(__GNUC__) | |
| __attribute__((section(".text"))) | |
| #endif | |
| const char code[] = | |
| // push %rbp |
This file contains hidden or 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 <unistd.h> | |
| #include <sys/mman.h> | |
| static const unsigned char code[] = | |
| // mov $0x01,%rax | |
| "\x48\xc7\xc0\x01\x00\x00\x00" | |
| // mov $0x0d,%edx | |
| "\xba\x0d\x00\x00\x00" | |
| // mov $0x01,%edi | |
| "\xbf\x01\x00\x00\x00" |