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

Windows7 32bitのPowerShellでdein.vimとckw-modを使う

More than 1 year has passed since last update.

目次

vim-KaoriYa

  • ダウンロードして解凍したフォルダにパスを通す
    https://www.kaoriya.net/software/vim/

  • "vi"と打っても起動できるようにvi.batを作成して同じフォルダに入れる

vi.bat
vim %*

dein.vim

  • ホームディレクトリに.vimrcを作成、'~/.vim/rc/' に'dein.toml', 'dein_lazy.toml'を作成

  • runtimepathは絶対パスにしないといけなかった、相対パスでは「未知の関数です dein#begin」などと出る

  • "syntax on"はdein.vimの設定の後でないと反映されない

~/.vimrc
set tabstop=4
set shiftwidth=4
set hlsearch
set ignorecase
set smartcase
set smartindent
set expandtab

nmap <Esc><Esc> :nohlsearch<CR><Esc>

let s:dein_dir = expand('~/.cache/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'

"set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim  " これではだめだったので
set runtimepath+=C:\Users\USERNAME\.cache\dein\repos\github.com\Shougo\dein.vim  " 絶対パスで指定しました

if dein#load_state(s:dein_dir)
  call dein#begin(s:dein_dir)

  let g:rc_dir = expand('~/.vim/rc')
  let s:toml = g:rc_dir . '/dein.toml'
  let s:lazy_toml = g:rc_dir . '/dein_lazy.toml'

  call dein#load_toml(s:toml, {'lazy': 0})
  call dein#load_toml(s:lazy_toml, {'lazy': 1})

  call dein#end()
  call dein#save_state()

  if dein#check_install()
    call dein#install()
  endif
endif

syntax on
dein_lazy.toml
[[plugins]]
repo = 'cespare/vim-toml'
on_ft = 'toml'


# python
[[plugins]]
repo = 'davidhalter/jedi-vim'
on_ft = 'python'
on_i = 1
hook_add = '''
  autocmd FileType python setlocal completeopt-=preview
'''

[[plugins]]
repo = 'hynek/vim-python-pep8-indent'
on_ft = 'python'
on_i = 1

[[plugins]]
repo = 'andviro/flake8-vim'
on_ft = 'python'
on_i = 1

[[plugins]]
repo = 'scrooloose/syntastic'
on_ft = 'python'
hook_add = '''
  let g:syntastic_python_checkers = ['pyflakes', 'pep8']
'''

[[plugins]]
repo = 'tell-k/vim-autopep8'
on_ft = 'python'

ckw-mod

設定は好みだと思いますが...
- "Ckw*transp"の値を小さくすると透過していく
- "!"がコメントアウト
- powershell.exeにパスが通ってない場合は絶対パスで書く

あとは毎回ckw.exeを起動するだけです

ckw.cfg
Ckw*title: ckw[cmd]
Ckw*exec:  c:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe
Ckw*chdir: c:\Users\USERNAME

Ckw*scrollHide:  no
Ckw*scrollRight: yes
Ckw*internalBorder: 1
Ckw*lineSpace: 0
Ckw*topmost: no
Ckw*transp: 200

Ckw*font: MeiryoKe_Console
Ckw*fontSize: 12

Ckw*geometry:  100x38+0+0
Ckw*saveLines: 10000
nabehide
Music, Programming Web, Native app, Generative art Nuxt.js, React.js, React Native, Unity
https://nabehide.com
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