1 " Commment one line (Controle /)
2 autocmd FileType vim nnoremap <buffer> <C-_> <Home>i" <esc>
3 autocmd FileType python nnoremap <buffer> <C-_> <Home>i# <esc>
4 autocmd FileType conf nnoremap <buffer> <C-_> <Home>i# <esc>
5 autocmd FileType dosini nnoremap <buffer> <C-_> <Home>i# <esc>
6 autocmd FileType sh nnoremap <buffer> <C-_> <Home>i# <esc>
7 autocmd FileType make nnoremap <buffer> <C-_> <Home>i# <esc>
8 autocmd FileType c nnoremap <buffer> <C-_> <Home>i// <esc>
9 autocmd FileType c nnoremap <buffer> <Leader>/ <Home>i/* <End> */<esc>
10 autocmd FileType cpp nnoremap <buffer> <C-_> <Home>i// <esc>
11 autocmd FileType html nnoremap <buffer> <C-_> <Home>i<!-- <End> --><esc>
12 autocmd FileType css nnoremap <buffer> <C-_> <Home>i/* <End> */<esc>
14 " Uncomment one line (Shift /)
15 autocmd FileType vim nnoremap <buffer> ? :s/^" /<CR>
16 autocmd FileType python nnoremap <buffer> ? :s/^# /<CR>
17 autocmd FileType conf nnoremap <buffer> ? :s/^# /<CR>
18 autocmd FileType dosini nnoremap <buffer> ? :s/^# /<CR>
19 autocmd FileType sh nnoremap <buffer> ? :s/^# /<CR>
20 autocmd FileType make nnoremap <buffer> ? :s/^# /<CR>
21 autocmd FileType c nnoremap <buffer> ? :s/^\/\/ /<CR>
22 autocmd FileType c nnoremap <buffer> <Leader>/ :s/^/* /<CR>:s/ */$/<CR>
23 autocmd FileType cpp nnoremap <buffer> ? :s/^\/\/ /<CR>
24 autocmd FileType html nnoremap <buffer> ? :s/^<!-- /<CR>:s/ -->$/<CR>
25 autocmd FileType css nnoremap <buffer> ? :s/^/* /<CR>:s/ */$/<CR>
27 " Commment selected lines (Controle /)
28 autocmd FileType vim vnoremap <buffer> <C-_> <Home><C-v>I" <esc><esc>
29 autocmd FileType python vnoremap <buffer> <C-_> <Home><C-v>I# <esc><esc>
30 autocmd FileType conf vnoremap <buffer> <C-_> <Home><C-v>I# <esc><esc>
31 autocmd FileType dosini vnoremap <buffer> <C-_> <Home><C-v>I# <esc><esc>
32 autocmd FileType sh vnoremap <buffer> <C-_> <Home><C-v>I# <esc><esc>
33 autocmd FileType make vnoremap <buffer> <C-_> <Home><C-v>I# <esc><esc>
34 autocmd FileType c vnoremap <buffer> <C-_> <Home><C-v>I// <esc><esc>
35 autocmd FileType cpp vnoremap <buffer> <C-_> <Home><C-v>I// <esc><esc>
37 " Uncomment selected lines (Shift /)
38 autocmd FileType vim vnoremap <buffer> ? :s/^" /<CR>
39 autocmd FileType python vnoremap <buffer> ? :s/^# /<CR>
40 autocmd FileType conf vnoremap <buffer> ? :s/^# /<CR>
41 autocmd FileType dosini vnoremap <buffer> ? :s/^# /<CR>
42 autocmd FileType sh vnoremap <buffer> ? :s/^# /<CR>
43 autocmd FileType make vnoremap <buffer> ? :s/^# /<CR>
44 autocmd FileType c vnoremap <buffer> ? :s/^\/\/ /<CR>
45 autocmd FileType cpp vnoremap <buffer> ? :s/^\/\/ /<CR>