2015-03-16 06:00:25 +00:00
|
|
|
" global settings
|
|
|
|
set nocompatible
|
2013-10-26 08:07:26 +01:00
|
|
|
set noswapfile
|
2015-03-16 06:00:25 +00:00
|
|
|
set undofile
|
|
|
|
set undodir=$HOME/.vim/undo
|
2016-01-24 13:50:45 +00:00
|
|
|
set spell spelllang=en_gb
|
2015-09-23 15:49:46 +01:00
|
|
|
|
|
|
|
" buffers can be switched despite having changes
|
|
|
|
set hidden
|
|
|
|
|
2015-03-16 06:00:25 +00:00
|
|
|
" file settings
|
2013-10-26 08:07:26 +01:00
|
|
|
set encoding=utf-8
|
2013-10-09 09:59:38 +01:00
|
|
|
|
2013-11-27 17:38:14 +00:00
|
|
|
" key mappings
|
|
|
|
let mapleader = ","
|
2013-10-26 15:55:11 +01:00
|
|
|
nmap <leader>p :set paste!<CR>
|
2013-11-15 20:35:40 +00:00
|
|
|
nmap <leader>h :set hlsearch!<CR>
|
2016-05-15 21:16:29 +01:00
|
|
|
nmap <leader>t :wa <bar> :Make test<CR>
|
2015-09-23 15:49:46 +01:00
|
|
|
|
|
|
|
" navigate buffers by ctrl-b
|
|
|
|
nmap <C-b> :bprevious<CR>
|
|
|
|
|
2016-07-09 11:27:33 +01:00
|
|
|
" YCM
|
|
|
|
nnoremap <Leader>g :YcmCompleter GoTo<CR>
|
|
|
|
|
2013-11-27 17:38:14 +00:00
|
|
|
nnoremap ; :
|
|
|
|
|
2015-07-05 14:47:31 +01:00
|
|
|
" no cheating !
|
2013-11-27 17:38:14 +00:00
|
|
|
map <up> <nop>
|
|
|
|
map <down> <nop>
|
|
|
|
map <left> <nop>
|
|
|
|
map <right> <nop>
|
2013-11-15 20:35:40 +00:00
|
|
|
|
2015-07-05 14:47:31 +01:00
|
|
|
" for damaged keyboards
|
|
|
|
map <F1> <Esc>
|
|
|
|
imap <F1> <Esc>
|
|
|
|
|
2013-10-26 08:07:26 +01:00
|
|
|
" special chars
|
|
|
|
nmap <leader>l :set list!<CR>
|
|
|
|
set listchars=tab:▸\ ,eol:¬
|
|
|
|
highlight NonText guifg=#4a4a59
|
|
|
|
highlight SpecialKey guifg=#4a4a59
|
|
|
|
|
|
|
|
" tabs and spaces
|
|
|
|
set tabstop=4
|
|
|
|
set softtabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set expandtab
|
2013-10-09 13:13:37 +01:00
|
|
|
|
2016-05-15 21:16:29 +01:00
|
|
|
" plugins
|
2016-07-09 11:57:56 +01:00
|
|
|
|
|
|
|
filetype off
|
|
|
|
|
|
|
|
set rtp+=~/.vim/bundle/Vundle.vim
|
|
|
|
call vundle#begin()
|
|
|
|
|
|
|
|
Plugin 'VundleVim/Vundle.vim'
|
|
|
|
|
|
|
|
Plugin 'https://github.com/cyplo/vim-colors-solarized.git'
|
2016-07-09 12:21:42 +01:00
|
|
|
Plugin 'mileszs/ack.vim'
|
|
|
|
Plugin 'scrooloose/nerdtree.git'
|
|
|
|
Plugin 'scrooloose/syntastic.git'
|
|
|
|
Plugin 'wting/rust.vim'
|
|
|
|
Plugin 'sjl/splice.vim.git'
|
|
|
|
Plugin 'vim-airline/vim-airline'
|
2016-07-09 13:47:45 +01:00
|
|
|
Plugin 'vim-airline/vim-airline-themes'
|
2016-07-09 12:21:42 +01:00
|
|
|
Plugin 'timonv/vim-cargo'
|
|
|
|
Plugin 'kien/ctrlp.vim'
|
|
|
|
Plugin 'will133/vim-dirdiff'
|
|
|
|
Plugin 'tpope/vim-dispatch.git'
|
|
|
|
Plugin 'tpope/vim-fugitive.git'
|
2016-07-09 13:56:07 +01:00
|
|
|
Plugin 'tpope/vim-sensible'
|
2016-08-13 17:38:40 +01:00
|
|
|
Plugin 'tpope/vim-cucumber'
|
2016-07-09 12:21:42 +01:00
|
|
|
Plugin 'airblade/vim-gitgutter.git'
|
|
|
|
Plugin 'godlygeek/tabular'
|
|
|
|
Plugin 'plasticboy/vim-markdown'
|
2016-07-09 12:49:54 +01:00
|
|
|
Plugin 'Valloric/YouCompleteMe'
|
2016-07-09 12:21:42 +01:00
|
|
|
|
|
|
|
call vundle#end()
|
|
|
|
filetype plugin indent on
|
|
|
|
|
2016-08-20 09:21:24 +01:00
|
|
|
" line ending
|
|
|
|
set fileformats=unix,dos
|
|
|
|
|
2016-07-09 12:21:42 +01:00
|
|
|
" colours
|
2013-10-26 08:23:08 +01:00
|
|
|
set t_Co=256
|
|
|
|
syntax enable
|
|
|
|
set background=dark
|
2013-10-26 08:59:45 +01:00
|
|
|
highlight clear SignColumn
|
2013-10-26 08:23:08 +01:00
|
|
|
colorscheme solarized
|
|
|
|
|
2013-10-26 08:07:26 +01:00
|
|
|
" plugins: airline
|
2013-10-25 21:46:59 +01:00
|
|
|
let g:bufferline_echo = 0
|
2013-10-25 22:00:21 +01:00
|
|
|
let g:airline_powerline_fonts = 1
|
2013-10-26 07:43:09 +01:00
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
2013-10-26 07:48:07 +01:00
|
|
|
|
2016-05-15 21:59:29 +01:00
|
|
|
" plugins: rust
|
|
|
|
let g:rustfmt_autosave = 1
|
2013-10-26 08:07:26 +01:00
|
|
|
|
2016-01-13 11:25:34 +00:00
|
|
|
" plugins: ag/ack
|
|
|
|
if executable('ag')
|
|
|
|
let g:ackprg = 'ag --vimgrep'
|
|
|
|
endif
|
|
|
|
|
2013-10-26 08:07:26 +01:00
|
|
|
" appearance
|
2014-11-15 13:20:41 +00:00
|
|
|
set number
|
2013-10-26 08:07:26 +01:00
|
|
|
set relativenumber
|
|
|
|
set laststatus=2
|
|
|
|
set noshowmode
|
|
|
|
set showtabline=1 "only show tabline when more than 1 tab
|
2013-10-26 07:48:07 +01:00
|
|
|
|
2016-05-30 09:16:52 +01:00
|
|
|
" exclude quickfix from the buffers list
|
|
|
|
augroup qf
|
|
|
|
autocmd!
|
|
|
|
autocmd FileType qf set nobuflisted
|
|
|
|
augroup END
|
|
|
|
|
2014-02-11 14:17:04 +00:00
|
|
|
" vimdiff
|
|
|
|
set diffopt+=iwhite
|
|
|
|
set diffexpr=""
|