Permalink
Browse files

bash and vim settings

  • Loading branch information...
gabesoft committed May 15, 2011
1 parent 6eb3f19 commit 39ffca00f63dac4a2cdae041a4679e4f9deb8e36
Showing with 308 additions and 0 deletions.
  1. +61 −0 .bashrc
  2. +247 −0 .vimrc
View
61 .bashrc
@@ -0,0 +1,61 @@
+# .bashrc
+
+# User specific aliases and functions
+
+# delete
+alias rm='rm -i'
+alias rf='rm -f'
+alias rr='rm -f -r'
+
+# copy move
+alias cp='cp -i'
+alias mv='mv -i'
+
+# list directory
+alias ll='ls -hl'
+alias la='ls -a'
+alias lla='ls -lah'
+
+# disk usage
+alias df='df -h'
+
+# tar
+alias untar='tar xvzf'
+
+# version
+alias ver='cat /etc/redhat-release'
+
+alias aliases="cat ~/.bashrc | egrep 'alias*'" # list all aliases
+alias colors="set | egrep 'COLOR_\w*'" # lists all the colors
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+ . /etc/bashrc
+fi
+
+# colors
+export TERM=xterm-color
+export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
+export CLICOLOR=1
+export LSCOLORS=Exfxcxdxbxegedabagacad
+
+export COLOR_NC='\033[0m' # No Color
+export COLOR_WHITE='\033[1;37m'
+export COLOR_BLACK='\033[0;30m'
+export COLOR_BLUE='\033[0;34m'
+export COLOR_LIGHT_BLUE='\033[1;34m'
+export COLOR_GREEN='\033[0;32m'
+export COLOR_LIGHT_GREEN='\033[1;32m'
+export COLOR_CYAN='\033[0;36m'
+export COLOR_LIGHT_CYAN='\033[1;36m'
+export COLOR_RED='\033[0;31m'
+export COLOR_LIGHT_RED='\033[1;31m'
+export COLOR_PURPLE='\033[0;35m'
+export COLOR_LIGHT_PURPLE='\033[1;35m'
+export COLOR_BROWN='\033[0;33m'
+export COLOR_YELLOW='\033[1;33m'
+export COLOR_GRAY='\033[1;30m'
+export COLOR_LIGHT_GRAY='\033[0;37m'
+
+
+
View
247 .vimrc
@@ -0,0 +1,247 @@
+" ':so %' to reload this settings file from vim
+" keyword completion <C-N> or <C-P>
+" trace back <C-o>, trace forward <C-i>
+" close current buffer :bd
+
+" plugins
+" zoomwin: http://www.vim.org/scripts/script.php?script_id=508
+" command-t: https://github.com/wincent/Command-T
+" nerd-tree: https://github.com/scrooloose/nerdtree
+" nerd-commenter: http://www.vim.org/scripts/script.php?script_id=1218
+" zen-coding: http://www.vim.org/scripts/script.php?script_id=2981
+" l9-library: http://www.vim.org/scripts/script.php?script_id=3252
+" fuzzy-finder: http://www.vim.org/scripts/script.php?script_id=1984
+
+" font
+if has("win32")
+ set gfn=Monaco:h10:cANSI
+else
+ set gfn=Monaco\ 12
+endif
+
+" colors
+set background=dark
+" highlight syntax
+syntax on
+" http://blog.toddwerth.com/entry_files/8/ir_black.vim
+color ir_black
+
+" allow hide unsaved buffers
+set hidden
+
+let mapleader=","
+
+" show line numbers
+set number
+
+" status bar
+set ruler
+set showcmd
+
+" set output encoding (as opposed to fileencoding)
+set encoding=utf-8
+
+" whitespace settings
+set nowrap
+set linebreak " wrap at word
+set tabstop=2
+set shiftwidth=2
+set softtabstop=2
+set expandtab
+set list listchars=tab:\ \ ,trail:-,eol:$
+
+" indenting
+set ai " auto indent of a new line
+set si " smart indent
+
+" toggle text wrap
+map <C-F5> :set nowrap! <CR>
+
+" search settings
+set hlsearch
+set incsearch
+set ignorecase
+set smartcase
+
+" search and replace
+" :%s/term/repl/flags (g,c,i,I)
+" g=global, c=ask for confirmation, i=case insensitive, I=case sensitive
+" more info http://vim.wikia.com/wiki/Search_and_replace
+map <M-/> :%s/
+
+" tab completion
+set wildmode=list:longest,list:full
+set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
+
+" status bar (0=never, 1=default, 2=always)
+set laststatus=2
+
+" toggle menu and toolbar
+map <silent> <C-F2> :if &go=~#'T'<Bar>set go-=T<Bar>set go-=m<Bar>else<Bar>set go+=T<Bar>set go+=m<Bar>endif<CR>
+
+" gui options
+set guioptions=aegirLt
+
+" remap backquote for marks
+" mark with m_, recall witn '_ where _ can be any letter
+" uppercase for global, lowercase for local
+nnoremap ' `
+nnoremap ` '
+
+" jj = <esc>
+imap jj <Esc>
+
+" scroll speed"
+nnoremap <C-e> 3<C-e>
+nnoremap <C-y> 3<C-y>
+
+" enter a new line by pressing enter (in command mode)
+map <CR> o<Esc>
+map <S-CR> O<Esc>
+
+" sets what is saved when saving a session
+set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize
+
+" enable plugins
+set nocp
+filetype plugin on
+
+" omni completion
+set ofu=syntaxcomplete#Complete
+autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
+autocmd FileType python set omnifunc=pythoncomplete#Complete
+autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
+autocmd FileType css set omnifunc=csscomplete#CompleteCSS
+autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
+autocmd FileType php set omnifunc=phpcomplete#CompletePHP
+autocmd FileType c set omnifunc=ccomplete#Complete
+autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
+
+set history=1000
+set undofile
+
+" make sure that max lines are displayed
+set colorcolumn=80,120
+hi ColorColumn guibg=#2d2d2d
+
+" directories
+set backupdir=~/.vim/tmp " backup directory
+set backup " enable backup
+set undodir=~/.vim/tmp " undo directory
+set directory=~/.vim/tmp " swap directory
+
+runtime macros/matchit.vim
+set wildmenu
+set title
+set scrolloff=3
+set backspace=indent,eol,start
+
+" file settings
+" to show current filetype use ':set filetype'
+filetype on
+filetype indent on
+filetype plugin indent on
+
+map <leader>s :set nolist!<CR>
+
+" remove search highlighting
+map <leader>g :silent :nohlsearch<CR>
+
+set noerrorbells
+set mousehide
+map H ^
+map L $
+nnoremap <F6> :buffers<CR>:buffer<Space>
+
+" move between windows
+map <leader>k :wincmd k<CR>
+map <leader>j :wincmd j<CR>
+map <leader>h :wincmd h<CR>
+map <leader>l :wincmd l<CR>
+
+" multiple windows when created are equal in size
+set equalalways
+set splitbelow splitright
+
+" vertical and horizontal split then hop to a new buffer
+" ,H = new horizontal window
+" ,V = new vertical window
+:noremap <leader>V :vsplit<CR>
+:noremap <leader>H :split<CR>
+
+" ,p = go to previous buffer
+map <leader>p <C-^>
+
+" open current buffer in a new tab
+nmap te :tabedit %<CR>
+" close current tab
+nmap td :tabclose<CR>
+
+" resize horizontal windows with +-
+map - <C-W>-
+map + <C-W>+
+" resize vertical windows with ALT-SHIFT <>
+map <M-<> <C-W><
+map <M->> <C-W>>
+
+" wrap a selected block of text
+vnoremap qs <Esc> `>a'<Esc>`<i'<Esc>
+vnoremap qd <Esc> `>a"<Esc>`<i"<Esc>
+vnoremap qp <Esc> `>a)<Esc>`<i(<Esc>
+
+" abbreviations
+iab tihs this
+
+" hard to type
+imap aa @
+
+" -- plugin settings --
+
+" ,, = maximize active buffer
+" ,n = toggle nerd tree
+" ,t = fuzzy find files with command-t
+" ,b = fuzzy find buffers with command-t
+" ,f = fuzzy find files with fuzzy-finder
+" ,B = fuzzy find buffers with fuzzy-finder
+" CTRL-t = zen-coding expand
+
+" nerd-tree settings
+let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
+map <leader>n :NERDTreeToggle<CR>
+
+" nerd-commenter settings
+" map <leader>c :call NERDComment(0, "toggle")<CR>
+
+" command-t settings
+let g:CommandTMaxHeight=20
+let g:CommandTAlwaysShowDotFiles=1
+nmap <leader>t :CommandT<CR>
+nmap <leader>b :CommandTBuffer<CR>
+
+" fuzzy-finder settings
+nmap <leader>f :FufFile<CR>
+nmap <leader>B :FufBuffer<CR>
+
+" toggle maximize active buffer
+map <leader><leader> :ZoomWin<CR>
+
+" zen-coding pluggin settings
+let g:user_zen_expandabbr_key='<c-t>'
+let g:use_zen_complete_tag=1
+let g:user_zen_settings = {
+ \ 'php' : {
+ \ 'extends' : 'html',
+ \ 'filters' : 'c',
+ \ },
+ \ 'xml' : {
+ \ 'extends' : 'html',
+ \ },
+ \ 'haml' : {
+ \ 'extends' : 'html',
+ \ }
+ \}
+
+" -- ruby settings --
+compiler ruby
+map <F5> :!ruby %<CR>
+

0 comments on commit 39ffca0

Please sign in to comment.