Questions tagged [movement]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

How to make left,right,up,down window movement behave like if windows were a ring?

This is, in the current window layout: +---+---+---+ | | | | | A | D | C | | | | | +---+---+---+ | E | F | G | +---+---+---+ If the focused windows is A, then moving to the left should ...
ax ax's user avatar
  • 25
0 votes
0 answers
89 views

Search forward / backward (`*` / `#`) in visual select mode

This seems to be a mismatch in behavior between Vim and Neovim. In Vim, when in visual selection mode, * and # work as expected: they jump forward / backward to the next occurrence of the word under ...
phg's user avatar
  • 197
1 vote
1 answer
31 views

move (motion or visual selection) to own line and indent

Suppose I have the following text \[ X = (a, b) \] I want to easily convert it to the following, including indentation: \[ X = ( a, b ) \] Suppose my cursor is on a. How can I do ...
japreiss's user avatar
  • 151
1 vote
2 answers
135 views

How to move to the beginning of visual line or to move to the last non-whitespace character of visual line?

What are the commands to move to the very beginning and to move the last non-whitespace character of the current visual line? Do they exist at all? Commands for normal lines Commands for visual lines ...
user90726's user avatar
  • 113
0 votes
1 answer
21 views

Swapping nested dictionary access

In python if you have a nested dictionary, accessing elements will look like this: dict["key1"]["key2"] How would I go about swapping the two keys the fastest? Nothing really ...
fbence's user avatar
  • 603
2 votes
1 answer
234 views

`:g` to move matching lines to the end of the current selection?

I use vim for my todo list: * [ ] A * [ ] B * [X] C * [ ] D * [ ] E * [X] F * [X] G * [ ] H In order to get the completed tasks out of the way, I can use :g/\[X\]/m$, which ...
Eric Duminil's user avatar
0 votes
1 answer
212 views

Why doesn't vim-sneak's label-mode work even after enabling it?

I wanted lightspeed-like features in Vim (without having to install Neovim). I installed vim-sneak and followed the directions to enable "label-mode": let g:sneak#label = 1 But when ...
will's user avatar
  • 5
1 vote
1 answer
323 views

How can I use a variable line number with a command?

I want to move a line to another specified in a variable. So where I might do this to move the current line up seven lines: :m-7 I want to do it with a variable line destination. Something like this: ...
markling's user avatar
  • 319
1 vote
1 answer
92 views

How to move the word under the cursor to the left or right in insert mode without plugins

I'm really new to vim and I was searching for moving my single word or a line to move 'up' 'down' 'left' 'right' in insert mode I was able to achieve the up a line or block in visual mode and down a ...
Jay Chotaliya's user avatar
0 votes
1 answer
90 views

movement similar to "f" but you can specify more than one character as search criteria

Say we got this sentence: pafpaf apfa fpa i apa panda pafas af I would like to quickly move the cursor from the start of the line to the beginning of the word panda. I could do 6fp, but what takes ...
Sebastian Nielsen's user avatar
3 votes
1 answer
1k views

Delete everything between two surrounding characters

Commands I use a lot are commands like: dib (delete everything between two surrounding parantheses) di{ (delete everything between two surrounding curly brackets) ... it works for a few other ...
Sebastian Nielsen's user avatar
1 vote
1 answer
179 views

How does the underscore forward movement work? _f

I was recently watching a more advanced vim tutorial on youtube. One of the commands used was _f. This was actually just part of a longer macro being demonstrated and the underscore wasn't commented ...
BrianWilson's user avatar
3 votes
2 answers
4k views

How to move selected lines up and down? [duplicate]

Is it possible to move selected lines up and down? c = 3 a = 1 b = 2 I would like to select second and third lines and move them one line up, so that result be: a = 1 b = 2 c = 3 I know that > ...
niekas's user avatar
  • 1,545
4 votes
1 answer
68 views

Why > sometimes move 4 whitespaces sometimes 3 whitespaces in my vim?

Here is part of my vim setting: set tabstop=4 set sts=4 set expandtab set softtabstop=4 set shiftwidth=4 When I edit a file in /mtp/test, type print('ok') in the first line, and type 1> in ex mode,...
showkey's user avatar
  • 1,104
3 votes
2 answers
299 views

Undo an 'f' movement (or in general, any movement that Ctrl-O doesn't undo)

I just accidentally did f], how do I return the cursor to where it previously was? Ctrl-O doesn't work of course because f is not regarded as a jump. , doesn't work because I wasn't on a ] previously.
theonlygusti's user avatar
  • 2,229
0 votes
2 answers
135 views

How to move a selection horizontally whilst retaining the selection?

I want to select some characters on a line, then be able to move them by one character forward/backward (i.e to the right/left) as many times as desired whilst retaining the selection as it moves. ...
8c6b5df0d16ade6c's user avatar
0 votes
1 answer
32 views

Override a plugin to restore movement key?

I'm using the pencil plugin which remaps the jk movement buttons to go up/down by row (text is soft wrapped) rather than line, which is usually helpful. But at times I want to have the normal behavior ...
aris's user avatar
  • 145
0 votes
3 answers
88 views

Does a plugin exist which allows moving (across) the windows and split them without having to press Ctrl+w before each action?

I'm kind of fine with moving across windows using Ctrl+w followed by (sometimes a counter and) h, j, k, l, p, t, b, and I'm also fine with the similar key combinations to split the windows or to move ...
Enlico's user avatar
  • 2,172
0 votes
1 answer
101 views

jump to files on puppet include function

On a particular init.pp file, I have the following definition: class temp_executor { if $::fqdn =~ /host.*01/ { include ::temp_executor::deploy } } deploy.pp is on the same folder as init.pp. ...
pr3c0g's user avatar
  • 3
2 votes
1 answer
2k views

Bottom Padding In Vim?

My (n)vim window looks like this: Line 91 is the end of the document, and it's flush with the document name at the bottom (essentially the bottom of the screen). How do I "move" that line ...
user avatar
1 vote
1 answer
54 views

Vimrc syntax move up and down a certain line continously

So I am new to Vim and I am trying to understand the language of vimrc. I have this in my vimrc: map <F8> <C-E>: sleep 100m<CR>j<F8> This would automatically move the cursor ...
mle0312's user avatar
  • 331
15 votes
2 answers
2k views

What is a "section" in vim?

I'm trying to improve my ability to move around inside files in vim, especially using built-in mappings/commands. I edit a lot of different types, including shell, markdown, Python, etc. I'm familiar ...
Andrew Ferrier's user avatar
2 votes
1 answer
129 views

Is it possible to prevent a mapping from being repeated with a prefix number (vim range)?

Sometimes it is possible to accidentally hit some numeric keys. I have a lot of binds and for most of them there is nothing to be gained by allowing them to repeat with a prefix. Let's suppose that ...
Steven Lu's user avatar
  • 2,231
2 votes
2 answers
62 views

How to (more reliably) recognize the end of sentences in LaTeX?

Movement and actions using ) and ( are very powerful: I use them all the time. However, when writing and editing LaTeX, I have run into the following problem: vim cannot recognize the end of some ...
Telemachus's user avatar
2 votes
1 answer
269 views

Why do arrow keys behave differently in insert mode than in other modes?

Background I would like to disable arrow keys in all modes. This is what I tried: "EDIT: added remap for <esc> as per the comments inoremap <esc> <nop> inoremap <up> <nop&...
Attilio's user avatar
  • 359
3 votes
2 answers
77 views

"[[" and "]]" jump to top and bottom of file instead of expected behavior

I'm trying to utilize section movement via [[, ]] and friends, but I'm not seeing the behavior I'm expecting given my understanding of the documentation. A section begins after a form-feed () in ...
bronzehedwick's user avatar