1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VIMとVSCodeを行ったり来たり移動する

Last updated at Posted at 2018-10-11

Qfixhowmと、fugitiveだけはVim使いたい

  • vimとVSCode行ったり来たりしたい
    • vimからVSCodeを呼び出してファイルを開く
    • VSCodeからvimを呼び出してファイルを開く

vim側

  • vimscriptでvscodeを呼び出す
.vimrc
if has('win32')
  nnoremap <silent> <leader>v :<c-u>call <SID>OpenVSCode()<CR>
  function! s:OpenVSCode()
    let l:targetfile  = expand("%:p")
    let l:cmd = '!code ' . l:targetfile
    silent execute! l:cmd
  endfunction
endif

vscode側

settings.json
    // vimで開く
    "alt-editor.binary": "gvim",
    "alt-editor.args": "{filename}",
1
1
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?