12

Say hello to knowledge fragmentation: https://stackoverflow.com/q/6932702/520162 This question was already asked and answered on StackOverflow. The key is to press CTRL and the key that is located where the ] lives on the US keyboard. I had the issue with a QUERTZ German keyboard and have to press CTRL-+ Compare: US keyboard: German keyboard: Another ...


8

ControlI is Tab (I is character code 73 and control subtracts 64; this leaves us with 9, which is TAB). Every vim install I've tried this on (including gvim) maps this to <tab> - even :help <ctrl-i> shows us that the feature you want is actually also bound to <tab>. From my testing, it works fine on any vim install that doesn't map <...


7

There is command that is close to what you need: g; will bring you back to older change position, g, will go forward to newer change position . List of change position can be displayed with :changes.


6

I don't think you took the time to read :help quickfix. Your :grep results populate the "quickfix list" which is then optionally displayed in the "quickfix window". The whole quickfix mechanism is completely independent from the jumplist. When using the quickfix window, you are supposed to press <CR> to jump to the location of the current entry while ...


6

Yes I think it's a normal behavior. In :help keycode, you can read that <C-I> and <Tab> have the same decimal keycode (9): <Tab> tab CTRL-I 9 *tab* *Tab* Which means that Vim and gVim can't make the difference between the two keys. You can find a technical reason for this here. So "\<C-I>" is translated into a ...


5

My EnhancedJumps plugin offers separate special mappings that restrict the jump targets to only local locations (in the same buffer) and remote locations (only in other buffers).


5

You don't need a plugin, all you need is two lines of vimscript! If you would like every time you press 'j' or 'k' to be added to the jumplist, this is pretty easy. You could do it with this: nnoremap <silent> j :<C-u>exe "normal! m'".v:count1."j"<cr> nnoremap <silent> k :<C-u>exe "normal! m'".v:count1."k"<cr> ...


5

There is :sleep command (:h sleep or :h gs). Using that command it's possible to loop over given array of line numbers: let g:line_list = [ 5, 10, 15 ] let g:line_list_sleep = 5 " in seconds, add m suffix to go miliseconds function LinePlaylist() for x in g:line_list execute "normal " . x . "G" redraw! echom getline('.') execute "sleep " ....


4

Looks like :<line number> or :e filename is the best you can do. (Well, except for the convenience mapping that I found in Vim help. Jump to the "update" at the end of this post if you're not interested in the context.) I don't believe there are any commands specific to [I. That's the standard message for paged results so the available commands are ...


4

If you have vim8 you might want to play with the new timers feature. The difference with @grodzik solution is that timers are asynchronous meaning that you can still use Vim will the cursor is moving. The idea is to add the following to your .vimrc: function! GoToLines() " Indexes of the lines to read let lines = [1, 2, 3, 4, 5, 10] " Time ...


3

Go back in the same file Mark your current position with mm , move around, go back with 'm or `m. Go back to last insert position in the same file `^ Go back to last insert position and continue in insert mode gi Go back accross files Mark your current position with mM , move around, go back with 'M or `M.


3

As :h 'foldopen' states: NOTE: When the command is part of a mapping this option is not used. Add the |zv| command to the mapping to get the same effect. (rationale: the mapping may want to control opening folds itself) So you should add the zv to your mapping, e.g. cnoremap <cr> <cr>zv


3

My question is I would like to know why when the key combination ctrl + i is pressed multiple times it loads up older documents. Because that's how Vim works. From different places near :h jumplist you can read: A "jump" is one of the following commands: "'", "`", "G", "/", "?", "n", "N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" ...


3

Here's some vimscript I whipped up that seems to work pretty well. (disclaimer: I have not done extensive testing on this. I just threw it together in a couple minutes) function! YankNoMove() let repcount = v:count if v:count == 0 let repcount = 1 endif exe "normal! m'".repcount."y".nr2char(getchar())."^O" endfunction function! YankObjectNoMove(...


2

My EnhancedJumps plugin provides (among other variants) <Leader><C-O> and <Leader><C-I> commands that work like built-in <C-O> / <C-I>, but skip over jumps inside the same buffer. I personally use the old MruMenu plugin for buffer recall. It uses the menu (in GVIM), is file-based instead of showing the current buffers, ...


2

I just found out why I had this problem. The cause of the problem The problem is that I used a Non-English keyboard layout on my Windows 7 computer. The backslash character is entered using Alt Gr+9 on my Non-English keyboard layout. This leads to that ^] would be entered using Ctrl+Alt Gr+9. This simply does not work within Vim. I do not know why that ...


2

you can use the winsaveview() and winrestview() functions, to correctly restore the last saved view. However, there is no easy way to have this done automatically restore a view after a jump or so. You would have to do some Vim Scripting to have this work for you.


2

You can use the matchit plugin for this. It supports many languages, and seem to work great with LaTeX. It allows you to use % to jump between matching tags. To install it, you can simply add this line to your vimrc file: packadd! matchit Or instal from the repo with your favourite plugin manager.


2

I had exactly the same problem as yours, which annoyed me years. Now I add a trimjumplist function to vim so I can use below code and it works for me but you will have to compile vim. Hope this will help. function! TrimJumpListAndCscopeFind(action, word) if has('jumplist') if exists('*trimjumplist') let jl = getjumplist() ...


1

Finally, I write a experiment plugin for this https://github.com/epheien/myjl


1

For question 1, try this: set matchpairs+=`:' See :help 'matchpairs' This requires the characters to be different, so it won't help you with question 2 (or indeed 3). For these latter two requirements, the short answer is that Vim doesn't provide this feature by default, and it will be tricky to implement well because it requires a greater understanding ...


1

I realised the information is available in the :help more-prompt section. I think a plugin might be causing auto-macro recording.


1

I'm not sure if this is doable in mintty, but I have a workaround for iTerm on Mac OS and the same would work for alacritty which is cross platform. In vim I have this mapping nnoremap <C-n>i <C-i> In teminal preferences I have set up ^i to send hex codes "0xe 0x69" to the shell. For alacritty you need to add this to the key mapping section ...


1

Edit didn't realize someone posted the same answer in a comment rather than just posting an answer. Per a post on /r/vim, you can add numbered jumps by setting the previous context mark. These two lines will only set the mark when jumping more than 1 time (i.e. must be numbered like 3k or 20j) nnoremap <expr> k (v:count > 1 ? "m'" . v:count : '') ....


1

I just found a plugin on reddit which does exactly what you want: bufsurf. From the readme: ... This plugin supplies the user with the commands :BufSurfForward and :BufSurfBack to navigate buffers forwards and backwards according to the navigation history. ...


1

I would recommend the vim-unimpaired plugin, which has convenient mappings for quickfix motions (and then some). It's not the most minimal solution, but check the source code if you want to roll your own mappings.


1

Yes, backtick-backtick: `` goes back to the previous mark (but only the previous mark) in the current buffer.


Only top voted, non community-wiki answers of a minimum length are eligible