-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc_map
69 lines (58 loc) · 1.65 KB
/
.vimrc_map
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
" Ctags configure
map <F11> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --exclude=.git --exclude=log --exclude=node_modules .<CR>
" quickfix configure
nmap <F6> :cn<cr>
nmap <F7> :cp<cr>
"strip all trailing whitespace in the current file
nnoremap <leader>w :%s/\s\+$//<cr>:let @/=''<CR>
" translation
" sudo pip install ici
nmap <Leader>y :!echo --==<C-R><C-w>==-- ;ici <C-R><C-W><CR>
" Keep screen at center
nnoremap <silent> n nzz
nnoremap <silent> N Nzz
nnoremap <silent> * *zz
nnoremap <silent> # #zz
nnoremap <silent> g* g*zz
" Keep selection after indent
vnoremap < <gv
vnoremap > >gv
set relativenumber number
au FocusLost * :set norelativenumber number
au FocusGained * :set relativenumber
autocmd InsertEnter * :set norelativenumber number
autocmd InsertLeave * :set relativenumber
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber number
else
set relativenumber
endif
endfunc
nnoremap <C-n> :call NumberToggle()<cr>
" Zooming toggle
function! s:ZoomToggle() abort
if exists('t:zoomed') && t:zoomed
execute t:zoom_winrestcmd
let t:zoomed = 0
else
let t:zoom_winrestcmd = winrestcmd()
resize
vertical resize
let t:zoomed = 1
endif
endfunction
command! ZoomToggle call s:ZoomToggle()
nnoremap <silent> <Leader>z :ZoomToggle<CR>
" w!! to sudo & write a file
cmap w!! w !sudo tee >/dev/null %
" Map ; to :
nnoremap ; :
" cmatrix
if !has("gui_running")
nmap mx :!cmatrix<cr>
endif
" Eclim
nnoremap <silent> <buffer> <leader>i :JavaImport<cr>
nnoremap <silent> <buffer> <cr> :JavaSearchContext<cr>
nnoremap <silent> <buffer> <leader>d :JavaDocSearch -x declarations<cr>