LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-24-2017, 11:58 PM   #1
nodir
Member
 
Registered: May 2016
Posts: 222

Rep: Reputation: Disabled
vim search acts weird (after upgrade?).


I think there was an upgrade of vim.
If i search
/searchterm
and try to go to the next result with n
the searchterm either changes or goes back to a different searchterm

I tried to
mv .vimrc vimrc_backup
cp /usr/share/vim/vimrc .vimrc
use vimrc from a different distro installation
and what not, but the problems with search stay.

Code:
user$ locate vimrc
/home/user/Programming/git-notabug/dotfiles/vimrc
/home/user/.vimrc
/usr/share/vim/vimrc~
/usr/share/vim/vimrc.new
/usr/share/vim/vim80/gvimrc_example.vim
/usr/share/vim/vim80/vimrc_example.vim
/usr/share/vim/.vimrc.un~
/usr/share/vim/vimrc
/usr/doc/python-2.7.13/Misc/Vim/vimrc
/usr/doc/mutt-1.7.2/samples/sample.vimrc-sidebar
user$
.vimrc
Code:
" An example for a vimrc file.
"
" Maintainer:	Bram Moolenaar <Bram@vim.org>
" Last change:	2016 Jul 28
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"	      for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"	    for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
  finish
endif

" Get the defaults that most users want.
"source $VIMRUNTIME/defaults.vim

"if has("vms")
"  set nobackup		" do not keep a backup file, use versions instead
"else
"  set backup		" keep a backup file (restore to previous version)
"  if has('persistent_undo')
"    set undofile	" keep an undo file (undo changes after closing)
"  endif
"endif

set nobackup
set history=50		" keep 50 lines of command line history
set ruler		" show the cursor position all the time
set showcmd		" display incomplete commands
set incsearch		" do incremental searching
set tw=80 
set shiftwidth=2 
set softtabstop=2
set expandtab 
set nohlsearch 

"if &t_Co > 2 || has("gui_running")
  " Switch on highlighting the last used search pattern.
"  set hlsearch
"endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  augroup END

else

  set autoindent		" always set autoindenting on

endif " has("autocmd")

" Make vim work with the 'crontab -e' command
set backupskip+=/var/spool/cron/*

" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
if has('syntax') && has('eval')
  packadd matchit
endif
 
Old 01-25-2017, 01:43 AM   #2
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Rep: Reputation: 242Reputation: 242Reputation: 242
Assuming you're running Slackware 14.2, the last update of vim was Wed Jun 15 01:57:05 UTC 2016. So something changed besides vim itself.
Just run "vim --version" if you want to check your version (and compile date). Or just do a Ctrl+F on the changelog
Have you recently made changes to ~/.inputrc perhaps?
 
Old 01-25-2017, 01:50 AM   #3
nodir
Member
 
Registered: May 2016
Posts: 222

Original Poster
Rep: Reputation: Disabled
thanks

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 10 2017 12:19:49)

I didn't recently edit inputrc

I now suddenly works again. I got no idea why.
For two hours i replaced vimrc (from backups), used the systemd defaults ones and what not.
Figured out that root's vim still work, copied that, didn't work.
deleted .viminfo, tried "vi" and "vim" (though vi is aliased to vim) etc. etc.
Suddenly it works again and i got no idea why.

I still don't understand the meaning of all the vimrc files which i listed above.
Which one is the one i care for ?
(on debian there is /etc/vim/vimrc, or similar, on Slackware it doesn't seem to exist per default, but lots of vimrc at all kind of places)
 
Old 01-25-2017, 01:58 AM   #4
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Rep: Reputation: 242Reputation: 242Reputation: 242
So it looks like you're either running Slackware -Current (not 14.2) or you've installed a vim that does not belong in 14.2.
As for your vimrc files and etc. sorry, I can't help. I use vi (/usr/bin/vi: symbolic link to elvis)
 
Old 01-25-2017, 02:00 AM   #5
nodir
Member
 
Registered: May 2016
Posts: 222

Original Poster
Rep: Reputation: Disabled
Yes, it is current
(not that i would have wanted it, but made an error when editing the "mirros" file and then simply sticked to it, as i was not sure if i could undo that).
 
Old 01-25-2017, 02:02 AM   #6
nodir
Member
 
Registered: May 2016
Posts: 222

Original Poster
Rep: Reputation: Disabled
The questions about vimrc can be answered by you, i guess. What is:
vimrc.new
for example?
 
Old 01-25-2017, 02:06 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,847

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
I do not think that functionality depends on the rc file. So it looks like (at least for me) either a bug or you missed/mistyped something.
 
Old 01-25-2017, 02:21 AM   #8
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by nodir View Post
The questions about vimrc can be answered by you, i guess. What is:
vimrc.new
for example?
If you mean /usr/share/vim/vimrc.new, that's the new version of /usr/share/vim/vimrc which should be manually overwritten or merged with the old vimrc. It's probably the only .new file that's not handled by slackpkg. I think slackpkg only looks for .new files in /etc.
 
Old 01-25-2017, 07:19 AM   #9
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
I run -stable, but at one point I compiled vim 8 from the -current SlackBuild and upgraded with that. I can't remember if I had that same problem as you, but I know I ran into other quirks or bugs. For example, certain settings would take effect if I entered them interactively, but not if I put them in vimrc, while others would work fine either way. I also tried with a fresh vimrc.

So my advice would be to stick with the version of vim from -stable, at least until the next time it is upgraded. If you are running -current, you can get the SlackBuild from the source/ directory of your DVD or a mirror and use that to build it.
 
Old 01-25-2017, 07:36 AM   #10
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
I couldn't reproduce the problem in a -current install. Even with the vimrc that you posted.

I don't know if this is the problem, but your vim compile date is different from mine,
maybe you could run slackpkg reinstall.

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 9 2017 13:17:47)
Quote:
Originally Posted by nodir View Post
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 10 2017 12:19:49)
 
Old 01-25-2017, 07:59 AM   #11
nodir
Member
 
Registered: May 2016
Posts: 222

Original Poster
Rep: Reputation: Disabled
Like said: After two hours of trying everything which came to my mind,
the problem vanished just like it occured: Out of the blue.

I do recall that i had that problem before. Iirc i set an alias from vi to vim and/or copied the vimrc from debian to ~/.vimrc

Main problem is that doing search and then going through the results is in muscle memory. If it doesn't work, i can't even say for sure which keyboard-shortcut i use.

Oh my ...
 
Old 01-25-2017, 08:26 AM   #12
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
You can always inspect the search history by pressing
Code:
q/
It won't help you now, because you removed .viminfo, but it would have showed you what was the last search when you were having trouble repeating it.
 
Old 01-25-2017, 08:45 AM   #13
nodir
Member
 
Registered: May 2016
Posts: 222

Original Poster
Rep: Reputation: Disabled
Well: i did know what the last searchterm was, because after typing "esc + n" it always went back to the last searchterm, instead of showing the next result of the actual searchterm.
 
  


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
RH5: Ran updates last week, now faillog acts weird HelpdeskMonkey Red Hat 1 06-16-2010 07:15 PM
Laptop touchpad acts weird in firefox der_11 Fedora 2 09-07-2007 09:23 AM
dhcpcd acts weird JockVSJock Slackware 3 12-12-2005 05:53 PM
Middle button in Firefox acts weird Newb001 Linux - Software 5 06-15-2004 08:40 PM
esd acts weird when not running xmms etc. as root intense Linux - General 1 03-24-2004 06:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:58 AM.

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