You are not logged in.

#1 2016-09-18 09:22:52

TJM
Member
Registered: 2016-09-18
Posts: 114

Looking for a vim plugin.

Hi there,
I am looking for a vim plugin which can provide the following functions:
1.automatically let the cursor jump one character ahead and insert a tag(<++>) at the original place if the user input a pair of brackets with nothing between them.
2.when user press ctrl+j, the cursor jumps to the next <++> and remove the tag, as well as push user into insert mode.

I have seen these kind of features in vim-latexsuit. But, I cannot use it while I am not writing tex files.
So, if it possible to find some vim plugins which can provide these functions?
I will appreciate it if anyone can give me some advice.

Offline

#2 2016-09-18 11:21:04

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: Looking for a vim plugin.

There is a database of vim scripts on vim.org and a lot of them are on Github.

Offline

#3 2016-09-18 18:08:06

TJM
Member
Registered: 2016-09-18
Posts: 114

Re: Looking for a vim plugin.

Awebb wrote:

There is a database of vim scripts on vim.org and a lot of them are on Github.

I konw there it is, but I couldn't find exact one. I wonder if experienced people know that.

Offline

#4 2016-09-18 18:12:47

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Looking for a vim plugin.

Not a Programming issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2016-09-18 18:22:00

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Looking for a vim plugin.

The latex-suit documentation gives some information that should help you start your search: http://vim-latex.sourceforge.net/docume … ce-holders

Offline

#6 2016-09-18 20:11:36

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Looking for a vim plugin.

You may also have a look at the VPars Vim script. Not exactly what you want but probably near enough.


To know or not to know ...
... the questions remain forever.

Offline

#7 2016-09-18 23:06:35

TJM
Member
Registered: 2016-09-18
Posts: 114

Re: Looking for a vim plugin.

Thanks all replay above.
I have found a trick make it.

" A syntax for placeholders
" Pressing Control-j jumps to the next match.
inoremap <c-j> <Esc>/<++><CR><Esc>cf>
" Completions using placeholders
inoremap ) )<++><Esc>F)i
inoremap ] ]<++><Esc>F]i
inoremap } }<++><Esc>F}i

Offline

Board footer

Powered by FluxBB