Vim » 履歴 » バージョン 1
kanata, 2025/04/13 16:37
| 1 | 1 | kanata | # Vim |
|---|---|---|---|
| 2 | |||
| 3 | {{toc}} |
||
| 4 | |||
| 5 | 自分は熱心なVim宗派という訳でもないんですが、諸事情でPython環境を整備したので記録として残しておきます。 |
||
| 6 | |||
| 7 | # dein.vim のインストール&セットアップ |
||
| 8 | |||
| 9 | [dein.vim](https://github.com/Shougo/dein.vim)というプラグイン管理するものがあります。 |
||
| 10 | 以下でインストール |
||
| 11 | |||
| 12 | ~~~ |
||
| 13 | $ mkdir -p ~/.vim/bundle |
||
| 14 | $ curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh |
||
| 15 | $ sh installer.sh ~/.vim/bundle |
||
| 16 | $ vi ~/.vimrc |
||
| 17 | ~~~ |
||
| 18 | .vimrc |
||
| 19 | |||
| 20 | ~~~ |
||
| 21 | "dein Scripts----------------------------- |
||
| 22 | if &compatible |
||
| 23 | set nocompatible " Be iMproved |
||
| 24 | endif |
||
| 25 | |||
| 26 | " Required: |
||
| 27 | set runtimepath^=~/.vim/bundle/repos/github.com/Shougo/dein.vim |
||
| 28 | |||
| 29 | if dein#load_state(expand('~/.vim/bundle')) |
||
| 30 | call dein#begin(expand('~/.vim/bundle')) |
||
| 31 | |||
| 32 | " プラグインリストを収めたTOMLファイル |
||
| 33 | let g:dein_dir = expand('~/.vim/bundle') |
||
| 34 | let s:toml = g:dein_dir . '/dein.toml' |
||
| 35 | let s:lazy_toml = g:dein_dir . '/dein_lazy.toml' |
||
| 36 | |||
| 37 | " TOMLファイルにpluginを記述 |
||
| 38 | call dein#load_toml(s:toml, {'lazy': 0}) |
||
| 39 | call dein#load_toml(s:lazy_toml, {'lazy': 1}) |
||
| 40 | |||
| 41 | call dein#end() |
||
| 42 | call dein#save_state() |
||
| 43 | endif |
||
| 44 | |||
| 45 | " Required: |
||
| 46 | filetype plugin indent on |
||
| 47 | |||
| 48 | " If you want to install not installed plugins on startup. |
||
| 49 | if dein#check_install() |
||
| 50 | call dein#install() |
||
| 51 | endif |
||
| 52 | |||
| 53 | "End dein Scripts------------------------- |
||
| 54 | ~~~ |
||
| 55 | |||
| 56 | ~~~ |
||
| 57 | $ vi ~/.vim/bundle/dein.toml |
||
| 58 | ~~~ |
||
| 59 | |||
| 60 | dein.toml |
||
| 61 | |||
| 62 | ~~~ |
||
| 63 | [[plugins]] |
||
| 64 | repo = 'Shougo/dein.vim' |
||
| 65 | |||
| 66 | [[plugins]] |
||
| 67 | repo = 'Shougo/unite.vim' |
||
| 68 | |||
| 69 | [[plugins]] |
||
| 70 | repo = 'tomasr/molokai' |
||
| 71 | ~~~ |
||
| 72 | |||
| 73 | ~~~ |
||
| 74 | $ vi ~/.vim/bundle/dein_lazy.toml |
||
| 75 | ~~~ |
||
| 76 | |||
| 77 | dein_lazy.toml |
||
| 78 | |||
| 79 | ~~~ |
||
| 80 | # python設定 |
||
| 81 | |||
| 82 | [[plugins]] |
||
| 83 | repo = 'hynek/vim-python-pep8-indent' |
||
| 84 | on_ft = 'python' |
||
| 85 | |||
| 86 | [[plugins]] |
||
| 87 | repo = 'davidhalter/jedi-vim' |
||
| 88 | on_ft = 'python' |
||
| 89 | |||
| 90 | [[plugins]] |
||
| 91 | repo = 'jmcantrell/vim-virtualenv' |
||
| 92 | on_ft = 'python' |
||
| 93 | |||
| 94 | [[plugins]] |
||
| 95 | repo = 'kevinw/pyflakes-vim' |
||
| 96 | on_ft = 'python' |
||
| 97 | |||
| 98 | #[[plugins]] |
||
| 99 | #repo = 'andviro/flake8-vim' |
||
| 100 | #on_ft = 'python' |
||
| 101 | |||
| 102 | # 一般設定 |
||
| 103 | |||
| 104 | [[plugins]] |
||
| 105 | repo = 'Shougo/neocomplete.vim' |
||
| 106 | insert = 1 |
||
| 107 | ~~~ |
||
| 108 | |||
| 109 | # 参考 |
||
| 110 | |||
| 111 | Qiita - dein.vim インストール ~ 0から始めるvim ~ |
||
| 112 | http://qiita.com/ymiyamae/items/e14059b77ba1cf0b344c |
||
| 113 | |||
| 114 | 誰か俺をデバッグしてくれ - dein.vimでvimのplugin管理 |
||
| 115 | http://kyo-bad.hatenablog.com/entry/2016/05/28/172510 |
||
| 116 | |||
| 117 | タオルケット体操 - 補完などを有効にしてVimを最高のPython用開発環境に進化させる |
||
| 118 | http://hachibeechan.hateblo.jp/entry/vim-customize-for-python |
||
| 119 | |||
| 120 | Qiita - VimでPython環境をいい感じに整える |
||
| 121 | http://qiita.com/tekkoc/items/923d7a7cf124e63adab5 |