GithubHelp home page GithubHelp logo

Comments (18)

folke avatar folke commented on June 30, 2024 3

additional_vim_regex_highlighting is really bad. It honestly should not be an option in treesitter. Disable it and test again.

from noice.nvim.

folke avatar folke commented on June 30, 2024 2

@unrealapex it should be less than a ms at least. Can you post your config?

As @Shougo mentioned, a minimal init.lua would be great to be able to reproduce.

from noice.nvim.

Shougo avatar Shougo commented on June 30, 2024 2

It means vim treesitter highlight?
It should be disabled in noice.nvim cmdline.

from noice.nvim.

folke avatar folke commented on June 30, 2024 2

Indent also causes performance issue in Treesitter, so might also be the culprit

from noice.nvim.

Shougo avatar Shougo commented on June 30, 2024 1

Oh, the list is too long. You should disable plugins one by one...

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024 1

Oddly enough, it appears that treesitter is causing a majority of the delay.

from noice.nvim.

Shougo avatar Shougo commented on June 30, 2024 1

It seems your configuration issue. Close?

from noice.nvim.

folke avatar folke commented on June 30, 2024

I experimented with native cursors, but that leads to a whole lot of issues due to autocmds that are triggered when entering the cmdline window. But even with the native cursors, you're still only looking at a view of the cmdline.

I simply receive events from Neovim, that tell me what the cmdline is and where the position should be for the cursor.

Thinking about it, native cursors would have a similar delay.

I honestly don't notice any delays. Is it very noticable for you?

And yes, great idea to use details for the logs!

from noice.nvim.

Shougo avatar Shougo commented on June 30, 2024

I think you should create the minimal init.vim.

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

I experimented with native cursors, but that leads to a whole lot of issues due to autocmds that are triggered when entering the cmdline window. But even with the native cursors, you're still only looking at a view of the cmdline.

I simply receive events from Neovim, that tell me what the cmdline is and where the position should be for the cursor.

Thinking about it, native cursors would have a similar delay.

I understand.

I honestly don't notice any delays. Is it very noticable for you?

Yep, the delay is around a second. This is unlikely but perhaps inputting keys too fast might be the problem?

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

I think you should create the minimal init.vim.

Clarify how this would improve Noice's performance. What do you think I would need to do to make it more minimal? Have you checked my Neovim config?

from noice.nvim.

Shougo avatar Shougo commented on June 30, 2024

If it is noice.nvim problem, it must be reproduced by other people.
Your configuration is too long to test.

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

Oh I see what you mean. Thank you for the clarification Shougo and Folke. I will create a minimal init.lua example and see if the delay is still present.

My Neovim config takes around 600 ms to load(using Neovide, ~400ms in TUI). Here is my [unminimal] config: https://github.com/UnrealApex/dotfiles

Below are significant parts of my config if it makes it easier:

init.vim
" disable vi-compatability mode and enables useful vim functionality
set nocompatible
" allow hidden buffers
set hidden
" set the font to Ubuntu Mono and the font size to 14 pixels
set guifont=UbuntuMono\ NF:h14
" show line numbers
set number
" show relative line numbers
set relativenumber
" disable annoying error bell to prevent your ears from dying
set noerrorbells visualbell t_vb=
" syntax highlighting
syntax on
" enable filetype detection
filetype on
" omni completion
filetype plugin on
" better indentation
filetype indent on
" don't show mode in status bar (insert/replace/...)
set noshowmode
" show typed command in status bar
set showcmd
" show cursor position in status bar
set ruler
" show file in titlebar
set title
" 8 lines above or below cursor when scrolling
set scrolloff=8
" don't wrap lines
set nowrap
" basic completion
set omnifunc=syntaxcomplete#Complete
set completeopt=menu,menuone,noselect
set list
set listchars=
" automatic indentation
set autoindent
set fo+=jpor
" more powerful backspacing
set backspace=indent,eol,start
" set tabs to two spaces
set tabstop=2
set shiftwidth=2
" indents to next multiple of 'shiftwidth'.
set shiftround
set expandtab
" incremental search
set incsearch
set magic
" ignore case unless explicitly stated
set ignorecase
set smartcase
" reread file if it has been modified outside of Vim
set autoread
" save yourself some memory
" you are never gonna undo 1000 steps which is the default value for undolevels
" 50 is the default value for history which is relatively low to be useful.
set undolevels=500 history=500
" store all swap files in one directory
set dir=$HOME/.vim/swap//
" store all backup files in one directory
set backupdir=$HOME/.vim/swap//
" persistent undo tree
set undofile undodir=$HOME/.vim/undo//
set wildmode=longest:full,full
set wildmenu
" auto close html tags
set matchpairs+=<:>
" set updatetime to 200 milliseconds
set updatetime=200
" set window background to dark
set background=dark
set termguicolors
set lazyredraw
" set gutter color to match background color
highlight clear SignColumn
" set path
set path+=.,**

augroup show_whitespace
autocmd!
autocmd ModeChanged :[vV\x16] :set listchars+=space:ยท
autocmd Modechanged [vV\x16]: :set listchars-=space:ยท
augroup END

autocmd BufEnter * call ChangeWorkingDirectory()
" set the working directory as the one of the file currently being edited
function ChangeWorkingDirectory()
if (bufname() != "" && &buftype == "" && &filetype != "" && &readonly == 0)
lcd %:p:h
" don't change the working directory for buffers that aren't files
else
endif
endfunction

" matchit plugin
packadd matchit
" built in debugger(requires gdb)
packadd termdebug

" change map leader to space
let mapleader=" "

" remap this so that using Ctrl + C doesn't have a delay
let g:ftplugin_sql_omni_key = '<C-;>'

" plugins
let $PLUGINS = stdpath("config") . "\plugins/plug.vim"
" keymaps
let $KEYMAPS = stdpath("config") . "\keymaps.vim"

command Prose call ProseMode()

" keymap management
runtime keymaps.vim
" plugin management
runtime plugins/plug.vim

plug.vim(vimscript/lua, 37 plugins)
" plugins
" automatically install vim plug
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  :echo "Installing Vim Plug"
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  :echo "Vim Plug installed"
endif

" plugins (make sure you have vim plug installed, run :PlugInstall to install them)
call plug#begin('~/.vim/plugged')
" lua libary
Plug 'nvim-lua/plenary.nvim'
" make neovim faster
Plug 'lewis6991/impatient.nvim'
Plug 'dstein64/vim-startuptime', {'on': 'StartupTime'}
" vim popup api
Plug 'nvim-lua/popup.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'folke/noice.nvim'
" more aesthetic notifications
Plug 'rcarriga/nvim-notify'
" file explorer
Plug 'tpope/vim-vinegar'
Plug 'preservim/tagbar'
" richer git integration
Plug 'lewis6991/gitsigns.nvim'
" status bar
Plug 'nvim-lualine/lualine.nvim'
" basic git integration
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
" git conflict helper
Plug 'rhysd/conflict-marker.vim'
" sensible default settings
Plug 'tpope/vim-sensible'
" commenter
Plug 'numToStr/Comment.nvim'
" indent guides
Plug 'Yggdroot/indentLine'
" zen mode
Plug 'junegunn/goyo.vim', {'on': 'Goyo'}
" easy parenthesis matching
Plug 'junegunn/rainbow_parentheses.vim'
" autocomplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}

" Repeat.vim
Plug 'tpope/vim-repeat'
" start screen
Plug 'mhinz/vim-startify'
" fuzzy finder
Plug 'nvim-telescope/telescope.nvim'
" sets vim.ui.select to telescope
Plug 'nvim-telescope/telescope-ui-select.nvim'
" not supported on windows
" Plug 'nvim-telescope/telescope-media-files.nvim'
" TODO: get Telescope fzf working
" TODO: figure out why this extension is not being found
" increase telescope search speed
" Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
" better movement
Plug 'ggandor/leap.nvim'
" multi cursor support
Plug 'mg979/vim-visual-multi'
" Emmet
Plug 'mattn/emmet-vim', {'for': ['html', 'css']}
" icons
Plug 'ryanoasis/vim-devicons'
" easily change dates
Plug 'tpope/vim-speeddating'
" keymap hints
Plug 'folke/which-key.nvim'
" color scheme
Plug 'folke/tokyonight.nvim'
" better buffer management
Plug 'matbme/JABS.nvim'
" markdown preview
Plug 'ellisonleao/glow.nvim'
Plug 'akinsho/toggleterm.nvim'
call plug#end()

" enable IndentLine
let g:indentLine_enabled = 1
" prevent indentLine from setting conceallevel for markdown files
let g:markdown_syntax_conceal=0
" prevent indentLine from setting conceallevel for json files
let g:vim_json_conceal=0
" files for indentLine to exclude
let g:indentLine_fileTypeExclude = ['help', 'startify', 'dashboard', 'packer', 'neogitstatus', 'NvimTree', 'Trouble', 'WhichKey', 'lsp-installer', 'mason', 'text', 'sh']

let g:VM_maps = {}

" map Leader z to toggle Goyo
nnoremap z :Goyo

" prose mode
" does not work without goyo
function ProseMode()
if (!exists('t:goyo_master'))
" enable prose mode
" set spell checking
setlocal spell spelllang=en_us
" set line wrapping
setlocal wrap
" map j and k to navigate visual lines instead of actual lines
" normal mode mappings
nnoremap j gj
nnoremap k gk
nnoremap 0 g0
nnoremap $ g$
nnoremap ^ g^
" visual mode mappings
vnoremap j gj
vnoremap k gk
vnoremap 0 g0
vnoremap $ g$
vnoremap ^ g^
Goyo
echo "Prose Mode Enabled"
else
" disable prose mode
setlocal nospell spelllang=
setlocal nowrap
" hack to return keys back to their original functionalities
" normal mode unmappings
nnoremap j j
nnoremap k k
nnoremap 0 0
nnoremap $ $
nnoremap ^ ^
" visual mode unmappings
vnoremap j j
vnoremap k k
vnoremap 0 0
vnoremap $ $
vnoremap ^ ^
Goyo!
echo "Prose Mode Disabled"
endif
endfunction

nnoremap :Telescope find_files
nnoremap :Telescope live_grep

nnoremap b :JABSOpen

nmap o :TagbarToggle

let g:tagbar_ctags_bin = "$HOME/ctags/ctags.exe"
" bind Enter to accept Copilot suggestions
" imap <script> copilot#Accept("<CR>")
" let g:copilot_no_tab_map = v:true

" after a re-source, fix syntax matching issues (concealing brackets):
if exists('g:loaded_webdevicons')
call webdevicons#refresh()
endif

" enable RainbowParentheses
augroup rainbow_parens
autocmd!
autocmd VimEnter * RainbowParentheses
augroup end

" lua stuff
lua <<EOF
-- set the colorscheme to tokyonight
vim.cmd("colorscheme tokyonight-moon")

-- make neovim faster
require('impatient')

require('Comment').setup()

require("which-key").setup()

require('leap').set_default_keymaps()

-- treesitter stuff
local configs = require("nvim-treesitter.configs")
configs.setup {
ensure_installed = "all",
sync_install = false,
ignore_install = { "" }, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = { "" }, -- list of language that will be disabled
additional_vim_regex_highlighting = true,

},
indent = { enable = true, disable = { "yaml" } },
}

-- require('telescope').load_extension('media_files')

-- todo get toggleterm to start in insert mode
require("toggleterm").setup({
open_mapping = [[]],
})
EOF

" plugin configurations
runtime plugins/coc.vim
runtime plugins/startify.vim
" lua files
lua require("user.lualine")
lua require("user.gitsigns")
lua require("user.notify")
lua require("user.telescope")
lua require("user.jabs")

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

Hmm, it seems that the delay is probably coming from one of the plugins I have installed. Any ideas of what plugin might be causing this? Here they are:

plugins
nvim-lua/plenary.nvim
lewis6991/impatient.nvim
dstein64/vim-startuptime 
nvim-lua/popup.nvim
MunifTanjim/nui.nvim
folke/noice.nvim
rcarriga/nvim-notify
tpope/vim-vinegar
preservim/tagbar
lewis6991/gitsigns.nvim
nvim-lualine/lualine.nvim
tpope/vim-fugitive
tpope/vim-surround
rhysd/conflict-marker.vim
tpope/vim-sensible
numToStr/Comment.nvim
Yggdroot/indentLine
junegunn/goyo.vim 
junegunn/rainbow_parentheses.vim
neoclide/coc.nvim 
nvim-treesitter/nvim-treesitter 
tpope/vim-repeat
mhinz/vim-startify
nvim-telescope/telescope.nvim
nvim-telescope/telescope-ui-select.nvim
ggandor/leap.nvim
mg979/vim-visual-multi
mattn/emmet-vim 
ryanoasis/vim-devicons
tpope/vim-speeddating
folke/which-key.nvim
folke/tokyonight.nvim
matbme/JABS.nvim
ellisonleao/glow.nvim
akinsho/toggleterm.nvim

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

Good idea! I was considering doing this but did not out of laziness. I will try.

from noice.nvim.

folke avatar folke commented on June 30, 2024

@unrealapex do you have any more information on why treesitter is causing this? Or does the delay just disappear without treesitter?

Treesitter is good to be enabled for highlighting, since it supports language injections, which means typing :lua ... will highlight the part after lua as lua.

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

I am not sure the about the exact cause of the delay. As you suggested, it just disappears when treesitter is disabled. If it helps, here is my treesitter config:

local configs = require("nvim-treesitter.configs")
configs.setup {
  ensure_installed = "all",
  sync_install = false, 
  ignore_install = { "" }, -- List of parsers to ignore installing
  highlight = {
    enable = true, -- false will disable the whole extension
    disable = { "" }, -- list of language that will be disabled
    additional_vim_regex_highlighting = true,

  },
  indent = { enable = true, disable = { "yaml" } },
}

from noice.nvim.

unrealapex avatar unrealapex commented on June 30, 2024

Setting additional_vim_regex_highlighting and indent both caused the problem. Thank you!

from noice.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.