Saturday, August 26, 2017

Friday, August 25, 2017

Sorry to use the `e' word but does vim have similar to cperl

Any one here familiar with emacs cperl mode, that can tell me how to
get something similar when using vim?

If not familiar, `cperl-mode' trys to offer a host of short cuts that insert
quite a bit of standard code for you... a simple example is; if you
type `if<spc>' `cperl-mode' inserts:

if (_) {
}

With the underscore indicating where the cursor is left.

I vaguely remember using something with vim, years ago, that did
something similar, but no longer remember how to load that sort of
thing.

With my current vim setup (just the basic install on debian using
`aptitude install vim'), plus a .vimrc carted around from OS to OS for
years.

If opening a perl script, I get syntax highlighting but when coding I
get no help... no tricky inserts or the like.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: "sudo vim example" and "vim example"

On 08/25/2017 09:00 AM, Tobias Klausmann wrote:
> Well, if vim is run with sudo, it runs as root and uses root's
> settings (vimrc etc). What you probably want is sudoedit. It
> copies the file you want to edit and launches the default editor
> on it. Once you quit, it copies the file back with propepr
> permissions etc.

Further, sudoedit (which uses your $EDITOR) is safer than running vim under sudo.

At least from a security perspective, sudoedit is safer as many editors, vim include, provide a way to escape the editor and launch a shell.

"sudo vim /path/to/file" followed by ":shell" gives you root shell.

"sudoedit /path/to/file" followed by ":shell" gives you a shell as your normal user.



--
Grant. . . .
unix || die

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to use stop directory in up/down search

I'm struggling to understand how to use "stop directories" in a combined upward/downward search.

I have the following directory layout:

/home/user/test/
| nosearch/
| | file.txt
| stopdir/
| | somedir/


I expect these commands in Vim to NOT find the file "file.txt", because the search should stop at "stopdir" and avoid searching the "nosearch" directory:

:cd /home/user/test/stopdir/somedir
:echo findfile('file.txt', '**;/home/user/test/stopdir')

However, instead I get the output:

/home/user/test/nosearch/file.txt

Likewise, if I do the following:

:set path=**;/home/user/test/stopdir
:find file.txt

Then file.txt is edited.

What am I doing wrong? I thought I'm doing just about exactly what's documented in the help under :help starstar, item 3) "Combined up/downward search".

Tested in a "HUGE" 8.0.987 build on both Windows 10 and an Xubuntu VM.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: how to compile and install gVim with Lua support?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJZoEJZAAoJEBVMlIZsU6XG4J0P/R34ukcLtAXIiUAGgm6wSc9n
nMWi6wBHbCLKa/n/9fzdY5nBwlw+ifO9Wz9QTKTWORPHetVs3RWfv/xXevUA4buU
xymTOYtXGp0Z+gAxqgTs+h962yLzt1FqIFXxVzYjXdQDqvwDyf8LpAQCsss/Lnqh
njT4ab5ouO8MsNCo4o8Yl2skw04syKp4PdzA4N0qz3rWP2JVR+viZk1AWvpoA5R7
kyIRRONuOrm1CMk4SPErKPnmo/ZBs78RB+aZAN79GbhhvuupE+fbzDdUVF3cXdiC
AnW2t/FfIMRtnW4oiR6XbwB6kZQkzpTm1qXMNTcI16i/7f5PYDSuo8MxxWoj+jNO
SoPNQzENpDrxKDwciEmWnifdM418DoEkdlt1ARjXVo4xDllEFo/pt+t76QBkyJPR
C88HajlDqzEaJoPV7sUkBtZISticeC5bGyNACZe/NPYU9oEF5ZDGLjUosqaFqt6c
dYFOqwCiaCsvNpH1VmBnbdCa3yBcoMcWmfuoeOMBbBEQRficuObB3ROs8g3lMZj+
Q8AbSeB+OgPHWuN3dPaDYXiKEpxal+3/JEF4Lx6QLqamWJ0Pk+ELYrFgYl7aaqRn
6qBHeM6xP0NBOkFFHW7qT6ZrdSaDtujF4xgh3W8nidkLSDYb+vfmsjLqp7XzEuwM
at5PEZCow4oHtnl8+K1P
=6urs
-----END PGP SIGNATURE-----
On 25/08/17 15:26, DwigtArmyOfChampions wrote:

> Aren't those all Linux commands? I'm using Windows 10.

It helps if you tell people what OS you're using in the first place.

Cheers,

Phil.

--
The sun shone, having no alternative, on the nothing new
Murphy by Samuel Beckett

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: "sudo vim example" and "vim example"

Hi!

On Fri, 25 Aug 2017, Maksim Yugai wrote:
> Can someone help me? I saved vim config file into ~/.vim/vimrc.
> And when I use "vim example" all settings are working, but when
> I use "sudo vim example" - it doesn't work! Looks like problem
> with privileges. =)
>
> Use Debian Stretch.

Well, if vim is run with sudo, it runs as root and uses root's
settings (vimrc etc). What you probably want is sudoedit. It
copies the file you want to edit and launches the default editor
on it. Once you quit, it copies the file back with propepr
permissions etc.

HTH,
Tobias

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.