Skip to content

Instantly share code, notes, and snippets.

@deris
deris / vim_keymapping.md
Created May 2, 2013 10:01
vimで使うキーの機能使用頻度と打ちやすさの整理

vimで使うキーの機能使用頻度と打ちやすさの整理

vimで使うキーの機能使用頻度と打ちやすさを整理してみました。 今回整理したのはnormalモードについてだけです。 機能の使用頻度と打ちやすさは、完全に個人の見解です。 キーボードによっても打ちやすさは変わると思います。

すべてのキーを網羅しているわけではありません。

@deris
deris / check_file_width.pl
Created January 5, 2020 22:30
ファイルの行ごとの幅チェック
use strict;
use warnings;
use Encode;
use constant MAX_WIDTH => 90;
use constant TAB_WIDTH => 4;
# ディレクトリ走査
sub traverse {
my $dir = shift;
@deris
deris / 1_176_vimrc_reading.vim
Created November 19, 2015 16:54
vimrc読書会の1回目から176回目までに読んだvimrcからVim pluginを雑に抽出したリスト
NeoBundle '2072/PHP-Indenting-for-VIm'
NeoBundle '29decibel/codeschool-vim-theme'
NeoBundle '5long/pytest-vim-compiler'
NeoBundle '5t111111/alt-gtags.vim'
NeoBundle '5t111111/markdown-preview.vim'
NeoBundle '5t111111/neat-json.vim'
NeoBundle 'Align'
NeoBundle 'AndrewRadev/inline_edit.vim'
NeoBundle 'AndrewRadev/multichange.vim'
NeoBundle 'AndrewRadev/splitjoin.vim'
command -nargs=1 CppCreateClass call s:cpp_create_class(<q-args>)
function! s:cpp_create_class(class_name)
if a:class_name !~ '^\a\w*$'
echom printf('[error] invalid parameter(%s)', a:class_name)
return
endif
let class_name = substitute(a:class_name, '^.', '\u&', '')
let file_name = substitute(a:class_name, '^.\+$', '\L&\E', '')
if exists ("b:current_syntax")
finish
endif
syntax match duzzleField / / contained
syntax region DuzzleMap start=/\%^/ end=/^\ze\[.*\]/ contains=duzzleField
highlight duzzleFieldHi guibg=lightcyan ctermbg=lightcyan
@deris
deris / open_neobundlepath1.vim
Created July 4, 2013 17:30
NeoBundleの相対パスを開く(from .vimrc)
NeoBundle 'tyru/open-browser'
nnoremap gz vi':<C-u>call ExecuteWithSelectedText('OpenBrowser https://github.com/%s')<CR>
vnoremap gz :<C-u>call ExecuteWithSelectedText('OpenBrowser https://github.com/%s')<CR>
" visualモードで最後に選択したテキストを%sで指定してコマンドを実行する {{{
function! ExecuteWithSelectedText(command)
if a:command !~? '%s'
return
endif
@deris
deris / open_neobundlepath2.vim
Created July 4, 2013 17:31
NeoBundleの相対パスを開く(operator-user対応)
NeoBundle 'tyru/open-browser'
NeoBundle 'kana/vim-operator-user'
call operator#user#define('open-neobundlepath', 'OpenNeoBundlePath')
map gz <Plug>(operator-open-neobundlepath)
function! OpenNeoBundlePath(motion_wise)
if line("'[") != line("']")
return
endif
let start = col("'[") - 1
@deris
deris / gist:5730298
Last active December 18, 2015 05:09
連番入力Vim script(from manga_osyo's code at Lingr)
function! s:fix_number(pattern, ...)
if a:0 > 2
return
endif
let s:start = exists('g:fix_number_default_start') ? g:fix_number_default_start : 0
let s:step = exists('g:fix_number_default_step') ? g:fix_number_default_step : 1
if a:0 >= 1
let s:start = a:1
@deris
deris / error.txt
Last active December 17, 2015 22:49
error
-----> Fetching custom git buildpack... done
-----> Ruby/Rack app detected
-----> Vendoring binaries
Fetching cairo-1.12.8.tgz
/tmp/build_2z0sqxbwxc8m1/vendor/cairo-1.12.8
Exporting cairo-1.12.8.tgz build and include paths
Fetching pixman-0.28.0.tgz
/tmp/build_2z0sqxbwxc8m1/vendor/pixman-0.28.0
Exporting pixman-0.28.0.tgz build and include paths
-----> Using Ruby version: ruby-2.0.0