1
0
Fork 0

move togglemouse into vimrc, fix compatibility

This commit is contained in:
Von Random 2017-03-06 12:10:51 +03:00
parent 4aaedf640e
commit 254d449118
2 changed files with 21 additions and 8 deletions

View file

@ -14,7 +14,6 @@ Plug 'ervandew/supertab'
Plug 'jeetsukumaran/vim-buffergator' Plug 'jeetsukumaran/vim-buffergator'
Plug 'junegunn/vim-easy-align' Plug 'junegunn/vim-easy-align'
Plug 'mhinz/vim-signify' Plug 'mhinz/vim-signify'
Plug 'nvie/vim-togglemouse'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-sleuth' Plug 'tpope/vim-sleuth'
Plug 'vimwiki/vimwiki' Plug 'vimwiki/vimwiki'
@ -35,9 +34,6 @@ call plug#end()
let g:signify_vcs_list=[ 'git', 'fossil' ] let g:signify_vcs_list=[ 'git', 'fossil' ]
let g:signify_sign_change='~' let g:signify_sign_change='~'
" vim-togglemouse options
nmap <Leader>m <F12>
" easy-align options " easy-align options
xmap <Leader>a <Plug>(EasyAlign) xmap <Leader>a <Plug>(EasyAlign)
nmap <Leader>a <Plug>(EasyAlign) nmap <Leader>a <Plug>(EasyAlign)

25
vimrc
View file

@ -1,6 +1,6 @@
" various settings " various settings
set nobackup number nomodeline cursorline backspace=indent,eol,start set nobackup number nomodeline cursorline backspace=indent,eol,start
set formatoptions+=j foldmethod=marker ttymouse=xterm2 mouse= set foldmethod=marker ttymouse=xterm2 mouse=
" hidden characters " hidden characters
set list listchars=tab:\|_,nbsp:x,trail:* set list listchars=tab:\|_,nbsp:x,trail:*
" search " search
@ -20,11 +20,10 @@ set statusline=[%F]\ %R%H%W%M\ %=[%{&fenc}/%{&ff}]\ %y\ [%4l/%L:%3v]
let g:sh_indent_case_labels=1 let g:sh_indent_case_labels=1
" version specific settings " version specific settings
if v:version >= 703 if v:version >= 703
set colorcolumn=80 relativenumber set colorcolumn=80 relativenumber formatoptions+=j
endif endif
if v:version >= 800 if v:version >= 800
set breakindent set breakindent keymap=russian-jcukenwintype iminsert=0 imsearch=0
set keymap=russian-jcukenwintype iminsert=0 imsearch=0
inoremap <C-@> <C-^> inoremap <C-@> <C-^>
cnoremap <C-@> <C-^> cnoremap <C-@> <C-^>
inoremap <C-Space> <C-^> inoremap <C-Space> <C-^>
@ -68,6 +67,24 @@ nnoremap qa :qa<CR>
nnoremap qs :wq<CR> nnoremap qs :wq<CR>
nnoremap <Leader>s :w<CR> nnoremap <Leader>s :w<CR>
" mouse toggle
fun! s:ToggleMouse()
if !exists("s:old_mouse")
let s:old_mouse = "a"
endif
if &mouse == ""
let &mouse = s:old_mouse
echo "mouse enabled (" . &mouse . ")"
else
let s:old_mouse = &mouse
let &mouse=""
echo "mouse disabled"
endif
endfunction
noremap <Leader>m :call <SID>ToggleMouse()<CR>
inoremap <Leader>m <Esc>:call <SID>ToggleMouse()<CR>a
" plugins " plugins
let plugins = expand("$HOME/.vimplugins") let plugins = expand("$HOME/.vimplugins")
if filereadable(plugins) && v:version >= 703 if filereadable(plugins) && v:version >= 703