On 19:28:24 May 09, Arun Tejasvi Chaganty wrote:
There are times where I want to switch between an entire set of
keybindings/commands depending on the type of file I'm editing. For
example, if I'm using C/C++, I'd like to (hypothetically) have a
shortkey <C-f> to create an for loop block as such:
for (i=0;i<b;i++) {
???<TAB>
}
But in python, I'd like it to do;
for i in range (b):
<TAB>
or it's equivalently for bash or any other language.
Another thing I'd like to do is create a generic function to insert
snippets like <C-I>f would insert a for loop, <C-I>i a if block, etc. My
doubt is how to send the 'f', 'i' as arguments to a vim function, and in
the function how to access the filetype, etc.