LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-07-2024, 01:29 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 635
Blog Entries: 1

Rep: Reputation: 48
problem with vi


I am on Ubuntu. Recently I find that vim/vi is broken in the sense that the
movement of cursor within the text is extremely slow. I have to wait for one second for the
cursor to down one row when I press the j or the down arrow key.

This happens for the left, right, up or down key. I have to wait for the cursor to jump one
last step before I start typing. As you can imagine, this is driving me nuts who has used vi for so many years!


This is totally unacceptable.

I do not know how vi is broken.

I have set :set ttyfast but it is not helpful at all.

the options in vi are:

Quote:
helplang=en nomodeline ruler scroll=32 ttyfast ttymouse=sgr
backspace=indent,eol,start
fileencoding=utf-8
fileencodings=ucs-bom,utf-8,default,latin1
printoptions=paper:a4
suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
I do not believe the keyboard has any issue since I edit this message using the same keyboard
on this forum site but the cursor movement is almost instantaneous!
 
Old 05-07-2024, 04:19 AM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,162

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
is it the same for all files that you open?
maybe the file is too big and that's why it's slow

any settings on your Terminal that might have been accidentally enabled that causes the lag?

have you check, top? and just check whether the CPU or memory whether it operates minimally

have you tried other editor like nano? is it the same?

Last edited by JJJCR; 05-07-2024 at 04:23 AM. Reason: edit
 
Old 05-07-2024, 04:42 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336
try another terminal (type), another user, console. Is it the same everywhere?
 
Old 05-07-2024, 09:22 PM   #4
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
I am still investigating. I login as another user and try to use vi and the lag is still felt. Seems to be system wide thing. This is nasty. How could vi be broken!

I think my another Ubuntu has no such problem.

So I will record here what I have on this machine. Worse come to worse, I have to do a fresh install of Ubuntu! (just to avoid this unfortunate problem
but I am spending 90% of my time in vi.)


Quote:

spd-1212034:~$ uname -a
Linux ihp-spd-1212034 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
spd-1212034:~$ apt list --installed | grep vim

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

vim-common/jammy-updates,jammy-updates,jammy-security,jammy-security,now 2:8.2.3995-1ubuntu2.16 all [installed,automatic]
vim-runtime/jammy-updates,jammy-updates,jammy-security,jammy-security,now 2:8.2.3995-1ubuntu2.16 all [installed,automatic]
vim/jammy-updates,jammy-security,now 2:8.2.3995-1ubuntu2.16 amd64 [installed]
 
Old 05-07-2024, 09:24 PM   #5
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
vim version and stuff.

Quote:

spd-1212034:~$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 14 2024 09:05:11)
Included patches: 1-579, 1969, 580-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term +gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap -ruby +wildignore
+cursorbind -lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname +sodium -X11
+digraphs +mouse -sound -xfontset
-dnd -mouseshape +spell -xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags +mouse_gpm +statusline -xsmp
+eval -mouse_jsbterm -sun_workshop -xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-RPNH56/vim-8.2.3995=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt -ldl -lm -lm

 
Old 05-07-2024, 09:35 PM   #6
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
my vi lag is probabilitic! it will land on the exact location if I am lucky or I did very slow cursor movement.

But nano seems OK. May be I shall switch to nano for now.

Only when i need to use complicated vi command then only I switch to vi again. But this is really nonsense!
 
Old 05-08-2024, 01:00 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,364

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try mv'ing any '.vimrc' or system wide vimrc files into a temp back up area for now and reboot.
Also rm (or mv) any .viminfo files.
Does the problem go away - could be a corruption in one of those?

Also, check / be consistent with either vi or vim.
I know some distros just symlink 'vi' to vim, but it it possible to have both.
I'd rm any vi (as opposed to vim) files as well - apart from a binary vi if you have it.

Last edited by chrism01; 05-08-2024 at 01:03 AM.
 
Old 05-08-2024, 01:32 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336
did you try it in gui, or in console mode? Did you try different terminal emulators?
 
Old 05-08-2024, 05:42 AM   #9
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
I notice the log above says the vim was recently built. Not sure that is problem but I remember vividly things became weird when I did the apt update; apt upgrade a few days ago. Or it is due to some strange random things but I have been very careful so I think the issue is quite nasty so I made a decision to take a difficult route to
reinstall Ubuntu from scratch!

I installed a new Ubuntu (in fact the latest 24.04 version! ) and even though i paid the price to
redoing everything but at least I recover my vim for my work --- can't do anything vi.

The old ubuntu is still sitting in one partition so it could be booted up if I ever have time/energy to hunt down the root of the problem.

Cheers!

BTW:

Quote:

vi --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Mar 31 2024 00:15:53)
Included patches: 1-16
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term +gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap -ruby +wildignore
+cursorbind -lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname +sodium -X11
+digraphs +mouse -sound +xattr
-dnd -mouseshape +spell -xfontset
-ebcdic +mouse_dec +startuptime -xim
+emacs_tags +mouse_gpm +statusline -xpm
+eval -mouse_jsbterm -sun_workshop -xsmp
+ex_extra +mouse_netterm +syntax -xterm_clipboard
+extra_search +mouse_sgr +tag_binary -xterm_save
-farsi -mouse_sysmouse -tag_old_static
system vimrc file: "/etc/vim/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/vim-g8cgSd/vim-9.1.0016=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/vim-g8cgSd/vim-9.1.0016=/usr/src/vim-2:9.1.0016-1ubuntu7 -DSYS_VIMRC_FILE="/etc/vim/vimrc" -DSYS_GVIMRC_FILE="/etc/vim/gvimrc" -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.12/config-3.12-x86_64-linux-gnu -lpython3.12 -ldl -lm
 
Old 05-08-2024, 09:23 AM   #10
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 703
Blog Entries: 1

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
if not using wayland:

Did you try using xset(1), see the manual, there is a way to speed up the cursor using xset(1).

I know Ubuntu and many distros has GUI tools for this, but xset(1) always works for me and is portable to the BSDs.
 
Old 05-08-2024, 09:43 AM   #11
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by centguy View Post
I am on Ubuntu. Recently I find that vim/vi is broken in the sense that the
movement of cursor within the text is extremely slow.
So you've been using Vim on Ubuntu and it was working fine, then - without any changes by you - one day it's not working fine, and you've ruled out hardware failure?

Step 1: search for other people with the same issue, to see if the bug has already been reported.

Step 2: //help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en

 
Old 05-08-2024, 09:54 PM   #12
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
yes. It was working fine.
Then it broke suddenly.

My company is adopting this Ubuntu scripts to the "hardening" of OS for enhanced security purposes (frankly I do not
know how effective it is -- my understanding is that as long as I do apt update; apt upgrade and adopt some
common security protocol Linux is reasonably secure but then people are paranoid these days), I highly suspect I am a victim of that.
I must admit the old Ubuntu 22.04 was running fine under "hardened" OS but then bad things just happened suddenly.


But for now, I am using the new ubuntu 24.04 on exactly the same hardware and all is good and sound..
Troubleshooting takes time and energy so I will revisit this issue by booting up the broken-vi OS.

Once this 24.04 is hardened, then it might have a problem again. I shall see.

Thanks for suggestions.

Last edited by centguy; 05-08-2024 at 09:57 PM.
 
Old 05-09-2024, 01:37 AM   #13
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
Back to my ubuntu 22.04, I think this is a helpful discovery.
I find that as long as I do not change the size of the Terminal, the lag is not observed at all.
So it seems to be pointing to some underlying bug..

At least I just keep the size untouched this could be a temporary solution!
 
Old 05-09-2024, 02:02 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336
that may mean incorrect TERM settings
 
Old 05-09-2024, 02:33 AM   #15
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
Any way, I decided to move to ubuntu 24.04. I have lost confidence in ubuntu22.04 already.

Was busy customizing Gnome 3 to get all these cool extension such as Window List stuff working.
I am now about to work productive again (hopefully!)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
UEFI problem, GRUB2 problem, blank screen problem, :( JackDinn Linux - Newbie 22 05-26-2015 01:57 PM
Do I have a path problem, an Apache2 problem or a Javascript problem or any other pro rblampain Linux - Networking 0 12-29-2010 03:50 AM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration