Questions tagged [navigation]

For questions about how to traverse through files, directories, and tabs inside of Vi/Vim.

Filter by
Sorted by
Tagged with
0
votes
3answers
41 views

List/navigate specific syntax elements in a file?

I would like to jump through specific syntax elements in a file. For example, quickly navigate to the next string element. In a .vim file strings are defined as vimString syntax elements. For ...
1
vote
1answer
72 views

Explore command not working in Terminal normal mode

In vim, I open a terminal using :term and enter the normal mode using <C-w> <N>. Then, :Explore does not open the vim's file navigation view, but creates a another split window of the ...
0
votes
0answers
41 views

How can use Tab to navigate completion list

I use both coc.nvim and Ultisnip for completion in vim. coc-snippet does not support some feature in Ultisnip so I use Ultisnip instead But I have a problem is <Tab> for trigger completion in ...
0
votes
1answer
34 views

what's the difference between `tag` and `tags` command

I've recently come across the concept of tags in vim. I run ctags on a file and it generates tags for that file. When I try to access those tags Iuse the tag command which basically provides a list of ...
0
votes
1answer
31 views

Is there a plugin for (neo)vim that allows to jump to a possition by label, similar to things like vimium do?

With some browser plugins like vimium, one can press a key and all links on the open webpage get labeled with a short combination of letters. If you then type that combination, the corresponding link ...
3
votes
2answers
102 views

how to jump to start of tag

I might have some text like the following: <foo>something very important</foo> 1 2 ^ 3 4 If the cursor is inside the tag, for example on the m character, what is ...
1
vote
2answers
45 views

Can I navigate backwards by word (not WORD) in command-line mode?

If I'm in command-line mode in vim, and I have the current command line entered (cursor position shown with |): :somecommand somefilename.txt| I'd like to navigate backwards so that the cursor is ...
1
vote
1answer
58 views

navigate between current and previous tab or split

Is it possible to navigate between two previously used tabs and/or splits? I understand why buffers are best to use, and that I can use :b# to achieve what I want, but I have wondered if this was ...
1
vote
1answer
73 views

Add current position to the jump list the first time <C-u> or <C-d> is pressed

I'm often using <C-u> and <C-d> to quickly navigate around in my code (I don't like using { and } since they're hard to type on my layout). One thing that annoys me is that <C-u> and ...
0
votes
1answer
28 views

Vim shortcut for :tabprevious change opened file on start

I try to configure my .vimrc file adding new shortcuts for my daily routing. One of my basic operations in every single IDE is switching between "tabs". I suppose to put the same key binding ...
0
votes
1answer
64 views

How to search in `more` screens?

Some commands, for example :syn and :scriptnames show a "--more-- screen" which is confusing to navigate. Contrary to what man more says, pressing / doesn't seem to work to search for text. ...
1
vote
1answer
69 views

How to search for vue components with vim's gf?

I want to go to a vue component file. Vue component filenames are written in PascalCase: ExampleComponent.vue In html (or in my case blade.php) the ExampleComponent.vue is instantiated by <example-...
1
vote
2answers
47 views

Go back to previous position when coming out of quickfix

When I navigate out of the quickfix list, the split I get put back in is not the same as the one I left. For example: vim -u NONE :copen open quickfix list ^w w leave quickfix list :vsplit open a ...
0
votes
1answer
36 views

How to move down or up, exactly one page, just like a book reader does?

I'm using the most recent version of nvim. When you flip to the next page in a book reading app you see none of the last page only the next page. Is there a command in nvim to effectivley flip pages ...
0
votes
1answer
58 views

How to jump to specific line of a file when file path and line number is given?

I have a filename and its line provided in this format, e.g.: ./my_dir/my_filename.py:20: When I move on the filename and press gf I jump to that file, however the cursor stands on line number 1, ...
4
votes
0answers
46 views

Intermittently cannot switch from Vim terminal to other panes

I've looked at quite a few other posts and haven't found a similar problem. I've recently begun using WSL and Vim and love it. Most of the time, it works great and I use CTRL-W-h/j/k/l to navigate ...
3
votes
1answer
49 views

Skip to next batch of search results (or find next non-match)?

So you search /needle, and end up trapped in a haystack of result lines. Is there a quick way to skip to the first non-matching line (and then the next batch of results)? E.g. I'm viewing the results ...
2
votes
1answer
77 views

How to move to Markdown ATX-style headers?

How can I move (navigate) between Markdown ATX-style headers? The Vim plugin https://github.com/gbgar/pandoc-sections.vim does so using the [ and ] keys, but only when there is no space between the ...
3
votes
1answer
65 views

ctags vs GNU id-tools?

I stumbled upon mkid tools in tips.txt and tried it out (on C code). In terms of navigating to definitions, I thought it was identical to using ctags except for the fact that the ID file (generated by ...
1
vote
0answers
38 views

How to make Vim not be a line editor

Vim is famously (or infamously) a child of line-based editing. For many cases this is acceptable. But I wish to use it primarily as an academic tool with large amounts of text. I want the experience ...
0
votes
1answer
242 views

Navigation in insert mode with soft wrap and showbreak

I’m having trouble with hjkl movement in insert mode. The issue is that I have changed hjkl movement to move by display line. I have 'wrap' on. The cursor should normally move line by line, not move ...
0
votes
1answer
96 views

Moving up and down wrapped lines [duplicate]

I have a text line (let's call it LINE) wrapped into some fifteen lines on the terminal screen (let's call these lines). Using only the keyboard I need to move up and down lines to edit. Keys j, k, up-...
0
votes
1answer
72 views

Is there an equivalent to Xcode's quick jump bar (to navigate Swift MARK annotations within a file)?

Does a rough equivalent to this Xcode quick jump bar feature exist as a Vim plugin? I haven't been able to find any good leads on one in my research. It's a way to navigate sections in a file - in the ...
1
vote
0answers
115 views

Code tour plugin

I was wondering if you know any helpful vim or neovim package/ way to show and explain your codebase to new people. The best way I managed to find up until now is https://marketplace.visualstudio.com/...
16
votes
8answers
3k views

Trying to move away from arrow keys in normal/insert/visual mode, but small text inserts are killing me!

I've disabled my arrow keys, and am finally getting used to hjkl (for the longest time I'd always hit j and k the wrong way around - just seemed more natural for some reason). In normal mode I'm fine ...
1
vote
1answer
17 views

Quickly go to the end of "syntax highlighted" element

I am using syntax highlighting to help with writing LaTeX documents in vim. My documents involve a lot of brackets, and it is easy to do a trivial mistake and end-up with something which doesn't ...
4
votes
2answers
790 views

Why isn't this implemented by default in vim? (line by line Scroll) [closed]

Very often, my preferred way of navigating a file in vim is by "scrolling" line by line. By scrolling, I mean shifting the lines up/down while keeping the cursor on the same line and ...
0
votes
0answers
2k views

Restore "search hit BOTTOM, continuing at TOP" when search navigation wraps aound end of file

I've recently switched to Neovim, and some days in, I realized that there was no search hit BOTTOM, continuing at TOP message when jumping from the last to the first search result (or vice versa), ...
1
vote
3answers
181 views

Fastest way to navigate various points in vim

Is it possible for vim navigation to be as quick as a normal point-and-click navigation? For example, I've taken the following example here where I've created four points that need to be clicked: ...
1
vote
0answers
36 views

How do I navigate using tags in a personal copy of the vim documentation?

As background: I am a beginner in VIM and I want to go through the built-in vim manual, but with my own copy (not the system copy) so that I can practice in the manual text as I go along (I also ...
1
vote
0answers
21 views

Navigating wrapped paragraph as multiple lines [duplicate]

Vim wraps text around as most other text editors, but does not allow the same kind of navigation within wrapped lines. Take for instance a piece of text composed of several long paragraphs. If the ...
0
votes
1answer
20 views

Is there a backward equivalent to w?

You can go forward, to the beginning of next word, with w/W. You can go forward, to the end of the word, with e/E You can go backward, to the beginning of the word whit b/B How do you go backward, to ...
1
vote
1answer
482 views

Smart jump to definition

I have ctags installed on my Windows machine. I have the following mappings in my vimrc file set tags=./tags;/ nnoremap <F5> :!ctags -R .<CR> nnoremap ,dd :exec("tag ".expand("<cword&...
1
vote
1answer
37 views

Why are split and tab navigations distinct?

Known: <Ctrl>w then any of hjkl. Known: :tab_<CR> where _ is either rlpn. Why is there not a <Ctrl> navigation for tabs nor a : for splits? Why do the navigation commands differ ...
3
votes
1answer
628 views

How to navigate long lines like separate lines?

When I have a very long line in vim it will be shown on the screen as multiple lines, like this: line no. | content | 100 | this is a very ...
3
votes
1answer
141 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
41 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 ...
1
vote
2answers
326 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
46 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
37 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....
1
vote
3answers
110 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
259 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
93 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 ...
1
vote
2answers
91 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
643 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
419 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 ...
4
votes
2answers
816 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 ...
4
votes
2answers
392 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
119 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
23 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 ...