Questions tagged [navigation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
36 views

How to treat underscores as whitespace when skipping to the next word? [duplicate]

Let's consider an example where the cursor is at the beginning of the text one_two three. Underscores are treated as part of the word, so w moves right to the first letter of three. With set ...
1
vote
0answers
38 views

Is there a simple way to navigate a generated file that includes # line preprocessor directives?

I'm working on a code generator tool. I'm planing to use # LINE "filename" directives like the ones generated by the C preprocessor to show the relationship between the generated code and the original ...
0
votes
2answers
48 views

Move cursor to old position after scrolling

I often want to edit text in say line 200 of a file, but while doing this I need to look at say line 100, so I scroll to line 100. Is there a way to quickly jump back to line 200 after scrolling? Is ...
1
vote
0answers
21 views

Easier way to create alternate-file?

I use switching between alternate-files in VIM a lot in my development workflow and it works great. However, sometimes I feel that it will be very useful if I could create missing alternate files, so ...
1
vote
0answers
30 views

How do you remap keys in :history or :highlight?

I use Colemak hnei for nav in normal mode, but my keys default to hjkl when when I'm viewing :history and :highlight. How do I remap these keys? My guess is that the program may be switching to more....
0
votes
2answers
45 views

moving through the doc, caret staying centered

I move around using the arrows ←↓↑→, never really got used to the hjkl thing. I know I'm supposed to use the hjkl thing. When hitting ↓, it reaches a point where the caret is on the lower side of the ...
-2
votes
1answer
37 views

How to go to before last character in a line? [closed]

I know its a simple one, but I've had no luck finding it so far. I known A, brings you to the end of a line. However, I would like to jump to and, insert after the second last character. Example: ...
1
vote
2answers
33 views

Read-only mode in Vim while using cscope?

I am traversing through a C code in Vim using cscope. Sometimes while traversing, some key gets pressed or mouse gets right-clicked and the Vim enters in insert mode, and it creates a mess to undo the ...
0
votes
2answers
49 views

Incremental search: is it possible to push 'Esc` without scrolling back?

My problem on this gif: I am in one place, searching for meta, I do not want to loose my current search highlighting (yes I know that I can restore it later in / menu). I found what I need - without ...
1
vote
3answers
109 views

Move to first word of paragraph in vim with { and }

Since Vim considers paragraphs as lines/sentences separated by blank lines the paragraph movement with { and } feels little weird to me as it takes you to the next blank line and you always have to ...
1
vote
1answer
44 views

changes command only display current file change history

The :changes command listed the change history of current file. However when I work with multiple buffers, I want to list changes to all the buffers I opened in current vim-server, like the behavior ...
3
votes
2answers
97 views

How to jump to the previous location in the same file?

I mean like CTRL-O (repeatedly) but limited to the current file only. Sometimes I check stuff in another file(say using goto definition). And it loads it into the same window. Still, I want to focus ...
3
votes
2answers
144 views

Equivalent to tmux CTRL+B z in vim?

In tmux if you have alot of panes open, you can press CTRL+B, z to zoom into that terminal pane. Is there a way to do the same thing in vim, to zoom into / out of the selected pane?
1
vote
1answer
51 views

how to skip commented lines when navigating?

When navigating in normal mode by j or k, I want to skip commented lines. Is it possible? Is there a vimscript snippet for that?
0
votes
1answer
20 views

How to automatically return to where the cursor was before executing cdo?

Is it possible to automatically return to where the cursor was before running :cdo command? Currently, the cursor ends in the last file in the quickfix, then I have to navigate back to where I was ...
1
vote
1answer
46 views

creating a menu for navigation in file

while coding in vim I use often special comment to denote section of the file. For example in C it is //;; some title 1 //;; some title 2 I have also configured a shortcut to print with a global ...
0
votes
1answer
27 views

Is there a way to change the “current buffer”--the one that gets defined when I use “n” and “N”?

Once in a while I do work on a large number of files (i.e. today it was about 1,700) using a command such as: gvim `find . -name *.cpp` and I use the "n" (no changes) or "wn" (made a change) to go ...
2
votes
1answer
523 views

move forward by a certain number of chars or bytes?

Sometimes I need to move to a particular byte offset or move to the nth unicode rune in a file (utf-8). Does vim expose a way to move to an absolute byte/char offset or to move the cursor forward a ...
0
votes
1answer
63 views

Plugin for showing marks by *highlighting entire line*, instead of using signcolumn?

I write code mostly on my laptop for portability. It's a small monitor, so plugins that use the "sign column" tend to take up too much space. For example, I have my Syntastic plugin configured to ...
1
vote
2answers
983 views

Show Outline of Code

Is there a way, built-in or with a plugin, to get an outline of my code in Vim? In Eclipse, there is a panel that shows an outline of the code in the file, showing a breakdown of the classes and ...
1
vote
2answers
743 views

Jump to Next Number

Is there a command in Vim to move the cursor to the next number? I know I can do f2 to find the number 2 in the same line, but I'm looking for a more general number-jumping command.
2
votes
1answer
70 views

How to move to top/bottom of region delimited by consecutive blank lines

I have two commands for somewhat emulating the Emacs command narrow-to-defun. I have two commands that move to the top/bottom of the current paragraph nnoremap <silent> <leader>gt mp{...
0
votes
1answer
92 views

How to setup the default browser to follow hyperlinks [closed]

On a text file with a hyperlink (http://url/) if I hover the mouse over the hyperlink and click on it, it is opened on chrome. How can I change the browser that vim decides to use when following ...
4
votes
2answers
291 views

How to show the current location in a yaml hierarchy

When working with larger or rather deeply nested yaml files (Hi Rails), it happens quickly that I loose sight of where I am with regards to the indentation hierarchy of the file. A very simple ...
1
vote
1answer
109 views

How do you page through the jump list?

With the :jumps command, you can display the list of jump locations to aid navigation. That is you can use CTRL_O and CTRL_I to jump backwards and forwards respectively. However, my jump lists appear ...
1
vote
1answer
138 views

Move to next keyword in vim?

I want to map W to jump to the next keyword of the language or jump to the next interestingly syntax highlighted word eg: For the following snippet SELECT * FROM Fruits WHERE Fruits.name = 'Apple'...
0
votes
1answer
301 views

Jump to next occurrence of the current character

I often navigate to the next occurrence of the current non-paren character. For example, `HTTP GET www.example.com/example/com` is an example URL. When the cursor is at the beginning of the line at ...
1
vote
1answer
89 views

configure vim to process argv and understand filename:linenumber

Does vim expose an api for manipulating argv before the "main program" looks at it? I want to be able to use the syntax: $ vim /path/to/my/file:100 and have it mean the same thing as $ vim +100 /...
4
votes
2answers
420 views

Go forward to first alphabetic character

Is there a way to go forward to the first letter, maybe using f other than specifying the letter itself? In other words I want to skip over whitespace, symbols and digits. The reason I ask is that I ...
3
votes
2answers
362 views

How do I jump to the next line with the same indent level?

I have a space formatted (yaml) file like the following: en: templates: template: "VERYLONGTEXTHEREWITHHUNDREDSOFLINES" destination: "I want to jump here" other: stuff ...
0
votes
1answer
68 views

Remapped keys won't work when combined

I have these lines in my .vimrc: " Remap movement nnoremap j h nnoremap k j ...
2
votes
0answers
130 views

Fuzzy Find C++ function definition

I am looking for a way to fuzzy find C++ function/method definition in NeoVim. A function definition can look like this: bool Cls::func() { bool func() { bool Cls::func(unsigned some, bool argument)...
1
vote
1answer
44 views

Stop curly braces navigation from leaving marks

When using curly braces navigation, {, }, to move between paragraph, overwrites the "last jump" mark (the one accessible via ''). I would find it more useful if it left this mark untouched. Is there ...
2
votes
1answer
565 views

Is it possible to clear the tag stack without jumping anywhere?

Vim keeps a stack of tags (displayable with :tags) that the user jumps to and from, similar to the jump list (displayable with :jumps). The jump list can be cleared with the :clearjumps command. This ...
4
votes
1answer
368 views

Brace { } navigation without opening folds

I use {/} a lot for navigating around, but when I do this I never intend to open a fold and jump to blank lines within the fold. How can I nremap { and } to skip over folds?
4
votes
2answers
120 views

To pageup and pagedown without reserved lines

When I scroll a whole page up by ctrl-f, and down by ctrl-b, vim reserves 2 lines, and repeats them both in the previous GUI window and the present one. But I expect it not to repeat lines, because ...
2
votes
1answer
95 views

To split long paragraph to next window

Now, I am starting to use vim to edit "normal text", that is, other than programming code. Thus, a "line" is really a paragraph, and is usually "long". In the very end of the current GUI window, ...
4
votes
1answer
428 views

How to tag jump in new tab, if target file not in active tabs, else switch to exists tab?

I use the mapping below: nnoremap <silent><C-]> <C-w><C-]><C-w>T But it will open duplicate file in multiple tabs. I have two questions: Has vim built-in functions ...
19
votes
5answers
7k views

Navigation in insert mode

I finally decided to ditch the arrow keys for navigation in favor of hjkl. I used the Vim hardmode plugin to disable the arrow keys. I got used to navigation pretty fast, but turns out that ...
4
votes
1answer
399 views

Navigate to tag in a new tab if not already opened, like `tab drop`?

What I expect from "tab-tag" navigation is the following behaviour: when need to jump to a tag: if the corresponding file is already opened in a window, navigate to it if it is not, open the buffer ...
2
votes
1answer
724 views

Swap two shortcuts

I'm very new to vim and found bindings Ctrl-F for page down and Ctrl-B for page up kind of inconvenient. I intuitively try to page up with Ctrl-F and page down with Ctrl-B because F is higher than B. ...
-1
votes
2answers
679 views

List of buffers in view pane

I must be turning a corner because I keep thinking of moving my text drafts off my Windows machine and onto my Linux box to get the convenience of editing them in Vim instead of Notepad++. One thing ...