Re: Why vimscript instead of another language? A philosophical or a technical question?

2024-05-01 Thread Jose Caballero
Thanks a lot everybody for the comments. Very helpful. Cheers Jose El dom, 28 abr 2024 a las 19:51, Jose Caballero () escribió: > Hello, > > I am just curious about it. I have just been experimenting with it, and it > is possible to send the selected range of lines, or even the e

Re: Why vimscript instead of another language? A philosophical or a technical question?

2024-04-28 Thread Jose Caballero
a good point: "your favourite language might not be my favourite language" Cheers, Jose El dom, 28 abr 2024 a las 20:44, Tony Mechelynck (< antoine.mechely...@gmail.com>) escribió: > On Sun, Apr 28, 2024 at 9:27 PM Jose Caballero > wrote: > > > > Hello, > &g

Why vimscript instead of another language? A philosophical or a technical question?

2024-04-28 Thread Jose Caballero
Hello, I am just curious about it. I have just been experimenting with it, and it is possible to send the selected range of lines, or even the entire buffer, to an external script. Right? In my case, in python. I find python, or even bash, to be more readable and friendly than vimscript. What

Re: documenting my own plugins?

2023-06-13 Thread Jose Caballero
I think using ~/.vim/doc/ is cleaner than ~/.vim/ftplugin/foo/doc Thanks a lot for all your help. Cheers, Jose El lun, 12 jun 2023 a las 21:18, Bram Moolenaar () escribió: > > > Indeed, this worked: > > > > :set runtimepath=~/.vim/ftplugin/foo,$VIMRUNTIME > > > > I assume I can add it to

Re: documenting my own plugins?

2023-06-12 Thread Jose Caballero
Indeed, this worked: :set runtimepath=~/.vim/ftplugin/foo,$VIMRUNTIME I assume I can add it to .vimrc, so I don't need to do it every time. Thanks a lot for your help !!! Cheers, Jose El dom, 11 jun 2023 a las 17:37, Gary Johnson () escribió: > On 2023-06-10, Jose Caballero wr

Re: documenting my own plugins?

2023-06-11 Thread Jose Caballero
that may be it. Thanks a lot. Jose El dom, 11 jun 2023 a las 17:37, Gary Johnson () escribió: > On 2023-06-10, Jose Caballero wrote: > > > > El sáb, 10 jun 2023 a las 18:51, Gary Johnson escribió: > > > > On 2023-06-10, Jose Caballero wrote: > &

Re: documenting my own plugins?

2023-06-10 Thread Jose Caballero
El sáb, 10 jun 2023 a las 18:51, Gary Johnson () escribió: > On 2023-06-10, Jose Caballero wrote: > > Hi, > > apologies if this is a silly question. > > > > > > I am trying to write documentation for my plugins in the > ~/.vim/ftplugin/foo/ > > directory

documenting my own plugins?

2023-06-10 Thread Jose Caballero
Hi, apologies if this is a silly question. I am trying to write documentation for my plugins in the ~/.vim/ftplugin/foo/ directory. This is what I have tried: 1) created ~/.vim/ftplugin/foo/doc/ 2) created file ~/.vim/ftplugin/foo/doc/testfoo.txt with content *testfoo* this is a test 3)

Re: E121: Undefined variable

2023-03-13 Thread Jose Caballero
Indeed it works !! Thanks a lot. Cheers, Jose El lun, 13 mar 2023 a las 14:06, Christian Brabandt () escribió: > > > On Mo, 13 Mär 2023, Jose Caballero wrote: > > > Hello, > > > > I have this function [*]. > > It is meant to create a line when opening a new

E121: Undefined variable

2023-03-13 Thread Jose Caballero
Hello, I have this function [*]. It is meant to create a line when opening a new file with extension .pan, where that line is based on the path of the file. That code works on my personal computer, with VIM 9.0.1023 However, it fails on the computer at work where it has to run, with VIM 7.4.629 I

location of vim rc files and directories. Making them relocatable.

2017-11-25 Thread Jose Caballero
Hi, this is a quick question about how to modify my .vimrc and all my plugins so I can copy all of them to different hosts (under different usernames) and still work. I have all of them (vimrc and all plugin directories) in a github account. So my intention is, when I login to a remote host

Re: a few [crazy?] questions to make editing like an IDE experience

2017-11-09 Thread Jose Caballero
> > > > Or, why do you want this? Just trying to learn new things that could eventually improve performance, while I have some fun during the process. Thanks a lot for your comments and pointers. Cheers, Jose -- -- You received this message from the "vim_use" maillist. Do not top-post!

a few [crazy?] questions to make editing like an IDE experience

2017-11-07 Thread Jose Caballero
Hi, I didn't really know how to express it better, so I picked that meaningless subject. Sorry about that. Let's say, as a mental experiment, we want to write plugins -or whatever is needed- to enhance the experience of editing a given kind of configuration file, with a well defined extension.

Re: recommendation for a function over the entire buffer

2017-10-26 Thread Jose Caballero
2017-10-26 20:24 GMT-04:00 Tim Chase <v...@tim.thechases.com>: > On 2017-10-26 19:13, Jose Caballero wrote: >> if I want to write a function that does something after every line >> matching a given pattern (for example, for every python method >> definition), wha

recommendation for a function over the entire buffer

2017-10-26 Thread Jose Caballero
Hello, if I want to write a function that does something after every line matching a given pattern (for example, for every python method definition), what does the community prefer to handle it? Just iteratively? Or with a recursive function where the range changes from call to call? I am just

Re: how to apply a given map, written for a line, to a block of lines?

2017-10-22 Thread Jose Caballero
2017-10-20 23:36 GMT-04:00 Tony Mechelynck <antoine.mechely...@gmail.com>: > On Sat, Oct 21, 2017 at 4:25 AM, Ben Fritz <fritzophre...@gmail.com> wrote: >> On Friday, October 20, 2017 at 5:29:53 PM UTC-5, Jose Caballero wrote: >>> Hi, >>> >>>

how to apply a given map, written for a line, to a block of lines?

2017-10-20 Thread Jose Caballero
Hi, I would only need to know which key words I need to search in google... :) I have a few remaps (and iremaps) that modify the current line. For example, to add # at the beginning, and stuff like that. I would like to know how to re-use those mappings for a block of lines, not line by line. I

how to redefine paragraphs?

2017-09-08 Thread Jose Caballero
I have searched on google using the same words as the subject, but didn't get too much information. Or didn't understand what I found. Maybe people in this list can provide for hints on how to google it more precisely. So this is what I would like to be able to do. When editing python code, I

Re: quick question: what is the function or command to insert text, from a variable, in current cursor pos?

2017-09-06 Thread Jose Caballero
2017-09-06 9:11 GMT-05:00 Gary Johnson <garyj...@spocom.com>: > On 2017-09-06, Jose Caballero wrote: > >> I trying to modify an plugin that I already have in such a way that, >> after adding the lines it already does and moving the cursor to a >> given posit

quick question: what is the function or command to insert text, from a variable, in current cursor pos?

2017-09-06 Thread Jose Caballero
Hi, I trying to modify an plugin that I already have in such a way that, after adding the lines it already does and moving the cursor to a given position, now it also adds the name of the file in that position. I know how to get the name of the file in a variable. But what is the function I

need help with regex and matchlist()

2017-09-02 Thread Jose Caballero
Hi, As this is my first time I try to write a vimscript function that uses regular expressions, I am a little bit of lost. Not sure which built-in function is the most proper, and/or how to use it. Let's say I have this line (very familiar for python developers): def __init__(self, x, y,

Can I write an abbreviation that only works at the beginning of the line?

2017-08-27 Thread Jose Caballero
Hi, I am asking here because I am not sure myself how to google it. I tried with something similar to the subject of this email, but no luck. That, or I didn't actually understand what I found. Let's say, and this is not my real need but a very clear example, I want to write an abbreviation that

Re: does VIM read OK the tags file if ctags was installed after VIM?

2017-08-17 Thread Jose Caballero
2017-08-17 16:15 GMT-04:00 Nikolay Aleksandrovich Pavlov <zyx@gmail.com>: > 2017-08-17 22:04 GMT+03:00 Jose Caballero <jcaballero@gmail.com>: >> 2017-08-17 14:51 GMT-04:00 Gary Johnson <garyj...@spocom.com>: >>> On 2017-08-17, Jose Caballero wrote:

Re: does VIM read OK the tags file if ctags was installed after VIM?

2017-08-17 Thread Jose Caballero
2017-08-17 14:51 GMT-04:00 Gary Johnson <garyj...@spocom.com>: > On 2017-08-17, Jose Caballero wrote: > >> In both cases, after trying a tag, :ts gives me the same, similar to >> >># pri kind tag file >> 1 F C iStatu

Re: does VIM read OK the tags file if ctags was installed after VIM?

2017-08-17 Thread Jose Caballero
2017-08-15 17:44 GMT-04:00 Benji Fisher <benji17fis...@gmail.com>: > On Tue, Aug 15, 2017 at 4:42 PM, Jose Caballero <jcaballero@gmail.com> > wrote: >> >> Thanks Ben and Erik. >> >> Both tags files are identical: >> >> host1 $ md5

Re: does VIM read OK the tags file if ctags was installed after VIM?

2017-08-15 Thread Jose Caballero
Thanks Ben and Erik. Both tags files are identical: host1 $ md5sum tags 34e5413f4dea1c0644b35de7808a8029 tags host2 $ mad5sum tags 34e5413f4dea1c0644b35de7808a8029 tags Also tags are equal: :set tags? tags=./tags,./TAGS,tags,TAGS But, when hitting CTRL+] on top of a

does VIM read OK the tags file if ctags was installed after VIM?

2017-08-14 Thread Jose Caballero
Hi, I am working on a host that didn't have ctags installed. I have just installed it. However, I think I am missing some step. After creating the tags file, opening a file with VIM and hitting CTRL+] on a string, it does not jump to the file with the definition. It just gives me a comment like

Re: A very naive question: any doc (book, web page, ...) to learn step by step how to custom configure vim?

2017-08-11 Thread Jose Caballero
2017-08-11 15:27 GMT-04:00 Nikolay Aleksandrovich Pavlov <zyx@gmail.com>: > 2017-08-11 21:36 GMT+03:00 Jose Caballero <jcaballero@gmail.com>: >> I reply to myself so I don't pick any particular answer. >> Thanks a lot for your comments. I will have a look to th

Re: A very naive question: any doc (book, web page, ...) to learn step by step how to custom configure vim?

2017-08-11 Thread Jose Caballero
I reply to myself so I don't pick any particular answer. Thanks a lot for your comments. I will have a look to those books. I have SAFARI account, so I can check them for free :) As I said, I am not that much concerned about learning editing features, or things I can do "with my fingers" when

A very naive question: any doc (book, web page, ...) to learn step by step how to custom configure vim?

2017-08-11 Thread Jose Caballero
Hi, first, I sincerely apologize for asking in this forum a question that I believe is trivial for most members in the list. However, I think you will understand why I am asking it here. I am regular VIM user, even though I only know around 1% of the user's features. But that is fine, since I

Re: question on VIM syntax: highlight an entire paragraph

2016-04-17 Thread Jose Caballero
2016-04-17 13:46 GMT-04:00 Nikolay Aleksandrovich Pavlov <zyx@gmail.com>: > 2016-04-17 20:19 GMT+03:00 Jose Caballero <jcaballero@gmail.com>: >>> >>> " Need average length of such enabled section in place of 50 >>> syntax sync minline

Re: question on VIM syntax: highlight an entire paragraph

2016-04-17 Thread Jose Caballero
> > " Need average length of such enabled section in place of 50 > syntax sync minlines=50 > syntax match PreProc /\%(\%^\|^$\n\)\@2<=\%(.\+\n\)*enabled = > False\n\%(.\+\%(\n\|\%$\)\)*\%(\n\|\%$\)\@1=/ > I have just started playing with it E59: invalid character after \@ E475:

Re: question on VIM syntax: highlight an entire paragraph

2016-04-16 Thread Jose Caballero
>> >> >> Is it possible to highlight an entire paragraph based on a single line >> content? >> I would be interested in changing the color of an entire block of >> configuration lines if one of those lines in the block is "enabled = >> False", for example. >> >> I am so new to this (*) that

question on VIM syntax: highlight an entire paragraph

2016-04-16 Thread Jose Caballero
Hello, I have the feeling I asked this same question about a year ago. If that is the case, then I truly apologize. I know, and understand, that asking twice the same thing in a mailing list is close to a deadly sin. Is it possible to highlight an entire paragraph based on a single line content?

write a very basic syntax file (follow up questions)

2015-11-11 Thread Jose Caballero
Hi, I sent the question "write a very basic syntax file" yesterday to this forum. Thanks to the help provided I managed to write it. But I have a couple of related questions. (1) I was suggested to search for the inline help :help new-filetype

Re: write a very basic syntax file

2015-11-11 Thread Jose Caballero
2015-11-11 4:25 GMT-05:00 John Beckett <johnb.beck...@gmail.com>: > Jose Caballero wrote: >> Now I only need to figure out how to highlight comments. > > I'm not sure if that point is covered, but try: > http://vim.wikia.com/wiki/Creating_your_own_syntax_files >

write a very basic syntax file

2015-11-10 Thread Jose Caballero
Hello, I am pretty sure this question has been already asked many times. I apologize if that is the case. I have been googling the topic for a while, and the problem is that I found too many different ways to [theoretically] do it, so I am not sure which one is the right one. So let's say I only

Re: write a very basic syntax file

2015-11-10 Thread Jose Caballero
>> >> au BufRead,BufNewFile *.myfile setfiletype myfile > > It would be better, i.e., more likely to work as you expect, if you > instead put this line in ~/.vim/filetype.vim >> ~/.vim/plugin/syntax/myfile.vim, with content >> >> if exists("b:current_syntax") >> finish >>

how to join all lines in a paragraph?

2014-10-26 Thread Jose Caballero
Hi, I have been trying to find in google how to join all lines in a given paragraph, or a range to lines. I only found this :set tw=100 gggqJ or similar recipes. But that joins all lines in the file.I would be interested only in a portion of the file. How should I modify that recipe for

Re: how to join all lines in a paragraph?

2014-10-26 Thread Jose Caballero
I have been trying to find in google how to join all lines in a given paragraph, or a range to lines. You could use visual mode: vipJ That was so simple I now feel embarrassed. Thanks a lot! -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply

how to pass a visual block as argument to the Toggle plugin (or any other plugin)

2012-03-04 Thread Jose Caballero
Hi, this is actually a more generic question, but we can use the Toggle plugin as example. I apologize in advance if it is a very simple question, or already asked many times. I have found this plugin called Toogle: http://www.vim.org/scripts/script.php?script_id=895 I have modified it to

increasing/reducing the number of leading white spaces dynamically

2011-11-03 Thread Jose Caballero
Hi, for our current python project, we are trying to follow the PEP recommendations, and therefore keeping all indentations to 4 white spaces. However, when I am writing code, I feel more comfortable with 8 white spaces. I am pretty sure there must be a trick to put on .vimrc (or similar) in

Re: increasing/reducing the number of leading white spaces dynamically

2011-11-03 Thread Jose Caballero
that trigger on BufWritePre and BufWritePost, something like (untested) autocmd BufWritePre *.py %s/^\( \{8}\)\+/\=substitute(**submatch(0), repeat(' ', 8), repeat(' ', 4), 'g') autocmd BufWritePost *.py %s/^\( \{4}\)\+/\=substitute(submatch(0), repeat(' ', 4), repeat(' ', 8), 'g')

Re: replacing all characters in the current line?

2011-11-02 Thread Jose Caballero
Thanks a lot everyone for your comments and tips. Jose -- 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

replacing all characters in the current line?

2011-11-01 Thread Jose Caballero
Hi, this happened to me today. I had a line like this one === and I wanted to replace all characters by '-', so I could have something like I thought I could do it by combining 'g' and 'r' as I understood 'g' is good to repeat the same command over all chars

case-dependent replace

2011-09-18 Thread Jose Caballero
Hi, I would like to know if it is possible to replace 'foo' by 'bar', 'FOO' by 'BAR' and 'Foo' by 'Bar' (or at least the first two), with a single command. Any link or the right :help command would be enough. Thanks a lot in advance, Jose -- You received this message from the vim_use

Re: detecting first and last line of the current paragraph

2011-07-24 Thread Jose Caballero
On Jul 23, 2011, at 18:00, Tim Chase v...@tim.thechases.com wrote: On 07/23/2011 12:59 PM, Jose Caballero wrote: 2011/7/23 Ben Schmidtmail_ben_schm...@yahoo.com.au You don't need to apologies for bothering us. If we didn't enjoy helping people with Vim, we wouldn't be on this mailing list

why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
Hi, I was trying to write a small function in vimscript that moves the cursor to a given line, in order to perform some actions. I was trying with something like this function F() cursor(4,0) endfunction but I got and E492 error. However, with call cursor(4,0)

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
2011/7/24 Taylor Hedberg tmhedb...@gmail.com :call is always needed in order to call a function if the function call is not otherwise wrapped in some ex command. In other words, it's never valid to have a bare function call by itself on a line. OK. I need to digest that. I think I should

Re: detecting first and last line of the current paragraph

2011-07-24 Thread Jose Caballero
1.- to protect it from crashing when I use vim 6.x I guess there has to be something similar to the python sys.version or sys.version_info variables. :help v:version I already found v:version on the web. I am embedding the whole function into a if v:version 700 endif

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
cursor(4,0) is the _value_ of the function. For instance, in a Vim compiled with +float, acos(-1) is the arc-cosine (in radians) of minus one, i.e., the number pi. All functions return a value (if you execute a :return statement without an explicit return value, the function returns the

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
I don't know what you get for :help call :help call call({func}, {arglist} [, {dict}]) *call()* *E699* Call function {func} with the items in |List| {arglist} as arguments. {func} can either be a |Funcref| or the name of a

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
On Jul 24, 2011, at 22:42, Tim Chase v...@tim.thechases.com wrote: On 07/24/2011 09:34 PM, Tony Mechelynck wrote: On 25/07/11 03:41, Jose Caballero wrote: I don't know what you get for :help call Hm, strange. Is this hitting the difference between these two? :help call

Re: detecting first and last line of the current paragraph

2011-07-23 Thread Jose Caballero
2011/7/23 Ben Schmidt mail_ben_schm...@yahoo.com.au I wanted to thank you guys for the patience, and for all the tips. I am quite new with Vimscript, so everything is hard to me. But that is the reason I keep trying, to learn and to educate myself. Sorry for bothering you guys. As I said,

Re: detecting first and last line of the current paragraph

2011-07-22 Thread Jose Caballero
2011/7/22 Ben Schmidt mail_ben_schm...@yahoo.com.au Thanks a lot for all your comments! For this particular purpose, the visual way is perfect. However, I am still interested in the regex way, because that will allow me to do other things with the paragraph and not only adding a char at the

Re: detecting first and last line of the current paragraph

2011-07-22 Thread Jose Caballero
Hi, I wanted to thank you guys for the patience, and for all the tips. I am quite new with Vimscript, so everything is hard to me. But that is the reason I keep trying, to learn and to educate myself. Sorry for bothering you guys. As I said, trying to educate myself with Vimscript, I am still

detecting first and last line of the current paragraph

2011-07-21 Thread Jose Caballero
Hi, I am trying to write a function to comment all lines of code in a block. Note the main purpose for this is to educate myself on vim scripting, given I am quite new with it. I am sure there are many other solutions to do it, and much better, but I want to do it in this way to learn. I have

Re: a question about path where the files to be edited are

2011-07-20 Thread Jose Caballero
You could put those directories into the 'path' option, then use :find instead of :edit. Once those directories are in 'path', though, you could use gF or ^WF to jump to the file name and line number under the cursor. Hmmm. Seems like gF or ^WF don't work for me. I am stuck with vim 6.3,

a question about path where the files to be edited are

2011-07-19 Thread Jose Caballero
Hi all, I have been using so far with success this plugin [1], which allowed me to jump from logs files directly to the source code file and specific line where a given log message was generated. However, it worked because the source files where placed in the same directory where the log files

Re: jumping to a given file and line from a log file

2011-02-07 Thread Jose Caballero
2011/2/7 AK andrei@gmail.com On 02/07/2011 04:12 PM, Jose Caballero wrote: Hi, my apologies if this question is too silly, or already asked. In that case, you can just point me to the documentation or example, and I will keep investigating myself. I use vim version 6.3.82 on RedHat

how to prevent abbreviations to be expanded when pasting with the mouse?

2010-11-05 Thread Jose Caballero
Hi everyone, I use VIM 6.3 (I cannot update it) on Red Hat. I have a set of abbreviations defined in my .vimrc file that allows me to type very fast. However, when I copypaste some text using the mouse, if some string inside the new text matches any of my defined abbreviations, it is also

Re: how to prevent abbreviations to be expanded when pasting with the mouse?

2010-11-05 Thread Jose Caballero
I have a set of abbreviations defined in my .vimrc file that allows me to type very fast. However, when I copypaste some text using the mouse, if some string inside the new text matches any of my defined abbreviations, it is also expanded automatically. But when I copy and paste text

introduction, and a beginner question about vimrc files

2010-05-24 Thread Jose Caballero
Hi, this is my first post in this list, so I wanted to introduce myself and say hello to everyone here. I have a very basic question, as a beginner I am using vi. I use vim 6.3.82, on Red Hat. I have no root privileges. Right now I have all my mappings and abbreviations and those things in a