mouse.vim 756 B

123456789101112131415161718192021222324
  1. """"""""
  2. "" UI - Mouse & Cursor
  3. """"""""""""""""""""""""""""""""""""""""""""""""""""""""
  4. " The following two settings are related to how vim reacts to the incoming $TERM
  5. " value from either the terminal emulator (e.g. iTerm2) or tmux. In the best
  6. " case, both of these should be set to xterm-256color. This will result in vim
  7. " reacting with the settings below:
  8. "set ttymouse=xterm2 " Needed to allow mouse support to resize windows
  9. "set ttyfast " Allows for instantaneous refresh when using the mouse to select
  10. " Toggle mouse support.
  11. nnoremap <silent> <leader>m :call ToggleMouse()<CR>
  12. function! ToggleMouse()
  13. if &mouse == 'a'
  14. set mouse=
  15. echo 'Mouse usage disabled'
  16. else
  17. set mouse=a
  18. echo 'Mouse usage enabled'
  19. endif
  20. endfunction