Sunday, October 28, 2012

Re: Mapping keys Ctrl-K Ctrl-C

On 28/10/12 13:36, Alejandro Exojo wrote:
> El Sábado, 27 de octubre de 2012, ashwin sathya escribió:
>> map <C-K><C-c> <leader>cc
>> map <C-K><C-U> <leader>cu
>>
>> the <leader>cc and <leader>cu are mapped to NERD commands accordingly. I am
>> having some trouble mapping C-c (BREAK ?? ) is there any workaround for
>> this ?
>
> I'm not sure that you should map <C-c>. Seems an important key that is used to
> cancel things. Vim might understand that <C-c> to cancel the previous key, so
> If the <C-k><C-u> map works for you, is probably that.
>

It is possible to map Ctrl-C, and the infamous mswin.vim script actually
does it. Whether it's a good thing to do is of course a different story,
and indeed I wouldn't recommend it either. Having Ctrl-C as part of an
{lhs} which starts with something else should be less of a problem. See
:help map_CTRL-C

Ctrl-K is one of the rare alphabetic and Ctrl-alphabetic keys not used
in Normal mode, so here there is no conflict. It is however not mappable
in Insert and Command-line mode, where it is used to enter digraphs and
the <> notation of special keys, see :help digraphs-use


Best regards,
Tony.
--
"I'm prepared for all emergencies but totally unprepared for everyday
life."

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

surround a visual block with character(s)

What's the most efficient way to visually select a block of text and
append/prepend a character or more?

In other words, I often want convert this:

blah blah foo foo

to

"blah blah foo foo"

I assume there are plugins that help with this kind of thing, for
which suggestions are welcome, but I'm curious how to do this most
efficiently without them.

c
--
Chris Lott <chris@chrislott.org>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Pathogen breaks my python syntax highlighting for some reason.

My best guess is the Python-Syntax plugin you have in .vim/bundle . Have you tried disabling all of your python-specific plugins? Could be a good place to start.

On Sat, Oct 27, 2012 at 12:11 PM, Marcel <vedicmathsaregreat@gmail.com> wrote:
Here is my .vimrc file:

1 call pathogen#infect()
  2 call pathogen#runtime_append_all_bundles()
  3 syntax on
  4 filetype plugin indent on
  5 set rtp+=~/.vim/bundle/vundle/
  6 set nocompatible
  7 filetype off
  8 filetype plugin indent on
  9 syntax on
 10 call vundle#rc()
 11 let g:EclimNailgunclient = 'external'
 12 set history=700
 13 set autoread
 14 set so=7
 15 set wildmenu
 16 set ruler
 17 set tabstop=2
 18 set cmdheight=2
 19 set hid
 20 set backspace=eol,start,indent
 21 set ignorecase
 22 set smartcase
 23 set nobackup
 24 set nowb
 25 set noswapfile
 26 set expandtab
 27 set shiftwidth=2
 28 set number
 29 set guifont=Menlo:h16
 30 set linebreak
 31 set wildmode=longest:full
 32 set noerrorbells
 33 set more
 34 au FileType * setl fo-=cro "disable autocomment"
 35 if has("gui_macvim")
 36   let macvim_hig_shift_movement = 1
 37   syntax on
 38   set hlsearch
 39   colorscheme slate
 40   set ruler
 41   set tabstop=2
 42   set guifont=Menlo:h16
 43   set noerrorbells
 44 endif

and here are the bundles and .vim/bundle files:
[jean-marcelbelmont@Jean-Marcel-Belmonts-MacBook-Pro]~/.vim 630 % ls bundle
AutoComplPop                             PHP-correct-Indenting                    html_FileCompletion
CRefVim                                  PyInteractive                            javacomplete
Cpp-code-template-generator              Python-3.x-Standard-Library-Reference    matchit.zip
Cppcheck-compiler                        Python-Syntax                            matchparenpp
FuzzyFinder                              SQLComplete.vim                          mathematic.vim
JavaBrowser                              SQLUtilities                             php.vim
JavaDecompiler.vim                       bufexplorer.zip                          php_check_syntax.vim
JavaKit                                  c.vim                                    phpcomplete.vim
JavaScript-Indent                        checksyntax                              project.tar.gz
Javascript-Indentation                   clang                                    python.vim
Javascript-OmniCompletion-with-YUI-and-j clang-complete                           stackoverflow.vim
L9                                       compiler.tar.gz                          surround.vim
Match-Bracket-for-Objective-C            compilergfortran.vim                     vcscommand.vim
Mathematica-Syntax-File                  compilerjsl.vim                          vtreeexplorer
NERD_Tree-and-ack                        compilerpython.vim                       vundle
OmniCppComplete                          cpp.vim
PDV--phpDocumentor-for-Vim               css.vim

Python 3.2 syntax highlighting is not working right.

Does anyone have any suggestions?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: gvim hanging

Dnia 28 października 2012 14:40 Marc Weber <marco-oweber@gmx.de> napisał(a):
 
Excerpts from rockybalboa4's message of Sun Oct 28 13:56:31 +0100 2012:
> Looking into gdb output and the process list:
> name      8139  0.7  1.0 906440 32596 pts/25   Tsl+ Oct11 173:59 /usr/bin/gvim -f
> name      7661  0.0  0.0      0     0 ?        Zs   07:50   0:00  \_ [bash] <defunct>
This really looks like a problem in Vim. defunct means that vim should
gather the exit code which it didn't do for some reason or the like.

Which plugin might have run that bash shell? Any idea which plugin might
have spawned the subshell?

Consider posting your plugin list and what you did (open filetypes, etc)
This may help.

Tip:
watch -- sh -c 'ps aux | grep defunct'
will give you feedback when that situation might be happening again.
 
This was just a macro recorded and run by hand incorporating c_! ie. :.!/usr/bin/php -r ... I don't think there were any problems with third party plugins.
 
Calling several times "return" in gdb looked promising in the interactivity of the interface, but after some detaching and reattaching I ended up killing gvim. I won't be investigating this today any more after recovering backups unless it happens again during ordinary usage. I really strongly suspect creating too many processes. After some similar operations to the original ones on a sample /usr/share/dict/polish (with rawURLEncode instead of rawURLDecode) I had hundreds of [defunct] gvim subprocesses, although it did not finally freeze. Learning about gdb seems quite useful as my vim freezes every month or every two months in various situations. Once I read more and use it more successfullly (where CTRL-c does not work) I will add a new debugging tip to vim.wikia.com.
 
Another situation that causes freezes for me are certain selections in visualstar.vim followed by // in order to type //e which doesn't get accepted. I have to upgrade my vim (which is currently just from the Ubuntu maverick distribution repository) in order to be sure that the bugs don't happen only to me before reporting.
 

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: gvim hanging

Excerpts from rockybalboa4's message of Sun Oct 28 13:56:31 +0100 2012:
> Looking into gdb output and the process list:
> name      8139  0.7  1.0 906440 32596 pts/25   Tsl+ Oct11 173:59 /usr/bin/gvim -f
> name      7661  0.0  0.0      0     0 ?        Zs   07:50   0:00  \_ [bash] &lt;defunct&gt;
This really looks like a problem in Vim. defunct means that vim should
gather the exit code which it didn't do for some reason or the like.

Which plugin might have run that bash shell? Any idea which plugin might
have spawned the subshell?

Consider posting your plugin list and what you did (open filetypes, etc)
This may help.

Tip:
watch -- sh -c 'ps aux | grep defunct'
will give you feedback when that situation might be happening again.

Marc Weber

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: gvim hanging

Dnia 28 października 2012 13:04 Marc Weber <marco-oweber@gmx.de> napisał(a):
 
Try such to make sure its not any VimL code or non standard
configuration.
vim -u NONE -U NONE -N

If it is Vim code gdb will be very awkward to solve your issue.
Then you have to enable/disable your plugins or code snippets to see
which is causing the issue.

If it is not VimL you may also use strace to see what vim is actually
doing (causing 100% CPU).

If it is not VimL try to start gvim without X:

DISPLAY= gvim
(by not setting DISPLAY gvim will start as vim and show an error
message)

to verify it is related to the 'gui' feature.
 
Looking into gdb output and the process list:
name      8139  0.7  1.0 906440 32596 pts/25   Tsl+ Oct11 173:59 /usr/bin/gvim -f
name      7661  0.0  0.0      0     0 ?        Zs   07:50   0:00  \_ [bash] <defunct>
 
I would think the problem was with launching an external program rather than with the VimL instructions. I have "n" remapped though, but probably not "zz", ":", nor have I any affecting command line mappings or abbreviations. Perhaps "bash -c" or "php -r" crashed for some reason. I am trying to reproduce it without plugins in a separate instance with your tips, but I would rather discover a way how recover a hanging session in general even in a hackish way rather than isolate a bug in this case. My version is not the up-to-date. Attaching with gdb at least made my processor quieter by stopping the execution, so I can leave it alone for a bit.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Mapping keys Ctrl-K Ctrl-C

El Sábado, 27 de octubre de 2012, ashwin sathya escribió:
> map <C-K><C-c> <leader>cc
> map <C-K><C-U> <leader>cu
>
> the <leader>cc and <leader>cu are mapped to NERD commands accordingly. I am
> having some trouble mapping C-c (BREAK ?? ) is there any workaround for
> this ?

I'm not sure that you should map <C-c>. Seems an important key that is used to
cancel things. Vim might understand that <C-c> to cancel the previous key, so
If the <C-k><C-u> map works for you, is probably that.

--
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php