Jul 28, 2025 - 10:31 PMDeutsch | English
Hello unlogged user [ Register | Log in ]

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
severin
Post subject: [geloest] update-alternatives vi vollkommen verquer  PostPosted: May 19, 2006 - 09:09 PM



Joined: Mar 18, 2004
Posts: 3417

Hallo miteinander!
Ich hab auf einmal (keine Ahnung, seit wann; aber ich mach taeglich dist-upgrades, vielleicht war's eines davon) folgendes Problem: "vi" ruft auf einmal vi auf - frueher startete immer vim. ALso hab ich mal angefangen nach den alternatives zu wuehlen:
Code:
root@Godot:~# which vi
/usr/bin/vi
root@Godot:~# ll /usr/bin/vi
lrwxrwxrwx 1 root root 20 2006-01-03 19:28 /usr/bin/vi -> /etc/alternatives/vi
root@Godot:~# ll /etc/alternatives/vi
lrwxrwxrwx 1 root root 12 2006-01-03 19:25 /etc/alternatives/vi -> /usr/bin/vim
root@Godot:~# ll /usr/bin/vim
lrwxrwxrwx 1 root root 21 2006-05-18 08:11 /usr/bin/vim -> /etc/alternatives/vim
root@Godot:~# ll /etc/alternatives/vim
lrwxrwxrwx 1 root root 16 2006-05-18 08:11 /etc/alternatives/vim -> /usr/bin/vim.gtk
root@Godot:~# ll /usr/bin/vim.gtk
-rwxr-xr-x 1 root root 1668396 2006-05-17 05:46 /usr/bin/vim.gtk
So. vim.gtk waere auch das, was ich gerne aufrufen wuerde, aber aus irgendeinem Grund startet immer vi. Woran kann das denn liegen? Und wie koennte ich das direkt ueber update-alternatives richten?

Schoene Gruesse,
Severin

_________________
Kein Wort verstanden? Auf http://kanotix.com/index.php?module=pnW ... uerDummies
gibt's ein Glossar.

No clue what I'm talking about? New to Linux? Check http://kanotix.com/index.php?module=pnW ... ForDummies for a glossary.


Last edited by severin on May 20, 2006 - 08:59 AM; edited 1 time in total
 
 View user's profile Send private message Visit poster's website ICQ Number 
Reply with quote Back to top
slh
Post subject: update-alternatives vollkommen verquer  PostPosted: May 20, 2006 - 01:24 AM



Joined: Aug 16, 2004
Posts: 1905

In beiden Fällen wird vim aufgerufen, mittels "vi" eben nur mit /etc/vim/virc als Konfiguration ("set compatible" --> strenger vi Mode) und bei "vim" mit /etc/vim/vimrc als Konfiguration. Dies ist eine Konzession der Debian vim Maintainer zugunsten der nvi Anhänger, um vim-tiny anstelle von nvi in debian base zu bekommen.

Mehr noch stört mich bei den vim 7 Paketen in sid das automatisch aktive code folding für changelogs...
 
 View user's profile Send private message  
Reply with quote Back to top
severin
Post subject: update-alternatives vollkommen verquer  PostPosted: May 20, 2006 - 08:55 AM



Joined: Mar 18, 2004
Posts: 3417

Hi slh!
Ich glaube, ich hab hier ein anderes Problem. Denn je nachdem, ob ich "vi" oder "vim" eingebe, liefert "ps au | grep vi" auch "vi" oder eben "vim". Ausserdem habe ich jetzt die /etc/vim/virc umbenannt und durch einen Link auf /etc/vim/vimrc ersetzt, aber kriege dennoch nach Eingabe von "vi" vi und nach "vim" vim

---EDIT---
hab jetzt vi aktualisiert (gab's gerade neu in SID), und seitdem funktioniert dieser virc-vimrc-Zauber mit den symbolischen Links Frage
Egal Smilie

_________________
Kein Wort verstanden? Auf http://kanotix.com/index.php?module=pnW ... uerDummies
gibt's ein Glossar.

No clue what I'm talking about? New to Linux? Check http://kanotix.com/index.php?module=pnW ... ForDummies for a glossary.
 
 View user's profile Send private message Visit poster's website ICQ Number 
Reply with quote Back to top
slh
Post subject: update-alternatives vollkommen verquer  PostPosted: May 20, 2006 - 12:42 PM



Joined: Aug 16, 2004
Posts: 1905

Debian verwendet einen Patch für vim, mit welchem das binary feststellt unter welchem Namen es aufgerufen wurde und anhand dessen die "richtige" Konfigurationsdatei aufruft.

Code:
Index: vim/src/os_unix.h
===================================================================
--- vim/src/os_unix.h.orig
+++ vim/src/os_unix.h
@@ -237,6 +237,9 @@
 /*
  * Unix system-dependent file names
  */
+#ifndef SYS_VIRC_FILE
+# define SYS_VIRC_FILE "$VIM/virc"
+#endif
 #ifndef SYS_VIMRC_FILE
 # define SYS_VIMRC_FILE "$VIM/vimrc"
 #endif
Index: vim/src/main.c
===================================================================
--- vim/src/main.c.orig
+++ vim/src/main.c
@@ -89,6 +89,9 @@
 #ifdef FEAT_DIFF
     int                diff_mode;              /* start with 'diff' set */
 #endif
+#ifdef SYS_VIRC_FILE
+    int                vi_mode;                /* started as "vi" */
+#endif
 } mparm_T;

 /* Values for edit_type. */
@@ -1423,6 +1426,8 @@
     }
     else if (STRNICMP(initstr, "vim", 3) == 0)
        initstr += 3;
+    else if (STRNICMP(initstr, "vi", 2) == 0)
+       parmp->vi_mode = TRUE;

     /* Catch "[r][g]vimdiff" and "[r][g]viewdiff". */
     if (STRICMP(initstr, "diff") == 0)
@@ -2606,7 +2611,14 @@
         * Get system wide defaults, if the file name is defined.
         */
 #ifdef SYS_VIMRC_FILE
+# ifdef SYS_VIRC_FILE
+       if (parmp->vi_mode)
+           (void)do_source((char_u *)SYS_VIRC_FILE,  FALSE, DOSO_NONE);
+       else
+           (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
+# else
        (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
+# endif
 #endif
 #ifdef MACOS_X
        (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE);
 
 View user's profile Send private message  
Reply with quote Back to top
spacepenguin
Post subject: Re: update-alternatives vollkommen verquer  PostPosted: Jun 12, 2006 - 08:37 PM



Joined: Dec 10, 2004
Posts: 597
Location: Schleswig-Holstein
slh wrote:
Debian verwendet einen Patch für vim, mit welchem das binary feststellt unter welchem Namen es aufgerufen wurde


Irgendsoeinen "Mist" habe ich ja befürchtet :-/
alias vi=vim

_________________
Linux-Userin #213445
LastFM-Musikstatistik für Kanoten
Kanotix, siduction, Kubuntu, antiX
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
 
Deutsch | English
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2004 - 2006 by Jörg Schirottke (Kano).
Consult Impressum and Legal Terms for details. Kanotix is Free Software released under the GNU/GPL license.
This CMS is powered by PostNuke, all themes used at this site are released under the GNU/GPL license. designed and hosted by w3you. Our web server is running on Kanotix64-2006.