Strange keymap loading behaviour, and unlet b:keymap_name
Hi, using: VIM - Vi IMproved 7.0 (2006 May 7, compiled Feb 6 2007 18:55:12) Included patches: 1-188 when I load any keymaps after each other the b:keymap_name variable vanish after loading the second keymap and never appears again. So, - open vim $vim -u NONE --noplugin - :echo b:keymap_name #error message, the value doesn't exist, OK, true - :setlocal keymap=esperanto #or whatever else - :echo b:keymap_name #Eo message, OK, true - :setlocal keymap=esperanto #or whatever else - :echo b:keymap_name #error message, the value doesn't exist, ???, it's like :unlet b:keymap_name. Strange enough: the %k variable in the statusline works well all the time -- shows the right value: either nothing, or lang = nothing, or Eo. But it depends on the b:keymap_name value which stops to exist at some time. I couldn't find anything, which would point to a vanishing variable of b:keymap_name (which is actually defined in every keymap file) in the documentation or help: - help keymap - help loadkeymap - help statusline Regs, Milan
Re: Strange keymap loading behaviour, and unlet b:keymap_name
Thanks, Tony, it works. It should be documented or mentioned. :help iminsert says nothing about it, as far as I understand. Rergs, Milan On Fri Mar 09, 2007 at 04:30:03PM +0100, A.J.Mechelynck wrote: Milan Berta wrote: Hi, using: VIM - Vi IMproved 7.0 (2006 May 7, compiled Feb 6 2007 18:55:12) Included patches: 1-188 when I load any keymaps after each other the b:keymap_name variable vanish after loading the second keymap and never appears again. So, - open vim $vim -u NONE --noplugin - :echo b:keymap_name #error message, the value doesn't exist, OK, true - :setlocal keymap=esperanto #or whatever else - :echo b:keymap_name #Eo message, OK, true - :setlocal keymap=esperanto #or whatever else - :echo b:keymap_name #error message, the value doesn't exist, ???, it's like :unlet b:keymap_name. Strange enough: the %k variable in the statusline works well all the time -- shows the right value: either nothing, or lang = nothing, or Eo. But it depends on the b:keymap_name value which stops to exist at some time. I couldn't find anything, which would point to a vanishing variable of b:keymap_name (which is actually defined in every keymap file) in the documentation or help: - help keymap - help loadkeymap - help statusline Regs, Milan Apparently, to change keymaps in a buffer where a keymap is defined, you need to clear both the 'keymap' and 'iminsert' options: :setlocal keymap=esperanto :setlocal keymap= iminsert=0 keymap=accents works (%k on the status line shows acc which is the b:keymap_name for the accents keymap). Note that setting 'keymap' (from empty to nonempty) also sets 'iminsert' (from 0 to 1). Best regards, Tony.
Re: vim70f, ft=vim, syn on -- highlighting of matching parens fails
I can still reproduce the wrong behavior of parens. Using vim7.0g. Best regards, Milan On Sun Apr 30, 2006 at 01:57:28PM +0200, Bram Moolenaar wrote: Milan Berta wrote: I was browsing some Vim-scripts and I found strange that a highlighting of matching parens fails on this line: let l:fg=substitute(l:bcdefg,.*\\C . l:cde . ,\\([^,]\\),.*,\\1,) It fails when the cursor is on - the first, the second of '(' - the first '[' - the last ')' - everything else is OK. It works well when ':syn off', it fails when ':syn on'. ft=vim. I can reproduce the problem with this simple line alone in a file.vim or by changing the 'ft' and 'syn' for a buffer. This problem was fixed a few days ago. Please try the current snapshot or the next beta (should be later today).
vim70f, ft=vim, syn on -- highlighting of matching parens fails
Hello Vim-Dev, I was browsing some Vim-scripts and I found strange that a highlighting of matching parens fails on this line: let l:fg=substitute(l:bcdefg,.*\\C . l:cde . ,\\([^,]\\),.*,\\1,) It fails when the cursor is on - the first, the second of '(' - the first '[' - the last ')' - everything else is OK. It works well when ':syn off', it fails when ':syn on'. ft=vim. I can reproduce the problem with this simple line alone in a file.vim or by changing the 'ft' and 'syn' for a buffer. Best regards, Milan -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/ VIM - Vi IMproved 7.0f BETA (2006 Apr 24, compiled Apr 25 2006 00:22:48) Compiled by [EMAIL PROTECTED] Huge version without GUI. Features included (+) or not (-): +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript +printer +profile -python +quickfix +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset -xim +xsmp_interact +xterm_clipboard -xterm_save system vimrc file: $VIM/vimrc user vimrc file: $HOME/.vimrc user exrc file: $HOME/.exrc fall-back for $VIM: /home/bertm0am/local/share/vim Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall -I/usr/X11R6/include Linking: gcc -L/usr/X11R6/lib -L/usr/local/lib -o vim-lXt -lncurses -lacl
spell function -- suggestion to do: error rate of a file
Hello Vim-Dev, Is there any way how to count bad words in a file which is spelled? Or any function which can show an 'error rate' of a file? For example, the number of bad words per ten words, or a percentage of bad words in a file. I snooped the spell.txt help file thorough and found nothing :( That would be cool to make an automatic dictionary selection function then. Using simple comparison of the error rates with some limit would make possible to select a proper .spl file, and a region. With a parameter, which defines the most used spell regions (e.g. en_gb, hu, cs, sk), could be frequent spell checking in different languages made a lot of friendly. I'm personally using 3-4 different languages per day (e-mails, work,...), and using the spell function of Vim 7 for a week I realised this inconvenience. Any suggestion how to make it solved without implementing a new feature? Best regards, Milan -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/
Re: vim70f, no hyphen-suggestions, dictionary bug(?)
I see. Probably I'd found rare word combinations and the hyphen-suggestion works very good with the best and double internal method. I was used to the Ispell program and its spelling and vocabulary. There were always some suggestion with hyphen which suited the wrong words in right way. There is definitely no problem with the spell function in Vim. Thanks for your help. Best regards, Milan On Tue Apr 25, 2006 at 06:11:22PM +0200, Bram Moolenaar wrote: Milan Berta wrote: Is this only my problem, or is this really a bug? There are no suggestions with hyphen - in the list of suggestions (for example, on z= request in normal mode. There are a lot of possibilities with the hyphen in long words (especially in English). But they are just not shown. ('badboy' could be 'bad-boy', 'noncentrosymmetric' could be 'non-centrosymmetric',..) How come? Wrong .aff or .dic? I'm spelling with the .spl files added to the vim70f release. I'm assuming you are using English. This is different for every language. Vim can handle hyphens very well (as far as I know). The words with hyphen must appear in the dictionary. You can't put a hyphen between every two words. I don't think bad-boy is a valid word. bad-tempered and bad-egg are. -- This is the polymorph virus! Follow these instructions carefully: 1. Send this message to everybody you know. 2. Format your harddisk. Thank you for your cooperation in spreading the most powerful virus ever! /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/
vim70f -- number of spell suggestions 'lines' (for some non-English spl)
Hello Vim-Dev, In :help 'spellsuggest' these lines are written about the number of the suggestions: 'spellsuggest' 'sps'string (default best) . . {number} The maximum number of suggestions listed for |z=|. Not used for |spellsuggest()|. The number of suggestions is never more than the value of 'lines' minus two. . . I tried several spelling dictionaries listed below, few wrong words, and have got these numbers of the suggestions: for Hungarian: hu.iso-8859-2.spl - semenyi - 167 suggestions - lennni - 157 sugg - nemlenni - 159 sugg - ... for Czech: cs.iso-8859-2.spl - činebýt - 167 sugg - měljste - 169 sugg - býtči - 197 sugg - ... for Slovak: sk.iso-8859-2.spl - činebyť - 160 sugg - malste - 151 sugg - byťči - 174 sugg - ... The results were achieved with 'set spellsuggest=double'. The suggestion works fine with the fast and the best internal methods. The settings 'set sps=double,10' doesn't work at all, it just decreases the number of suggestions to maximum 150. What's interesting they all have the rating in the style (number - 0). Does the zero mean sth important? It was not much effort to find the listed above -- three shots = three hits, for each language -- probably this is a behavior like that for the most of the words. (for EN: I can't find any word for the spell function behave like above. There is a maximum of 34, which is correct. I have 'lines' set as 36.) A) There is mistake in the help files and there should be written 'the number of the suggestions are not limited using the double internal method' (which is a but strange -- why one can't use any limitation using this method...). Or.. B) There is same wrong number checking in the 'spellsuggest=double,{any,number}' and it doesn't work for other than English language. C) I missed sth very important in the help files... :) Best regards, Milan -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/ VIM - Vi IMproved 7.0f BETA (2006 Apr 24, compiled Apr 25 2006 00:22:48) Compiled by [EMAIL PROTECTED] Huge version without GUI. Features included (+) or not (-): +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript +printer +profile -python +quickfix +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset -xim +xsmp_interact +xterm_clipboard -xterm_save system vimrc file: $VIM/vimrc user vimrc file: $HOME/.vimrc user exrc file: $HOME/.exrc fall-back for $VIM: /home/bertm0am/local/share/vim Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall -I/usr/X11R6/include Linking: gcc -L/usr/X11R6/lib -L/usr/local/lib -o vim-lXt -lncurses -lacl
vim70f, no hyphen-suggestions, dictionary bug(?)
Hello Vim-Dev, Is this only my problem, or is this really a bug? There are no suggestions with hyphen - in the list of suggestions (for example, on z= request in normal mode. There are a lot of possibilities with the hyphen in long words (especially in English). But they are just not shown. ('badboy' could be 'bad-boy', 'noncentrosymmetric' could be 'non-centrosymmetric',..) How come? Wrong .aff or .dic? I'm spelling with the .spl files added to the vim70f release. Best regards, Milan -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/
vim70e bug -- visual mode, pink on pink is not seen
Hello, I want to report a behavior that is pretty strange for me. When there is a syntax highlighting on and VISUAL mode is used, then the pink color disappear where the VISUAL block extends. I know, if there would be a VISUAL mode in another color than the same happens somewhere else. Is it a normal behavior or is this a bug? Can it be set (or suppressed) that the underlaying (in this case) pink writing will have a different color then (in this case) the pink VISUAL block? I just report it as a bug. I wanted to report a simple example as a JPEG (as I've seen it as an E-mail while forwarding), but it was sent back as non-deliverable :( Regards, Milan -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/
vim70e -- spell, one-touch selection
Hello, Would it be possible to set (or implement) such a behavior of the spell functions, that while selecting from the suggestion (from the suggested list) and typing the digits for a number of the item the typing will end at the moment when the number of the digits reaches the maximum number in the list. For example, when I have set spellsuggest=9 then after typing any digit of [1-9] the selection and replacement will be made without entering the ENTER key. If the spellsuggest=20 then it would happen after two digits. The idea is to spare some time without typing the ENTER key. Regards, Milan -- * Milan Berta * Institute of Physics * Academy of Sciences of the Czech Republic * Na Slovance 2 * CZ-182 21 Prague 8 * Czech Republic * * mailto: [EMAIL PROTECTED] * phone: +420 266 052 650, +420 266 052 748 * fax:+420 286 890 416 * URL:http://www.fzu.cz/