-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to not render UI views (#44)
* Add ability to not show UI panes, determined by LayoutProvider. Refine error handling in treesitter context creation. * Add guide on not rendering preview UI * Allow for customizing the cursor character * Add dot_index_expression to catch Lua module functions in ts context * Add Lua method index expression to ts context triggers
- Loading branch information
Showing
8 changed files
with
169 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Hide the Preview UI Pane | ||
|
||
Some folks would prefer to hide the preview UI pane and just have the main bookmark stack rendered. This is possible by leaving off the dimension function for the pane you'd prefer not to render when supplying your own custom `LayoutProvider`. | ||
|
||
Here's an example of leaving the preview UI pane un-rendered, with a sample `lazy.nvim` spec: | ||
```lua | ||
{ | ||
'EvWilson/spelunk.nvim', | ||
dependencies = { | ||
'nvim-lua/plenary.nvim', | ||
}, | ||
config = function() | ||
local spelunk = require('spelunk') | ||
local function width_portion() | ||
return math.floor(vim.o.columns / 20) | ||
end | ||
local function height_portion() | ||
return math.floor(vim.o.lines / 12) | ||
end | ||
local base_dimensions = function() | ||
return { | ||
width = width_portion() * 16, | ||
height = height_portion() * 5, | ||
} | ||
end | ||
spelunk.setup({ | ||
orientation = { | ||
bookmark_dimensions = function() | ||
local dims = base_dimensions() | ||
return { | ||
base = dims, | ||
line = height_portion() * 5, | ||
col = width_portion() * 2, | ||
} | ||
end, | ||
help_dimensions = function() | ||
local dims = base_dimensions() | ||
return { | ||
base = dims, | ||
line = height_portion() * 3, | ||
col = width_portion() * 2, | ||
} | ||
end, | ||
}, | ||
}) | ||
end | ||
}, | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters