mouse.vim 793 B

1234567891011121314151617181920212223242526
  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. " Mouse support enabled.
  11. set mouse=a
  12. " Toggle mouse support.
  13. nnoremap <silent> <leader>m :call ToggleMouse()<CR>
  14. function! ToggleMouse()
  15. if &mouse == 'a'
  16. set mouse=
  17. echo 'Mouse usage disabled'
  18. else
  19. set mouse=a
  20. echo 'Mouse usage enabled'
  21. endif
  22. endfunction