Giter VIP home page Giter VIP logo

git-vim's Introduction

git.vim

This project is no longer maintained. You may want to use tpope/vim-fugitive.

Introduction

Git-vim provides:

  • Plugin files for calling git functions from inside Vim

  • Syntax files for git displays

Commands

:GitAdd <file>

git-add <file> or current file if not specified.

:GitCommit <args>

git-commit.

:GitStatus

Show git-status of current file or repository.

:GitLog

Show git-log of current file or repository.

:GitCheckout <args>

git-checkout. Completes git commits.

:GitDiff <args>

git-diff. Completes git commits.

:GitPull <args>

git-pull.

:GitPullRebase

git-pull –rebase.

:GitPush <args>

git-push. Defaults to +git push origin <current-branch>+.

:GitCatFile <args>

git-cat-file.

:GitBlame <args>

git-blame.

:Git <args>

Does any git command.

:GitVimDiffMerge

Experimental. Call this command on unmerged file to enter vimdiff mode.

:GitVimDiffMergeDone

Call this command after merging.

Keymaps

<Leader>gd

:GitDiff

<Leader>gD

:GitDiff –cached

<Leader>gs

:GitStatus

<Leader>gl

:GitLog

<Leader>ga

:GitAdd

<Leader>gA

:GitAdd <cfile>

<Leader>gc

:GitCommit

<Leader>gb

:GitBlame

In git-status buffer

<Enter>

:GitAdd <cfile>

License

The MIT License

git-vim's People

Contributors

amjith avatar ehamberg avatar holophrastic avatar motemen avatar tksohishi avatar trygvis avatar ulrikbuchholtz avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-vim's Issues

Use BufDelete or similar instead of BufWritePost in :GitCommit

When writing a lengthy commit message you might want to save the buffer occasionally out of habit, but if you do you'll find that a commit takes place and your half-written commit message got included.

To avoid this, I think it would be a good idea if the BufWritePost autocmd in the :GitCommit implementation were changed to BufDelete or similar.

It would also match the behaviour of the command line when you have EDITOR=vim (or any other editor) in your environment and do a "git commit": the actual commit is only processed when you exit the editor, not when you save the message.

commit fails on windows

looks like the pwd is left as the .git directory,

adding in "cd .." before "execute printf("autocmd BufWritePost" within GitCommit() sorted this for now,

No colour in output

In my ~/.gitconfig I have

[color]
ui = auto

which means that output from git is coloured. The git-vim commands don't show this colouring.

Slash in paths

Hi

Tho GetGitDir() seems to return a path ending in /

-        let lines = readfile(git_dir . 'HEAD')
+        let lines = readfile(git_dir . '/HEAD')

-    execute printf('%s %sCOMMIT_EDITMSG', g:git_command_edit, git_dir)
+    execute printf('%s %s/COMMIT_EDITMSG', g:git_command_edit, git_dir)

(stupid formatting - you get the point ;)

patches are required for this to work.

Would you mind looking into this?

Thanks for the good work :)

Enter in :GitStatus doesn't add files

With current HEAD of git-vim (73a1817), hitting "enter" to add files while viewing :GitStatus output doesn't work. Just yields this error for me:

Error detected while processing function GitAdd..GitDoCommand..<SNR>16_SystemGit:
line    1:
E484: Can't open file /var/folders/mh/mhvu4vHPGiGR1PpCmIscX++++TI/-Tmp-/v868250/10

Not sure what other info might help troubleshoot this one. I'm running MacVim 7.2 stable 1.2 (33.3) on Mac OS X 10.5.6 and Git 1.6.3.

commit failing

Loving the plugin, but when I try to create a commit message from within vim I get the new buffer, I fill out my commit message, and it finishes with:
"COMMIT_EDITMSG" 1L, 76C [w]

But the commit doesn't take place. When I run git status I have the same changes/etc.

Any hints or any ideas to track? From the code it looks like the post write hook should work fine.

Doesn't handle submodules

If you're editing a file inside a submodule :Git* is acted upon the main repository rather than the submodule. So :GitBlame says things are not commited, and :GitStatus reports the status of the main repo.

When editing commit messages set filetype to "gitcommit"?

Any chance of automatically setting the filetype to "gitcommit" when editing a commit message in a Vim buffer (triggered by :GitCommit)? (That is, ":setlocal filetype=gitcommit").

At least with my version of Vim -- that is, MacVim 7.2 stable 1.2 (33.3) -- Tim Pope's Git files (http://www.tpope.net/vim-git-announcement) came included, which means that a commit message has syntax colouring, highlighting of errors, autowrapping to 72 columns etc. I've also got Tim Pope's files in /usr/share/vim/vim72/, so I guess they come standard with the version of Vim that ships with Mac OS X leopard anyway.

As far as I can telling, setting the filetype to "gitcommit" on systems which don't have Tim's runtime files has no ill effects.

MacVim git-vim compatibility issues

All of the git commands seem to work well for me if I open up the file through the terminal,
but if I open up the file through MacVim and try to run the same commands I run into issues.
It would tell me that the file is "Not a git repository (or any of the parent directories): .git",
even though the directory in which the file is in has a .git file.

Anyone else having this issue?

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.