简体   繁体   中英

Can't remap in vim

I want to have shift-tab behave as it does in other text editors. However it just won't work for me

syntax on 

:set number 

filetype plugin indent on 

set tabstop=4 

set shiftwidth=4

set expandtab

inoremap <S-tab> <C-d>

colo ron

Does anyone know why the remap won't work?

Edit: I already tried using the solution from Map shift-tab in vim to inverse tab in Vim . Also i'm using Ubuntu 14.04.

Use tabedit to open more than one file at a time. Tabedit should allow you open and navigate between files the way you do in other editors. That includes the <tab> and <shift + tab> behavior you are probably expecting in normal mode .

open files with:

:tabedit <filename>

auto complete will work on file names with the tabkey, too. Example:

:tabe[tab] s<[tab]/R[tab]

might produce something like:

:tabedit source/Readme.txt

You can use tabs in your macros, too. So copying information in complex ways between files becomes something you can quickly do on the fly with macros.

The linked solution works fine for me on Ubuntu 14.04, as well as using the commands in your question as my .vimrc .

Assuming you're storing the settings in your .vimrc file, did you reload the file after you made the change? You can do this by either relaunching vim, or running :source ~/.vimrc .

If that doesn't work, make sure you're in insert mode ( :i / :I ).

And if that doesn't work, make sure you aren't in paste mode ( :set nopaste )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM