kshenoy / vim-signature Goto Github PK
View Code? Open in Web Editor NEWPlugin to toggle, display and navigate marks
License: MIT License
Plugin to toggle, display and navigate marks
License: MIT License
I use very low updatetime
option, that is set to 150ms. If I place several marks in buffer, overall experience is well, but if I place only one mark my editing area keep twitching around every time my cursor is stopped on one place.
Following gif demonstrates that behavior:
The reason for that behavior is autocommand SignRefresh
on CursorHold
, that refreshes marks on every updatime
interval. I've digged into the code and found, that SignRefresh
function does following:
if !has_key( b:sig_marks, j[1] ) || b:sig_marks[j[1]] !~# j[0] || a:0
call signature#ToggleSign( j[0], "remove", 0 )
call signature#ToggleSign( j[0], "place" , j[1] )
endif
So, if I have only one mark in my buffer, on every edit it became kind of "stale" and it's position updated via remove
with successive place
functions. But, again, if I have only one mark, on first call (which is remove
) it's get deleted and overall SignColumn
gets collapsed, then it's placed and SignColumn
becomes visible again.
I've though about proposing pull request, but can't forge clever solution. Hope you have some ideas.
Is there a variable to disable signature at startup? I want the gutter (along with the marks) only to appear when I call the Signature toggle command but not automatically. Thanks!
First of all, thank you so much for vim-signature, I love this program very much - it makes taking notes far faster and more efficient.
I have a series of todo lists that I sync across my all of my computers on my lan, and I have been using vim-signature to quickly navigate to categories in my list. I have noticed though that once the file has been moved to another computer, the tags aren't there on the new computer.
Is there a particular file that you store the tag information in? It would be convenient not to have to update the tag locations each time I save on a separate computer if I can manage it.
Thank you so much again,
Will
Hi,
I use Vim 7.4 x86 GUI on Windows 8.1 x64 with vim-signature (newest version) installed through Pathogen. I can set marks and jump marks (they display just fine) but i cannot delete them. Using m-
gives me this error:
I tried it with default vimrc and no other plugins installed.
This is one of the most important plugins for me, so it would be great if you could help me.
Error detected while processing function signature#ToggleMark..53_ToggleSign:
line 63:
E239: Invalid sign text:
Mark is placed but sign is not displayed. Instead it appears that an empty string is being placed.
EDIT: Works after fix
I have this set in my .vimrc for now to work around issue #1:
let g:SignatureIncludeMarks = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Now when I try to set a mark via m,
vim logs the following errors, and no marks are set:
I'm not sure if this is a feature or a bug, but if I create a mark then remove it, the gutter sidebar remains present in the buffer.
If there is a mark present, and I m<Space>
, the marks are cleared and the gutter is removed (as wonderfully expected). However when there are no marks present and I m<Space>
, the gutter remains.
Perhaps this functionality could be added if it isn't already deemed a feature?
Every time when I jump to another buffer vim call SignRefresh
which execute 5 second :(
It is too slow ...
FUNCTION signature#SignRefresh()
Called 2 times
Total time: 5.150196
Self time: 0.018367
count total (s) self (s)
" Description: Add signs for new marks/markers and remove signs for deleted marks/markers
" Arguments: '1' to force a sign refresh
2 0.000045 if !exists('b:sig_marks') | let b:sig_marks = {} | endif
" b:sig_marks = { lnum => signs_str }
2 0.000029 if !exists('b:sig_markers') | let b:sig_markers = {} | endif
" b:sig_markers = { lnum => marker }
" If Signature is not enabled, return
2 0.000030 if !exists('b:sig_enabled') | let b:sig_enabled = g:SignatureEnabledAtStartup | endif
2 0.000018 if !b:sig_enabled | return | endif
2 0.000052 let l:SignatureIncludeMarks = ( exists('b:SignatureIncludeMarks') ? b:SignatureIncludeMarks : g:SignatureIncludeMarks )
2 0.010115 0.000116 let l:used_marks = map( copy(s:MarksList( "used" )), 'v:val[0]')
106 0.010820 0.000664 for i in s:MarksList( "free" )
" ... remove it
104 5.118709 0.016436 call s:ToggleSign( i, "remove", 0 )
104 0.000381 endfor
" Add signs for marks ...
2 0.009584 0.000183 for j in s:MarksList( "used" )
" ... if mark is not present in our b:sig_marks list or if it is present but at the wrong line,
" remove the old sign and add a new one
if !has_key( b:sig_marks, j[1] ) || b:sig_marks[j[1]] !~# j[0] || a:0
call s:ToggleSign( j[0], "remove", 0 )
call s:ToggleSign( j[0], "place", j[1] )
endif
endfor
" We do not add signs for markers as SignRefresh is executed periodically and we don't have a way to determine if the
" marker already has a sign or not
hi vim.signature
vim version :version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 13 2013 01:07:02) on Cygwin
keybord jp106
my operation
vim a.c ""a.c editing
1 #pragma comment( lib, "sqlite3.lib" )
2
3 #include <tchar.h>
4 #include <sqlite3.h>
5 #include <stdio.h>
my operation
m4
m6
err msg
function signature#Input..43_ToggleMarker..43_ToggleSign >
の処理中にエラーが検出されました:
行 24:
E716: 辞書型にキーが存在しません: 1
E116: Invalid arguments for function substitute( b:sig_markers[l:lnu
m], "\C" . a:sign, "", "" )
E15: 無効な式です: substitute( b:sig_markers[l:lnum], "\C" . a:sign
, "", "" )
行 27:
E716: 辞書型にキーが存在しません: 1
E15: 無効な式です: b:sig_markers[l:lnum] == ""
unofficial fix
/.vim/bundle/vim-gitgutter/plugin/gitgutter.vim
"let g:SignatureIncludeMarkers = ")!@#$%^*("
let g:SignatureIncludeMarkers = ")!@(#"
del character $%^*(
edited
i want official fix plz
thanks reading
Hi!
After the most recent update :BundleUpdate
command (from Vundle) generates in the end:
Error detected while processing function signature#SignRefresh..<SNR>78_ToggleSign..signature#SignInfo:
line 39:
E713: Cannot use empty key for Dictionary
The error continues to spread (it affects almost each Vim action) so I have to restart Vim.
When setting a mark in the command line window I get the attached stack trace:
Steps to reproduce:
$ vim
q:
ma
I'm running Vim 7.4.316 with vim-signature on commit 0a294ca.
Error detected while processing function signature#Input..<SNR>52_ToggleMark..<SNR>52_ToggleSign:
line 17:
E121: Undefined variable: b:sig_enabled
E15: Invalid expression: !b:sig_enabled | return | endif
line 46:
E121: Undefined variable: b:sig_marks
E116: Invalid arguments for function get( b:sig_marks, l:lnum, "" )
E15: Invalid expression: a:sign . get( b:sig_marks, l:lnum, "" )
line 70:
E121: Undefined variable: b:sig_marks
E116: Invalid arguments for function has_key( b:sig_marks, l:lnum ) && ( l:SignaturePrioritizeMarks || !has_key( b:sig_markers, l:lnum )))
E15: Invalid expression: ( has_key( b:sig_marks, l:lnum ) && ( l:SignaturePrioritizeMarks || !has_key( b:sig_markers, l:lnum )))
line 81:
E155: Unknown sign: sig_Sign_781
It's currently grey but I'd like to change this to another colour.
Is this possible?
Thanks
Hi! I tried to unmap ] and
[ but I could not. Am I doing it wrong or is it a bug?
https://github.com/andreicristianpetcu/dotfiles/commit/64e816e3670e396968aa361f94da3389a7620300
If I try to set a mark using A-Z, and it's already set, but in a different file, I get:
Error detected while processing function signature#Input..105_ToggleMark:
line 20:
E684: list index out of range: 0
E15: Invalid expression: filter( s:MarksList(), 'v:val[0] ==# l:mark' )[0][1]
line 22:
E121: Undefined variable: l:mark_pos
E15: Invalid expression: l:mark_pos == l:lnum
If it's not set, or if it's set in the current file, everything works just fine.
I'm using fd5c5e4.
If I set
let g:SignatureLcMarkStr = "\m"
when I try to add the 'p' mark (and only this one!?) with mp
your plugin throws that exception.
I think the default mappings for ']
, ]`, `'[`,
[` (to move to the first or last line or character of the previously operated text) are more useful than traversing marks in alphabetical order.
Is there any way to disable these mappings while still having the vim-signature signs?
Error detected while processing function signature#Toggle:
line 18:
E715: Dictionary required
E714: List required
line 22:
E715: Dictionary required
E714: List required
Is there a requirement needed that arent specified?
Is there any ability to change the colors used in the mark column? I use the solarized-dark color scheme, and the mark column has this awful reverse color rather than blending in nicely like in your screenshots. I suspect this is due to the unorthodox way that solarized uses ANSI color codes. Having an option to specify the colors used here would be great.
Hello,
Vim automatically sets [
and ]
markers on the beginning and ending lines of a block of pasted text. I rely upon this behavior to quickly navigate around blocks of pasted text. But this plugin breaks that behavior. 😿
How can I prevent this plugin from overriding the '[
and ']
mappings?
Thanks for your consideration.
Signature gets confused/broken if g:SignatureMap
is redefined after init (for example if the user does :source ~.vimrc
with a custom g:SignatureMap
).
Error detected while processing function signature#Input:
line 11:
E716: Key not present in Dictionary: PlaceNextMark
[...]
Suggestion: the plugin should use g:SignatureMap
only on initialization, to set a script-local variable s:signature_map
. It should not reference g:SignatureMap
thereafter.
how to delele mark point?
any plans to add support for generating signs for the quickfix and the locationlist items?
something similar to https://github.com/tomtom/quickfixsigns_vim
I have the following in my vimrc to insert lines before/after the current line without entering INSERT mode:
map <silent> <Leader>o :set paste<CR>m`o<ESC>``:set nopaste<CR>
map <silent> <Leader>O :set paste<CR>m`O<ESC>``:set nopaste<CR>
However since installing vim-signature this doesn't work anymore. It jumps back to the position of my last jump as if `m`` was never run.
Hello,
I’m using vim-signature and gitgutter together, both using the signs feature of ViM. When gitgutter marks a line has been changed, and I set a mark on that line, the mark signature overwrites the gitgutter signature. I’m not familiar with ViM plugin internals, so I can’t really tell if it is possible to prevent, though.
If I use :delm a
to remove the mark a
, I have to :SignatureToggle
to update the display to reflect that the mark is gone. Is there a way to have this happen without the toggle?
Since last version plugin basically doesn't work here.
I reverted to branch stable_4104e0bb6c and it works OK.
First thing that happens is that m
binding doesn't work although when I type map m
everything looks correctly. For example If I type mi
I enter insert mode and If I call the mapped function Input()
directly it starts to work !?
Second thing is that signature bar shows nothing, or it starts showing things in uncertain manner (showing just some of the marks, sometimes)
Conflicts with the python debugger (removes the highligting and signs), which sets signs for current line and break points as in the screenshot.
When there's only one mark set in the buffer, '] yields an error:
Error detected while processing function signature#GotoMark:
line 13:
E706: Variable type mismatch for: l:mark
Hello,
I have missing something or the internal marks (like '.
) are not displayed?
Hello Kartik,
would it be possible before setting a mark to check if this mark (local or global) was already set and a confirmation dialog to overwrite or not?
In the moment I delete some of my marks (most globals) by accident when setting a new mark that already exists :(
I like this plugin, the only one problem is it will delay the menu display in nerdtree.
In the first, I thought it is the problem of leader key 'm', I change it to <c-m>. Then the delay remains. The only way to get the speed back is to remove this plugin.
Any ideas can resolve this issue?
Thanks.
This issue is probably related to #54.
With this plugin it the movements to the start/end of the last block of changes ('[
and ']
) doesn't work -- those commands have no effect (no cursor movement), despite '.
still moves to the last change position.
As the docs states that
The default behavior of ]', [', ]` and [` is supported and enhanced by wrapping
around when beginning or end of file is reached.
, I expected that last change would be a stop when jumping over marks, or that it would fallback to the default behavior when there are no marks on the current buffer. Is this correct or there is another way to access the last modified block?
Currently, no marks are visible in the sidebar when lines are folded, and when a mark is added on a fold, it is added to the end of the fold. In my opinion, it would be preferable if:
(a) marks on the first line of the fold were visible in the sidebar
(b) marks added on folded lines marked the beginning of the first line instead of the last line.
Hi,
I installed vim-signature and I've been playing with it but I'm only able to place vim marks and have them displayed correctly. All other key bindings (e.g. m, or the "£$%^" marks, don't seem to work.
After playing around with it and even trying it with a modified vim script where it was the only bundle being loaded, I noticed that it does indeed work properly, but only on the first buffer.
Seeing as nobody else is having this problem, it must be something weird in my config/environment. Any hint to help me get to the bottom of this would we welcome.
(My config, without signature yet, is available on github just in case someone wants to test it out).
Cheers!
Steps to reproduce:
ma
The mark doesn't immediately show up on the screen. After some timeout, then it finally appears
I have sacrificed my 'm' mark for the ease of pressing 'mm', which I remapped to bringing up Ex.
Since the plugin runs after my vimrc (that's what I guess) it's overriding my remap. Ideally it would check for existing remaps on each of m[a-z] and leave remaps alone. Maybe do this check only if I define something like let g:signature_dont_override_mappings = 1
Otherwise looking forward to this plugin!
plugin/signature.vim
should bail if !has("signs")
. Instead, right now it shows this error every once in awhile (CursorHold?):
Error detected while processing function signature#SignRefresh..<SNR>52_ToggleSign:
line 57:
E319: Sorry, the command is not available in this version: sign unplace 2308
Error detected while processing function signature#SignRefresh..<SNR>52_ToggleSign:
line 52:
E319: Sorry, the command is not available in this version: sign define sig_Sign_2316
text=a texthl=Exception
Error detected while processing function signature#SignRefresh..<SNR>52_ToggleSign:
line 60:
E319: Sorry, the command is not available in this version: sign place 2316 line=1158
name=sig_Sign_2316 buffer=1
When vim-signature is installed, I am unable to toggled NERDTree's menu (m key). I tried setting g:SignatureDefaultMappings = 0, but that didn't work.
It seems the problem is
if l:ascii == eval( '"' . g:SignatureMap['PlaceNextMark'] . '"' ) | return s:ToggleMark('next') | endif
If I replace l:ascii with l:char it works; I don't know enough about the edge cases in VimL to know if that's safe for all characters, or if something else, instead of eval, should be used to convert the characters in SignatureMap to an ascii value.
Hi. I've installed your plugin and see next:
As you see, vim-gitgutter color works fine, cause I set:
" -------------------- base colors --------------------
highlight SignColumn ctermbg=236
" -------------------- vim-gitgutter --------------------
highlight GitGutterAdd ctermbg=236
highlight GitGutterChange ctermbg=236
highlight GitGutterDelete ctermbg=236
highlight GitGutterChangeDelete ctermbg=236
How can I change colors for vim-signature
?
Hi,
After the latest commit I got the following messages when opening some files:
"~/Projects/vim-ctrlspace/plugin/ctrlspace.vim" 5150L, 156065C
Error detected while processing function signature#SignRefresh..signature#ToggleSign:
line 71:
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
E121: Undefined variable: Exception
I'm not sure is it something broken on my side (.viminfo?) or there is sth wrong with the latest changes.
Thanks if advance for your help, and thanks for a cool plugin :). With files like ctrlspace.vim (5k lines) it's really helpful.
Cheers!
s.
I just installed vim-signature. It starts off ok, but after using it for a while, I start getting errors about b:sig_marks
being undefined. I haven't determined the exact trigger yet. I've been working in a single buffer, just trying out the features and navigation. Sometimes I get an error when trying to set a mark (ma
), or when trying to navigate (['
), etc. I've tried before and after calling :SignatureToggle
, but I can't find any root cause.
Here's a spammy sample of what I see (although the initial source of the exception varies):
Error detected while processing function signature#GotoMark..<SNR>71_GotoMarkByPos:
line 6:
E121: Undefined variable: b:sig_marks
E116: Invalid arguments for function empty( b:sig_marks ) | return "" | endif
E15: Invalid expression: empty( b:sig_marks ) | return "" | endif
line 16:
E121: Undefined variable: b:sig_marks
E116: Invalid arguments for function keys( b:sig_marks ), "s:NumericSort" ))
E116: Invalid arguments for function sort( keys( b:sig_marks ), "s:NumericSort" ))
E116: Invalid arguments for function max( sort( keys( b:sig_marks ), "s:NumericSort" ))
E15: Invalid expression: max( sort( keys( b:sig_marks ), "s:NumericSort" ))
line 17:
E121: Undefined variable: b:sig_marks
E116: Invalid arguments for function copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" ))
E116: Invalid arguments for function filter( copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" ))
E116: Invalid arguments for function keys( filter( copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" ))
E116: Invalid arguments for function sort( keys( filter( copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" ))
E116: Invalid arguments for function reverse( sort( keys( filter( copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" ))
E15: Invalid expression: reverse( sort( keys( filter( copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" ))
There's more, and other examples, but they all seem to be complaining about b:sig_marks
.
Sometimes I receive error E19 after a log file is update outside Vim:
Error detected while processing function signature#GotoMark:
line 23:
E19: Mark has invalid line number
E19: Mark has invalid line number
This error message is correct because the file is smaller and the marks became invalid. The error is triggered after I tried to jump to a mark using ['
. But I only tried to jump because the sign column was still present, even when there was no valid mark.
I think it would be better to use a autocmd BufReadPost
to remove any marks that become invalid and remove the sign column.
"Jump to next mark" works only if at least two marks exist.
Try:
$ cat > fu <<
hello world
fubar
baz
$ vim fu
3jmx
3k
]`
The "jump to next mark" doesn't jump to x
. After adding a mark a
on the first line, it works.
The pyclewn plugin for gdb debugging in vim uses marks to show breakpoints or the current location in the file. When used together with vim-signature, these marks are hidden by the "gutter" where the other marks are.
I notice that the "current position" marker (=>) is briefly shown after each "step" or "next" command, but gets hidden right away after that. Breakpoint markers are never shown.
This behaviour occurs both with g:SignaturePeriodicRefresh on and off.
This was working before, the first bad changeset is:
commit 16436bd
Author: KS [email protected]
Date: Thu Aug 30 16:10:24 2012 -0400
Added option to control auto-refresh
In vim, if you delete a line where a lowercase mark is set on (a-z) the mark is automatically deleted. In this plugin (which is great by the way), the sign for that mark remains. If you try to jump to it vim tells you "mark not set".
I get the following when opening the yankring browser:
Error detected while processing function signature#BufferRefresh..59_BufferMaps:
line 51:
E31: No such mapping
Version 1.1 of mark-tools provides this functionality, and it's quite handy from time to time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.