Questions tagged [movement]
27 questions
15
votes
2 answers
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 with the { and } keys, which move between…
Andrew Ferrier
- 6,729
- 7
- 28
- 41
4
votes
1 answer
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, I get the normal result, character p is in the 5th…
showkey
- 1,130
- 2
- 11
- 30
3
votes
2 answers
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.
minseong
- 2,313
- 1
- 19
- 38
3
votes
2 answers
"[[" 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 the first column and at each of
a set of section…
bronzehedwick
- 805
- 1
- 7
- 14
0
votes
1 answer
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 comes to my mind other than something like di[wwdi["p1bbp.
Also just out…
fbence
- 677
- 4
- 12
0
votes
1 answer
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.
Kind of like this:
Is there way already to do this…
8c6b5df0d16ade6c
- 179
- 8
0
votes
1 answer
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.
I want to jump to that deploy.pp file, while…
pr3c0g
- 3
- 3