It's necessary to escape "|" as <Bar> in {rhs} of :map commands.
hoooo, now I know why.
Thank you. it works.
Anna
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
It's necessary to escape "|" as <Bar> in {rhs} of :map commands.
onoremap w :<C-U>exe DoCommand() <Bar> call DoSomethingElse()<CR>
On Dec 1, 4:19 pm, anna klein <annaklein...@gmail.com> wrote:
> This gives me error E488: Trailing characters.
It's necessary to escape "|" as <Bar> in {rhs} of :map commands.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> onoremap w :<C-U><CR>:exe DoCommand()<CR>:call DoSomethingElse()<CR>onoremap w :<C-U>exe DoCommand() | call DoSomethingElse()<CR>
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
onoremap w :<C-U>exe DoCommand() | call DoSomethingElse()<CR>
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Below is my script. There are three comands that I want to execute for
one mapping. When I type command dw or pw, it works as what I want,
because it stays in normal mode. However, when I type command cw, it
will enter to insert mode, and then type ":exe DoCommand()<CR>:call
DoSomethingElse()<CR>".
So, I guess that it enters insertmode after finishing first command.
Is there a way to make it finish the three comands first, and then go
to insert mode?
Any advice is really appreciated. Thank you.
onoremap w :<C-U><CR>:exe DoCommand()<CR>:call DoSomethingElse()<CR>
function! DoCommand() range
return 'normal! d2w'
endfunction
function! DoSomethingElse()
echo 'dummy'
endfunction
Note: I intentionally oversimplify the DoCommand() function.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
This seems petty - it's the difference between 5 keystrokes and 2, but I use it
about 30 times a day. Can I ask what the <C-U> does? I tried the code w/o the <C-U> and I can't see a difference in the functionality.
AFAIK there is no groovy indent file. I now created a proxy file that
loads the java indent file instead. If you put semicolons at the end
of the lines, this should be an improvement. Let's see.
I guess one could modify the java file to handle missing semicolons
properly. The basic indentation level is set by cindent(). The problem
would be to define a set of rules that tell the current indentexpr
isn't a continuation of the previous one.
Regards,
Tom
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
There's no built-in command to do that, but you could create a
mapping such as this one that redefines the behavior of gJ, taking
advantage of the observation that J moves the cursor to the
whitespace joining the two lines:
:nnoremap gJ Jdiw
HTH,
Gary
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
gJ doesn't remove the indentation space whereas J removes the
indentaion space and add's up to two spaces. Is there any command to
join two lines without any white space added in between?or a function
needs to be written to acheive this?
Regards,
Sharat
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On Sun, Nov 29, 2009 at 10:09 AM, Tom Link <micathom@gmail.com> wrote:Hi,
Does somebody know a groovy indent file? I found a thread from 1-2
years ago with no satisfying answer to a similar question. Has the
situation changed in the meantime?
Tom,
I would be interested in an updated groovy indent file, also.
Whenever I format a groovy file using gg=G, I end up with code like this:
def var1 = 'Foo'
def var2 = 'Bar'
def var3 = 'Baz'
And obviously, all three lines should be on the same indent level.
Thanks,
--Nate
Regards,
Tom
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Hi,
Does somebody know a groovy indent file? I found a thread from 1-2
years ago with no satisfying answer to a similar question. Has the
situation changed in the meantime?
Regards,
Tom
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On Mon, Nov 30, 2009 at 3:36 AM, Andy Wokula <anwoku@yahoo.de> wrote:Nathan Neff schrieb:
> I'm looking to create a custom command / mapping where I can use the:h v:register
> contents of a register that is specified by the user.
>
> Similar to how ["x]p works. The user can press "ap and the contents of the
> "a" register will be pasted. The user can just press p and the contents of
> the unnamed register are pasted by default.
>
> I want to define a custom command where the user can put the optional ["x]
> in front of the mapping, and my command will work with the register that the
> user specified.
>
> If the user doesn't specify a register, then I'm going to use the unnamed
> register by default.
>
> Is there a way to create a mapping that accepts the optional ["x] in front
> of it?
>
> Thanks,
> --Nate
nn <Leader>a :<C-U>call MyPaste()<CR>
func! MyPaste()
exec "normal!" v:count1. '"'.v:register. "p"
endfunc
And what is your command supposed to do?
Good question. The command will take the contents of the specified register and paste it in a new line below the cursor. Similar to the :pu command.
Thanks,
--Nate
--
Andy
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Nathan Neff schrieb:
> I'm looking to create a custom command / mapping where I can use the:h v:register
> contents of a register that is specified by the user.
>
> Similar to how ["x]p works. The user can press "ap and the contents of the
> "a" register will be pasted. The user can just press p and the contents of
> the unnamed register are pasted by default.
>
> I want to define a custom command where the user can put the optional ["x]
> in front of the mapping, and my command will work with the register that the
> user specified.
>
> If the user doesn't specify a register, then I'm going to use the unnamed
> register by default.
>
> Is there a way to create a mapping that accepts the optional ["x] in front
> of it?
>
> Thanks,
> --Nate
nn <Leader>a :<C-U>call MyPaste()<CR>
func! MyPaste()
exec "normal!" v:count1. '"'.v:register. "p"
endfunc
And what is your command supposed to do?
--
Andy
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
:exe 'let var="abc\' . 'ndef"'
where the :execute command will put the \ and n together inside a double-quoted string which :let will then evaluate.
Depending on how the "sending" application represents strings, there may be an easier way of ensuring that the \n remains two characters until the :let command evaluates the double-quoted string.
Correct -- Either the OP has a mapping, or mis-typed
"shift+J"/"capital J" which does as described (joins with extra
whitespace.
:help J
:help gJ
I find that by the time I think about whether I want whitespace
added or not, typing the "g" is less overhead than remembering a
non-standard mapping, so I just use the stock J/gJ when joining.
As an aside, it can also be done as an Ex command, using either
:j
:j!
which can be nice in a global command like
:g/pattern/,+3j
to join every line matching /pattern/ with the following 3 lines.
-tim
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> Peng Yu wrote:
>
>> I use ctrl+J to join two lines. However, there will always be a space
>> added between the two lines that are joined. I'm wondering how to
>> configure gvim not to add this extra space?
>
> See :help gJ
Thanks to this question and answer, my .vimrc just gained a new mapping:
map <D-j> gJ
(I'm on a Mac, so <D-j> is Command-j, which was previously unmapped.)
That said, "ctrl+J"? Isn't that just a newline? On my keyboard, shift-J
joins two lines, adding a space between them (and trimming any leading
space that may have been on the line below).
Dave
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> I use ctrl+J to join two lines. However, there will always be a space
> added between the two lines that are joined. I'm wondering how to
> configure gvim not to add this extra space?
See :help gJ
-- Dominique
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I do not think so. However, that's to have Vim use :py to run
Python commands. You can always use ! to filter text using any
external program.
John
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Sorry, I have read it few months ago and didn't remind where in the
help I can convert text file to string.
It is native with readfile func. So Cool !
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On Mo, 30 Nov 2009, epanda wrote:
> Hi,
>
> I have a text file and it contains those lines
>
> item1
> item2
> item3
>
>
> I would like to read this file from a vimscript and feed a List with
> all items read.
>
> echo myList
>
> ['item1','item2',''item3]
>
echo getline(1,'$')
You should read eval.txt and/or usr_41.txt, if you'd like to script
within vim.
regards,
Christian
--
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I have a text file and it contains those lines
item1
item2
item3
I would like to read this file from a vimscript and feed a List with
all items read.
echo myList
['item1','item2',''item3]
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
As sc wrote, strftime() is a better solution in this case. However,
for commands for which Vim does not have an internal equivalent, use
system(), e.g.,
let stamp = system("date +%s")
That will include the trailing newline in your stamp variable. If
that's undesirable, use this instead:
let stamp = substitute(system("date +%s"), '\n', '', '')
HTH,
Gary
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
But what Tuo Pe wants to do is change the leader for only the XML
mappings. He doesn't want it constant throughout the session, at
least as I understood his original question.
It seems to me that, according to Vim's documentation, setting
maplocalleader any time before the mappings of xml.vim were defined
should have worked.
As an experiment, I created a file with the contents shown here:
map <LocalLeader>X :echo "hello X"<CR>
let maplocalleader = ","
map <LocalLeader>Y :echo "hello Y"<CR>
let maplocalleader = ""
map <LocalLeader>Z :echo "hello Z"<CR>
and sourced it. Both the ":map" command and trying the mappings
verified that the left-hand sides of the mappings were as expected:
\X
,Y
\Z
It worked for me; I wonder why it didn't work for Tuo Pe.
Regards,
Gary
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> Hi,
>
> I need to set the output from the following command to a
> variable: date +%s
> It's a string of 10 digits.
>
> I tried
> let stamp = execute "!date +\%s"
> but apparently "execute" doesn't return anything, besides I
> can't escape "%" character which is treated as buffer name.
>
just wondering: would you still want to do that if you knew vim
supports its own strftime function?
:let td = strftime("%Y-%b-%d")
will give you a nice 11 character string in 'td', and you can
adjust to your preferences
why go out for milk when there's plenty in the fridge?
sc
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
To get Vim to understand the format of the error messages, you need to
tell Vim what compiler generated the messages, or at least how to
parse them. If your compiler is one of those in the officially
distributed runtime (in the "compiler" directory) you can just use
the :compiler command prior to your :cfile command to do it for you.
Otherwise, you'll need to set the 'errorformat' option appropriately
by hand or by finding a plugin to do it for you.
Note that the :compiler command offers tab completion/wildmenu entries
of all the installed compilers.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Since you have a script loaded that is supposed to give you
completion, you probably need to use CTRL-X CTRL-O or *possibly* CTRL-
X CTRL-U to use the script-based completion. CTRL-N and CTRL-P are
just the built-in completion.
Since CTRL-X CTRL-O can be inconvenient to type, it is easy to map
this to another easier key such as CTRL-<Spacebar>.
I have this in my .vimrc:
imap <C-Space> <C-X><C-O>
I actually have another (somewhat complicated) mapping for completion
that sets up the selection menu behavior to be more intuitive to me,
so I used imap rather than inoremap. inoremap may be better for you,
or you can check out the tip I based my other mappings on here:
http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
A further note on the "autoload" directory. "autoload" is for scripts
that define functions in a special way, so that the functions are not
defined until they are actually used. "plugin" is the directory for
scripts that define things that should always be defined, or
"ftplugin" for scripts that define things that should always be
defined for certain file types.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
You might have a look at Dr. Chip Campbell's Align plugin. It's very
handy for aligning all sorts of things...
Brett Stahlman
>
> Thanks in advance.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Yes, but there are some side-effects of this, such as rendering the zm
command useless until you first do zMzR.
See http://vim.wikia.com/wiki/All_folds_open_when_open_a_file
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I would like to fold catch block in php file.
In order to do that, i have define my own syntax file for php.
But fold become available only when i move the line contain the "catch"
keyword, with "dd" and "p", for example.
Fold became also available if i'm put the "catch" region at top level in
the syntax file, and not in a nextgroup.
Is it a bug in my syntax file or a vim's bug, or a feature ?
Extract of syntax file is here : http://pastebin.com/m57ef7d41
And php file is here : http://pastebin.com/m6a0e8c38
Best regards, Fred
--
========================================================================
Frédéric HARDY Responsable technique
No parking Email : fhardy@noparking.net
10 rue Stappaert URL : http://www.noparking.net
59000 Lille Tel : +33 (0)3 20 06 51 26
France Fax : +33 (0)3 20 63 92 21
========================================================================
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I would like to fold catch block in php file.
In order to do that, i have define my own syntax file for php.
But fold become available only when i move the line contain the "catch"
keyword, with "dd" and "p", for example.
Fold became also available if i'm put the "catch" region at top level in
the syntax file, and not in a nextgroup.
Is it a bug in my syntax file or a vim's bug, or a feature ?
Extract of syntax file is here : http://pastebin.com/m57ef7d41
And php file is here : http://pastebin.com/m6a0e8c38
Best regards, Fred
--
========================================================================
Frédéric HARDY Responsable technique
No parking Email : fhardy@noparking.net
10 rue Stappaert URL : http://www.noparking.net
59000 Lille Tel : +33 (0)3 20 06 51 26
France Fax : +33 (0)3 20 63 92 21
========================================================================
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
No, I thought this would work. And a simple test case seemed to work.
Oh well, sorry.
regards,
Christian
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
:h v:register
nn <Leader>a :<C-U>call MyPaste()<CR>
func! MyPaste()
exec "normal!" v:count1. '"'.v:register. "p"
endfunc
And what is your command supposed to do?
--
Andy
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Christian Brabandt schrieb:
> Hi Nathan!You were just guessing?
>
> On Mo, 30 Nov 2009, Nathan Neff wrote:
>
>> I see that there's a "-register" option that I can use when defining
>> a custom command, but I'm having trouble understanding how to use it.
>>
>> For example, I just want to create a command that prints out the contents of
>> a register that is specified by the user.
>>
>> I tried something like this, but can't print out the <reg> part:
>>
>> :command! -register Foo :echo You picked this register: <reg>
>>
>> What am I doing wrong?
>
> You need to expand <reg>, e.g. com! -register Foo :echo expand("<reg>")
:Foo a
executes
:echo expand("a")
Nathan, try these examples:
:com! -register Foo echo 'Register:' <q-reg>
:com! -register Foo display <reg>
:h <q-args>
You were just guessing?
:Foo a
executes
:echo expand("a")
Nathan, try these examples:
:com! -register Foo echo 'Register:' <q-reg>
:com! -register Foo display <reg>
:h <q-args>
--
Andy
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Tony Mechelynck <a...@gmail.com> skribis:
> On 28/10/09 11:36, Raúl Núñez de Arenas Coronado wrote:
>> I use Vim to store lists of items, like the one below:
>>
>> - This is a think I should do, or maybe buy - Feed my cat - Tell my
>> cat he is a naughty boy for having chewing up my most expensive
>> headphones without having even considered the possibility of eating
>> a cheaper pair (or none). - Write a message to vim_use to ask how to
>> delete items from lists like this, where some of the items are
>> oneliners but others are clearly not, and may or may not have a
>> final period - More items, this time an oneliner - Stop using
>> computers. NOW!
>>
>> The problem is that, sometimes I want to delete, cut or paste an
>> item. Deleting, cutting or pasting one-line items is very easy, just
>> dd or yy and p afterwards. The problem are the multiline items.
>
> Hi Raúl: As you can see, I'm still a month behind.
Don't worry, I understand perfectly. I've been almost a week far from
the computer and I have a ton of pending mail (including this!). Thanks
a lot for your reply :)
> However, have you thought of using ranges made of search patterns (for
> the ":y[ank]" and ":d[elete]" commands)?
I must confess that this is the first time I heard about ranges made of
search patterns O:) They're QUITE useful!
Thanks for the examples. I'll try to make much more use of them, they're
very useful. I don't know why I didn't discover them before!
Oh, and BTW, I saw your correction in your next message, thanks :)
--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I would do something like:
1. Ctrl-V + movement to select block
2. hit $ to extend selection to end of line
3. type :s/;$/<Tab><Tab><Tab><Tab>;<Enter>
Note: <Tab> means you hit the tab key, and should display as ^I
You should see something like:
:'<,'>s/;$/^I^I^I^I^I; before you
Some of the ';' will probably be misaligned, but this shouldn't be a
problem if you just want to do some block-inserts, anyway (?).
CJ
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On Mo, 30 Nov 2009, Nathan Neff wrote:
> I see that there's a "-register" option that I can use when defining
> a custom command, but I'm having trouble understanding how to use it.
>
> For example, I just want to create a command that prints out the contents of
> a register that is specified by the user.
>
> I tried something like this, but can't print out the <reg> part:
>
> :command! -register Foo :echo You picked this register: <reg>
>
> What am I doing wrong?
You need to expand <reg>, e.g. com! -register Foo :echo expand("<reg>")
regards,
Christian
--
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On Mo, 16 Nov 2009, Joan Miquel Torres Rigo wrote:
> The best solution which I found is to select the query which I want to test
> (writting it if I am retriving data instead of testing) and then normally
> execute ':!psql <database>'.
>
> This replaces selected text by the result of the command but, if you want,
> you can restore the selection by undoing changes with 'u'. I did'nt found
> any way to avoid deletion of selected text yet.
Well you could write a wrapper (e.g. a shell script), that first outputs
the input, and afterwards processes the input with sql. That's no
generic solution and a little bit awkward.
regards,
Christian
--
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
For example, I have some C code:
helloa;
helloab;
hellofgh;
Is there a way to change the C code into the form, which looks like:
helloa ;
helloab ;
hellofgh ;
Where the semicolon is at a "TAB" position. So that I can use
block-insert to insert some code, such as:
helloa ("helloa ");
helloab ("helloab ");
hellofgh ("hellofgh ");
Thanks in advance.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-----Original Message-----
From: Ni, Ruiyu
Sent: Monday, November 30, 2009 1:22 PM
To: vim_use@googlegroups.com
Subject: RE: Why I keep receiving mails from this group?
But I cannot find the vim_use group?
-----Original Message-----
From: Reid Thompson [mailto:reid.thompson@ateb.com]
Sent: Monday, November 30, 2009 1:21 PM
To: vim_use@googlegroups.com
Subject: Re: Why I keep receiving mails from this group?
Ni, Ruiyu wrote:
while I don't know how to
> unsubscribe.
>
> Could anyone tell me how to remove me from the mailing list?
>
> Thanks a lot
>
> --
> You received this message from the "vim_use" maillist.
> For more information, visit http://www.vim.org/maillist.php
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sure, this link at the bottom of every email will tell you how
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-----Original Message-----
From: Reid Thompson [mailto:reid.thompson@ateb.com]
Sent: Monday, November 30, 2009 1:21 PM
To: vim_use@googlegroups.com
Subject: Re: Why I keep receiving mails from this group?
Ni, Ruiyu wrote:
while I don't know how to
> unsubscribe.
>
> Could anyone tell me how to remove me from the mailing list?
>
> Thanks a lot
>
> --
> You received this message from the "vim_use" maillist.
> For more information, visit http://www.vim.org/maillist.php
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sure, this link at the bottom of every email will tell you how
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I know I am using VIM and may visit this group once before. But now it seems I am in the mailing list of this group while I don’t know how to unsubscribe.
Could anyone tell me how to remove me from the mailing list? No offense this group is a good source for my daily vim using but I just don’t want to receive so many mails.
Thanks a lot
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
sounds like a peculiarity of the folding syntax definition.
Alternatively, if you're trying a top-level fold, there might not
actually be a fold there. You can view them more readily by
setting the fold-column width to something non-zero:
:set foldcolumn=3
to view them.
> 1. when I open the file - it is not folded by default
I *think* that the 'foldlevelstart' option controls this,
allowing you to set it to some ridiculously high number like 99.
:help 'foldlevelstart'
Or, if you want (per your later example), you can set it to 1 for
one level of indent.
> 2. I would like to be able to issue a command that folds everything at a
> certain 'depth'
You can manually set it to a certain depth with
:set foldlevel=3
(or whatever level you want), or you can use
zr
zm
to increase/decrease (respectively) the fold level from its
current count (though unfortunately these don't take a prefixed
count of levels to increase/decrease).
:help 'foldlevel'
:help zr
:help zm
> 3. I want vim to remember what lines were folded the last time I was editing
> the file
>
> I'm pretty sure I'm ok with #3 with these lines in .vimrc:
> au BufWinLeave ?* mkview
> au BufWinEnter ?* silent loadview
If that works, no need to mess with it :)
> for #2, here's what I'd like to be able to do:
>
> [php code - before folding]
> class Foo extends Bar
> {
> function __construct()
> {
> //stuff
> }
>
> function method1($arg1,$arg2)
> {
> //stuff
> }
> }
>
>
> do a folding command to collapse everything that's "1 deep"
> class Foo extends Bar
> {
> +--- 4 lines: function __construct()
>
> +--- 4 lines: function method1($arg1,$arg2)
> }
I think (with "let php_folding=1") setting foldlevel=1 will bring
it to this point. You can map this if you do it regularly
:nnoremap <f4> :set foldlevel=1<cr>
or
:nnoremap <f4> zMzr
-tim
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> Using python-config sounds like it's something that is the recommended
> way. I have no idea when this was introduced, we should fall back to the
> old method when it can't be found.
>
> You say the libs are below /usr/lib64, but the --libs output doesn't
> contain this. Does the compiler have a builtin path for this?
Yes, /usr/lib64 is in the default set of paths of gcc:
$ gcc -print-search-dirs # trimmed for email
install: /usr/lib/gcc/x86_64-redhat-linux/4.4.2/
[...]
libraries:
[...]
/lib/../lib64/
[...]
/usr/lib/../lib64/
[...]
I took a quick look at the source RPM for Vim on Fedora 12 to
see how the distro handles this problem. They've patched Vim's
configure script to search the "lib64" directory in addition to
"lib" and "share" as follows:
$ cat SOURCES/vim-7.1-lib64.patch
diff -up vim71/src/auto/configure.lib64 vim71/src/auto/configure
--- vim71/src/auto/configure.lib64 2008-07-23 12:36:17.000000000 +0200
+++ vim71/src/auto/configure 2008-07-23 12:37:04.000000000 +0200
@@ -4291,7 +4291,7 @@ else
vi_cv_path_python_conf=
for path in "${vi_cv_path_python_pfx}"
"${vi_cv_path_python_epfx}"; do
- for subdir in lib share; do
+ for subdir in lib64 lib share; do
d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
if test -d "$d" && test -f "$d/config.c"; then
vi_cv_path_python_conf="$d"
diff -up vim71/src/configure.in.lib64 vim71/src/configure.in
--- vim71/src/configure.in.lib64 2008-07-23 12:36:17.000000000 +0200
+++ vim71/src/configure.in 2008-07-23 12:36:17.000000000 +0200
@@ -634,7 +634,7 @@ if test "$enable_pythoninterp" = "yes";
[
vi_cv_path_python_conf=
for path in "${vi_cv_path_python_pfx}"
"${vi_cv_path_python_epfx}"; do
- for subdir in lib share; do
+ for subdir in lib64 lib share; do
d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
if test -d "$d" && test -f "$d/config.c"; then
vi_cv_path_python_conf="$d"
It seems like the Fedora team's patch to include lib64 in the
list of subdirectories might be the simplest fix, though the
python-config tool seems like the right idea when it's
available.
I also looked quickly to see how old python-config might be, but
I think it's new enough that you are right to want to fall back
to the old configuration logic.
Michael Henry
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I've been fruitlessly searching for documentation on the format of vim
swap files. Does anybody have a link for that? All I want is a way to
tell whether the swap file is for a file that's been modified. It
seems that most of the time, swap files for modified files start with
an uppercase 'U', but this isn't an entirely reliable indicator.
Thanks,
MS.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> I recently decided to try out 64-bit Linux with Fedora 12. When
> I tried to compile Vim, the configure script couldn't locate the
> Python "config" directory, which is necessary to successfully
> compile with --enable-pythoninterp. This is because 64-bit
> Fedora 12 puts the Python libraries beneath /usr/lib64 instead
> of /usr/lib.
>
> I was able to work around the problem in two ways.
>
> First, based on clues from this posting to the mailing list:
> http://old.nabble.com/Trouble-compiling-vim-%2B-python-td21136985.html
>
> I added the following switch to the configure script:
>
> --with-python-config-dir=/usr/lib64/python2.6/config
>
> Since I didn't want to hard-code that path into my generic
> script for building Vim, I also tried the following symlink,
> which appeared to work as well:
>
> ln -s /usr/lib64/python2.6/config /usr/lib/python2.6/config
>
> Neither approach above seems quite smooth to me. I didn't drill
> down into the configure script very far, but I'm wondering if
> using Python's "python-config" tool would help ferret out the
> necessary configuration information. For example, on my system,
> I get the following output:
>
> $ python-config --prefix
> /usr
> $ python-config --includes
> -I/usr/include/python2.6 -I/usr/include/python2.6
> $ python-config --libs
> -lpthread -ldl -lutil -lm -lpython2.6
>
> The python-config tool comes in the python-devel package on
> Fedora. This package is required when building Vim using the
> --enable-pythoninterp switch anyway, and I imagine it's true
> in general that python-config would be available anywhere that
> the necessary Python development libraries were installed. In
> any event, the configure script could check for the presence of
> python-config and use that if found, falling back to the old
> method if not.
Using python-config sounds like it's something that is the recommended
way. I have no idea when this was introduced, we should fall back to the
old method when it can't be found.
You say the libs are below /usr/lib64, but the --libs output doesn't
contain this. Does the compiler have a builtin path for this?
--
I learned the customs and mannerisms of engineers by observing them, much the
way Jane Goodall learned about the great apes, but without the hassle of
grooming.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Does somebody know a groovy indent file? I found a thread from 1-2
years ago with no satisfying answer to a similar question. Has the
situation changed in the meantime?
Regards,
Tom
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I recently decided to try out 64-bit Linux with Fedora 12. When
I tried to compile Vim, the configure script couldn't locate the
Python "config" directory, which is necessary to successfully
compile with --enable-pythoninterp. This is because 64-bit
Fedora 12 puts the Python libraries beneath /usr/lib64 instead
of /usr/lib.
I was able to work around the problem in two ways.
First, based on clues from this posting to the mailing list:
http://old.nabble.com/Trouble-compiling-vim-%2B-python-td21136985.html
I added the following switch to the configure script:
--with-python-config-dir=/usr/lib64/python2.6/config
Since I didn't want to hard-code that path into my generic
script for building Vim, I also tried the following symlink,
which appeared to work as well:
ln -s /usr/lib64/python2.6/config /usr/lib/python2.6/config
Neither approach above seems quite smooth to me. I didn't drill
down into the configure script very far, but I'm wondering if
using Python's "python-config" tool would help ferret out the
necessary configuration information. For example, on my system,
I get the following output:
$ python-config --prefix
/usr
$ python-config --includes
-I/usr/include/python2.6 -I/usr/include/python2.6
$ python-config --libs
-lpthread -ldl -lutil -lm -lpython2.6
The python-config tool comes in the python-devel package on
Fedora. This package is required when building Vim using the
--enable-pythoninterp switch anyway, and I imagine it's true
in general that python-config would be available anywhere that
the necessary Python development libraries were installed. In
any event, the configure script could check for the presence of
python-config and use that if found, falling back to the old
method if not.
Michael Henry
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I got a little problem with my detect pattern for C++ constructor/
destructor methods and func
This is this :
^\(\w\+\s*\)\{0,10}\w\+\(::\~*\w\+\)\?[^(]\{0,10}(
It fails when I encounter spaces before constructor
constructor::constructor
destructor::destructor
Can you correct my pattern ?
Thanks
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I generally use the omni-completion functionality, using the
pythoncomplete script from here:
http://www.vim.org/scripts/script.php?script_id=1542
I also update the syntax highlighting support for Vim by
installing this:
http://www.vim.org/scripts/script.php?script_id=790
I found some inspiration here as well:
http://dancingpenguinsoflight.com/2009/02/python-and-vim-make-your-own-ide/
Michael Henry
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Given a file ERR with the following content, i would like to use this
file as quickfix error list. So i tried:
vim ERR
:cfile %
:setf python
well ... it doesn't work. can anyone help ?
regards.
marc
ERR file:
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 236, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 188, in main
base.doTransaction()
File "/usr/share/yum-cli/cli.py", line 364, in doTransaction
if self.gpgsigcheck(downloadpkgs) != 0:
File "/usr/share/yum-cli/cli.py", line 464, in gpgsigcheck
self.getKeyForPackage(po, lambda x, y, z: self.userconfirm())
File "/var/lib/python-support/python2.5/yum/__init__.py", line 2571, in getKeyForPackage
misc.import_key_to_pubring(rawkey, po.repo.cachedir)
File "/var/lib/python-support/python2.5/yum/misc.py", line 278, in import_key_to_pubring
ctx = gpgme.Context()
AttributeError: 'module' object has no attribute 'Context'
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I have submitted Slovenian Vim menu translation a while ago while I
was still using XP (and then didn't use Windows for ages; menu
translations don't work with Aqua Vim at all).
Now I tried it on Windows 7 and discovered that the language is set to
Slovenian_Slovenia.1250. That might be a bit weird. The native
encoding used to be cp1250 indeed, but it could be that Windows 7 now
tries to use utf-8 whenever possible ... but I don't really know.
The problem is that now I get translation
Pomoé (eacute)
instead of
Pomoč (ccaron)
for "Help". S and Z with caron are missing completely, so there's a
big bunch of wrong translations.
Does anyone have a hint how to solve this problem?
Thanks a lot,
Mojca
PS: I didn't try to modify any setting. I'm just using the defaults of
what gvim 7.2 for windows provides. I tried to rename files
afterwards, but with zero success.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I've tried some of them (tags seems the most promising), but they don't work
quite as I extpected.
I've programmed a lot in Visual-C++ and when I'm talking about
auto-completion I mean mostly things like the editor supplying a dropdown
list
of the member variables of a structure after you type foo-> for example,
or giving you
the names of the functions visible from the current file and the files it
includes, and the files
they include, etc.
I know how to use ctags to create tags file, and I can use it to parse
the standard headers for python, but even with tags, the auto-completion I
get
is not aware of the scope of variables/namespaces/classes
--
View this message in context: http://old.nabble.com/Need-to-know-how-to-load-script-in-Vim-tp26560003p26560492.html
Sent from the Vim - General mailing list archive at Nabble.com.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I've tried some of them (tags seems the most promising), but they
don't work quite as I extpected.
I've programmed a lot in Visual-C++ and when I'm talking about
auto-completion I mean mostly things like the editor supplying a
dropdown list
of the member variables of a structure after you type foo-> for
example, or giving you
the names of the functions visible from the current file and the files
it includes, and the files
they include, etc.
I know how to use ctags to create tags file, and I can use it to parse
the standard headers for python, but even with tags, the auto-
completion I get
is not aware of the scope of variables/namespaces/classes
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
How can I make it use an easier shortcut. Two ctrl-key combinations
for every auto completion will make it slower to use auto completion
that not :)
> 1. Whole lines |i_CTRL-X_CTRL-L|
> 2. keywords in the current file |i_CTRL-X_CTRL-N|
> 3. keywords in 'dictionary' |i_CTRL-X_CTRL-K|
> 4. keywords in 'thesaurus', thesaurus-style |i_CTRL-X_CTRL-T|
> 5. keywords in the current and included files |i_CTRL-X_CTRL-I|
> 6. tags |i_CTRL-X_CTRL-]|
> 7. file names |i_CTRL-X_CTRL-F|
> 8. definitions or macros |i_CTRL-X_CTRL-D|
> 9. Vim command-line |i_CTRL-X_CTRL-V|
> 10. User defined completion |i_CTRL-X_CTRL-U|
> 11. omni completion |i_CTRL-X_CTRL-O|
> 12. Spelling suggestions |i_CTRL-X_s|
> 13. keywords in 'complete' |i_CTRL-N|
Wow, that's a lot of auto-completions. Now which one of these gives
me
a Visual-C++-like intellisense for python :D
If there is a tutorial or a thread in some forum where this question
is answered,
please point me to it. Cause I've been searching the internet for
hours now
and I've found many sites with instructions, or vim scripts, etc. that
claim to
enable intellisense and even to "turn Vim into IDE" but I just can't
make any of them work. It's really frustrating.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
No, you should stay with maplocalleader, but just define it in the
vimrc.
g:mapleader -> <Leader>
g:maplocalleader -> <LocalLeader>
It is a convention that global plugins should define mappings with
<Leader> and filetype plugins with <LocalLeader>.
:h <Leader>
:h <LocalLeader>
--
Andy
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> map <F5> :!gnome-terminal -x python -i %<CR>
This did the trick! Thanks!
David
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> :let maplocalleader = ','
>
> is a setting for the vimrc: controlled by the user,
> constant throughout
> the session.
So this means that I should use mapleader instead of maplocalleader? And that I should set in in .vimrc, not in .vim/ftplugin/ files etc?
Tuomas
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On So, 29 Nov 2009, satuon wrote:
>
> > you can get a complete list of all scripts currently sourced by
> > issuing the
> >
> > :scriptnames
> >
> > command -- the command to load a script is
> >
> > :source <scriptname>
>
> Thanks, I used that and it showed me that pythoncomplete was loaded. But I
> still have only the default autocomplete when hit Ctrl+N/Ctrl+P. Ctrl+X just
> outputs this at the bottom of the screen:
> -- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)
That means, vim is expecting a second <Ctrl-> Letter, to choose the
completion you want. There are several different ways of completion:
1. Whole lines |i_CTRL-X_CTRL-L|
2. keywords in the current file |i_CTRL-X_CTRL-N|
3. keywords in 'dictionary' |i_CTRL-X_CTRL-K|
4. keywords in 'thesaurus', thesaurus-style |i_CTRL-X_CTRL-T|
5. keywords in the current and included files |i_CTRL-X_CTRL-I|
6. tags |i_CTRL-X_CTRL-]|
7. file names |i_CTRL-X_CTRL-F|
8. definitions or macros |i_CTRL-X_CTRL-D|
9. Vim command-line |i_CTRL-X_CTRL-V|
10. User defined completion |i_CTRL-X_CTRL-U|
11. omni completion |i_CTRL-X_CTRL-O|
12. Spelling suggestions |i_CTRL-X_s|
13. keywords in 'complete' |i_CTRL-N|
See :h ins-completion for the glory details on how to use each
completion.
regards,
Christian
--
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Thanks, I used that and it showed me that pythoncomplete was loaded. But I
still have only the default autocomplete when hit Ctrl+N/Ctrl+P. Ctrl+X just
outputs this at the bottom of the screen:
-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)
> loaded -- there should be script specific documentation in your
> doc path to help out too -- try
>
> :help python<tab>
That gave me some results about syntax highlighting and indenting in python
but no autocomplete
So if the script is loaded, how do I go about activating it? I mean I still
can't get autocompletion for class members or standard functions in python.
--
View this message in context: http://old.nabble.com/Need-to-know-how-to-load-script-in-Vim-tp26560003p26560430.html
Sent from the Vim - General mailing list archive at Nabble.com.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
> I've spent several hours now trying to configure Vim use
> autocompletion for python. The default omni-completion is
> nice but it only completes words that I've already typed.
>
> I'm trying to use this script
> /usr/share/vim/vim71/autoload/pythoncomplete.vim which comes
> with Vim However I don't know how to load it, or if it's
> already loaded - how to check that. Can anyone tell me how
> you load a script in Vim, i.e. is there a command like
>
> :load-script /usr/share/vim/vim71/autoload/pythoncomplete.vim
>
> or
>
> :check-if-script-is-already-loaded pythoncomplete.vim
>
> Does this autoload directory mean the script is already
> loaded?
>
it should be, yes
you can get a complete list of all scripts currently sourced by
issuing the
:scriptnames
command -- the command to load a script is
:source <scriptname>
but you won't need that if the python script is in your autoload
directory
see
:help autoload
:help autoload-functions
for information on how to call autoloaded functions -- if you can
successfully call a function in pythoncomplete, you'll know it's
loaded -- there should be script specific documentation in your
doc path to help out too -- try
:help python<tab>
for a list of python specific help that has been installed and
indexed -- just keep hitting the tab key til one you're
interested in is highlighted, then hit enter
hmmm -- that :help <subject><tab> trick works in vim 7.1 --
right?
sc
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
I'm trying to use this script
/usr/share/vim/vim71/autoload/pythoncomplete.vim which comes with Vim
However I don't know how to load it, or if it's already loaded - how to
check that. Can anyone tell me how you load a script in Vim, i.e. is there a
command like
:load-script /usr/share/vim/vim71/autoload/pythoncomplete.vim
or
:check-if-script-is-already-loaded pythoncomplete.vim
Does this autoload directory mean the script is already loaded?
--
View this message in context: http://old.nabble.com/Need-to-know-how-to-load-script-in-Vim-tp26560003p26560003.html
Sent from the Vim - General mailing list archive at Nabble.com.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
When I was on Windows, I used to compile with Cygwin (which generates a
native-Windows not-for-cygwin executable by means of the Cygwin version
of MinGW gcc): see
http://users.skynet.be/antoine.mechelynck/vim/compile.htm -- however,
you could use Steve Hall's precompiled "Vim without Cream" installer as
the "Vim" package from http://sourceforge.net/projects/cream/files/ (By
clicking "View all files" you have access to the "Release notes" which
are actually the ":version" output from the build in question). I see
that the latest distro there at the moment is at patchlevel 7.2.303
which is only 6 patches behind Bram's "latest"; and it supports Python
2.6 if the file "python26.dll" can be found in the $PATH at run-time.
Sometimes run-time errors can be erased so fast that you don't have time
to see them (try the ":messages" command to recall them).
Does it make a difference if you use ":browse w x.bat" (not starting
with a letter) or ":browse w x.txt" (with a non-executable extension)
instead of 1.bat ? I suppose not...
Oh, one thing I forgot to ask: your Vim build _is_ compiled with +browse
isn't it? If it isn't, the ":browse" prefix will be accepted as a no-op.
Best regards,
Tony.
--
Review Questions
(1) If Nerd on the planet Nutley starts out in his spaceship at 20 KPH,
and his speed doubles every 3.2 seconds, how long will it be before
he exceeds the speed of light? How long will it be before the
Galactic Patrol picks up the pieces of his spaceship?
(2) If Roger Rowdy wrecks his car every week, and each week he breaks
twice as many bones as before, how long will it be before he breaks
every bone in his body? How long will it be before they cut off
his insurance? Where does he get a new car every week?
(3) If Johnson drinks one beer the first hour (slow start), four beers
the next hour, nine beers the next, etc., and stacks the cans in a
pyramid, how soon will Johnson's pyramid be larger than King
Tut's? When will it fall on him? Will he notice?
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php