You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
4.0 KiB

set encoding=utf-8
set fileencoding=utf-8
10 years ago
set nocompatible
filetype off
" set the runtime path to include vundle and initialize
10 years ago
" *nix
10 years ago
set rtp+=~/.vim/bundle/Vundle.vim
10 years ago
call vundle#begin()
" let Vundle manage Vundle, required
10 years ago
Plugin 'gmarik/Vundle.vim'
" Solarized theme
" Plugin 'altercation/vim-colors-solarized'
" Nord theme
Plug 'arcticicestudio/nord-vim'
" Syntastic
Plugin 'scrooloose/syntastic'
" Git
10 years ago
Plugin 'tpope/vim-fugitive'
" Easy Commenting
Plugin 'tpope/vim-commentary'
" Surround - Easy changing of quotes and stuff
10 years ago
Plugin 'tpope/vim-surround'
" Ctrlp full path fuzzy file finder
10 years ago
Plugin 'kien/ctrlp.vim'
" Ack from vim
Plugin 'mileszs/ack.vim'
10 years ago
" Improved vim status bar
Plugin 'bling/vim-airline'
" Indent guides
Plugin 'Yggdroot/indentLine'
10 years ago
" Language specific syntax highlighting
Plugin 'derekwyatt/vim-scala'
Plugin 'kchmck/vim-coffee-script'
Plugin 'rust-lang/rust.vim'
if !has("win32") || !has("win16")
"Code Completion
Plugin 'Valloric/YouCompleteMe'
10 years ago
" Tree explorer
"Instead of forcing vim to start Nerdtree just do it manually
" autocmd vimenter * NERDTree " make NERDTree come up automatically
" on vim start
10 years ago
Plugin 'scrooloose/nerdtree'
10 years ago
" Make Vim play nice with tmux
" Use <c-h> <c-j> <c-k> <c-l>
" to move between window panes in tmux or vim
Plugin 'christoomey/vim-tmux-navigator'
endif
10 years ago
" Markdown
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
10 years ago
" Jade - Express templating
Plugin 'digitaltoad/vim-jade'
10 years ago
" Stylus highlighting
Plugin 'wavded/vim-stylus'
10 years ago
" Haskell
Plugin 'raichoo/haskell-vim'
10 years ago
" end plugin list
call vundle#end()
filetype plugin indent on
10 years ago
" Solarized Dark
syntax enable
set background=dark
colorscheme solarized
" let g:solarized_termcolors=256 " Better terminal colors
" Toggle solarized scheme
" call togglebg#map("<F5>")
" Standard variables
set expandtab " tabs to spaces
set tabstop=2 " spaces entered when tab key is pressed
set shiftwidth=2 " spaces entered for indentation
set number " Line numbering
set backspace=indent,eol,start " Make backspacing work right
10 years ago
set clipboard=unnamedplus " Share system clipboard
set eol " End of line at bottom of file
set shiftround
set hlsearch " Highlight matches in search
set incsearch " Search as characters are entered
set list
set list listchars=tab:»·,trail
" custom functons
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
set number
else
set relativenumber
endif
endfunc
" Autocmds
" Stripping trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
10 years ago
" Fix rust
autocmd FileType rust setlocal shiftwidth=2 tabstop=2
autocmd BufRead,BufNewFile *.rs set filetype=rust
10 years ago
" Disable the rust style guide recommended 4 space indentation
let g:rust_recommended_style=0
10 years ago
" Hotkeys
" Note noremap is a normal mode non-recursive mapping
" nnoremap and nmap make the bind only work in normal mode
let mapleader=" "
map <silent> <Leader>t :NERDTreeToggle<CR>
nnoremap <silent> <Leader>r :call NumberToggle()<CR>
" This one maps F5 to delete all trailing whitespace
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
10 years ago
" Pressing enter in command mode clears the current search highlighting until
" the next search.
nnoremap <silent> <CR> :noh<CR><CR>
10 years ago
" ctrlp hotkeys
let g:ctrlp_map='<c-p>'
let g:ctrlp_cmd='CtrlP'
10 years ago
" ctrlp configuration
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
10 years ago
let g:ctrlp_working_path_mode='ra'
" Highlight any line with ErrorMsg that goes over 120 characters
if exists('+colorcolumn')
set colorcolumn=120
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif
" Indent lines customizations
" Color customizations
" let g:indentLine_color_term=###
" Line indent guides are defaulted to off
let g:indentLine_enabled=0
" Leader + i will toggle line indent guides
map <silent> <Leader>i :IndentLinesToggle<CR>