Skip to content

Commit

Permalink
vimrcに複数形変換を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ken39arg committed Sep 4, 2011
1 parent da5be21 commit 3df1cb1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .vimrc
Expand Up @@ -182,3 +182,21 @@ set wildmode=list:longest,full

set splitright
set splitbelow

" {{{ inflect_pluralize
if !exists('g:inflect_pluralize_cmd')
let g:inflect_pluralize_cmd = "perl -MLingua::EN::Inflect=PL -E 'print PL(\"%s\")'"
endif

function! s:inflect_pluralize(word)
return system(substitute(g:inflect_pluralize_cmd, "%s", a:word, "g"))
endfunction

function! s:insert_(v)
execute "normal i" . a:v ."\<Esc>"
echo a:v
endfunction

command! -nargs=1 PL echo s:inflect_pluralize(<q-args>)
command! -nargs=1 PLI call s:insert_(s:inflect_pluralize(<q-args>))
" }}}
2 changes: 1 addition & 1 deletion .zshrc
Expand Up @@ -227,7 +227,7 @@ alias df='df -h'

alias view='vim -R'
alias rm='rm -i'
alias gr="grep -rn --color --exclude='*.svn*' --exclude='*.swp' --exclude='*.o' --exclude='*.so' --exclude-dir='.svn'"
alias gr="grep -rn --color --exclude='*.svn*' --exclude='*.swp' --exclude='*.o' --exclude='*.so' --exclude='.svn'"

alias sf='php ./symfony --color'

Expand Down

0 comments on commit 3df1cb1

Please sign in to comment.