zeroknight / vim-signjump Goto Github PK
View Code? Open in Web Editor NEWJump to signs just like other object motions. A feature that is oddly absent from Vim.
License: MIT License
Jump to signs just like other object motions. A feature that is oddly absent from Vim.
License: MIT License
By default, (Neo)Vim uses [s
, [S
, ]s
, and ]S
for jumping to words highlighted by the spell-check system. This should be addressed in some way. Some ideas:
[|]
for angle brackets <|>
]j
, ]J
, ]k
, ]K
? Not quite as intuitive due to how overloaded and ambiguous bare j
and k
are as a concept.<Leader>
mappings
<Leader>sj
/<Leader>sJ
for next/last sign and <Leader>sk
/<Leader>sK
for prev/first sign?Working out of the box is an important design choice, so there should be no user requirement to map or remap anything themselves, so unbound by default or any kind of prompt is out of the question.
Should NextSign
and PrevSign
support 'wrapscan'
behavior?
In essence, much like searching, NextSign
on or after the last sign would wrap to the beginning of the file and end up on the first sign, vice-versa for PrevSign
.
Remember to update the README to reflect this change.
Jumping to signs while in Visual mode would be pretty useful, especially Visual-Line mode.
The current method of relying on an autocmd to refresh the buffer's cache (b:signjump_signs
) of signs is flawed. While the current list of events to trigger on covers a lot of cases, there are still edge cases that cannot be easily covered.
For example, this scenario with GitGutter:
CursorHold
is triggered. This causes a refresh of the buffer's sign cache.:GitGutterDisable
or :GitGutterToggle
. GitGutter's signs disappear, but the sign cache is not updated to reflect this.There's a new signs API (available in Vim 8.1.0772 and in Neovim), it doesn't need text parsing to get at the juicy bits, unlike :signs place list
.
Of course, wholesale moving to this easier-to-use API does mean the plugin wouldn't be compatible with older versions o (Neo)Vim anymore. Another option is conditional usage, though that likely only has the disadvantage of quasi-duplicating code.
I'm unsure whether it has performance benefits.
Usage of it in vim-lsp
:
$ rg 'sign_[a-z_]*\('
autoload/lsp/ui/vim/signs.vim
55: call sign_define(a:sign_name, l:options)
78: call sign_undefine('LspError')
79: call sign_undefine('LspWarning')
80: call sign_undefine('LspInformation')
81: call sign_undefine('LspHint')
104: let l:sign_group = s:get_sign_group(a:server_name)
105: call sign_unplace(l:sign_group, { 'buffer': a:path })
108:function! s:get_sign_group(server_name) abort
115: let l:sign_group = s:get_sign_group(a:server_name)
125: let l:sign_id = sign_place(0, l:sign_group, l:sign_name, a:path, { 'lnum': l:line })
vim
It would be nice to be able to set up a mapping something like
nnoremap ]d signjump#next_sign(123, 234)
which would only jump to signs 123 and 234 instead of all signs
Regarding #8:
Would also be good to treat groups of signs as the same sign type
This might be tricky if there are overlapping regions with different signs. Maybe able to do text object by specific sign names, or set the priorities of the different names
Plugin installation is pretty straightforward, but some basic steps are good to have, especially for those new to Vim.
Hi,
this plugin parses the output of the :sign
command. However it only works, if it is run in an english locale (e.g. try running :lang mes de_DE
and it will fail miserably :()
So please consider for parsing switching the locale to english. I am doing something similar for my DynamicsSign plugin here
If I have multiple lines in a row with a sign I would like to be able to jump to the next section of lines with a sign in it and skip over all the remaining ones in the section I am in
Ideally signs could be configurably grouped (e.g. all signs from a certain plugin) and those treated as a single section
Currently vim-signjump uses the following to get a list of all placed signs in a buffer:
split(execute('sign place buffer='.a:buffer, 'silent'), '\n'),
However, this doesn't work when a plugin has placed signs in their own group (an example is vim-lsp
).
Changing this to:
split(execute('sign place group=* buffer='.a:buffer, 'silent'), '\n'),
Fixes it. I haven't been able to observe an ill effect in vim-signjump.
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.