Questions tagged [movement]
The movement tag has no usage guidance.
22
questions
0
votes
1
answer
19
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 ...
2
votes
1
answer
45
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 ...
0
votes
1
answer
55
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 ...
1
vote
1
answer
38
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:
...
1
vote
1
answer
70
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 ...
0
votes
1
answer
64
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 ...
1
vote
1
answer
260
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 ...
1
vote
1
answer
115
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 ...
1
vote
2
answers
1k
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 > ...
4
votes
1
answer
66
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,...
2
votes
2
answers
104
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.
-1
votes
1
answer
69
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.
...
0
votes
1
answer
30
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 ...
0
votes
3
answers
76
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 ...
0
votes
1
answer
67
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.
...
2
votes
1
answer
897
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 ...
1
vote
1
answer
32
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 ...
11
votes
2
answers
1k
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 ...
2
votes
1
answer
83
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 ...
2
votes
2
answers
58
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 ...
2
votes
1
answer
145
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&...
2
votes
2
answers
66
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 ...