diff options
author | Squibid <me@zacharyscheiman.com> | 2024-08-09 02:45:31 -0400 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-08-09 02:45:31 -0400 |
commit | c489d393695e90d424f9ae51e35c4d42358e6a71 (patch) | |
tree | 12ea97ec4684fd82cd6b73dd127d0137b115837b /lua/conf/plugins/glance.lua | |
parent | ad76983d969c318e6e234bc82384b4b025d70447 (diff) | |
download | nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.gz nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.bz2 nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.zip |
yes there's a bit of java in my nvim config why do you ask?
Diffstat (limited to 'lua/conf/plugins/glance.lua')
-rw-r--r-- | lua/conf/plugins/glance.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lua/conf/plugins/glance.lua b/lua/conf/plugins/glance.lua new file mode 100644 index 0000000..c5a4d41 --- /dev/null +++ b/lua/conf/plugins/glance.lua @@ -0,0 +1,44 @@ +local misc = require('core.misc') +local map = misc.map + +return { 'dnlhc/glance.nvim', + disable = vim.version().minor < 7, + function() + require('glance').setup { + border = { + enable = true, + top_char = '', + bottom_char = '─', + }, + folds = { + fold_closed = '+', + fold_open = '-', + folded = true + }, + theme = { + enable = false + }, + hooks = { + before_open = function(results, open, jump, method) + local uri = vim.uri_from_bufnr(0) + if #results == 1 then + local target_uri = results[1].uri or results[1].targetUri + + if target_uri == uri then + jump() + misc.timeout_highlight() + return + end + end + + open() + end + } + } + + map('n', 'gd', '<cmd>Glance definitions<CR>') + map('n', 'gr', '<cmd>Glance references<CR>') + map('n', 'gy', '<cmd>Glance type_definitions<CR>') + map('n', 'gi', '<cmd>Glance implementations<CR>') + end +} |