0
votes
2answers
40 views

What is the difference between “find” and “till” in vim?

I see I can use t c or Tc to move to the next / previous character c I can also use fc or Fc to move to the next / previous character c Is the only difference between them that tc places the ...
1
vote
1answer
72 views

Mapping C-1 does not work in VIM

I'm trying to bind 1gt to CTRL + 1, so in vimrc I added nmap <c-1> 1gt But pressing these keys in normal mode does not work. Either VIM (konsole) or gVIM Anything wrong with my command?
8
votes
2answers
166 views

Vim - map last shell command to the key

Is there any way to map leader-r to repeat last command sent to bash? For example, when working with C files I would like to compile and run program from vim without typing :!make or gcc. I know I ...
5
votes
1answer
69 views

How to put current line at top/center/bottom of screen in vim?

Any quicker navigation trick to place the line at which the cursor is at the moment to the top of the screen? center of the screen? bottom of the screen?
1
vote
3answers
88 views

Emacs's <C-l> vim equivalent

There's a neat Control-L hotkey in Emacs that repetitively moves the cursor to the top/middle/bottom of the screen. I'm quite sure there's a vim equivalent for that, but I couldn't find it.
1
vote
1answer
54 views

Vim key binding to cycle through windows

How do I bind one single key to cycle through the windows? For example, each time I want to switch a window, I have to click ctrl-a (default was ctrl-c) then use arrow key up/down/left/right to ...
4
votes
2answers
95 views

How can I use caps lock to change language in VIM

Can I use capslock for changing languages in VIM instead of Ctrl + 6 in case of "keymap=russian-jcukenwin"? How can I do it? Maybe something like mapping it in the $VIMRC file? How can I map ...
47
votes
6answers
4k views

Exit vim more quickly

I use Vim mainly for quick edits rather than long work sessions. In that sense, I find the keyboard sequence for quitting especially laborious: Esc, Shift + ;, w, q, Enter. How to quit Vim (possibly ...
0
votes
1answer
48 views

is there a vim shortcut or can I create one for 'tabe other_file'

When possible I create 1 or 2 letter abbreviations for aliases and the like, e.g. x for exit or p for pwd at the command line. When using vim and doing multiple tabs for different files (which I can ...
9
votes
2answers
993 views

What is meant by a shell is in “vi” mode or “emacs” mode?

This question follows directly from the answer to one of my previous questions here. I am newbie to unix world and this site has helped a lot to understand some core concepts. In this case I am ...
0
votes
1answer
53 views

Disabling/enabling language specific mappings in Vim

I have :set keymap=russian-jcukenwin. In this keyboard mapping ` maps to ё. I want to unmap this backtick. :lmap ` l ` *@ё :lunmap ` E31: No such mapping Why lunmap ` gives an error? ...
5
votes
4answers
3k views

Ctrl-s hang terminal emulator?

I came across a sentence in vimdoc: Note: CTRL-S does not work on all terminals and might block further input, use CTRL-Q to get going again. and this key indeed hangs my vim. I was ...
5
votes
2answers
165 views

How to consistently start Vim's command line to make a mapping work in any mode?

I try to normalize access to Vim's command line mode from any other mode in order to simplify my actual mappings. For example to make the <f6> key work from anywhere I define the following ...
6
votes
1answer
250 views

How to change Vim's command type mode programmatically?

Is there a simple way to switch from one command type mode to another without loosing the current command line? In my ~/.vimrc file I remap the <space> and <c-space> character, coming ...
1
vote
1answer
206 views

Reassigning Ctrl + Arrow keys in Vim [duplicate]

Possible Duplicate: How to fix Ctrl + arrows in Vim? Through the several tutorials and tips and tricks site about Vim, I think I happened to read that one can reassign a combination of keys ...
1
vote
1answer
174 views

map “Ñ” to “:” in vim

I want map the key Ñ (Shift+ñ) to : in the normal mode of vim. I've searched vim configs with Ntilde but I've found nothing. Any idea?.
3
votes
2answers
109 views

Shortcut for tabn & tabp in vim/vi

When I open several files using vim+tabf, switching across the files will involve using tabp & tabn. Can I have a quicker way to do so?
5
votes
2answers
366 views

vim customized with emacs commands (insert mode only)

I was an emacs user, and I have to switch to vim. But I miss some basic emacs commands in vim insert mode: C-A C-E C-K C-Y C-x C-s ... and some other I know that I can press Escape and then press ...
7
votes
2answers
418 views

How can I switch 2 characters in vi?

I like the fact that I've memorized ddp for switching two lines (i.e. dd deletes the line and then p puts it back '1 higher'). Is there are similar set of keystrokes for switching 2 characters so ...
6
votes
3answers
581 views

Vim: How to get rid of filetype-specific map?

Edit: Working version. I've mapped [[ and ]] to my own functions: nmap <silent> ]] :let &tabstop += 1 <CR> :echo 'tabstop =' &tabstop <CR> nmap <silent> [[ :let ...
1
vote
1answer
133 views

vim hot keys with variables

I am trying to do a mapping that moves the current line to another line. Something like nnoremap < space >m$VARIABLE :m $VARIABLE <CR> dd
2
votes
1answer
496 views

How to add additional Gnome-Shell and Unity workspace navigation shortcuts

I am very familiar with (and love) the workspace switching in Gnome-Shell and Unity (using Ctrl+Alt+[Up/Down/Right/Left]), but being a vim fan, it would also be great if I could add an additional ...
5
votes
3answers
2k views

In vim, search backwards for matching braces/parens

As most of you probably know, you can use % to search forwards on the line to find the next paired brace/bracket/paren and move to its matched partner: |a|rray[index] = value; " |e| is the cursor; ...
15
votes
4answers
4k views

How to get vim to work with tmux properly?

I'm trying to figure out how to get vim and tmux play together. My problem is: When I use xterm-256color I get vim to work nicely, but the background doesn't render properly. I fixed this by using ...
2
votes
3answers
824 views

console vim in screen session: remap Ctrl-Shift-Left, Ctrl-Shift-Right to not delete lines

I have my gvim setup so that I can select word-wise with Ctrl-Shift-Right, Ctrl-Shift-Left etc. (yes, I know it's a bad habit, but it works for me..). Unfortunately, these key combinations delete ...
2
votes
1answer
102 views

How to limit a search to the current line

VIM newbie here. I'm trying to write a mapping that will let me move around 'common' insertion points in a line when in insert mode. For ex. I have the delimitMate plugin - so typing a opening ...
2
votes
3answers
950 views

Vim shortcuts in insert mode

When I'm entering some text in vim, sometimes I need to jump to some other place and enter more text. I know there are some shortcuts with ctrl key to simplify the movement. What are the most useful ...
9
votes
2answers
1k views

Select code block in vim

Given a code like this: 588 while ($linecounter > 0) { 589 $token = " "; 590 while ($token != PHP_EOL) { 591 if (fseek($handle, $pos, SEEK_END) == ...
3
votes
2answers
4k views

How to map ALT key in .vimrc?

In order to be able add blank lines without going into insertion mode, I'm trying to map ALT-o and ALT-O to o<ESC> and o<ESC> I've tried the following in my .vimrc map <M-o> ...
11
votes
4answers
383 views

Is there a vim shortcut for <name of current file>?

In vim, if I'm working on a Python script, I will commonly type: :! python this_script.py to execute the script. Is there a shortcut for the name of the current file? If not, can I easily make one? ...
9
votes
2answers
2k views

Can less invoke vim instead of the default vi when I hit the 'v' key?

I want to launch vim instead of the default vi editor when I hit v in less. Are there any settings I can modify to allow me to do this?
10
votes
4answers
17k views

How do I quit from Vi?

I started Vi on my Ubuntu machine. However I don't know Vi, and now I can not quit. I see the editor and I can write text, at the bottom line there is a label "recording". How do I quit from Vi?