summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc30
1 files changed, 28 insertions, 2 deletions
diff --git a/vimrc b/vimrc
index 01479f9..ebfef5e 100644
--- a/vimrc
+++ b/vimrc
@@ -34,6 +34,7 @@ inoremap jj <ESC>
inoremap jk <ESC>
nnoremap o ox<BS>
nnoremap O Ox<BS>
+set pastetoggle=<F2>
function! ToggleHlsearch()
if &hlsearch
@@ -51,11 +52,13 @@ nnoremap <C-_> :call ToggleHlsearch()<cr>
hi Todo ctermbg=DarkGreen ctermfg=Black
-set expandtab
+"set expandtab
autocmd BufRead,BufNewFile *.cli setfiletype xml
+autocmd BufRead,BufNewFile *.bnf setfiletype bnf
"autocmd FileType c setlocal expandtab
autocmd FileType make set noexpandtab
-autocmd FileType cpp setlocal expandtab
+"autocmd FileType cpp setlocal expandtab
+autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType bitbake setlocal expandtab
autocmd FileType python setlocal expandtab
autocmd FileType haskell setlocal expandtab
@@ -87,3 +90,26 @@ highlight DiffAdd cterm=bold ctermfg=233 ctermbg=101 gui=none guifg=bg guibg
highlight DiffDelete cterm=bold ctermfg=175 ctermbg=175 gui=none guifg=bg guibg=Red
highlight DiffChange cterm=bold ctermfg=234 ctermbg=101 gui=none guifg=bg guibg=Red
highlight DiffText cterm=none ctermfg=242 ctermbg=0 gui=none guifg=bg guibg=Red
+
+let g:previousmode = 'i'
+function PushModeSwitchNormal() abort
+ let g:previousmode = mode()
+ " important: l so that we don't walk backward every time clutch is pushed
+ return "\<C-\>\<C-n>l"
+endfunction
+
+function PopMode() abort
+ return g:previousmode
+endfunction
+
+inoremap <expr> <F11> PushModeSwitchNormal()
+vnoremap <expr> <F11> PushModeSwitchNormal()
+xnoremap <expr> <F11> PushModeSwitchNormal()
+snoremap <expr> <F11> PushModeSwitchNormal()
+onoremap <expr> <F11> PushModeSwitchNormal()
+inoremap <F12> <Nop>
+vnoremap <F12> <Nop>
+xnoremap <F12> <Nop>
+snoremap <F12> <Nop>
+onoremap <F12> <Nop>
+nnoremap <expr> <F12> PopMode()