GithubHelp home page GithubHelp logo

vim-editerm's Introduction

vim-editerm

A plugin sets $EDITOR in :terminal to open a file in the working vim instead of a new one.

Usually, calling git commit, vim and suchlike commands in |:terminal|,
new vim process starts in their. But it makes some unfavorable situation depending on the settings.

This plugin, vim-editerm will set an environment varialble $EDITOR and override vim command with function that drops files in new buffer in parent vim.

Screenshot

INSTALLATION

With vim-plug:

Plug 'kyoh86/vim-editerm'

And if you want to override vim and create commands :edit|new|vnew|tabnew in :terminal, put below lines in .zshrc or .bashrc.

if [[ "${VIM_EDITERM_SETUP}" != "" ]]; then
  source "${VIM_EDITERM_SETUP}"
fi

USAGE

Without being conscious.

In :terminal, you can git commit in buffer in the parent vim.

If you want to stop editing with the error (i.e. to stop to commit), call :Cq or :CQ.

CONFIGURATION

Behavior to open files

We can change behavior to open files.

let g:editerm_opener = 'n'  " :new <file> (default)
let g:editerm_opener = 'e'  " :edit <file>
let g:editerm_opener = 'v'  " :vnew <file>
let g:editerm_opener = 't'  " :tabnew <file>

Or by .zshrc or .bashrc

export VIM_EDITERM_OPENER="n"  # :new <file>
export VIM_EDITERM_OPENER="e"  # :edit <file>
export VIM_EDITERM_OPENER="v"  # :vnew <file>
export VIM_EDITERM_OPENER="t"  # :tabnew <file>

Definition of the dropping commands

vim-editerm will create below commands which drop files to vim.

:drop <files...>
:edit <files...>
:new <files...>
:vnew <files...>
:tabnew <files...>

If you want to supress them:

let g:editerm_defdrop = '0'  " default: '1'

And if you want to change prefix of them:

let g:editerm_defdrop_prefix = 'vim_'  " default: ':'

Similar projects

LICENSE

MIT License

This software is released under the MIT License, see LICENSE.

vim-editerm's People

Contributors

kyoh86 avatar shun095 avatar tsuyoshicho avatar aiya000 avatar

Watchers

 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.