Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnab committed Feb 1, 2014
0 parents commit 73ca371
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bash_aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alias tmux="TERM=screen-256color-bce tmux"
9 changes: 9 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[user]
name = Ole Petter Bang
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
[github]
user = gnab
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*
!.bash_aliases
!.gitconfig
!.gitignore
!.gitmodules
!.tmux.conf
!.vim
!.vimrc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".vim/bundle/vundle"]
path = .vim/bundle/vundle
url = https://github.com/gmarik/vundle.git
15 changes: 15 additions & 0 deletions .tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use C-a instead of C-b as prefix key
unbind C-b
set -g prefix C-a

# Use vim style pane navigation
set-window-option -g mode-keys vi
unbind l
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R

# Make windows and panes 1-indexed
set -g base-index 1
set -g pane-base-index 1
2 changes: 2 additions & 0 deletions .vim/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bundle/*
!bundle/vundle
1 change: 1 addition & 0 deletions .vim/bundle/vundle
Submodule vundle added at f31aa5
116 changes: 116 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
" Reload ~/.vimrc after write
autocmd!
autocmd BufWritePost ~/.vimrc so ~/.vimrc


" GENERAL
" --------------------------------------------------------------------------

let mapleader = "," " Use , as leader
set hidden " Hide abandoned buffer (no unload)


" COMMAND LINE
" --------------------------------------------------------------------------

set wildmenu " Enhanced command-line completion
set wildmode=list:longest " - List all matches
set wildignore+=.git,node_modules " - Ignore folders in completion

" Browse command history with <c-j/k>
cmap <c-j> <down>
cmap <c-k> <up>

" UI
" --------------------------------------------------------------------------

set number " Show line numbers
set numberwidth=4 " Use 4 character wide line numbers
set ruler " Show ruler
set t_Co=256 " Use 256 colors
set background=dark " Background color
set showmatch " Show matching bracket
set linebreak " Use word-wrapping

syntax on " Enable syntax highlighting


" NAVIGATION
" --------------------------------------------------------------------------

set smartcase " Match all for lowercase pattern
set incsearch " Incremental search while typing
set scrolloff=10 " Lines above/below cursor

" Move up/down into wrapped lines
nnoremap j gj
nnoremap k gk
" Goto tab using <leader>1..9
for i in [1,2,3,4,5,6,7,8,9]
exec "map <leader>" . i . " :normal " . i . "gt<cr>"
endfor


" EDITING
" --------------------------------------------------------------------------

set autoindent " Copy indent when starting new line
set smartindent " Add indent, i.e. on line after {
set encoding=utf-8 " Use utf-8 encoding
set softtabstop=2 " Make a tab correspond to 2 spaces
set shiftwidth=2 " Make indents 2 spaces
set shiftround " Round indents to multiple of shiftwidth
set expandtab " Insert spaces instead of tabs

" Move line(s) up/down
nnoremap <c-k> mz:m-2<cr>`z
nnoremap <c-j> mz:m+<cr>`z
vnoremap <c-k> :m'<-2<cr>`>my`<mzgv`yo`z
vnoremap <c-j> :m'>+<cr>`<my`>mzgv`yo`z
" Don't exit visual mode when shifting
vnoremap < <gv2h
vnoremap > >gv2l
" Remove trailing spaces before save
autocmd BufWritePre * :%s/\s\+$//e

" Toggle paste mode
noremap <f4> :setlocal paste!<cr>
" Write buffer using <leader>w
nnoremap <leader>w :w<cr>
vnoremap <leader>w <esc>:w<cr>
inoremap <leader>w <esc>:w<cr>
" Replace word under cursor
nnoremap <leader>r :%s/\<<c-r><c-w>\>/

" VUNDLE CONFIGURATION
" --------------------------------------------------------------------------

filetype off " Disable filetype detection
set runtimepath+=~/.vim/bundle/vundle/ " Add Vundle path to run time path
call vundle#rc() " Load Vundle

" Configure Vundle itself
Bundle 'gmarik/vundle'

" Configure other bundles
Bundle 'kien/ctrlp.vim'
Bundle 'guns/vim-clojure-static'
Bundle 'xptemplate'
Bundle 'scrooloose/nerdcommenter'
Bundle 'scrooloose/syntastic'

filetype plugin indent on " Re-enable filetype detection


" BUNDLES CONFIGURATION
" --------------------------------------------------------------------------

let g:ctrlp_working_path_mode = 0 " Dont't manage working directory
let g:xptemplate_key = '<Tab>' " Use tab to expand templates

0 comments on commit 73ca371

Please sign in to comment.