Loading ...
Sorry, an error occurred while loading the content.

63740Re: making Home, End, PgUp and PgDn keys useful in all modes

Expand Messages
  • Robert Cussons
    Dec 1, 2005
    • 0 Attachment
      A. J. Mechelynck wrote:

      >Justin Randall wrote:
      >
      >
      >>Thanks a lot A.J. you were right it was my terminal emulator that's
      >>not mapping the PageUp and PageDown keys to anything. I am running
      >>Sun Solaris 9 and using dtterm. Annoying. While we're on the subject,
      >>is there any way to get the mouse (scroll wheel) working as well?
      >>Maybe that is hoping for too much. BTW all of the normal key mappings
      >>work perfectly in gvim. It's just console based vim that's giving me
      >>fits. Thus, it's probably a problem with my terminal emulator like
      >>you said.
      >>
      >>
      >[...]
      >
      >There are three possible problem sources with using the mouse wheel in
      >console Vim:
      >
      >1. Many terminal emulators simply don't recognise the mouse. The Windows
      >Dos Box does, but under Linux you need an additional software package
      >such as gpm.
      >2. Console Vim is often compiled without mouse support, or if it has
      >mouse support it's not always for the same mouse package as the one (if
      >any) installed in your terminal emulator.
      >-- To see if your console Vim has mouse support:
      > :echo has("mouse")
      >... in the answer, 0 (zero) means no, 1 (nonzero) means yes.
      >-- To see what kind of mouse support it has got, two possibilities:
      >---- a)
      > :version
      >... in the answer, look for an item starting +mouse (if it's -mouse then
      >you haven't got mouse support compiled-in).
      >---- b) if you know what kind of mouse package you are looking for, for
      >instance gpm:
      > :echo has("mouse_gpm")
      >The possibilities are +mouse +mouse_dec +mouse_gpm etc.: see them all by
      >doing ":help feature-list" then searching "/^mouse" (without the quotes
      >in both cases).
      >3. The mouse wheel needs proper settings in your vimrc; but I'm not sure
      >what they are. ":help scroll-mouse-wheel" might help you, but don't
      >forget to keep scrolling the help file, what you need might (or might
      >not) be somewhere lower down.
      >
      >HTH,
      >Tony.
      >
      >
      Hi Justin and Tony,

      I'm lucky my wheel works but I tried out what Tony said (apart from
      looking into the help file) and if it's any help, here are the relevant
      parts (I think) that appear when I type in :version :

      +mouse +mouseshape
      +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm

      I don't think I have any relevant settings in my .vimrc, but here it is
      (in its messy, hotchpotched contradictory commands form!!):
      set tabstop=4
      set shiftwidth=4
      set novb
      set mousehide
      set noexpandtab
      set guioptions-=T "hide toolbar
      set columns=88 lines=80
      syntax on
      gui
      colors guardian
      filetype plugin on
      set grepprg=grep\ -nH\ $*
      filetype indent on
      autocmd Filetype tex source ~/.vim/after/syntax/tex.vim
      autocmd Filetype c set number
      set wrapmargin=2
      set hlsearch
      set number
      set winaltkeys=no
      nnoremap - O<esc>j
      nnoremap + o<esc>k

      " Clears search highlighting by just hitting a return.
      " The <BS> clears the command line.
      " (From Zdenek Sekera [zs@...] on the vim list.)
      " I added the final <cr> to restore the standard behaviour of
      " <cr> to go to the next line
      :nnoremap <CR> :nohlsearch<CR>/<BS><CR>
      " Maps ?? when in visual mode with some text selected to open a firefox
      " browser and get google to search for the selected text
      vmap ?? <ESC>:exec
      \ ':!/usr/bin/firefox http://www.google.com/search?q="'
      \ . substitute(@*,'\W\+\\|\<\w\>'," ","g")
      \ . '"'<CR><CR>
      " Maps ?w when in visual mode with some text selected to open a firefox
      " browser and go to Cambridge dictionarys website
      vmap ?w <ESC>:exec
      \ ':!/usr/bin/firefox http://dictionary.cambridge.org/"'
      \ . '"'<CR><CR>
      " Maps ?l when in visual mode to open a firefox browser and go to LEO's
      website
      vmap ?l <ESC>:exec
      \ ':!/usr/bin/firefox http://dict.leo.org/?lp=ende"'
      \ . substitute(@*,'\W\+\\|\<\w\>'," ","g")
      \ . '"'<CR><CR>
      let c_C99=1

      Hope some of that might help,
      Rob.
    • Show all 25 messages in this topic