Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 41

Thread: VIM broken

  1. #11
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,125
    Blog Entries
    2

    Default Re: VIM broken

    Quote Originally Posted by lupus47 View Post
    update-alternatives --config vim
    I get exactly the same output for
    HTML Code:
    update-alternatives --config vim
    I apologise, but what exactly do you mean by "force" re-install vim with the default configuration files ? Which configuration files ?

    /etc/vimrc is gone as mentioned by "arvidjaar". Since I do not have problems with syntax highlighting I did not register that /etc/vimrc was important in my case also - is it ?

    Since I have been using VI for so long I still use a ,exrc file with a lot of my own macros - I have diffed a backup and it has not changed. My macros still work.

    Code:
    " $Id: .exrc,v 1.15 2008/07/07 19:13:41 root Exp root $
    " .exrc for vi
    " Author: Klaus Franken, kfr@suse.de
    
    " added Super-Stutter-Sequences and useful function key mappings
    " Author: John E. Wulff, wulff.johne@gmail.de
    " modified for US-ASCII keyboards
    
    " The following settings are useful for programming:
    
    syntax enable
    
    " activate the mouse for 'xterm'
    set mouse=a
    
    " keep at least 2 lines above or below the cursor when scrolling
    set so=2
    
    " searches are case sensitive
    set noignorecase
    
    " show cursor line and column in the status line
    set ruler
    " show INSERT/REPLACE mode in status line
    set showmode
     ^
    map  $ matching parentheses, and braces
    set showmatch
    " Insert Delete PageUp PageDown on xterm and linux
    map  il to start with !
    map  xell=bash
    map  
    map  ompatible works strangely with :g//s///g
    " - alternates last g every line
    " F1 - F10 in insert mode for xterm
    
    map! <F1> ht search
    map! <F2> ch
    map! <F3> ~ wulff
    A p! <F4> :r !timestamp
    map! <F5> [numbering
    map! <F6> ]enumber
    map! <F7> {
    map! <F8> }
    map! <F9> \ for programming
    map! <F10> |th=4  
    set tabstop=8
    " shift F1 - F10 in insert mode for xterm
    set nowrap
    map! <S-F1> 
    map! <S-F2> n linux
    map! <S-F3> ~
    map! <S-F4> @
    map! <S-F5> []
    map! <S-F6> <>xterm
    map! <S-F7> {}
    map! <S-F8> ()
    map! <S-F9> ""
    map! <S-F10> ''
    
    " F1 - F10 in command mode for xterm
    
    " move to next error entry
    map <F1> :cn
    " write to the temporary buffer for transfer between windows
    map <F2> :w! /tmp/vim_buffer
    " next file in argument list
    map <F3> :n
    " change in line /* C comments */ to // C++ comments
    map <F4> :g/\/\*\(.*[^   ]\)[    ]*\*\/$/s//\/\/\1/
    map <F5> :e 
    map <F6> :e #
    map <F7> {
    map <F8> }
    map <F9> :g//s//
    cwp <F10> 0/\/\/\/
    
    " shift F1 - F10 in command mode for xterm
    
    " move to previous error entry
    map <S-F1> :cN
    " read from the temporary buffer for transfer between windows
    map <S-F2> :r /tmp/vim_buffer
    " previous file in argument list
    map <S-F3> :N
    " change // C++ comments^M to in line /* C comments */
    map <S-F4> :g/\/\/\(.*\)$/s//\/\*\1 \*\//
    map <S-F5> :e! 
    map <S-F6> :e! #
    map <S-F7> {
    map <S-F8> }
    map <S-F9> :g//s//
    map <S-F10> {!}fmt -w72
    
    " special command mappings of spare letters
    
    " mark position and transfer to tag at cursor
    map - mt
    " return to previous file
    map _ :e#
    " quits like less - unmap when recording
    map q :q
    
    " The 'Super-Stutter-Sequences'
    
    })i iii if ) {
    ///heee } else {
    ///^f)i } else if ) {
    ///^f)i } elsif ) {
    })i www while ) {
    } while );f)i
    })i fff for ) {
    })i ffe foreach ) {
    }%F)i;t:switch ) {
    break;k$iase:
    :ab ppp printf(\n");\i
    } /* main */k^hchar **argv)
    eab rrr ///zzz){///} /* zzz */>>?zzz
    :ab kkk /* */hi
    :ab KKK /** */hi
    :ab lll /* **///kA
    :ab LLL /** **///kA
    :ab hhh ////**1a****** ****1a******/kA
    :ab HHH ////\2i*********\/2i******kA
    :ab PPP ///2i#########2i######kA
    a******kA;*;*;**
    :ab DDD i#define
    dwi FFF ///PPOi#ifdef VVVoi#elseoi#endifVVV
    :ab III i#include 
    :ab CCC class {private:///public:///};>>kk>>kk$hi
    :ab SSS struct {///};>>k$hi
    :ab UUU union {///};>>k$hi
    :ab AAA /$$////k2<<oDi
    The procedure I described attempted to suggest that you try to run vim as it is installed by default nowadays...
    Perhaps I should have added removing your .exrc file when doing this.
    The objective is to test whether a default installation works properly on your system.

    If you can verify a default installation works properly, you can then inspect the difference between default and your configuration.

    There may be something that has changed in how your .exrc is used by vim... As you already know (but others reading this thread may not) that ex is a special mode running vim, and although you'd probably expect that ex mode configurations should be separate from vim mode configurations, the two are so closely related that there may be some "bleed over" where one might affect the other.

    In fact, I posted a gist recently that installs prerequisites for ocsinventory on LEAP 15.2, and used ex in line 35 to insert a setting in the middle of the file text
    https://gist.github.com/putztzu/2aa9...63daad4e1e9cdc

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  2. #12
    Join Date
    Mar 2012
    Location
    Bowen Mountain, NSW, Australia
    Posts
    72

    Default Re: VIM broken

    Quote Originally Posted by arvidjaar View Post
    What difference did you expect? Did you try to actually read the other thread that was pointed to you? The latest update removed /etc/vimrc which contained default configuration. You may reinstall it until you are blue in the face - it won't bring removed file back. Either create your personal vimrc with whatever configuration you need or downgrade vim to previous version, save /etc/vimrc, install update (which will remove /etc/vimrc again) and then copy saved /etc/vimrc back. It will not belong to any package now and so will not be removed on next updates.

    And as I already told OP in another thread - if you are concerned by this change, you should open bug report so it can be fixed.
    I have finally fixed VIM by obtaining a version from my old laptop with OpenSUSE Leap 42.3
    I was not able to locate a version that worked online or in the /snap backups.

    The removal of vimrc from /etc really caused a lot of grief and should be fixed. If you really have problems with SPEC files, the following lines should be removed:

    HTML Code:
    " Skeleton for spec files
    autocmd BufNewFile      *.spec  call SKEL_spec()
    also possibly the whole SKEL_spec function.

    As a final note the worst part of not having a vimrc file was that the move cursor arrow keys caused mayhem in insert mode. The ESC of those arrow keys stopped insert mode and the rest of the ESC sequence was used as a VI command.

    All search and ex histories now work as well as the other bugs reported by me.

    Please help me to open a bug report so that this can be fixed properly. I do not know how to do that.

  3. #13
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,748
    Blog Entries
    3

    Default Re: VIM broken

    Quote Originally Posted by lupus47 View Post
    Please help me to open a bug report so that this can be fixed properly.
    I notice two bug reports already, that are related to this. They are:

    Bug 1179307 -- Latest vim update breaks colored highlighting
    and
    Bug 1179384 -- vim - insert mode - backspace not working on existing content

    You should be able to comment on those bug reports. The same login/password that you use for the forums should also work for the bugzilla.

    To start a new bug report, I normally use openSUSE:Submitting bug reports
    but in this case, it makes more sense to use the existing bug reports.
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  4. #14
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    3,672

    Default Re: VIM broken

    Quote Originally Posted by lupus47 View Post
    I have finally fixed VIM by obtaining a version from my old laptop with OpenSUSE Leap 42.3
    You can recover a copy of the factory ‘/etc/vimrc’ by retrieving the version 8.0.1568-lp152.7.1 from the RPM in the OSS repository – <http://download.opensuse.org/distrib...po/oss/x86_64/> – download “vim-8.0.1568-lp152.7.1.x86_64.rpm” – «do not install it!!», open it with “Ark” and, extract ‘/etc/vimrc’ …

  5. #15
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,125
    Blog Entries
    2

    Default Re: VIM broken

    The procedure I described to force install vim should have worked....

    I inspected a couple of couple of my 15.2 machines... one a virtual machine that has been in a "deep freeze" for several months and a machine I've been updating regularly and found /etc/vimrc on both machines.
    I then inspected the package vim on my recently updated machine
    Code:
    # rpm -ql vim | grep /etc/
    /etc/alternatives/vim
    /etc/vimrc
    Bottom line, at least in my experience if /etc/vimrc was removed at any time by a package install or update, it hasn't been seen by me... I can't find any evidence of it.
    And, a default install should re-install vim with a working /etc/vimrc. And, a missing /etc/vimrc isn't necessarily a show stopper but could be an inconvenience with unknown consequences... There have been many postings and discussions about that over the years but restoring either a /etc/vimrc or ~/vimrc usually has fixed the problem.

    BTW - Although not particularly important, if anyone has more information about whenever /etc/vmrc might have been removed, I'd appreciate any posting for future reference although from what I can see I don't expect to see the problem again for now.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #16
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    3,672

    Exclamation Re: VIM broken

    Quote Originally Posted by tsu2 View Post
    Bottom line, at least in my experience if /etc/vimrc was removed at any time by a package install or update, it hasn't been seen by me... I can't find any evidence of it.
    Code:
     > cat /etc/os-release 
    NAME="openSUSE Leap"
    VERSION="15.2"
    ID="opensuse-leap"
    ID_LIKE="suse opensuse"
    VERSION_ID="15.2"
    PRETTY_NAME="openSUSE Leap 15.2"
    ANSI_COLOR="0;32"
    CPE_NAME="cpe:/o:opensuse:leap:15.2"
    BUG_REPORT_URL="https://bugs.opensuse.org"
    HOME_URL="https://www.opensuse.org/"
     > 
     > rpm --query --list vim | grep -i '/etc'
    /etc/alternatives/vi
    /etc/alternatives/vim
     > 
     > rpm --query --info vim
    Name        : vim
    Version     : 8.0.1568
    Release     : lp152.8.3.1
    Architecture: x86_64
    Install Date: Mo 30 Nov 2020 20:09:00 CET
    Group       : Productivity/Text/Editors
    Size        : 3193171
    License     : Vim
    Signature   : RSA/SHA256, Di 24 Nov 2020 00:03:24 CET, Key ID b88b2fd43dbdc284
    Source RPM  : vim-8.0.1568-lp152.8.3.1.src.rpm
    Build Date  : Di 24 Nov 2020 00:02:20 CET
    Build Host  : cloud133
    Relocations : (not relocatable)
    Packager    : http://bugs.opensuse.org
    Vendor      : openSUSE
    URL         : http://www.vim.org/
    Summary     : Vi IMproved
    Description :
    Vim (Vi IMproved) is an almost compatible version of the UNIX editor
    vi. Almost every possible command can be performed using only ASCII
    characters. Only the 'Q' command is missing (you do not need it). Many
    new features have been added: multilevel undo, command line history,
    file name completion, block operations, and editing of binary data.
    Distribution: openSUSE Leap 15.2
     >

  7. #17
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,125
    Blog Entries
    2

    Default Re: VIM broken

    I guess I had to look harder.
    Found a machine of mine which is also missing /etc/vimrc in the package contents although it had an /etc/vimrc.

    Inspected the package, I see no indication that the missing /etc/vimrc was intentional (although could be, who knows).

    I did find though in the package the following file with express instructions it should be installed as /etc/vimrc in its comments
    Code:
    /usr/share/doc/packages/vim/suse.vimrc
    On this machine of mine which I think was newly installed approx Feb 2020, it has a /etc/vimrc although its current installed vim package is missing the file and was updated as recently as yesterday. I just ran an update and it looks like /etc/vimrc was removed.... Interestingly, when I look at the log of what was in the update I just ran, there is nothing in it related even closely to vim... The following is what was updated
    Code:
    The following 23 packages are going to be upgraded:  libgstadaptivedemux-1_0-0 libgstbadaudio-1_0-0 libgstbasecamerabinsrc-1_0-0 libgstcodecparsers-1_0-0
      libgstmpegts-1_0-0 libgstphotography-1_0-0 libgsturidownloader-1_0-0 libgstwayland-1_0-0 libQt5Core5
      libQt5DBus5 libQt5Gui5 libQt5Network5 libQt5OpenGL5 libQt5PrintSupport5 libqt5-qtbase-platformtheme-gtk3
      libQt5Sql5 libQt5Sql5-sqlite libQt5Test5 libQt5Widgets5 libQt5Xml5 python3-pip youtube-dl
      youtube-dl-bash-completion
    I then created /etc/vimrc as instructed in the file
    Code:
    cp /usr/share/doc/packages/vim/suse.vimrc /etc/vimrc
    After a reboot, the newly created /etc/vimrc is still there.
    I guess its status can be re-checked after another update when it comes.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  8. #18
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    30,220
    Blog Entries
    15

    Default Re: VIM broken

    Hi
    Suggest a perusal of Change Logs would help?

    Tumbleweed;
    Code:
    -------------------------------------------------------------------
    Tue Jun 30 15:14:06 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
    
    - stop owning /etc/vimrc so the old, distro provided config actually
      gets removed. Leaving it around leads to a duplicated autocmd for
      *.spec, leading to spec file template inserted twice.
    Leap 15.2 update.....
    https://build.opensuse.org/package/v...hinfo?expand=1
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #19
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,125
    Blog Entries
    2

    Default Re: VIM broken

    Thx,
    That link led to some further investigation...

    Apparently for at least 8 years now VIM has been distributed in a variety of sizes...
    The following is a key to the features that are published in the VIM documentation

    http://vimdoc.sourceforge.net/htmldo...#+feature-list

    Code:
    [COLOR=var(--black-800)]The first column shows the smallest version in which they are included:[/COLOR]T   tiny
    S   small
    N   normal
    B   big 
    H   huge


    This may be the reason why I've found VIM in Debian/Ubuntu to be so primitive... Apparently since 2014, their VIM has been "tiny."
    Of course, if the default openSUSE VIM is now "small," the missing history described by @OP is a likely intentional consequence of the change.
    I wonder how many other issues will pop up over time, and so far I'm seeing no certain guide how to restore or change the VIM version, if it can be done by simply installing an /etc/vimrc. I've been reading that the way to restore features requires re-compiling.

    Frankly, I don't understand the text Malcolm highlighted about *.spec files being read twice...
    Based on a small search, as expected I didn't see anything that made a .spec file essential during runtime, it's used during build and as a text editor if you want to edit a spec file belonging to something else.
    So, I just don't understand the reasoning for removing /etc/vimrc (BTW - this seems to be something unique to openSUSE, the system-wide vimrc file is normally located in the /usr/ tree)

    TSU




    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #20
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    30,220
    Blog Entries
    15

    Default Re: VIM broken

    Quote Originally Posted by tsu2 View Post
    Thx,
    That link led to some further investigation...

    Apparently for at least 8 years now VIM has been distributed in a variety of sizes...
    The following is a key to the features that are published in the VIM documentation

    http://vimdoc.sourceforge.net/htmldo...#+feature-list

    Code:
    [COLOR=var(--black-800)]The first column shows the smallest version in which they are included:[/COLOR]T   tiny
    S   small
    N   normal
    B   big 
    H   huge


    This may be the reason why I've found VIM in Debian/Ubuntu to be so primitive... Apparently since 2014, their VIM has been "tiny."
    Of course, if the default openSUSE VIM is now "small," the missing history described by @OP is a likely intentional consequence of the change.
    I wonder how many other issues will pop up over time, and so far I'm seeing no certain guide how to restore or change the VIM version, if it can be done by simply installing an /etc/vimrc. I've been reading that the way to restore features requires re-compiling.

    Frankly, I don't understand the text Malcolm highlighted about *.spec files being read twice...
    Based on a small search, as expected I didn't see anything that made a .spec file essential during runtime, it's used during build and as a text editor if you want to edit a spec file belonging to something else.
    So, I just don't understand the reasoning for removing /etc/vimrc (BTW - this seems to be something unique to openSUSE, the system-wide vimrc file is normally located in the /usr/ tree)

    TSU




    Hi
    Um, never tried the template?

    Code:
    vim tsu2_has_not_tried_this.spec
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Page 2 of 5 FirstFirst 1234 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •