98 Commits

Author SHA1 Message Date
Gerd Wachsmuth bea577d88a Use zv instead of :foldopen 2021-08-11 21:58:57 +02:00
Filipe Brandenburger 8c4386bb2e Fix expansion of abbreviations in the middle of a line 2018-09-07 14:08:26 +02:00
Gerd Wachsmuth db1cc0ae9f Some improvements in SyntaxFolds
- Remove (undocumented and unused) optional argument of MakeSyntaxFolds
- Use script-local functions
- Use getpos()/setpos() for cursor positioning
- Use normal! instead of normal
- Use add()/remove() on arrays
- Remove a bug if startskip matches on first line of buffer
2017-02-12 20:50:01 +01:00
Gerd Wachsmuth 84a9039aa6 Use startinsert instead of feedkeys()
With feedkeys, the "_c was delayed until the very end of an active
mapping. Now, startinsert is issued immediately and the IMAP_JumpFunc
leaves in insertmode (if there was an empty placeholder).
2017-02-11 22:27:56 +01:00
Gerd Wachsmuth 15262af05f Use function! 2017-02-11 22:27:40 +01:00
Gerd Wachsmuth 60dc192256 Some updates in filebrowser 2017-02-11 19:11:13 +01:00
Gerd Wachsmuth 47a82ee0c8 Small improvements in remoteOpen 2017-02-11 10:16:07 +01:00
Gerd Wachsmuth 15c93a4a84 Move functions from imaps.vim to main.vim
These two functions (along with two helper functions) are quite
unrelated to the functionality of imaps.vim.
2017-02-10 22:41:19 +01:00
Gerd Wachsmuth 6f98bde52a Make ft-IMAPs <buffer>-local
Now, all the IMAPs with ft='tex' will only appear as imaps in buffers
with ft=tex.
2017-02-08 21:09:10 +01:00
Gerd Wachsmuth 8cb9708aab Change IMAP_JumpFunc to a 'normal-mode function'
Up to now, IMAP_JumpFunc has to be called from insert mode. This
rendered the code in this function a little bit complicated. Now, it is
simpler to understand and to modify.
2017-01-28 11:21:26 +01:00
Gerd Wachsmuth 0e832ae9f3 Add IUNMAP function. 2016-12-28 21:57:54 +01:00
Gerd Wachsmuth 249d8397b4 Fix bug in IMAP matchings 2016-12-28 21:53:30 +01:00
Gerd Wachsmuth 8e28c3c304 Remove encoding and decoding of text.
In my opinion, this works now without the decoding. I have tested the
issue with the matching of "\xab" with itself, and it seems to be fine
in recent versions of Vim. (However, I did not find a clue in the change
logs of Vim concerning this issue)
2016-10-08 23:45:06 +02:00
Gerd Wachsmuth f138a527a2 Allow for multibyte placeholders
When selecting the placeholders, we have to use virtcol() instead of
col(), since bytes != columns.

Will this be the comeback of « and »?
2016-10-08 23:42:51 +02:00
Gerd Wachsmuth ba140b1bd2 Use maparg to check for abbreviations
Here, we utilize the 'abbr' argument in maparg,
which was introduced in Vim 7.
2016-10-08 23:23:57 +02:00
Gerd Wachsmuth b59d55ba9d Remove comment concering "Snip" 2016-10-08 21:55:12 +02:00
Gerd Wachsmuth dcee3581d7 Remove two superfluous functions 2016-10-07 12:05:09 +02:00
Gerd Wachsmuth b0a12cda0b Add debug function IMAP_list_all
Also fix two little bugs:
* Do not add lhs to s:LHS_... if it is already in there
* Use strtrans() in IMAP_list
2016-10-07 12:00:44 +02:00
Gerd Wachsmuth 6b8205e20e Replace MultiByteStrpart by specialized functions
We needed MultiByteStrpart for two reasons:
* remove last char
* return last char
This is now handled by two specialized functions.
2016-10-07 10:26:10 +02:00
Gerd Wachsmuth 4239843a55 Change logic for backspaces
Since we also add the mapped character (a:char), we have to erase it.
Hence, we do not need the '-1' and add another "\<bs>" later on.
2016-10-07 10:15:52 +02:00
Gerd Wachsmuth 1314b24df3 Use \%( \) in plugin/imaps.vim
Might be slightly faster than \( \)
2016-10-07 10:14:45 +02:00
Gerd Wachsmuth 4586e2210f Add gates to suppress latex-suite if needed.
This is usefull if latex-suite is installed system-wide but you do not
want to use it.
2016-10-05 10:52:14 +02:00
Gerd Wachsmuth b1872abd4f Merge pull request #51 from vim-latex/improved_folding
Improved folding feature
2016-09-21 22:04:49 +02:00
Gerd Wachsmuth ee2822394c Fix issue in LookupCharacter
In insert mode, <c-v>O will let you insert ascii keycodes as octal
numbers. Hence, an 'O' must not be preceeded by <c-v>. However, <c-v> is
necessary, if a:char is <c-\>.

Fix #59
2016-07-24 12:20:13 +02:00
Yuchen Ding c7aa5fa063 Fix issue in LookupCharacter
If a:char is a special character (e.g., <c-\>), it could interact with the following <c-g>.
Solution: Insert a:char literally.
2016-06-11 23:10:07 +02:00
Gerd Wachsmuth 275a85bf21 Improved the folding feature
- Improved(?) the foldtext
- Itemize environments can nest
- Replaced a stack implementation by vim lists
- Add some debugging code to SyntaxFolds.vim
- Removed some bugs
- Speedup of folding
2016-05-14 20:33:04 +02:00
Gerd Wachsmuth 79f0f795be Removed obsolete libList
Only one function from this lib was used, and
this has been moved (and slightly modified) to main.vim
2016-05-07 21:41:22 +02:00
Gerd Wachsmuth 5ab742d548 Fix bug with :iab
See http://vi.stackexchange.com/questions/2245/strange-behaviour-of-abbreviations-triggered-with-shiftenter-in-gvimvim-latex.
2016-04-25 22:55:36 +02:00
Gerd Wachsmuth 63b02f05ce New option: g:Imap_GoToSelectMode
This can be used to fix #47.
2016-04-25 22:50:59 +02:00
Gerd Wachsmuth fa6192981e Do not turn on highlighting in IMAP_Jumpfunc.
IMAP_Jumpfunc does not use the search prompt anymore. Thus, it will not have any effect on search highlighting.
2016-04-25 22:50:58 +02:00
Daeyun Shin 392577fc20 Fix: allow function overloading - Add the missing function qualifier (!) to indicate that MultiByteStrpart and MultiByteStrlen can be safely overloaded. See https://github.com/vim-latex/vim-latex/issues/5 2014-11-23 10:36:47 +01:00
LuX 02cce04263 imaps.vim: Add multibyte LHS support
- Add s:MultiByteStrlen() and s:MultiByteStrpart()
- Allow for example IMAP chaining as follows:
call IMAP("\\subset", "⊂", "")
call IMAP("⊂eq", "⊆", "")

References:
https://sourceforge.net/p/vim-latex/patches/5/
2014-11-15 19:08:36 +01:00
TODA Shuta 0ced0c9571 Fix some mappings to avoid unexpected recursive expansion. 2014-11-15 17:31:14 +01:00
Till Maas 3e7695b366 Restore registers with setreg()
Do not use "let @a = _a" to restore registers, since this adds an extra line
feed character to the register.

References:
- http://stackoverflow.com/questions/26896399/why-does-let-modify-the-value-it-assigns
- https://bugzilla.redhat.com/show_bug.cgi?id=1163518

Patch idea by Daniel Wagner <me@dmwit.com>
2014-11-15 16:34:02 +01:00
Till Maas dd2e3daf1e remove remaining SVN/CVS keywords 2014-11-15 15:23:57 +01:00
Michael Ekstrand 1a10ee7cc9 Use noremap for IMAP mappings
The IMAP mappings used plain [inv]map instead of the noremap
versions.  This causes conflicts with other plugins.
2014-05-12 13:31:03 -05:00
Bodo Graumann ce16347c36 Allow to undo IMAP substitution 2012-11-01 00:19:38 +01:00
Philipp Hartwig 8d8d1f4423 imaps: make VEnclose work when ignorecase is set 2011-02-14 20:57:42 +01:00
Till Maas e2f07b8792 remove most svn/CVS keywords 2010-11-12 22:12:38 +01:00
Johann Felix Soden 77c5977468 redefine RemoteOpen, RemoteInsert, if they exist
Description: Fix error message on double loading
 If the file plugin/remoteOpen.vim is loaded twice by vim (e.g. at both local
 and system-wide installation), errors about redefined commands are shown.
 This patch should fix this.
Author: Johann Felix Soden <johfel@gmx.de>
Bug-Debian: http://bugs.debian.org/444426
2010-11-12 22:10:59 +01:00
Srinath Avadhanula ffa9b5e465 Bug: In Vim6, there is an error on startup.
Why: Apparently, you cannot use
     :if v:version >= 700
        :for something
            ...
        :endfor
     :endif
     the :endfor and :for trigger errors.
Fix: For now, just remove this code from latex-suite since there is a new
     release purely for vim7 coming up.
2006-04-17 23:50:10 +00:00
Srinath Avadhanula cd184726e7 New: Significant speedup for the FB_DisplayFiles() function. Instead of
using FB_Strntok() to get the i^th line of glob('*'), iterate using
     stridx(). This makes the time required by FB_OpenFileBrowser() to list
     the files in C:/WINDOWS/system32 reduce from 104 seconds to 1 second.
     If v:version >= 700, then we can directly use Vim's inbuilt list and
     split() functions. This makes the time go to 0.6 seconds.
2006-03-28 19:15:18 +00:00
Srinath Avadhanula 059382b7db New: Used one of the advantages of using svn. Liberally used the 'prop*'
commands to do the following:
     1. change the EOL style of all vim files to be just LF.
     2. changed the mime-type of all files to text/plain
     3. removed the executable flag on all files.
     This should hopefully make the repo look better on all platforms etc.
2006-03-20 09:45:45 +00:00
Srinath Avadhanula 048e26a104 Bug: Sourcing problems because line continuation was used here.
Fix: Adjust 'cpo' settings at the start of the script.
2006-03-20 08:35:08 +00:00
Srinath Avadhanula b37e596f37 New: A new command :RemoteInsert which is useful for integration with
Jabref.
2006-03-20 08:30:51 +00:00
Srinath Avadhanula 3fff75c2a2 Bug: If there is an abbreviation like this:
:iab zzz whatever
     then typing 'z<space>' triggers the abbreviation in the presence of
     latex-suite. (Cristian Rigamonti)
Why: The reg-exp used to find out if a iab existed was faulty.
Fix: Fix the regexp to use an exact match of the previous word.
2006-03-19 04:29:47 +00:00
Srinath Avadhanula f1eb335c8e Minor clarification of code. 2005-12-28 00:38:04 +00:00
Srinath Avadhanula 2de1a71275 Bug: Typing
>>> \begin{array}
     >>>    \end{}
     results in
     >>> \begin{array}
     >>> \end{<++>}
     with the cursor at the end (Berta Milan)
Why: When the indentation of a line changes while typing the text returned
     by IMAP_PutTextWithMovement, then IMAP_Mark('go') does not go to the
     same location as set by IMAP_Mark('set'). This causes the cursor to be
     located not before the first placeholder causing the first
     placeholder to be "missed".
Fix: Check to see if the indentation of the line remembered by
     IMAP_Mark('set') has changed and if so, move a little to the left or
     right to adjust for the indentation changing.
2004-05-30 07:35:40 +00:00
Srinath Avadhanula 88d15e913d Bug: when 'ignorecase' is set, then typing 'etB' triggers an error.
Why: With 'ignorecase' set, 'etB' matches 'ETB', therefore, LookupCharacter
     assumes that a map exists for 'etB' and tries to find the value of
     s:Map_Tex_etB which doesn't exist.
Fix: Force matching case with the \C pattern.
2004-05-04 20:50:11 +00:00
Srinath Avadhanula dceabf2b35 Bug: RemoteOpen does not work with file names with spaces.
Why: The following vim command
        :drop File Name with spaces
     opens up multiple files.
Fix: escape() the file name before issuing the drop command.
     NOTE: There is a vim bug where
        exec "drop ".escape(filename, '\ ')
     hangs GVIM.
2004-03-14 19:39:29 +00:00