Browse Source

Add config files.

main
Titouan Rigoudy 7 years ago
parent
commit
53bce075ff
4 changed files with 159 additions and 2 deletions
  1. +29
    -2
      README.md
  2. +78
    -0
      config.vim
  3. +30
    -0
      prompt.sh
  4. +22
    -0
      tmux.conf

+ 29
- 2
README.md View File

@ -1,2 +1,29 @@
# dotfiles
Configuration files for a simple Linux dev environment.
# Setup
First, clone this repository into ~/dotfiles.
# Configure bash
Add the following to your .bashrc:
```sh
# Better prompt.
source ~/dotfiles/prompt.sh
```
# Configure vim
Install the jellybeans colorscheme, either by downloading jellybeans.vim into
.vim/colors/, or by installing a plugin manager and using it to install
jellybeans.
Then add the following to your .vimrc:
```
source ~/dotfiles/config.vim
```
# Configure tmux
Run the following command:
```sh
$ ln -s ~/dotfiles/tmux.conf .tmux.conf
```

+ 78
- 0
config.vim View File

@ -0,0 +1,78 @@
" Personalized vim config.
" Lots of stuff stolen from amix.dk's ultimate vimrc.
"
" Append the following line to your .vimrc to use this:
"
" source <path to this file>
"
" Visualization options.
" Always show the current cursor position.
set ruler
" Show the 80 character column.
set colorcolumn=80
" Show line numbers.
set number
" Show matching brackets when cursor hovers over them.
set showmatch
" Highlight search results.
set hlsearch
" Jump to search results as user types search query.
set incsearch
" Use a nice color scheme.
colorscheme jellybeans
" Formatting options.
" Use spaces instead of tabs.
set expandtab
" Be smart when using tabs ;)
set smarttab
" Tabs should look like 2 spaces.
set tabstop=2
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" Performance/misc options.
" Don't make annoying sounds on errors.
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Don't redraw while executing macros for performance.
set lazyredraw
" Set utf8 as standard encoding and en_US as the standard language.
set encoding=utf8
" Use Unix as the standard file type.
set ffs=unix,dos,mac
" Turn backup off, since most stuff is in SVN, git etc. anyway...
set nobackup
set nowb
set noswapfile
" Make moving around tabs and windows work like tmux.
" Normal mode shortcuts. We use nmap instead of nnoremap because there shouldn't
" be any difference anyway, colon commands should not map to something else.
nmap <C-w>c :tabnew<CR>
nmap <C-w>n :tabnext<CR>
nmap <C-w>p :tabprev<CR>
nmap <C-w>v :vsplit<CR>
nmap <C-w>h :split<CR>
" In insert mode, typing <C-w> will conveniently exit back to normal mode.
imap <C-w> <Esc><C-w>

+ 30
- 0
prompt.sh View File

@ -0,0 +1,30 @@
# Additional bash prompt configuration for interactive shells only.
function prompt () {
# Check for color support.
local boldblue=
local boldgreen=
local purple=
local nocolor=
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
boldblue="\[\e[1;34m\]"
boldgreen="\[\e[1;32m\]"
purple="\[\e[0;35m\]"
nocolor="\[\e[00m\]"
fi
local ps1="${boldgreen}\u@\h${nocolor}:${boldblue}\w ${purple}\D{%T}${nocolor} \$ "
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
ps1="\[\e]0;\u@\h: \w\a\]${ps1}"
;;
esac
echo "$ps1"
}
PS1=$(prompt)
unset -f prompt

+ 22
- 0
tmux.conf View File

@ -0,0 +1,22 @@
# Personalized settings for tmux.
# Usage:
#
# ln -s ~/.tmux.conf <path to this file>
#
# Map prefix to Ctrl-a instead of Ctrl-b.
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes with better keys.
unbind '"'
unbind %
bind v split-window -h
bind h split-window -v
# Enable 256 colors.
set -g default-terminal 'screen-256color'
# Enable vi-like key bindings for navigating around buffers.
set-window-option -g mode-keys vi

Loading…
Cancel
Save