Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 13/06/2008, à 10:04

Solaris974

[RESOLU] VIM Ubuntu 8.04 avoir <utilisateur>@<machine>: en couleurs

Bonjour tout le monde!

J'ai pas trouver de sujet parlant de ca, j'ai peut-être mal chercher mais bon voila ca fait un bout de temps que je trouve pas donc je viens "nous" voir un peu hein! wink la communauté! big_smile


Donc voila, dans les versions 7.10 de ubuntu on pouvait mettre dans la console, la partie <utilisateur>@<machine>: en couleur, ce qui était bien pratique lorsqu'un avait beaucoup de code dans une console pour s'y retrouver!
Mais malheureusement depuis mon passage à la 8.04 je ne trouve plus l'option dans le fichier .bashrc sad

Donc si quelqu'un saurait comment faire ca? tongue
Je précise j'utilise gnome-terminal sous Kubuntu big_smile

Merci bien!

Dernière modification par Solaris974 (Le 01/09/2008, à 18:27)


« La Terre est le berceau de l'humanité... Mais passe-t-on sa vie entière dans un berceau ? »

Quad-core i5 3,4Ghz  / 16Go DDR3  /  nVidia GTX 660 2Go OC  /  SSD OCZ Agility 4 256Go

Hors ligne

#2 Le 14/06/2008, à 13:04

Solaris974

Re : [RESOLU] VIM Ubuntu 8.04 avoir <utilisateur>@<machine>: en couleurs

Configuration du fichier .bashrc :

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize histverify

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

#if [ -n "$force_color_prompt" ]; then
#    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
	# We have color support; assume it's compliant with Ecma-48
	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	# a case would tend to support setf rather than setaf.)
#	color_prompt=yes
#    else
#	color_prompt=
#    fi
#fi

color_prompt="yes"

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.


#### Suite à modifier selon vous même ####

Dernière modification par Solaris974 (Le 01/09/2008, à 18:32)


« La Terre est le berceau de l'humanité... Mais passe-t-on sa vie entière dans un berceau ? »

Quad-core i5 3,4Ghz  / 16Go DDR3  /  nVidia GTX 660 2Go OC  /  SSD OCZ Agility 4 256Go

Hors ligne