From d3c1fbdeb60f93bafce7e0b86f104cdfa7153bc4 Mon Sep 17 00:00:00 2001 From: Cacahuete Date: Sat, 26 Mar 2022 22:10:37 +0100 Subject: [PATCH] Commit initial. --- .bashrc | 116 +++++++++++++++++++++++++++++++++++++++++++++++++ .tmux.conf | 66 ++++++++++++++++++++++++++++ .vimrc | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 9 ++++ 4 files changed, 316 insertions(+) create mode 100644 .bashrc create mode 100644 .tmux.conf create mode 100644 .vimrc create mode 100644 README.md diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..5f2e6c9 --- /dev/null +++ b/.bashrc @@ -0,0 +1,116 @@ +# ~/.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 +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# 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|xterm-256color) 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 + +if [ "$color_prompt" = yes ]; then + PS1='| ${debian_chroot:+($debian_chroot)}\[\033[32m\]\u\[\033[37m\]@\[\033[31m\]\h\[\033[00m\]:\[\033[36m\]\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*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# 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. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +export TERM=xterm-256color + diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..897fcbb --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,66 @@ + +# Force 256 colors +set -g default-terminal "xterm-256color" + +bind r source-file ~/.tmux.conf \; display-message " Configuration rechargĂ©e" +bind c command-prompt -p " Nom de la nouvelle fenĂȘtre :" "new-window -n '%%'" + +# I'm better off with the defaults +#bind | split-window -h +#bind - split-window -v +#unbind '"' +#unbind % + + +################################################################################ +# Movements + +# Better moves between windows +bind -n C-Left select-window -p +bind -n C-Right select-window -n + +# Better moves between panes +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Vimify (a little) +set-window-option -g mode-keys vi +#bind -t vi-copy 'v' begin-selection +#bind -t vi-copy 'y' copy-selection +# TODO: Need to be able to copy to clipboard + + +################################################################################ +# Global behaviour tuning +#set -g monitor-activity on +#set -g visual-activity on +set -g base-index 1 +set -g pane-base-index 1 +set -g history-limit 10000 +set -g display-time 1000 + + +################################################################################ +# About the status bar +set -g status-style fg=black,bg=colour45 + +set -g status-justify centre +setw -g window-status-format '#[bg=colour27] #I #[bg=colour33] #W ' +setw -g window-status-current-format '#[bg=colour165] #I #[bg=colour201] #W ' +setw -g window-status-activity-style fg=colour124 + +set -g status-left '#[bg=colour27] #S #[bg=colour33] #h ' +set -g status-right '' # Could display date/time :) +set -g status-left-length 30 +set -g status-right-length 20 + + +################################################################################ +# Some more styling +set -g pane-border-style bg=default +set -g pane-border-style fg=white +set -g pane-active-border-style fg=cyan + + diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..cfc4222 --- /dev/null +++ b/.vimrc @@ -0,0 +1,125 @@ +" DISPLAY SETTINGS: + +" Display line numbers +set number + +"colorscheme desert +colorscheme slate + +" Show the 80th column (recent VIM) +set colorcolumn=80 + +" Enable complete folding of windows +set winminheight=0 + +" Split options +set splitbelow +set splitright + +" How to display invisible characters +set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< +noremap :set list! + +" Scroll by x cols when wrapping enabled +set sidescroll=1 +" Allways keep x cols around the cursor +set sidescrolloff=3 +" Toggle wrap mode +noremap :set wrap! + + +" SEARCH SETTINGS: + +set ignorecase + +" Highlight search results +set hlsearch + +" Search while typing +set incsearch + +" Press F3 to toggle highlighting on/off, and show current value. +":noremap :set hlsearch! hlsearch? +noremap :nohlsearch + + + +" EDITION SETTINGS: + +" Insert space for tab +set expandtab + +" One tab is x spaces +set tabstop=4 + +" Indentation is x spaces +set autoindent +set shiftwidth=4 + +" No automatic return carriage +set textwidth=0 + +" Allow for edition everywhere +"set virtualedit=all +noremap :set virtualedit=all +noremap :set virtualedit="" + + + + +" FROM INTERNET SETTINGS: + +" enter the current millenium +set nocompatible + +" enable syntax and plugins (for netrw) +syntax enable +filetype plugin on + + + +" FINDING FILES: + +" Search down into subfolders +" Provides tab-completion for all file-related tasks +set path+=** + +" Display all matching files when we tab complete +set wildmenu + +" NOW WE CAN: +" - Hit tab to :find by partial match +" - Use * to make it fuzzy + +" THINGS TO CONSIDER: +" - :b lets you autocomplete any open buffer + + + +" FILE BROWSING: + +" Tweaks for browsing +let g:netrw_banner=0 " disable annoying banner +"let g:netrw_browse_split=4 " open in prior window +let g:netrw_altv=1 " open splits to the right +let g:netrw_liststyle=3 " tree view +"let g:netrw_list_hide=netrw_gitignore#Hide() +"let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+' + +" NOW WE CAN: +" - :edit a folder to open a file browser +" - /v/t to open in an h-split/v-split/tab +" - check |netrw-browse-maps| for more mappings + + + +" SNIPPETS: + +" Read an empty HTML template and move cursor to title +nnoremap ,html :-1read $HOME/.vim/.skeleton.html3jwf>a + +" NOW WE CAN: +" - Take over the world! +" (with much fewer keystrokes) + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b53a30 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +Penser a supprimer les fichiers d'origine: + +`rm .vimrc .tmux.conf .bashrc` + + +Et a creer un lien symbolique pour chaque: + +`ln -s ~/config/.vimrc ~/.vimrc` +