Vim: бинды <Shift+F2>, <Shift+F3> и т.д. не работают
MEP3OCTb 5 марта, 2009 - 00:56
Доброго времени суток.
Vim 7.2. Не срабатывают бинды для сочетаний Shift + функциональная клавиша
Наблюдается как в xterm так и в голой консоли.
Вот часть конфига ( на другой ОС с этим же конфигом все нормально работало):
nmap <S-F3> :tabp<cr> imap <S-F3> <ecs>:tabp<cr>i
Как побороть?
»
- Для комментирования войдите или зарегистрируйтесь

Давайте весь конфиг. Может
Давайте весь конфиг. Может там где-то условие стоит.
Что выводит то по нажатию на эти клавиши?
Попробуйте на F3 просто повесть
- работает. - не
<F3> - работает.
<S-F3> - не работает.
<C-F4> - не работает в xterm, в голой консоли работает.
Вот мой конфиг .vimrc
" ---------------- " Base options " ---------------- " uncompatible settings with Vi set nocompatible " turn off backup files "set nobackup " turn off swap files "set noswapfile " swap files directory "set dir=~/.vim/swp " turn on filetype plugin. filetype plugin on " turn on syntax highlight syntax on " strings wrapping set wrap " wrapping by words only set linebreak " Enable folding set foldenable " synatax folding set fdm=indent "set foldexpr=getline(v:lnum)=~'^sub'&&getline(v:lnum+1)=~'{'?'>1':getline(v:lnum)=~'}'?'s1':'-1' " by default all folds closed "set foldclose=all set foldminlines=0 " turn on autoindenting set autoindent " turn on smart indenting (file indenting) set smartindent " highlight settings highlight Comment ctermfg=lightred highlight Normal guibg=grey90 highlight Cursor guibg=Green guifg=NONE highlight NonText guibg=grey80 highlight Constant gui=NONE guibg=grey95 " show filename on console window name set title " hide panel in gui version set guioptions-=T " display string numbers set nu " always display cursor position set ruler " display uncompleted command in statusbar set showcmd " command string height = 1 set ch=1 " status string format set statusline=%<%f%h%m%r%=format=%{&fileformat}\ file=%{&fileencoding}\ enc=%{&encoding}\ %b\ 0x%B\ %l,%c%V\ %P " always display statusbar set laststatus=2 "hide mouse when typing set mousehide " turn off bell set novisualbell set t_vb= " use menu when autocomplete etc ???? set wildmenu " button that show menu set wcm=<Tab> " turn on mouse set mouse=a set mousemodel=popup " Default encoding set termencoding=utf8 " auto change directory set acd " session options "set sessionoptions=curdir,buffers,tabpages "set sessionoptions-=options " minimum strings displayed before cursor set scrolljump=5 " minimum strings displayed after cursor set scrolloff=5 " ignoring case when search words set ignorecase " incremental search set incsearch " turn off highlighting finded words "set nohlsearch " Do not unload file buffer "set hidden " replace <Tab> by <space> set expandtab " default <Tab> width set shiftwidth=4 set softtabstop=4 set tabstop=4 " аЁ-q - exit from vim map <C-Q> <Esc>:qa<cr> " autocomplete by <Tab> imap <tab> <c-r>=InsertTabWrapper()<cr> " autocomplete from set complete="" " current buffer set complete+=. " dictionary set complete+=k " from other open buffers/tabs set complete+=b " from tags set complete+=t " autocomplete options set completeopt-=preview set completeopt+=longest set mps-=[:] set tags +=.vim/ctags " ---------------- " Hotkeys " ---------------- " save nmap <S-F2> :w<cr> vmap <S-F2> <esc>:w<cr>i imap <S-F2> <esc>:w<cr>i " open new tab nmap <F2> :tabnew vmap <F2> <esc>:tabnew imap <F2> <esc>:tabnew " next tab nmap <F3> :tabn<cr> imap <F3> <esc>:tabp<cr>i " previous tab nmap <S-F3> :tabp<cr> imap <S-F3> <ecs>:tabp<cr>i " display Taglist window nmap <F4> :TlistToggle<cr> vmap <F4> <esc>:TlistToggle<cr> imap <F4> <esc>:TlistToggle<cr> " display marks browser nmap <S-F4> :MarksBrowser<cr> vmap <S-F4> :MarksBrowser<cr> imap <S-F4> :MarksBrowser<cr>i " display project nmap <C-F4> :Project<cr> vmap <C-F4> <esc>:Project<cr> imap <C-F4> <esc>:Project<cr> " make command nmap <F5> :w<cr>:make<cr> vmap <F5> <esc>:w<cr>:make<cr> imap <F5> <esc>:w<cr>:make<cr>i " make all nmap <S-F5> :wa<cr> :make<cr> vmap <S-F5> <esc>:wa<cr> :make<cr> imap <S-F5> <esc>:wa<cr> :make<cr>i " view next error nmap <F6> :cn<cr> vmap <F6> <esc>:cn<cr> imap <F6> <esc>:cn<cr>i " view previous error nmap <S-F6> :cp<cr> vmap <S-F6> <esc>:cp<cr> imap <S-F6> <esc>:cp<cr>i " view errors list nmap <C-F6> :copen<cr> vmap <C-F6> <esc>:copen<cr> imap <C-F6> <esc>:copen<cr>i " encoding menu (koi8-r, cp1251, cp866, utf8) set wildmenu set wcm=<Tab> menu Encoding.koi8-r :e ++enc=8bit-koi8-r<CR> menu Encoding.windows-1251 :e ++enc=8bit-cp1251<CR> menu Encoding.ibm-866 :e ++enc=8bit-ibm866<CR> menu Encoding.utf-8 :e ++enc=2byte-utf-8 <CR> menu Encoding.ucs-2le :e ++enc=ucs-2le<CR> " display encoding menu nmap <F7> :emenu Encoding.<TAB> vmap <F7> <esc>:emenu Encoding.<TAB> imap <F7> <esc>:emenu Encoding.<TAB> " string end format set wildmenu set wcm=<Tab> menu Encoding.End_line_format.unix<Tab><C-F7> :set fileformat=unix<CR> menu Encoding.End_line_format.dos<Tab><C-F7> :set fileformat=dos<CR> menu Encoding.End_line_format.mac<Tab><C-F7> :set fileformat=mac<CR> nmap <F8> :emenu Encoding.End_line_format.<TAB> " spell checking nmap <F10> :emenu Spell.<TAB> " F12 - file browser map <F12> :Ex<cr> vmap <F12> <esc>:Ex<cr>i imap <F12> <esc>:Ex<cr>i " < & > - move blocks vmap < <gv vmap > >gv " replace <Tab> with <space> retab " search and replace words under cursor nmap ; :%s/\<<c-r>=expand("<cword>")<cr>\>/ " C-c and C-v - Copy/Paste to global clipboard vmap <C-C> "+yi imap <C-V> <esc>"+gPi " shift-insert fix map <S-Insert> <MiddleMouse> " C-y - remove current string nmap <C-y> dd imap <C-y> <esc>ddi " C-d - doubles current string nmap <C-d> yyp imap <C-d> <esc>yypi vmap <C-d> <esc>yyp " [ replaced by [] "imap [ []<LEFT> " а�аНаАаЛаОаГаИб�аНаО аИ аДаЛб� { "imap { {<CR>} " move to next string ( useful when sring longer then window width ) nmap j gj| " move to previous string ( useful when string longer then window width) nmap k gk| " <space> in normal mode list pages "nmap <Space> <PageDown> " allow to use backspace instead of "x" set backspace=indent,eol,start whichwrap+=<,>,[,] " turn off replace mode imap >Ins> <Esc>i " autoreplace off map R <Esc> imap <Ins> <Esc>a " Fix <Enter> for comment set fo+=cr " window to bottom " map <C-J> <C-W>j " imap <C-J> <C-o><C-J> " window to top " map <C-K> <C-W>k " imap <C-K> <C-o><C-K> " window to left " map <C-L> <C-W>l " imap <C-L> <C-o><C-L> " window to right " map <C-H> <C-W>h " imap <C-H> <C-o><C-H> "fix russian map б� ` map аЙ q map б� w map б� e map аК r map аЕ t map аН y map аГ u map б� i map б� o map аЗ p map б� [ map б� ] map б� a map б� s map аВ d map аА f map аП g map б� h map аО j map аЛ k map аД l map аЖ ; map б� ' map б� z map б� x map б� c map аМ v map аИ b map б� n map б� m map аБ , map б� . map . . map а� ~ map а� Q map аІ W map аЃ E map а� R map а� T map а� Y map а� U map аЈ I map аЉ O map а� P map аЅ { map аЊ } map аЄ A map аЋ S map а� D map а� F map а� G map а H map а� J map а� K map а� L map а� : map а " map аЏ Z map аЇ X map аЁ C map а� V map а� B map аЂ N map аЌ M map а� < map аЎ > map , ? " ---------------- " Pluging options " --------------- " SessionMgr settings "let g:SessionMgr_AutoManage = 0 let g:SessionMgr_DefaultName = "~/.vim/session" " use snippets as ctrl+j let g:snippetsEmu_key = "<C-j>" " tag list window let g:Tlist_Inc_Winwidth = 0 " Taglist options (show current file in code nabigation window) let g:Tlist_Show_One_File = 1 "------------------------- " PHP options "------------------------- " use php dictionary for autocompete (from http://lerdorf.com/funclist.txt) set dictionary=~/.vim/php " usefull php manual navigation set keywordprg=~/.vim/bin/php_doc " php errors format set errorformat=%m\ in\ %f\ on\ line\ %l let g:pdv_cfg_Uses = 1 " turn on folding for classes/function let php_folding = 1 " turn off short php tags for php code search let php_noShortTags = 1 " sql highlightig in php code let php_sql_query=1 " html highlight in php string let php_htmlInStrings=1 " base php functions highlighting let php_baselib = 1 " ------------- " Autostart " ------------- " load dictionary if version >= 700 set spell spelllang= set nospell menu Spell.off :setlocal spell spelllang=<CR>:setlocal nospell<CR> menu Spell.Russian+English :setlocal spell spelllang=ru,en<CR> menu Spell.Russian :setlocal spell spelllang=ru<CR> menu Spell.English :setlocal spell spelllang=en<CR> menu Spell.-SpellControl- : menu Spell.Word\ Suggest<Tab>z= z= menu Spell.Add\ To\ Dictionary<Tab>zg zg menu Spell.Add\ To\ TemporaryDictionary<Tab>zG zG menu Spell.Remove\ From\ Dictionary<Tab>zw zw menu Spell.Remove\ From\ Temporary\ Dictionary<Tab>zW zW menu Spell.Previous\ Wrong\ Word<Tab>[s [s menu Spell.Next\ Wrong\ Word<Tab>]s ]s endif " autostart last session "autocmd VimLeavePre * silent mksession! ~/.vim/lastSession.vim " View non text files au BufReadPost *.pdf silent %!pdftotext -nopgbrk "%" - |fmt -csw78 au BufReadPost *.doc silent %!antiword "%" au BufReadPost *.odt silent %!odt2txt "%" " ------------- " Functions " ------------- " autocomplete function InsertTabWrapper() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\<tab>" else return "\<c-p>" endif endfunction " folding function FoldBrace() if getline(v:lnum+1)[0] == '{' return 1 endif if getline(v:lnum) =~ '{' return 1 endif if getline(v:lnum)[0] =~ '}' return '<1' endif return -1 endfunctionМожет терминал перехватывает эти сочетания
Есть вероятность, что терминал перехватывает эти комбинации. Можно попробовать в gvim
PS В разделе Hotkeys вместо
можно одной строчкой обойтись
map! <F6> <ESC>:cn<CR>iА у вас fix russian работает? Для utf оно же вроде не работало.
fix russian у меня работает
fix russian у меня работает нормально.
Поставил gvim в нем срабатывает.