Comments (7)
Would be nice if you can focus on the diff window and then not use FN tho.
from lazygit.
I'm gonna close this issue because we now support scrolling with ctrl+u/d and configurable scroll distance, but I'll open a new issue for your comment @OGKevin because I agree we should have that as a feature
from lazygit.
@OGKevin agreed. If somebody could put up a PR having a go at that, would be much appreciated!
from lazygit.
I tried ctrl + u and ctrl + d for scrolling up and down in a vim fashion, would love to have that but I don't have any experience with go. Configurable key bindings would solve it though!
from lazygit.
@jesseduffield I forked and did this for my own use but I take it you wouldn't accept a PR with just a duplicate key binding?
diff --git a/keybindings.go b/keybindings.go
index afaa095..e789dc8 100644
--- a/keybindings.go
+++ b/keybindings.go
@@ -16,6 +16,8 @@ func keybindings(g *gocui.Gui) error {
bindings := []Binding{
{ViewName: "", Key: 'q', Modifier: gocui.ModNone, Handler: quit},
{ViewName: "", Key: gocui.KeyCtrlC, Modifier: gocui.ModNone, Handler: quit},
+ {ViewName: "", Key: gocui.KeyCtrlU, Modifier: gocui.ModNone, Handler: scrollUpMain},
+ {ViewName: "", Key: gocui.KeyCtrlD, Modifier: gocui.ModNone, Handler: scrollDownMain},
{ViewName: "", Key: gocui.KeyPgup, Modifier: gocui.ModNone, Handler: scrollUpMain},
{ViewName: "", Key: gocui.KeyPgdn, Modifier: gocui.ModNone, Handler: scrollDownMain},
{ViewName: "", Key: 'P', Modifier: gocui.ModNone, Handler: pushFiles},
from lazygit.
god DAMN I did not know you could do ctrl keys like that, I assumed you could only add that via the modifier part which only supports cmd.
Given that we already have vim hjkl keybindings by default I'm happy to merge this in as well. But just before I do, Are we sure that c-u and c-d are the most appropriate vim keys? This comment states that c-p and c-n make sense. If you think so, I'm happy to merge the PR
from lazygit.
Haha nice!
I haven't mastered vim but Ctrl+n and Ctrl+p are often for going up and down a list of selectables, and the author of that other issue suggests it for scrolling through the list of files, for which you already put in h j k l.
The biggest pitch for Ctrl+d and Ctrl+u I should've mentioned is that those keybindings can be used to scroll when you type git diff
in the terminal :)
Alright I'll make a PR but it would also be nice if we could mimic the git diff behavior even better by making it scroll several lines per key stroke instead of just one. I couldn't figure out the handlers when I messed around. But this doesn't go for just Ctrl+d and Ctrl+u but fn+up and fn+down as well.
from lazygit.
Related Issues (20)
- .SelectedFile.Name not recognized in commitFiles context HOT 14
- "Todo not found in git-rebase-todo" error when we try to drop merge commit HOT 2
- Save git.log.showGraph and git.log.order in state.yml instead of config.yml
- View stash creation date HOT 6
- Cherry picking specific files from a commit? HOT 2
- Broken interface in Konsole and Yakuake HOT 1
- Push progress
- Crash from lazygit with $GIT_DIR set and $GIT_WORK_TREE unset HOT 1
- Disable responding to keys when there is not enough space to render the UI HOT 1
- Remote tags HOT 3
- Pull doesn't work from v0.39.1 since fetchAll is enabled by default HOT 33
- lazygit not detecting git throwing unsupported git service HOT 2
- How about supporting a local proxy for lazygit? HOT 2
- crash when cwd doesnt exist
- Color codes at the top/end of pager HOT 2
- Provide file tree for filtering by path
- Range-select HOT 3
- Clear copied commits selection after pasting (cherry-pick) HOT 3
- Make some custom patch keybindings directly available in commit files view HOT 8
- Focus commits view after moving custom patch into new commit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazygit.