Permalink
Browse files

Bugfix, code reorganization and clean-up

* Bugfix for issue#16
* Replaced SignatureLcMarkStr and SignatureUcMarkStr with SignatureMarkOrder
  to avoid ambiguity when a line contains both a local and a global mark
* Corrected marker navigation hotkeys for next and previous marker to ]- and [-
* While creating mappings check that RHS is unassigned to avoid collisions with
  user-created mappings.
* While creating mappings check that LHS is unmapped to avoid re-assigning maps.
* Reorganized code to have a cleaner separation of the SignatureToggle and
  SignatureRefreshDisplay functions
  • Loading branch information...
1 parent 49255ef commit e44b2e8e122a54c1292b0c794e3445a906a19184 @kshenoy committed Mar 27, 2013
Showing with 437 additions and 462 deletions.
  1. +20 −120 README.md
  2. +184 −163 autoload/signature.vim
  3. +222 −0 doc/signature.txt
  4. +11 −179 plugin/signature.vim
View
140 README.md
@@ -1,38 +1,29 @@
# vim-signature
-vim-signature is a plugin to toggle, display and navigate marks.
-What are marks you say... Read [this](http://vim.wikia.com/wiki/Using_marks)
+vim-signature is a plugin to place, toggle and display marks.
+
+Apart from the above, you can also
+* Navigate forward/backward by position/alphabetical order
+* Displaying multiple marks (upto 2, limited by the signs feature)
+* Placing custom signs !@#$%^&*() as visual markers
-Wait a minute...isn't this done not only well but excellently so by vim-showmarks
-and mark-tools; why another plugin you say?
-Well, you are right. However, I got a little impatient with the delay between
-setting and display of marks in vim-showmarks and
-I liked the navigation options which mark-tools provided and I didn't want to
-use two plugins where one would do and
-I was bored and felt like writing my own...
-Are you convinced yet or do you want me to go on? Anyway, that's how vim-signature was born.
-Oh, and I also added some touches of my own such as
-* Displaying multiple marks (upto 2, limited by the signs feature)
-* Placing custom signs !@#$%^&*() as visual markers
+### Screenshots
+[Click](http://imgur.com/a/3KQyt)
+
+### Vim.org mirror
+If you like the plugin, spread the love and rate at http://www.vim.org/scripts/script.php?script_id=4118
-### Screenshots
-[Click](http://imgur.com/a/3KQyt)
-### Vim.org mirror
-If you like the plugin, spread the love and rate at http://www.vim.org/scripts/script.php?script_id=4118
-
-
-## Requirements
-Requires Vim to be compiled with +signs to display marks.
+## Requirements
+Requires Vim to be compiled with +signs to display marks.
## Installation
-I highly recommend using Pathogen or Vundler to do the dirty work for you. If
-for some reason, you do not want to use any of these excellent plugins, then
-unzip it to your ~/.vim directory. You know how it goes...
+I highly recommend using Pathogen or Vundler to do the grunt work for you.
+If for some reason, you do not want to use any of these excellent plugins,
+then unzip it to your ~/.vim directory. You know how it goes...
-So, once that's done, out of the box, the followings mappings are defined by
-default
+Once that's done, out of the box, the followings mappings are defined by default
````
m[a-zA-Z] : Toggle mark
@@ -49,8 +40,8 @@ default
m[0-9] : Toggle the corresponding marker !@#$%^&*()
m<S-[0-9]> : Remove all markers of the same type
- ]= : Jump to next line having same marker
- ]- : Jump to prev line having same marker
+ ]- : Jump to next line having same marker
+ [- : Jump to prev line having same marker
m<BackSpace> : Remove all markers
````
@@ -66,104 +57,13 @@ This is a buffer-specific command.
If for some reason, the marks and their sign displays go out of sync,
use `:SignatureRefreshDisplay` to... well, refresh the display.
-
-## Customisation
-The defaults not to your liking bub? Have no fear; use the following
-variables to set things just the way you want it
-
-* `g:SignatureIncludeMarks` ( Default : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' )
- Specify the marks that can be controlled by this plugin.
- Only supports Alphabetical marks at the moment.
- `b:SignatureIncludeMarks` can be set separately to specify buffer-specific settings.
-
-* `g:SignatureWrapJumps` ( Default : 1 )
- Specify if jumping to marks should wrap-around.
- `b:SignatureWrapJumps` can be set to specify buffer-specific settings.
-
-* `g:SignatureMarkLeader` ( Default: m )
- Set the key used to toggle marks. If this key is set to `<leader>m`,
- `<leader>ma` will toggle the mark 'a'
- `<leader>m,` will place the next available mark
- `<leader>m<Space>` will delete all marks
-
-* `g:SignatureLcMarkStr` ( Default : "\p\m" )
- Set the manner in which local (lowercase) marks are displayed.
- `g:SignatureUcMarkStr` ( Default : "\p\m" )
- Set the manner in which global (uppercase) marks are displayed. Similar to above.
- `b:SignatureLcMarkStr` and `b:SignatureUcMarkStr`can be set separately to specify buffer-specific settings.
-
-`\m` represents the latest mark added and `\p`, the one previous to it.
-````
- g:SignatureLcMarkStr = "\m." : Display last mark with '.' suffixed
- g:SignatureLcMarkStr = "_\m" : Display last mark with '_' prefixed
- g:SignatureLcMarkStr = ">" : Display ">" for a line containing a mark. The mark is not displayed
- g:SignatureLcMarkStr = "\m\p" : Display last two marks placed
-````
-
-You can display upto 2 characters. That's a limitation imposed by the signs
-feature; nothing I can do about it : / .
-Setting the MarkStr to a single character will not suffix the mark.
-Don't be lazy people, if you want to see the mark, set it accordingly.
-Oh, and see in all the above strings, I've used double-quotes and not
-single-quotes. That's not cause I love 'em but things go haywire if
-double-quotes aren't used. Also, `\m` and `\p` cannot be set to _Space_
-
-* `g:SignatureSignTextHL` ( Default : "Exception" )
- The highlight group used for mark displays.
-
-* `g:SignatureMarkerLeader` ( Default: m )
- Set the key used to toggle markers. If this key is set to `<leader>m`
- `<leader>m1` will toggle the marker '!'
- `<leader>m!` will remove all the '!' markers
-
-* `g:SignatureIncludeMarkers` ( Default : '!@#$%^&*()' )
- Specify the markers that can be used by the plugin.
- `b:SignatureIncludeMarkers` can be specified separately for buffer-specific settings
-
-* `g:SignatureDefaultMappings` ( Default : 1 )
- Affects all settings which have <Plug> defined. Will use the default mappings specified above.
-
-````
- <Plug>SIG_PlaceNextMark : Place next available mark ( m, )
- <Plug>SIG_PurgeMarks : Remove all marks ( m<Space> )
- <Plug>SIG_PurgeMarkers : Remove all markers ( m<BackSpace> )
- <Plug>SIG_NextSpotByPos : Jump to next mark ( ]` )
- <Plug>SIG_PrevSpotByPos : Jump to prev mark ( [` )
- <Plug>SIG_NextLineByPos : Jump to start of next line containing a mark ( ]' )
- <Plug>SIG_PrevLineByPos : Jump to start of prev line containing a mark ( [' )
- <Plug>SIG_NextSpotByAlpha : Jump by alphabetical order to next mark ( `] )
- <Plug>SIG_PrevSpotByAlpha : Jump by alphabetical order to prev mark ( `[ )
- <Plug>SIG_NextLineByAlpha : Jump by alphabetical order to start of next line containing a mark ( '] )
- <Plug>SIG_PrevLineByAlpha : Jump by alphabetical order to start of prev line containing a mark ( '[ )
- <Plug>SIG_NextMarkerByType : Jump to next line having same marker ( ]= )
- <Plug>SIG_PrevMarkerByType : Jump to prev line having same marker ( [- )
-````
-
-* `g:SignaturePurgeConfirmation` ( Default: 0 )
- An option for the more clumsy-fingered. Asks for confirmation before deleting all marks
-
-* `g:SignatureDisableMenu` ( Default: 0 )
- Hides the menu if set to 1
-
-* `g:SignatureMenuStruct` ( Default: "P&lugins.&Signature" )
- Set where the menu options are to be displayed. For more details type,
-````
- :h usr_42.txt
-````
-
-* `g:SignaturePeriodicRefresh` ( Default: 1 )
- Enable the display to refresh periodically. Generally a good thing to have : /
+For more details on customization refer the help
## Thanks to...
-Restecp to (no, that's a reference and not a typo :P )
* Sergey Khorev for [mark-tools](http://www.vim.org/scripts/script.php?script_id=2929)
* Zak Johnson for [vim-showmarks](https://github.com/zakj/vim-showmarks)
-I feel obligated to mention that as some portions were coded so well by
-them, I could think of no way to improve them and I've just used it as is.
-Well, you know what they say... _"Good coders use; great coders reuse"_ ;)
-
## ToDo:
* Add custom color support for signs
Oops, something went wrong.

0 comments on commit e44b2e8

Please sign in to comment.