-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
87 lines (71 loc) · 1.76 KB
/
init.vim
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
" plugins
call plug#begin('~/.config/nvim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'tomasr/molokai'
Plug 'vim-pandoc/vim-pandoc'
Plug 'pgdouyon/vim-accio'
Plug 'bling/vim-airline'
Plug 'Valloric/YouCompleteMe'
Plug 'bfredl/nvim-ipy'
Plug 'rking/ag.vim'
Plug 'ensime/ensime-vim'
Plug 'kien/rainbow_parentheses.vim'
call plug#end()
" basic settings
syntax on
filetype plugin indent on
set encoding=utf-8
colorscheme molokai
set number
set cursorline
" tabs and spaces
set tabstop=4 " visual spaces per tab
set softtabstop=4 " number of inserted spaces per tab
set shiftwidth=4 " indent size
set expandtab " tabs are spaces
" for c
autocmd Filetype c setlocal ts=2 sts=2 sw=2
" for scala
autocmd Filetype scala setlocal ts=2 sts=2 sw=2
" search settings
set incsearch " incremental search
set hlsearch " highlight results
set ignorecase " case insensitive
set smartcase " unless query contains capitals
" movement
nnoremap j gj " move vertically by visual line
nnoremap k gk
" Relative numbering
function! NumberToggle()
if(&relativenumber == 1)
set nornu
set number
else
set rnu
endif
endfunc
" Toggle between normal and relative numbering.
nnoremap <leader>r :call NumberToggle()<cr>
inoremap jj <ESC>
let mapleader="\<Space>"
" airline
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
" let g:airline_powerline_fonts = 1
" ***
" files and buffers
" ***
set hidden
" nerdtree
map <silent> <C-n> :NERDTreeToggle<CR>
" ctrlp
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' " use ag
let g:ctrlp_match_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
nmap <leader>p :CtrlPBuffer<cr>
nmap <leader>bm :CtrlPMixed<cr>
nmap <leader>bs :CtrlPMRU<cr>
" open ag.vim
nnoremap <leader>a :Ag