dotfiles/.vimrc

114 lines
2.1 KiB
VimL
Raw Normal View History

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
" 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>
nmap <leader>t :wa <bar> :Make test<CR>
" 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 ; :
" 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
" 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
" 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'
Plugin 'timonv/vim-cargo'
Plugin 'kien/ctrlp.vim'
Plugin 'will133/vim-dirdiff'
Plugin 'tpope/vim-dispatch.git'
Plugin 'tpope/vim-fugitive.git'
Plugin 'airblade/vim-gitgutter.git'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
call vundle#end()
filetype plugin indent on
" 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
let g:airline#extensions#tabline#enabled = 1
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
" 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=""