1
vote
1answer
182 views

How to reference a script-local dictionary in a Vim mapping?

Somehow I'm not able to execute the following mapping: function! s:MySurroundingFunctionIWantToKeep() let s:Foobar={'foo': 'bar'} map \42 :echo <sid>Foobar.foo<cr> endfunction call ...
2
votes
3answers
488 views

How to reverse-match a string in the Vim programming language?

I want to find the last index of any character in the [abc] set in the abcabc string but the search should start from the end of the string: " Returns the 0th index but I want the 5th. let ...
1
vote
2answers
1k views

Script to create files in a template

I just wrote a function in my ~/.bashrc that will let me create a folder for a new website with one command. The function looks like this: function newsite() { mkcd "$*" # mkdir and cd into it ...