-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
118 lines (99 loc) · 3.11 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
" Bundles
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
Bundle 'shougo/vimproc.vim'
Bundle "Shougo/deoplete.nvim"
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
Bundle 'lokaltog/vim-easymotion'
Bundle 'eagletmt/ghcmod-vim'
Bundle 'scrooloose/syntastic'
Bundle 'bling/vim-airline'
Bundle 'SirVer/ultisnips'
Bundle 'honza/vim-snippets'
Bundle 'junegunn/vim-easy-align'
Bundle 'Chiel92/vim-autoformat'
Bundle 'shougo/unite.vim'
Bundle 'raimondi/delimitMate'
Bundle 'maksimr/vim-jsbeautify'
filetype plugin indent on
" Leader
let mapleader=','
let maplocalleader=','
" Sync pastebuffers
if has ('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
end
" Plugin settings
" let g:ycm_key_list_select_completion = ['<Down>']
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:syntastic_c_check_header = 1
let g:syntastic_java_javac_config_file_enabled = 1
let g:airline_powerline_fonts=1
" General options
syntax on
set number
set autoindent
set smartindent
set encoding=utf-8
set backspace=indent,eol,start
set scrolloff=8 "keep 8 lines below/above cursor
" Trailing whitespaces
set list
set listchars=tab:\ \ ,trail:·
" Indenting settings
set expandtab " use spaces for indentation
set shiftround " round space shifts
set tabstop=4 " 1 tab == 4 spaces
set shiftwidth=4
set softtabstop=4
"" Fixes ailine
set laststatus=2
" Backups and undo
set backupdir=~/.vim/tmp/backup/ " backups
set directory=~/.vim/tmp/swap/ " swap files
set backup " enable backups
set backupskip=/tmp/*,/private/tmp/*"
" Language specific indenting
autocmd FileType html setlocal shiftwidth=2 softtabstop=2
autocmd FileType haml setlocal shiftwidth=2 softtabstop=2
autocmd FileType css setlocal shiftwidth=2 softtabstop=2
autocmd FileType scss setlocal shiftwidth=2 softtabstop=2
autocmd FileType ruby setlocal shiftwidth=2 softtabstop=2
autocmd FileType coffee setlocal shiftwidth=2 softtabstop=2
autocmd FileType js setlocal shiftwidth=1 softtabstop=1
autocmd FileType hs setlocal shiftwidth=8 softtabstop=8 tabstop=8
" Keep selection after indenting
vnoremap > >gv
vnoremap < <gv
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" edit and source vimrc easily
nnoremap <leader>ev :vsplit $MYVIMRC<CR>
" rewrite file with sudo
cmap w!! w !sudo tee % >/dev/null
" toggle nerdtree
nnoremap <leader>n :NERDTreeToggle<CR>
" autoformat
nnoremap <leader>f :Autoformat<CR>
autocmd FileType javascript noremap <buffer> <leader>f :call JsBeautify()<cr>
" unite
nnoremap <leader>o :<C-u>Unite -no-split -buffer-name=files -start-insert file<cr>
" Tab completion
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
" Colorscheme
set t_Co=256
syntax enable
colorscheme seoul256