Comments (5)
One way to solve this would be to set a custom filetype for the preview buffer in the plugin (say, glowpreview
). Then, while setting the mapping, the autocommand can include that filetype as well. Thoughts?
from glow.nvim.
I cannot toggle the glow preview window by hitting because the mapping is not enabled in the preview buffer.
So are you suggesting to have the same mapping added to call the window and to close it? like a toggling feature? The current :Glow
command already works as a toggle, so if you call the original mapping it will already close the window
from glow.nvim.
I want to map some key (in the above example, <Space>
) to :Glow<CR>
only when file type is markdown, not global. The problem for doing this is that the mapping is not available in the preview buffer. So I proposed enabling to customize mapping to toggle preview window in the preview buffer.
from glow.nvim.
This is what i am not understanding. Do you want a custom mapping to trigger the window AND another one for closing it?
from glow.nvim.
Do you want a custom mapping to trigger the window AND another one for closing it?
Yes. More precisely, I need
augroup glow
autocmd!
autocmd FileType markdown nnoremap <buffer> <silent> <Space> <Cmd>Glow<CR>
augroup END
to open a preview window by typing <Space>
only in markdown file type, AND
-- In lua/glow.lua around lines 115-118
api.nvim_buf_set_keymap(buf, "n", "<Space>", ":lua require('glow').close_window()<cr>",
{noremap = true, silent = true})
to close the preview window, because the above autocmd
does not work in the preview window.
from glow.nvim.
Related Issues (20)
- Update to latest glow version HOT 3
- be explicit in README what markdown standard you support HOT 1
- Auto jump to current location in preview window / Show markdown in splits? HOT 1
- Glow binary is not installed HOT 19
- Weird Markdown preview HOT 3
- Glow Window Empty HOT 3
- Not working on macOS HOT 6
- Option to add more markdown extensions? HOT 1
- Syntastic and glow.nvim: Undefined variable: w:syntastic_wid HOT 3
- Glow shows a blank screen HOT 11
- Neovim hangs right after running :Glow file HOT 7
- [glow] could not execute glow binary in path= . in Windows 10 HOT 4
- Test
- [Feature] Concealer HOT 1
- Can't run glow.nvim, module "glow" not found HOT 1
- Light theme not readable
- Avoid popup HOT 1
- Run Glow with Lua command HOT 2
- Glow is not rendering Headings and Dropdowns HOT 3
- feature: configurable filetypes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glow.nvim.