Vim: Operator pending remaps funktioniert nicht mehr

499
Sergey Nikolayvich

Ich versuche, ein Vimscript zu erstellen, das mit dem vereinfachten Dvorak-Layout verwendet werden kann. Das heißt, da die Tasten der an den Computer angeschlossenen Tastatur im Dovark Simplified Layout angeordnet sind (und die Tastatureinstellungen des Systems entsprechend festgelegt sind), möchte ich ein Vimscript schreiben, das vim das Dvorak-Layout nur im Einfügemodus verwendet : In allen anderen Modi ist das Tastaturlayout QWERTY.

Folgendes habe ich:

"Keys between the 0 and the backspace noremap [ - noremap { _ noremap ] = noremap } +  "Keys from the tab till the end of the row noremap ' q noremap " Q noremap, w noremap < W noremap . e noremap > E noremap p r noremap P R noremap y t noremap Y T noremap f y noremap F Y noremap g u noremap G U noremap c i noremap C I noremap r o noremap R O noremap l p noremap L P noremap / [ noremap ? { noremap = ] noremap + }  "Home row keys noremap o s noremap O S noremap e d noremap E D noremap u f noremap U F noremap i g noremap I G noremap d h noremap D H noremap h j noremap H J noremap t k noremap T K noremap n l noremap N L noremap s ; noremap S : noremap -, noremap _ "  "Keys for the row below the home row noremap ; z noremap : Z noremap q x noremap Q X noremap j c noremap J C noremap k v noremap K V noremap x b noremap X B noremap b n noremap B N noremap w, noremap W < noremap v . noremap v > noremap z / noremap Z ?  "Same as above but now for the console  "Keys between the 0 and the backspace cnoremap [ - cnoremap { _ cnoremap ] = cnoremap } +  "Keys from the tab till the end of the row cnoremap ' q cnoremap " Q cnoremap, w cnoremap < W cnoremap . e cnoremap > E cnoremap p r cnoremap P R cnoremap y t cnoremap Y T cnoremap f y cnoremap F Y cnoremap g u cnoremap G U cnoremap c i cnoremap C I cnoremap r o cnoremap R O cnoremap l p cnoremap L P cnoremap / [ cnoremap ? { cnoremap = ] cnoremap + }  "Home row keys cnoremap o s cnoremap O S cnoremap e d cnoremap E D cnoremap u f cnoremap U F cnoremap i g cnoremap I G cnoremap d h cnoremap D H cnoremap h j cnoremap H J cnoremap t k cnoremap T K cnoremap n l cnoremap N L cnoremap s ; cnoremap S : cnoremap -, cnoremap _ "  "Keys for the row below the home row cnoremap ; z cnoremap : Z cnoremap q x cnoremap Q X cnoremap j c cnoremap J C cnoremap k v cnoremap K V cnoremap x b cnoremap X B cnoremap b n cnoremap B N cnoremap w, cnoremap W < cnoremap v . cnoremap v > cnoremap z / cnoremap Z ? 

Wenn Sie jedoch auf der physischen Tastatur die Taste "ii" drücken, die an den Anfang des Dokuments springen soll (da sowohl im Normalmodus als auch im Modus "Operator-Pending" die Taste "i" einem "g" zugeordnet ist), wird vim angezeigt in den Einfügemodus. Durch Drücken von "ig" auf der physischen Tastatur wird jedoch an den Anfang des Dokuments gesprungen.

Das Problem bleibt bestehen, ob unter Linux oder unter Windows.

Warum funktionieren die Karten für den laufenden Betrieb nicht? Die Vim-Hilfe besagt, dass "noremap" alle Modi außer "Einfügen", "Konsole", "Terminal-Job" und "Lang-Arg" neu zuordnet.

0
Duplikat von https://vi.stackexchange.com/questions/17911/operator-pending-mode-remaps-not-working Christian Brabandt vor 5 Jahren 0

1 Antwort auf die Frage

0
Ingo Karkat

ggist nicht normaler Modus g+ Bewegung g; Es handelt sich hierbei um ein volles Normalmodus-Mapping, das folgendermaßen zugeordnet werden muss:

nnoremap ii gg 

Ich denke jedoch, dass Ihre gesamte Vorgehensweise fehlerhaft ist und Probleme verursachen wird. Zumindest werden Dvorak-Layouts in der Regel anders implementiert :help 'keymap'. Siehe Verwenden von Vim mit dem Dvorak-Tastaturlayout und Auschecken $VIMRUNTIME/keymap/dvorak.vim.