Skip to main content

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
1 answer
44 views

How can I make w and b act like W and B to navigate big words (space delimited words)?

I navigate by big words much more often would like to just type w and b instead of W and B every time. I wonder if Vim has a setting for this.
Oneechan69's user avatar
0 votes
1 answer
33 views

How can I solve this wrong behaviour in gf command?

For some reason, on a specific project I work on (no per project configuration on my side). The gf command does a replacement of the last dot to slash, as if I'm in a Java file, even though it is a ...
Guilherme Marthe's user avatar
2 votes
3 answers
50 views

Best way to jump to the nth string block?

Given a line like this: <input class="submit" type="submit" value="update general"> What is the best way to jump directly to the value string block? Usually I’d ...
Vinn's user avatar
  • 781
2 votes
1 answer
511 views

How to come out to the previous file in vi after entering a file with 'gf'? [duplicate]

When using vi for a file A, if I want to go to a file B when the cursor is on file B's filename, I press gf and vi opens file B. After navigating inside file B, if I want to come out to file A, what ...
Chan Kim's user avatar
  • 123
-1 votes
1 answer
691 views

How can I hide navigation bar in nvim

I would like to know how I can remove this navigation bar or at least fix that fat red arrow. Here is my nvim config https://github.com/victororlyk/nvim_config
Victor Orlyk's user avatar
0 votes
1 answer
284 views

Go to file with gf from :terminal

I often keep a :terminal open on the right of a vertical split, and on the left keep a window open for files: ------------------------------ | | | | file buffers | :terminal ...
apostl3pol's user avatar
1 vote
3 answers
259 views

Strategies for vertically navigating long programs in Vim

I'm aware of many ways of jumping around a text file in Vim. Ctrl-f/b/u/d <count>G <count>% marks {,} And several other ways. How can I jump around efficiently in long file? Please ...
mrwonderfulness's user avatar
1 vote
1 answer
216 views

Can you configure vim to stop treating curly braces differently than other text? [closed]

I find it really annoying that when I use standard hjkl or arrow key navigation in Vim, then Vim highlights the curly braces and gets stuck on them. Here is an example of what I'm talking about: here ...
user avatar
3 votes
2 answers
564 views

Improve `gf` such that it would jump to the exact line, if possible

If a path is written in form filepath:line (i.e. python exception), I want gf to jump straight to the line.
eyal karni's user avatar
  • 1,136
1 vote
1 answer
22 views

Can the '[[' search algorithm be changed to match a '{' not in column 1?

I use terrible languages that do not even allow you to put the { character in the first column. Doing so makes the compiler fail. When I work on my project in C++, I use the [[ command all the time to ...
Alexis Wilke's user avatar
1 vote
1 answer
134 views

Navigation: Show current function name / if/switch depth etc

I'm struggling to explain what I want, and I do not even know if something like this is possible in vim. I code in PHP / JavaScript. In a large file, I would like a statusbar to show me: which ...
psx's user avatar
  • 115
5 votes
2 answers
1k views

How can I find the function name while navigating code?

I use Ctags and vim to browse by C source code. Quite often than not I am in middle of a long function and want to quickly check the name of the function that the browsing. I use the "{" to ...
Preetham Rangaswamy's user avatar
0 votes
2 answers
120 views

Can Vim be configured to leave insert/replace mode when I use the cursor keys

I find I forget to leave INSERT or REPLACE to navigate around the file with cursor keys, Page Up, Page Down, etc. Or, I walk off from the computer to make my coffee, or whatever. Then when my brain ...
Omar and Lorraine's user avatar
1 vote
3 answers
155 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 ...
yomotherboard's user avatar
2 votes
1 answer
616 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 ...
B1LLP4RK's user avatar
  • 105
0 votes
1 answer
394 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 ...
Pham Hung's user avatar
  • 153
2 votes
1 answer
434 views

What is 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 I use the tag command which basically provides a list ...
nikinbaidar's user avatar
0 votes
2 answers
942 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 ...
con-f-use's user avatar
  • 103
0 votes
1 answer
242 views

Is it possible to keep editing the same line when I execute code with !%?

Let's say I have a file with the following bash code: echo "line 1" echo "line 2" echo "line 3" echo "line 4" echo "line 5" echo "line 6" ...
raylight's user avatar
  • 545
4 votes
2 answers
583 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 ...
john's user avatar
  • 183
1 vote
2 answers
200 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 ...
Andrew Ferrier's user avatar
1 vote
1 answer
1k 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 ...
5c0tt's user avatar
  • 23
3 votes
1 answer
561 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 ...
T-Rex96's user avatar
  • 131
0 votes
1 answer
166 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 ...
hamsternik's user avatar
2 votes
1 answer
342 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. ...
Carla is my name's user avatar
1 vote
1 answer
167 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-...
Piet Pro's user avatar
-1 votes
0 answers
188 views

When I'm in Vi Normal mode my H and L keys do not work [closed]

I am new to using Vi. I'm using a virtual machine. When I'm in Normal mode and pressing l it used to take me to the right and h used to take me to the left. Now when I am in command mode pressing h or ...
Mustapha D's user avatar
1 vote
2 answers
220 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 ...
Marcel's user avatar
  • 133
0 votes
1 answer
56 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 ...
Kes's user avatar
  • 663
0 votes
1 answer
417 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, ...
niekas's user avatar
  • 1,655
5 votes
0 answers
160 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 ...
Christina Nguyen's user avatar
4 votes
1 answer
154 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 ...
usretc's user avatar
  • 374
2 votes
1 answer
191 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 ...
Serge Stroobandt's user avatar
3 votes
1 answer
157 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 ...
First User's user avatar
1 vote
0 answers
59 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 ...
Shadow43375's user avatar
1 vote
1 answer
587 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 ...
andrew_ysk's user avatar
0 votes
1 answer
2k 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-...
user avatar
0 votes
1 answer
206 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 ...
aehlke's user avatar
  • 151
1 vote
0 answers
207 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/...
Marek Subocz's user avatar
4 votes
2 answers
670 views

How can I make zz not center cursor when approaching end of file?

When I press zz at the end of file, the line is displayed at the center of screen by having many empty lines having empty lines beyond end of file is great, but this is too much. Is there a way to ...
zyy's user avatar
  • 239
18 votes
8 answers
5k 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 ...
Codemonkey's user avatar
1 vote
1 answer
24 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 ...
Nitin's user avatar
  • 235
4 votes
2 answers
1k 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 ...
WalksB's user avatar
  • 527
2 votes
0 answers
7k 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), ...
flotzilla's user avatar
  • 333
2 votes
3 answers
1k 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: ...
David542's user avatar
  • 2,455
1 vote
0 answers
56 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 ...
Jordan Mandel's user avatar
1 vote
0 answers
25 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 ...
Luís de Sousa's user avatar
0 votes
1 answer
64 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 ...
kbenoit's user avatar
  • 103
3 votes
3 answers
1k 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&...
Salahuddin Ahmed's user avatar
1 vote
1 answer
41 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 ...
fde-capu's user avatar
  • 282