LoginSignup
1
1

More than 5 years have passed since last update.

Kill Line in Vim

Posted at

日本語入力を快適にするため、インサートモードでは、 Emacs のキーバインドで操作できるようにしている。

C-k で Emacs の Kill Line 的な操作をするためには、下記の設定を ~/.vimrc に書けばOK

~/.vimrc
inoremap <C-k> <C-o>:call setline(line('.'), col('.') == 1 ? '' : getline('.')[:col('.') - 2])<CR>

ただこれだと一回ノーマルモードに戻ってしまうので、 autocmd InsertLeave などのフックがあると発動してしまう。課題。

~/.vimrc
autocmd InsertLeave * call system('fcitx-remote -c')
1
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1