Help us understand the problem. What is going on with this article?

dein.vimを使ってみる

dein.vimとは

vimのプラグイン管理ツール.NEOBUNDLEの後継版(?)
プラグインを入れようと思って色々と調べていたら,これからはdeinらしいので使ってみることにした.

dein.vim

Dein.vim is a dark powered Vim/Neovim plugin manager.

インストール

installer.shの実行権限を自分に与えたほうがいい場合も.

# インストール先は任意.ここでは~/.vim/bundlesとする

$ mkdir ~/.vim/bundles
$ cd ~/.vim/bundles
$ curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
$ sh ./installer.sh ~/.vim/bundle

最後のコマンド後に表示される内容を~/.vimrcに追記する.

~/.vimrc
"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=~/.vim/bundles/repos/github.com/Shougo/dein.vim

" Required:
if dein#load_state('~/.vim/bundles')
  call dein#begin('~/.vim/bundles')

  " Let dein manage dein
  " Required:
  call dein#add('~/.vim/bundles/repos/github.com/Shougo/dein.vim')

  " Add or remove your plugins here like this:
  "call dein#add('Shougo/neosnippet.vim')
  "call dein#add('Shougo/neosnippet-snippets')

  " NERDTreeを使用するために以下を追記
  call dein#add('scrooloose/nerdtree')

  " Required:
  call dein#end()
  call dein#save_state()
endif

" Required:
filetype plugin indent on
syntax enable

"If you want to install not installed plugins on startup.
if dein#check_install()
  call dein#install()
endif

"End dein Scripts-------------------------

使用方法

vimを開くと,必要なプラグインがインストールされる(?)
ノーマルモードで:NERDTreeToggleと入力することでファイルツリーを展開できる

より使いやすく

~/.vimrc
nnoremap <C-t> :NERDTreeToggle<CR>

などと書いておくと,vimを開いているときにわざわざ:NERDTreeToggleを入力せずともCtrl + tで代用できる.

mapの種類

  • map a b
    • aをbにマッピング.入れ子可能.
  • noremap a b
    • aをbにマッピング.入れ子不可.再帰的にコマンドを実行.
  • nnoremap a b
    • aをbにマッピング.入れ子不可.再帰的にコマンドを実行しない.

普通に使う分にはnnoremapを使っておこう.

参考

https://cocopon.me/blog/2013/10/vim-map-noremap/

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした