[solved] vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Tylko tematy nie mieszczące się powyżej.
Awatar użytkownika
Vizzdoom
Piegowaty Guziec
Piegowaty Guziec
Posty: 14
Rejestracja: 14 paź 2006, 18:37
Płeć: Mężczyzna
Wersja Ubuntu: 12.10
Środowisko graficzne: KDE Plasma
Architektura: x86_64
Kontakt:

[solved] vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Post autor: Vizzdoom »

Strasznie lubię korzystać z vima, ale zawsze mam z nim jeden problem na systemach 'debianowych'. Nie doszukałem się nigdzie rozwiązania :(

Gdy jestem w trybie wstawiania i nacisnę jakiś kursor (by przejść tam linijkę wyżej/niżej, w prawo/lewo etc), wtedy vim automatyczine dodaje mi nową linię i wpisuje w nią literkę: A, B, C lub D (w zależności od kursora). Jest to strasznie uciążliwę, aby przejść np dwie literki w prawo, trzeba wyjsc z trybu wstawiania, kursorami albo odpowiednimi klawiszami sie tam przestawic i znow przejsc w tryb wstawiania.

Bardzo ciekawi mnie dlaczego to robi i jak to naprawić. Podpowie ktoś:?:

ps. obecnie siedzę na Ubuntu 8.10 + gnome

edit

problem zniknal po zainstalowaniu:

Kod: Zaznacz cały

sudo aptitude install vim-syntax-gtk vim-gnome vim-python 
oraz zamienieniu vimrc na taki (z mojego shellkonta):

Kod: Zaznacz cały

" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below.  If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed.  It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
    \| exe "normal g'\"" | endif
endif

" Uncomment the following to have Vim load indentation rules according to the
" detected filetype. Per default Debian Vim only load filetype specific
" plugins.
if has("autocmd")
  filetype indent on
  filetype plugin indent on
endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd		" Show (partial) command in status line.
set showmatch		" Show matching brackets.
"set ignorecase		" Do case insensitive matching
"set smartcase		" Do smart case matching
set incsearch		" Incremental search
set hlsearch		" Hilight search results
"set autowrite		" Automatically save before commands like :next and :make
"set hidden             " Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes) in terminals
set nowrap		" Don't wrap long lines
set nobackup		" Don't keep (annoying) backups


" Source a global configuration file if available
" XXX Deprecated, please move your changes here in /etc/vim/vimrc
"if filereadable("/etc/vim/vimrc.local")
"  source /etc/vim/vimrc.local
"endif
Jednak dalej mnie interesuje geneza tego problemu, bo bardzo często się na niego natykam
Linux Registered User #446600
Ubuntu Registered User #13404
_________________
Awatar użytkownika
cukier_lukier
Przyjaciel
Przyjaciel
Posty: 1250
Rejestracja: 14 cze 2006, 18:25
Płeć: Mężczyzna
Wersja Ubuntu: 14.04
Środowisko graficzne: Brak
Architektura: x86

Odp: vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Post autor: cukier_lukier »

A jak wyglądał Twój plik .vimrc przed zmianą? Najlepiej wklej dwa pliki:

Kod: Zaznacz cały

/etc/vim/vimrc
i

Kod: Zaznacz cały

/home/twoja_nazwa_uzytkownika/.vimrc
Awatar użytkownika
Vizzdoom
Piegowaty Guziec
Piegowaty Guziec
Posty: 14
Rejestracja: 14 paź 2006, 18:37
Płeć: Mężczyzna
Wersja Ubuntu: 12.10
Środowisko graficzne: KDE Plasma
Architektura: x86_64
Kontakt:

Odp: vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Post autor: Vizzdoom »

No właśnie, palec mi się w cudzysłowu omcknął i nadpisałem ;p
Ogólnie te standardowe po instalacji ubuntu czy debiana ;)
Linux Registered User #446600
Ubuntu Registered User #13404
_________________
Awatar użytkownika
Carnophage
Serdeczny Borsuk
Serdeczny Borsuk
Posty: 169
Rejestracja: 03 maja 2008, 22:08
Płeć: Mężczyzna
Wersja Ubuntu: inny OS
Środowisko graficzne: Xfce
Architektura: x86_64
Lokalizacja: 127.0.0.1
Kontakt:

Odp: vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Post autor: Carnophage »

Are your Vim / Vi arrow keys making A,C, B etc characters instead of moving around in insert (?i') mode ?

Try typing this ? it fixes it for me:

:set nocompatible

Or, add the line:

set nocompatible

to your ~/.vimrc file.
When remotely editing through Vim on a friend?s server, I had troubles using the arrow keys, because instead of moving the cursor, using them result in some random letters printed on the screen. After some researches I stumbled on this help (:help compatible_):

This option has the effect of making Vim either more Vi-compatible, or
make Vim behave in a more useful way. When a ".vimrc" file is found while Vim is starting up, this option is switched off, and all options that have not been modified will be set to the Vim defaults.

So the point is, if you have the same problems I had, you don?t want to be Vi-compatible. So simply go and touch ~/.vimrc (this will create an empty .vimrc file in your $HOME directory).
Cytaty z dwoch pierwszych linkow wyrzuconych przez google dla zapytania: vim arrow keys
Awatar użytkownika
cukier_lukier
Przyjaciel
Przyjaciel
Posty: 1250
Rejestracja: 14 cze 2006, 18:25
Płeć: Mężczyzna
Wersja Ubuntu: 14.04
Środowisko graficzne: Brak
Architektura: x86

Odp: vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Post autor: cukier_lukier »

Ogólnie te standardowe po instalacji ubuntu czy debiana
No wiesz, tylko ja nie wiem jakie to są, bo sam je zmieniałem. Dlatego pytam. Jeśli teraz nie masz do nich dostępu, to ciężko będzie stwierdzić, co w nich było.
Awatar użytkownika
Vizzdoom
Piegowaty Guziec
Piegowaty Guziec
Posty: 14
Rejestracja: 14 paź 2006, 18:37
Płeć: Mężczyzna
Wersja Ubuntu: 12.10
Środowisko graficzne: KDE Plasma
Architektura: x86_64
Kontakt:

Odp: vim - kursory w trybie wstawiania dodają nową linię i litery A/B/C/D

Post autor: Vizzdoom »

Carnophage, dziękuje za odpowiedź, temat rozwiązany
Linux Registered User #446600
Ubuntu Registered User #13404
_________________
ODPOWIEDZ

Wróć do „Inne”

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 25 gości