2
votes
Accepted
Best way to downport funcrefs and partials from 8.2 to 7.4
The newer function() signature was introduced with Vim patch
7.4.1559. It may have been applied to some Vim 7.4 builds.
Should you decide to port a script, with a view to touching
as few lines as ...
2
votes
How to swap lines programmatically in file?
"#!/usr/bin/perl -d" <-> "#!/usr/bin/env perl"
First off, you do not want to remove the '-d', in fact you want to change the whole line. If you want to do that not for one ...
2
votes
How to swap lines programmatically in file?
Here's a POSIX-portable version that only relies on ed and can be shoved into a shell script:
printf %s\\n '1s/ -d' wq | ed -s $file
This uses the shorthand for s that only requires the delimited ...
2
votes
Accepted
How to swap lines programmatically in file?
To toggle a file's shebang, I'd use the following quick and dirty one-liner:
:1s@^#!/usr/bin/\zs.*@\=submatch(0)=='perl -d'?'env perl':'perl -d'
In English, that's: in line 1, substitute the ...
1
vote
Accepted
Script in autoload is not running
A script in autoload is loaded when a function that is defined in your autoload script is called.
The autoload scripts have been introduced to optimize the Vim startup time. Instead of loading all the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
vimscript × 1552vimrc × 257
key-bindings × 132
neovim × 125
functions × 113
regular-expression × 56
autocmd × 53
syntax-highlighting × 48
buffers × 40
search × 38
gvim × 37
command-line × 36
variables × 35
visual-mode × 32
vim-windows × 31
plugin-system × 26
external-command × 25
statusline × 24
autocompletion × 21
cursor-movement × 21
register × 21
lua × 21
terminal × 20
vimscript-python × 20
highlight × 19