Skip to content

Add command to edit selected file in editor #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jonstodle
Copy link
Contributor

Pressing e while looking at a file in the Status view will launch an external editor with the current file opened. The editor chosen is determined by the default logic introduced in #114.

An improvement to this in the future could be launching at the specific line at which the Diff view is focused, but that seems to require a change in FileDiff which is a change bigger than this PR.

Fixes #166

Pressing `e` while looking at a file in the _Status_ view will launch an external editor with the current file opened. The editor chosen is determined by the default logic introduced in gitui-org#114.

An improvement to this in the future could be launching at the specific line at which the _Diff_ view is focused, but that seems to require a change in `FileDiff` which is a change bigger than this PR.

Fixes gitui-org#166
@jonstodle jonstodle force-pushed the feat/166-open-file-in-external-editor branch from ee6b381 to d691d7a Compare July 6, 2020 00:17
@extrawurst extrawurst merged commit 52f31ad into gitui-org:master Jul 7, 2020
@extrawurst
Copy link
Collaborator

@jonstodle good work! ❤️

@jonstodle jonstodle deleted the feat/166-open-file-in-external-editor branch July 27, 2020 17:50
@beet
Copy link

beet commented Aug 20, 2020

This is awesome, thanks!

Looks like on Mac it opens ~/Library/Application Support/gitui/COMMITMSG_EDITOR in VIM to pre-populate the commit message with some boilerplate text, so I was able to get word wrap at 80 characters working by adding this to my .vimrc:

filetype plugin on
au FileType gitcommit set textwidth=80 wrap
autocmd BufNewFile,BufRead COMMITMSG_EDITOR set filetype=gitcommit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

open file in $EDITOR from tigui
3 participants