Questions tagged [navigation]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
171 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
0 votes
0 answers
51 views

clojure-lsp in neovim is not navigating to function definitions/namespaces

I'm using neovim with clojure lsp for clojure development. My neovim config are exactly same as this repo. The autosuggesting is working fine with this configuration. But when I like to navigate to ...
Rajkumar Natarajan's user avatar
-1 votes
1 answer
349 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
116 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
151 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
88 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
545 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,026
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
42 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
994 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
96 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 ...
Lorraine's user avatar
  • 103
1 vote
3 answers
128 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
1 vote
1 answer
395 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
0 votes
1 answer
293 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
  • 113
2 votes
1 answer
291 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
575 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
3 votes
2 answers
441 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
  • 163
1 vote
2 answers
160 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
563 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
437 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
134 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
264 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
150 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 vote
2 answers
167 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
43 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
  • 591
0 votes
1 answer
262 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,505
5 votes
0 answers
137 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
3 votes
1 answer
112 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
  • 345
2 votes
1 answer
161 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
130 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
54 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
0 votes
1 answer
487 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
1k 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
172 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
177 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
457 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
17 votes
8 answers
4k 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
  • 497
2 votes
0 answers
6k 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
967 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,335
1 vote
0 answers
50 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
49 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
  • 263
5 votes
2 answers
2k 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 ...
frakk's user avatar
  • 53
3 votes
1 answer
306 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 ...
danijar's user avatar
  • 391
1 vote
0 answers
45 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 ...
acppcoder's user avatar
1 vote
2 answers
574 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 ...
0x539's user avatar
  • 179