Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:configs [2006/12/15 12:53]
cyril created
linux:configs [2016/02/19 16:35] (current)
cyril [Your own locale]
Line 1: Line 1:
 ====== Configuration of some software ====== ====== Configuration of some software ======
 +===== Linux =====
 +
 +==== Your own locale ====
 +
 +Maybe you don't like any predefined locale ; it was my case.
 +
 +[[http://crteknologies.fr/wiki/lib/exe/fetch.php?media=linux:en_fr_euro.txt|Here]] you can find a "en_FR@euro" locale that I have defined :
 +
 +  * English messages (because french messages are often strangely translated, and there is less information on the internet)
 +  * "yyyy/mm/dd hh:mm:ss" date format, because it is logical, and alphanumerical sort is date sort !
 +  * "." as decimal separator, because even French people do not write "," with a keyboard ...
 +  * " " (space) as thousands separator, because it is the French standard, and not so bad
 +  * French monetary (except decimal and thousands separators)
 +  * French for other features (telephone, address, measurement etc)
 +
 +Rename the file to "en_FR@euro", and copy it in ''/usr/share/i18n/locales'' (you will find there all other locales, and you can look at it to make your own locale).
 +
 +Add "en_FR@euro ISO-8859-15" (or UTF8) to ''/etc/locale.gen'', and run ''locale-gen''.
 +
 +Now you can use the ''en_FR@euro.ISO-8859-15'' locale by exporting LC_ALL environment variable in your bashrc or zshrc or zshenv file, or even in ''/etc/env.d/02locale'' to set it for all users.
  
 ===== ZSH ===== ===== ZSH =====
 +==== Config files ====
 +
 +As for all shells, there are several configuration files, loaded in the order :
 +<code>
 +.zshenv    --> always loaded, first
 +.zprofile  --> loaded if login shell
 +.zshrc     --> loaded if interactive shell
 +.zlogin    --> loaded when a user logins
 +.zlogout   --> loaded when a user logouts
 +</code>
 +
 +
 +
 +==== Prompt ====
  
 A nice prompt which prints only the two first and two last folder names of the current path (instead of the whole path or only the last folder) : A nice prompt which prints only the two first and two last folder names of the current path (instead of the whole path or only the last folder) :
  
 <code bash> <code bash>
-export PS1="%{^[[33;39;1m%}%T%{^[[0m%} %{^[[33;31;1m%}%n%{^[[0m^[[33;31;1m%}@%{^[[33;39;1m%}%m %{^[[33;31;1m%}%(5~|%-2~..%2~|%~)%{^[[0m^[[33;31;1m%}%#%{^[[0m%} "+if [ "`id -u`" -eq 0 ]; then 
 +# root prompt : blue 
 +  export PS1="%{^[[33;39;1m%}%T%{^[[0m%} %{^[[33;34;1m%}%n%{^[[0m^[[33;34;1m%}@%{^[[33;39;1m%}%m %{^[[33;34;1m%}%(5~|%-2~..%2~|%~)%{^[[0m^[[33;34;1m%}%#%{^[[0m%} " 
 +else 
 +# user prompt : red 
 +  export PS1="%{^[[33;39;1m%}%T%{^[[0m%} %{^[[33;31;1m%}%n%{^[[0m^[[33;31;1m%}@%{^[[33;39;1m%}%m %{^[[33;31;1m%}%(5~|%-2~..%2~|%~)%{^[[0m^[[33;31;1m%}%#%{^[[0m%} " 
 +fi
 </code> </code>
 +
 +It gives something like :
 +<code>
 +17:59 cyril@cyrilr /mnt/fat..5_Archi/annales%
 +</code>
 +
 +==== Use the directory stack ====
 +
 +Zsh permits to use the directory stack very easily, in ''zshrc'' :
 +<code bash>
 +alias d='popd'            # simple alias
 +setopt auto_pushd         # auto pushd with cd
 +setopt pushd_ignore_dups  # ignore double names of the same directory
 +setopt pushd_silent       # don't print the directory when popd or pushd
 +</code>
 +
 +Then you can type ''d'' as many times you want to move back all ''cd'' you've done.
 +
 +==== History size ====
 +
 +It is always painful to lose what you have typed in your shell 20 lines above. You can tune it in ''zshrc'' :
 +
 +<code>
 +export HISTORY=500
 +export HISTSIZE=500
 +export SAVEHIST=500
 +</code>
 +
 +
 +==== Key bindings ====
 +
 +In order to use //navigation// keys, still in ''zshrc'' :
 +
 +<code>
 +bindkey '^A'    beginning-of-line       # Home
 +bindkey '^E'    end-of-line             # End
 +bindkey '^D'    delete-char             # Del
 +bindkey '^[[3~' delete-char             # Del
 +bindkey '^[[2~' overwrite-mode          # Insert
 +bindkey '^[[5~' history-search-backward # PgUp
 +bindkey '^[[6~' history-search-forward  # PgDn
 +
 +bindkey '\e[7~' beginning-of-line       # Home mrxvt
 +bindkey '\e[8~' end-of-line             # End mrxvt
 +
 +bindkey '^[[1~' beginning-of-line       # Home rxvt
 +bindkey '^[[4~' end-of-line             # End rxvt
 +
 +bindkey '^[[H'  beginning-of-line       # Home xterm
 +bindkey '^[[F'  end-of-line             # End xterm
 +</code>
 +
 +
 +
 +
 +==== Aliases ====
 +
 +Still in ''zshrc'' :
 +
 +<code bash>
 +### ls
 +alias ll='ls -l'
 +alias la='ls -a'
 +alias lla='ls -la'
 +
 +### misc
 +alias c='clear'
 +alias less='less --quiet'
 +alias s='cd ..'
 +alias d='popd'
 +
 +### df & du
 +alias df='df --human-readable'
 +
 +# sorted du in one pass
 +alias du='du -a -x --max-depth=1 --human-readable > /mnt/ram/dunosort ;
 + cat /mnt/ram/dunosort | grep -v -E "^[0123456789\.]+[KMG]\>" | sort -n > /mnt/ram/dusort ;
 + cat /mnt/ram/dunosort | grep -E "^[0123456789\.]+[K]\>" | sort -n >> /mnt/ram/dusort ;
 + cat /mnt/ram/dunosort | grep -E "^[0123456789\.]+[M]\>" | sort -n >> /mnt/ram/dusort ;
 + cat /mnt/ram/dunosort | grep -E "^[0123456789\.]+[G]\>" | sort -n >> /mnt/ram/dusort ;
 + cat /mnt/ram/dusort'
 +
 +# sorted du in two pass
 +#alias du='du -a -x --max-depth=1 -b > /mnt/ram/duab.list; 
 +# du -a -x --max-depth=1 --human-readable > /mnt/ram/dua.list;  
 +# paste /mnt/ram/duab.list /mnt/ram/dua.list | sort -n | cut --fields=3,4'
 +</code>
 +
  
 ===== MRXVT ===== ===== MRXVT =====
 +==== History size ====
  
 +It is always painful to lose what you have typed in your shell 20 lines above. You can tune it in ''mrxvtrc'' :
  
 +<code>
 +mrxvt.saveLines:        10000
 +</code>
  
 +==== Appearence ====
 +
 +<code>
 +mrxvt.showMenu:         False
 +mrxvt.background:       black
 +mrxvt.foreground:       white
 +mrxvt.scrollbarStyle:   plain
 +mrxvt.itabBackground:   grey
 +mrxvt.scrollColor:      white
 +mrxvt.troughColor:      grey
 +mrxvt.tabBackground:    white
 +</code>
 +
 +==== Shortcuts ====
 +
 +<code>
 +Mrxvt.macro.Shift+Left: GotoTab -1
 +Mrxvt.macro.Shift+Right:   GotoTab +1
 +Mrxvt.macro.Primary+Shift+Return:       Esc \ec
 +Mrxvt.macro.Ctrl+t:   NewTab
 +Mrxvt.macro.Ctrl+Shift+w:  Close 0
 +</code>
 +
 +==== Other tunings ====
 +
 +<code>
 +mrxvt.syncTabTitle:     False
 +mrxvt.syncTabIcon:      False
 +</code>
linux/configs.1166187188.txt.gz · Last modified: 2013/09/19 16:42 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0