-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
93 lines (72 loc) · 2.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
execute pathogen#infect()
filetype plugin indent on
set modeline
set modelines=5
set encoding=utf-8
set relativenumber
set number
set expandtab
set tabstop=2
set shiftwidth=2
" search
set ignorecase
set incsearch
set hlsearch
"mouse
set mouse=a
set mousemodel=extend
set clipboard=unnamedplus
:color cobalt
:hi Directory guifg=#FF0000 ctermfg=red
:highlight ExtraWhitespace ctermbg=darkgreen guibg=lightgreen
:autocmd ColorScheme * highlight ExtraWhitespace ctermbg=darkgreen guibg=lightgreen
:match ExtraWhitespace /\s\+$/
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled = 1
let g:ctrlp_extensions = ['tag']
noremap <F2> :NERDTreeToggle<CR>
set pastetoggle=<F3>
" fzf bindings
noremap <F4> :FZF<CR>
inoremap <F4> <esc>:w<CR>:FZF<CR>
" launch current file
nnoremap <F5> :!%:p<CR>
" ctrl+s make sure: stty -ioxn
noremap <silent> <C-S> :update<CR>
vnoremap <silent> <C-S> <C-C>:update<CR>
inoremap <silent> <C-S> <C-O>:update<CR>
" YouCompleteMe and UltiSnips compatibility, with the helper of supertab
" (via http://stackoverflow.com/a/22253548/1626737)
let g:SuperTabDefaultCompletionType = '<C-n>'
let g:SuperTabCrMapping = 0
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
let g:ycm_key_list_select_completion = ['<C-j>', '<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-k>', '<C-p>', '<Up>']
let mapleader = ","
noremap <leader>ev :vsp $MYVIMRC<CR>
noremap <leader>sv :source $MYVIMRC<CR>
" Move current line up or down
noremap <leader>- ddp
noremap <leader>+ ddkkp
" buffer management
noremap <leader>h :bp<CR>
noremap <leader>l :bn<CR>
noremap <leader>w :bd<CR>
" inoremap <esc> <nop>
inoremap jk <esc>
nnoremap <leader>g :set operatorfunc=GrepOperator<cr>g@
vnoremap <leader>g :<c-u>call GrepOperator(visualmode())<cr>
function! GrepOperator(type)
if a:type ==# 'v'
normal! `<v`>y
elseif a:type ==# 'char'
normal! `[v`]y
else
return
endif
silent execute "grep! -R " . shellescape(@@) . " ."
copen
" redraw!
endfunction