KAEDE Hack blog

JavaScript 中心に ライブラリなどの使い方を解説する技術ブログ。

My Vim Settings and favorite liberaries

My Vim Settings and favorite liberaries

f:id:kei_s_lifehack:20190927010611p:plain

intro

vim is great, however using simple extensions by neobundle boost your coding more faster.
I will write my favorite vim extension usage and simple commands.
https://qiita.com/fasahina/items/2767891134028648f288

Plugins

surround.vim

link

http://weibeld.net/vim/surround-plugin.html

surround the word

ysw: surround the word, and cursor go down.
yss: surround the line, and cursor go down.
and type ", the word was surrounded by "
yss<p>: can surround the whole line, like,
<p>Dolor provident amet consequatur earum</p>

del the surrounding

ds: target the surrounding, and type "
can delelte the surrounding ",
dst: delete the tag.

change the surrounding

cs"/: changes "hoge" to /hoge/.
It's same as vim ciw.

emmit.vim

https://github.com/mattn/emmet-vim https://qiita.com/yyuuiikk/items/6c7e793b9c734a84b62a ctrl y ,: changes the emmit shorten code to html.
like div, !, form, tag.class, tag#id, ...
try the tag you use often.

Settings

Writing JP

sites.google.com

"カーソルを表示行で移動する。物理行移動は<C-n>,<C-p>
nnoremap j gj
nnoremap k gk
nnoremap <Down> gj
nnoremap <Up>   gk

"日本語(マルチバイト文字)行の連結時には空白を入力しない。
set formatoptions+=mM

"画面最後の行をできる限り表示する。
set display+=lastline
  • 1st setting enables go down as you see

  • 2nd setting deletes cating inserted space.

  • 3rd, deletes this!!!!!!!!!!!!

@
@
@
@