Open samtrek opened 4 months ago
Are you using Vim or Neovim? Is nvim-treesitter
installed and is tree-sitter highlighting enabled?
neovim and nvim-treesitter is installed, but I removed highlighting for markdown, can it still affect zotcite performance?
Thanks for the feedback!
I'll investigate this later. It seems to be possible to use treesitter
for conceal...
With four citations in a line, I can see a delay after pressing the space bar in Insert mode, but only if I have the following lines in my init.lua
:
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.keymap.set('', '<Space>', '<Nop>')
There is no delay with the default mapleader
and maplocalleader
.
vim.g.maplocalleader = ',' The above is my default maplocalleader, let me check and test the performance once again.
I reverted back to the default keybinds for nvim, however, the same problem still persists, when in insert mode the slight delay is manageable (when calling on citations), however when writing normal sentences it can slow down work flow a little bit, especially when moving with the motion jklh vim-motion keys.
I didn't see any slowness in Vim. But, in Neovim, the slowness persists even if I comment out line 652 of autoload/zotcite.vim
:
syn match zoteroKey /@\S*[A-Z0-9]\{8}#/ conceal
So, my idea of using treesitter
to conceal the Zotero key would probably make no difference.
I just discovered that the delay that I was seeing was caused by a new feature that is being introduced in this pull request: https://github.com/R-nvim/R.nvim/pull/116
I changed the default configuration to insert a native R pipe from <LocalLeader>m
(my <LocalLeader>
is a <Space>
) to ;;
and now there is no delay. Of course, the cursor seems to be put when pressing h
and l
keys in Normal mode while moving from one character of the Zotero key to another because the characters are concealed and we can't see the cursor movement, but this is the expected behavior.
<loacalLeader>m
was not used for sending motion?
Trying to see if the lag is CPU dependent, will check it out on a more modern CPU.
I just discovered that the delay that I was seeing was caused by a new feature that is being introduced in this pull request: R-nvim/R.nvim#116
I changed the default configuration to insert a native R pipe from
<LocalLeader>m
(my<LocalLeader>
is a<Space>
) to;;
and now there is no delay. Of course, the cursor seems to be put when pressingh
andl
keys in Normal mode while moving from one character of the Zotero key to another because the characters are concealed and we can't see the cursor movement, but this is the expected behavior.
the above is mainly in .r or .rmd documents, I am using it in *.md files and the lag is visible, when moving with the jkhl keys.
I'll soon merge the branch nvim
into the master
branch. The nvim
branch replaced VimScript with Lua, but I don't think it will make any difference for this issue. Anyway, could you try it?
yes I will give it a try.
The nvim
branch is the master
branch now.
Including more than 3 citations on a single line greatly reduces the typing speed and motion movement in that line, but other lines without citations are not affected. Still use able but things become sluggish as typing continues, and their may even be a millisecond land between what is typed and and what is shown on the screen.