Giter Club home page Giter Club logo

vscode-open-in-vim's Introduction

Open in Vim

Open current file in vim. To activate this extension, open the Command Palette (Ctrl+Shift+P on linux or โ‡งโŒ˜P on mac) and search for "Open in Vim". Alternatively, you can assign a keyboard shortcut of your choosing.

Support for Windows is currently experimental.

Contribute on GitHub.

Building and Publishing

Useful guide: https://code.visualstudio.com/api/working-with-extensions/publishing-extension

  • Install npm packages defined in package.json
$ npm install
  • Install vsce to package/publish extensions
$ npm install -g @vscode/vsce
  • Build local .vsix package
$ vsce package

Extension Settings

  • open-in-vim.openMethod: specifies how vim should be launched. Allowed values are tabulated below.

    Value Description
    gvim Open vim in gVim.
    kitty Open vim in Kitty.
    integrated-terminal (DEFAULT) Open vim in VSCode's integrated terminal.
    linux.gnome-terminal Open vim in gnome-terminal (full-screen).
    linux.tilix Open vim in Tilix.
    macos.iterm Open vim in iTerm2.
    macos.macvim Open vim in MacVim.
  • open-in-vim.vimExecutable: CLI editor executable name (in $PATH) or full path to it

  • open-in-vim.restoreCursorAfterVim: (EXPERIMENTAL) syncs cursor position from vim to vscode when you close vim. Assumes that the code executable is in the $PATH.

  • Other settings for specific openMethods are tabulated below.

    Setting Description Default
    open-in-vim.linux.gnome-terminal.args Space-separated arguments that get passed to gnome-terminal. --hide-menubar --full-screen
    open-in-vim.linux.tilix.args Space-separated arguments that get passed to tilix. --full-screen
    open-in-vim.integrated-terminal.pathToShell Path to unix shell which will host the vim process. /bin/bash or C:\Program Files\Git\bin\bash.exe
    open-in-vim.macos.iterm.profile Name of iTerm profile to use (default profile is a special case to use iTerm's default). default profile

Inverse Plugin

If you'd like the inverse of this plugin (Open in VSCode from Vim), you can just add the following vimrc line:

:command! OpenInVSCode exe "silent !code --goto '" . expand("%") . ":" . line(".") . ":" . col(".") . "'" | redraw!

(On Mac, you'll also need to open vscode and run the command Install 'code' command in PATH)

If you additionally want to preserve the working directory, you can add getcwd() like so:

:command! OpenCwdInVSCode exe "silent !code '" . getcwd() . "' --goto '" . expand("%") . ":" . line(".") . ":" . col(".") . "'" | redraw!

vscode-open-in-vim's People

Contributors

jonsmithers avatar ipcjs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.