-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.keymap
133 lines (109 loc) · 3.98 KB
/
vimrc.keymap
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
" ---start buffer related mappings ---
" press tab to switch to new buffer
:nnoremap <Tab> :bnext<CR>
" press shift+tab to switch to previous buffer
:nnoremap <S-Tab> :bprevious<CR>
" press Cmd + x to close a buffer
:nnoremap <C-x> :bdelete<CR>
" ---end buffer related mappings ---
" quit vim without saving by pressing Cmd + q
:nnoremap <C-q> :q!<CR>
" save file by pressing Esc key twice
:nnoremap <Esc><Esc> :w<CR>
" set leader key to space
let mapleader = "\<Space>"
" currently, not working
nmap <S-CR> O<Esc>
" press enter key to create a new line below and maintain normal mode
nmap <CR> o<Esc>
nmap <Leader>p "+p
nmap <Leader>y "+yy
" invoke vimux
map <Leader>vp :VimuxPromptCommand<CR>
" vim-surround mappings
"let g:surround_no_mappings = 0
"nmap ds <Plug>Dsurround
"nmap hs <Plug>Csurround
"nmap ys <Plug>Ysurround
"nmap yS <Plug>YSurround
"nmap yss <Plug>Yssurround
"nmap ySs <Plug>YSsurround
"nmap ySS <Plug>YSsurround
"xmap S <Plug>VSurround
"xmap gS <Plug>VgSurround
"if !hasmapto("<Plug>Isurround","i") && "" == mapcheck("<C-S>","i")
"imap <C-S> <Plug>Isurround
"endif
"imap <C-G>s <Plug>Isurround
"imap <C-G>S <Plug>ISurround
" these are vim surround defaults
" surround a 'word' 'middle' "word" ... ysiw<surrounding letter>
" change a surround ...cs<oldsurround><newsurround>
"
" Start autocompletion after 4 chars
let g:ycm_min_num_of_chars_for_completion = 4
let g:ycm_min_num_identifier_candidate_chars = 4
let g:ycm_enable_diagnostic_highlighting = 0
" Don't show YCM's preview window [ I find it really annoying ]
set completeopt-=preview
let g:ycm_add_preview_to_completeopt = 0
" ycm autocompletion menu color
highlight Pmenu ctermfg=15 ctermbg=0 guifg=#ffffff guibg=#000000
highlight PmenuSel ctermfg=0 ctermbg=108 guibg=#ffffff guifg=#000000
"
" NERDTree Mapping
"let g:NERDTreeMapJumpNextSibling = '<C-S>'
"let g:NERDTreeMapJumpPrevSibling = '<C-T>'
"let g:NERDTreeMapJumpFirstChild = 'S'
"let g:NERDTreeMapJumpLastChild = 'T'
"let g:NERDTreeMapOpenVSplit = 'v'
"let g:NERDTreeMapOpenInTab = 'k'
"nmap <Leader>n :NERDTreeFind<CR>
"let g:AutoPairsShortcutToggle = 'C-E'
" always move cursor to the last line of yanked block
vmap y y`]
" EasyMotion mappings
map f <Plug>(easymotion-f)
map F <Plug>(easymotion-bd-f)
"map <Leader>é <Plug>(easymotion-w)
"map <Leader>É <Plug>(easymotion-bd-w)
"map <Leader>l <Plug>(easymotion-bd-jk)
map <Leader>/ <Plug>(easymotion-sn)
omap <Leader>/ <Plug>(easymotion-tn)
map e <Plug>(easymotion-next)
map E <Plug>(easymotion-prev)
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
" understand easy motion
filetype plugin indent on
let g:UltiSnipsSnippetsDir="~/.vim/plugged/vim-snippets/UltiSnips"
let g:UltiSnipsSnippetDirectories=["plugged/vim-snippets/UltiSnips"]
let g:UltiSnipsExpandTrigger = "<c-u>"
let g:UltiSnipsJumpForwardTrigger = "<c-f>"
let g:UltiSnipsJumpBackwardTrigger = "<c-space>"
let g:AutoPairsShortcutToggle = '<C-K>'
let g:NERDCustomDelimiters={
\ 'javascript': { 'left': '//', 'right': '', 'leftAlt': '{/*', 'rightAlt': '*/}' },
\}
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='codedark'
"let g:airline_theme='powerlineish'
set laststatus=2
set colorcolumn=80
"let g:user_emmet_install_global = 0
autocmd FileType html,css,js EmmetInstall
"let g:user_emmet_leader_key='<C-Z>'
"let g:user_emmet_leader_key='<,>'
let g:user_emmet_expandabbr_key = '<c-e>'
let g:user_emmet_settings = { 'javascript.jsx' : { 'extends' : 'jsx', }, }
let g:ale_sign_error = '●' " Less aggressive than the default '>>'
let g:ale_sign_warning = '.'
let g:ale_lint_on_enter = 0 " Less distracting when opening a new file
autocmd BufWritePost *.js AsyncRun -post=checktime ./node_modules/.bin/eslint --fix %
let g:deoplete#enable_at_startup = 1
let g:deoplete#file#enable_buffer_path = 1
let g:deoplete#enable_smart_case = 1