Comments (3)
Not sure if I understood your question correctly, but you seem to want shortcuts to jo
and ko
, right? Since this plugin sets the filetype of the browser buffer to "GV"
, you can use FileType GV
autocmd to set up custom mappings like follows.
" Version 1
autocmd! FileType GV nmap <buffer> <c-n> jo
autocmd FileType GV nmap <buffer> <c-p> ko
Makes sense? We can slightly improve the mappings to skip lines without commit hash.
" Version 2
autocmd! FileType GV nmap <buffer> <silent> <c-n> :call search('^.*[a-z0-9]')<cr>o
autocmd FileType GV nmap <buffer> <silent> <c-p> :call search('^.*[a-z0-9]', 'b')<cr>o
The problem with the above mappings is that when GV is first started and the split on the right side is not yet open, <c-n>
will directly go to the second commit. We can correct this by checking the number of windows on the tab.
" Version 3
autocmd! FileType GV nmap <buffer> <silent> <c-n> :if winnr('$') > 1<bar>call search('^.*[a-z0-9]')<bar>endif<cr>o
autocmd FileType GV nmap <buffer> <silent> <c-p> :if winnr('$') > 1<bar>call search('^.*[a-z0-9]', 'b')<bar>endif<cr>o
I could probably add these mappings to the code so that they are activated by default, but for now, I'd like to keep things as simple as possible. Does this answer your question?
from gv.vim.
Thank you for your details explanation. Sorry I wasn't too clear about the question.
Is it possible to go to the next commit while staying in the preview window? So you can browse the history without leaving it. Sort of like you can do with fugitive's :Glog
for the current file.
from gv.vim.
Fugitive mappings are available in the buffer. So P
will bring you to the parent commit, though it won't synchronize the cursor on the browser window. I'll make GV fire a User autocmd so one can setup custom mappings on the buffer.
from gv.vim.
Related Issues (20)
- :GV outputs Unkown function: FugitiveShellCommand HOT 2
- Syntax is gone after FileType autocmd HOT 2
- Error `no previous directory` HOT 1
- How to open a commit with diffview.nvim? HOT 2
- Highlight log line that is currently open (or the last opened)
- :w creates a file named `p --graph` HOT 2
- fugitive#repo().tree() has been replaced by FugitiveFind(":/") HOT 1
- Fix tab completion with latest Fugitive HOT 2
- Reverse range in character class HOT 1
- Using <q> to quit disables command history editing <q-:> HOT 1
- Cursor cannot move over some commits HOT 1
- GV from within a GV tab causes duplicated git history
- reverse the commit order HOT 1
- Diff command/pager settings HOT 2
- Use author rather than commiter HOT 2
- :Gbrowse is deprecated in favor of :GBrowse, fix it to GBrowse? HOT 1
- Add mapping to open commit in preview window HOT 1
- VIRA-283: Syntax for code highlighting
- [Question] is it possible to auto show diff and changed files like agit.vim?
- Error after fugitive update
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 gv.vim.