akinsho / bufferline.nvim

A snazzy bufferline for Neovim
GNU General Public License v3.0
3.5k stars 196 forks source link

[Bug]: When using tabs bufferline errors in lvim #560

Closed sampiecz closed 2 years ago

sampiecz commented 2 years ago

Is there an existing issue for this?

What happened?

I like vim's default tabs and splits, I set bufferline to use mode="tabs" and enforce_tabs=true.

In lunarvim if I use <leader>sr, <leader>sf, <leader>st I get this error message.

E5108: Error executing lua vim/shared.lua:0: t: expected table, got nil stack traceback: [C]: in function 'error' vim/shared.lua: in function 'validate' vim/shared.lua: in function 'tbl_filter' .../.local/share/lunarvim/lvim/lua/lvim/core/bufferline.lua:23: in function 'filter' ...k/packer/opt/bufferline.nvim/lua/bufferline/tabpages.lua:121: in function 'get_components' .../site/pack/packer/opt/bufferline.nvim/lua/bufferline.lua:93: in function <.../site/pack/packer/opt/bufferline.nvim/lua/bufferline.lua:89>

What did you expect to happen?

I'd expected for the functionality to continue without the tab errors.

Config

I'm pasting in my entire config.lua, bear with me, I'm new to nvim / lvim and am used to vimrc.

Perhaps this is a config issue on my end?

`-- --[[ -- lvim is the global options object

-- Linters should be -- filled in as strings with either -- a global executable or a path to -- an executable -- ]] -- -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT

-- -- general -- lvim.log.level = "warn" -- lvim.format_on_save = true -- lvim.colorscheme = "zellner" -- -- to disable icons and use a minimalist setup, uncomment the following -- -- lvim.use_icons = false

-- -- keymappings [view all the defaults by pressing Lk] -- lvim.leader = "space" -- -- add your own keymapping -- lvim.keys.normal_mode[""] = ":w" -- -- lvim.keys.normal_mode[""] = ":BufferLineCycleNext" -- -- lvim.keys.normal_mode[""] = ":BufferLineCyclePrev" -- -- unmap a default keymapping -- -- vim.keymap.del("n", "") -- -- override a default keymapping -- -- lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" )

-- -- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. -- -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. -- -- local _, actions = pcall(require, "telescope.actions") -- -- lvim.builtin.telescope.defaults.mappings = { -- -- -- for input mode -- -- i = { -- -- [""] = actions.move_selection_next, -- -- [""] = actions.move_selection_previous, -- -- [""] = actions.cycle_history_next, -- -- [""] = actions.cycle_history_prev, -- -- }, -- -- -- for normal mode -- -- n = { -- -- [""] = actions.move_selection_next, -- -- [""] = actions.move_selection_previous, -- -- }, -- -- }

-- -- Use which-key to add extra bindings with the leader-key prefix -- -- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } -- lvim.builtin.which_key.mappings["t"] = { -- name = "+Trouble", -- r = { "Trouble lsp_references", "References" }, -- f = { "Trouble lsp_definitions", "Definitions" }, -- d = { "Trouble document_diagnostics", "Diagnostics" }, -- q = { "Trouble quickfix", "QuickFix" }, -- l = { "Trouble loclist", "LocationList" }, -- w = { "Trouble workspace_diagnostics", "Workspace Diagnostics" }, -- }

-- -- TODO: User Config for predefined plugins -- -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile -- lvim.builtin.alpha.active = true -- lvim.builtin.alpha.mode = "dashboard" -- lvim.builtin.notify.active = true -- lvim.builtin.terminal.active = true -- lvim.builtin.nvimtree.setup.view.side = "left" -- lvim.builtin.nvimtree.setup.renderer.icons.show.git = false

-- -- if you don't want all the parsers change this to a table of the ones you want -- lvim.builtin.treesitter.ensure_installed = { -- "bash", -- "c", -- "javascript", -- "json", -- "lua", -- "python", -- "typescript", -- "tsx", -- "css", -- "rust", -- "java", -- "yaml", -- }

-- lvim.builtin.treesitter.ignore_install = { "haskell" } -- lvim.builtin.treesitter.highlight.enabled = true

-- -- generic LSP settings

-- -- -- make sure server will always be installed even if the server is in skipped_servers list -- -- lvim.lsp.installer.setup.ensure_installed = { -- -- "sumeko_lua", -- -- "jsonls", -- -- } -- -- -- change UI setting of LspInstallInfo -- -- -- see https://github.com/williamboman/nvim-lsp-installer#default-configuration -- -- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false -- -- lvim.lsp.installer.setup.ui.border = "rounded" -- -- lvim.lsp.installer.setup.ui.keymaps = { -- -- uninstall_server = "d", -- -- toggle_server_expand = "o", -- -- }

-- -- ---@usage disable automatic installation of servers -- -- lvim.lsp.installer.setup.automatic_installation = false

-- -- ---configure a server manually. !!Requires :LvimCacheReset to take effect!! -- -- ---see the full default list :lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers)) -- -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) -- -- local opts = {} -- check the lspconfig documentation for a list of all possible options -- -- require("lvim.lsp.manager").setup("pyright", opts)

-- -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires :LvimCacheReset to take effect!! -- -- ---:LvimInfo lists which server(s) are skipped for the current filetype -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) -- return server ~= "eslint" -- end, lvim.lsp.automatic_configuration.skipped_servers)

-- -- -- you can set a custom on_attach function that will be used for all the language servers -- -- -- See https://github.com/neovim/nvim-lspconfig#keybindings-and-completion -- -- lvim.lsp.on_attach_callback = function(client, bufnr) -- -- local function buf_set_option(...) -- -- vim.api.nvim_buf_set_option(bufnr, ...) -- -- end -- -- --Enable completion triggered by -- -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") -- -- end

-- -- -- set a formatter, this will override the language server formatting capabilities (if it exists) -- local formatters = require "lvim.lsp.null-ls.formatters" -- formatters.setup { -- { command = "black", filetypes = { "python" } }, -- { command = "isort", filetypes = { "python" } }, -- -- { -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration -- -- command = "prettier", -- ---@usage arguments to pass to the formatter -- -- these cannot contain whitespaces, options such as --line-width 80 become either {'--line-width', '80'} or {'--line-width=80'} -- -- extra_args = { "--print-with", "100" }, -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. -- -- filetypes = { "typescript", "typescriptreact" }, -- -- }, -- { command = "eslint", filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact" } }, -- }

-- -- -- set additional linters -- local linters = require "lvim.lsp.null-ls.linters" -- linters.setup { -- { command = "flake8", filetypes = { "python" } }, -- { -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration -- command = "shellcheck", -- ---@usage arguments to pass to the formatter -- -- these cannot contain whitespaces, options such as --line-width 80 become either {'--line-width', '80'} or {'--line-width=80'} -- extra_args = { "--severity", "warning" }, -- }, -- { -- command = "codespell", -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. -- filetypes = { "javascript", "python" }, -- }, -- }

-- -- Additional Plugins -- lvim.plugins = { -- { -- "puremourning/vimspector" -- },

-- { "ruanyl/coverage.vim" },

-- { "vim-test/vim-test" },

-- -- { -- -- "phaazon/hop.nvim", -- -- event = "BufRead", -- -- config = function() -- -- require("hop").setup() -- -- vim.api.nvim_set_keymap("n", "s", ":HopChar2", { silent = true }) -- -- vim.api.nvim_set_keymap("n", "S", ":HopWord", { silent = true }) -- -- end, -- -- },

-- { -- "nacro90/numb.nvim", -- event = "BufRead", -- config = function() -- require("numb").setup { -- show_numbers = true, -- Enable 'number' for the window while peeking -- show_cursorline = true, -- Enable 'cursorline' for the window while peeking -- } -- end, -- },

-- { -- "p00f/nvim-ts-rainbow", -- },

-- { -- "kevinhwang91/nvim-bqf", -- event = { "BufRead", "BufNew" }, -- config = function() -- require("bqf").setup({ -- auto_enable = true, -- preview = { -- win_height = 12, -- win_vheight = 12, -- delay_syntax = 80, -- border_chars = { "┃", "┃", "━", "━", "┏", "┓", "┗", "┛", "█" }, -- }, -- func_map = { -- vsplit = "", -- ptogglemode = "z,", -- stoggleup = "", -- }, -- filter = { -- fzf = { -- action_for = { ["ctrl-s"] = "split" }, -- extra_opts = { "--bind", "ctrl-o:toggle-all", "--prompt", "> " }, -- }, -- }, -- }) -- end, -- },

-- { -- "windwp/nvim-spectre", -- event = "BufRead", -- config = function() -- require("spectre").setup() -- end, -- }, -- { -- "andymass/vim-matchup", -- event = "CursorMoved", -- config = function() -- vim.g.matchup_matchparen_offscreen = { method = "popup" } -- end, -- },

-- { -- "tpope/vim-fugitive", -- cmd = { -- "G", -- "Git", -- "Gdiffsplit", -- "Gread", -- "Gwrite", -- "Ggrep", -- "GMove", -- "GDelete", -- "GBrowse", -- "GRemove", -- "GRename", -- "Glgrep", -- "Gedit" -- }, -- ft = { "fugitive" } -- },

-- { -- "windwp/nvim-ts-autotag", -- config = function() -- require("nvim-ts-autotag").setup() -- end, -- },

-- { -- "pwntester/octo.nvim", -- event = "BufRead", -- },

-- { -- "romgrk/nvim-treesitter-context", -- config = function() -- require("treesitter-context").setup { -- enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) -- throttle = true, -- Throttles plugin updates (may improve performance) -- max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. -- patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. -- -- For all filetypes -- -- Note that setting an entry here replaces all other patterns for this entry. -- -- By setting the 'default' entry below, you can control which nodes you want to -- -- appear in the context window. -- default = { -- 'class', -- 'function', -- 'method', -- }, -- }, -- } -- end -- },

-- { -- "folke/lsp-colors.nvim", -- event = "BufRead", -- },

-- { -- "rktjmp/lush.nvim", -- },

-- { -- "norcalli/nvim-colorizer.lua", -- config = function() -- require("colorizer").setup({ "css", "scss", "html", "javascript", "typescript", "javascriptreact", -- "typescriptreact" }, { -- RGB = true, -- #RGB hex codes -- RRGGBB = true, -- #RRGGBB hex codes -- RRGGBBAA = true, -- #RRGGBBAA hex codes -- rgb_fn = true, -- CSS rgb() and rgba() functions -- hsl_fn = true, -- CSS hsl() and hsla() functions -- css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB -- css_fn = true, -- Enable all CSS functions: rgb_fn, hsl_fn -- }) -- end, -- },

-- { -- "tzachar/cmp-tabnine", -- run = "./install.sh", -- requires = "hrsh7th/nvim-cmp", -- event = "InsertEnter", -- }, -- { -- "rmagatti/goto-preview", -- config = function() -- require('goto-preview').setup { -- width = 120; -- Width of the floating window -- height = 25; -- Height of the floating window -- default_mappings = false; -- Bind default mappings -- debug = false; -- Print debug information -- opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent. -- post_open_hook = nil -- A function taking two arguments, a buffer and a window to be ran as a hook. -- -- You can use "default_mappings = true" setup option -- -- Or explicitly set keybindings -- -- vim.cmd("nnoremap gpd lua require('goto-preview').goto_preview_definition()") -- -- vim.cmd("nnoremap gpi lua require('goto-preview').goto_preview_implementation()") -- -- vim.cmd("nnoremap gP lua require('goto-preview').close_all_win()") -- } -- end -- }, -- { -- "ahmedkhalf/lsp-rooter.nvim", -- event = "BufRead", -- config = function() -- require("lsp-rooter").setup() -- end, -- }, -- { -- "ray-x/lsp_signature.nvim", -- event = "BufRead", -- config = function() require "lsp_signature".on_attach() end, -- }, -- { -- "simrat39/symbols-outline.nvim", -- config = function() -- require('symbols-outline').setup() -- end -- }, -- { -- "folke/trouble.nvim", -- cmd = "TroubleToggle", -- },

-- { -- "lukas-reineke/indent-blankline.nvim", -- event = "BufRead", -- config = function() -- local opts = { -- -- char = "▏", -- filetype_exclude = { -- "alpha", -- "help", -- "terminal", -- "dashboard", -- "lspinfo", -- "lsp-installer", -- "mason", -- }, -- buftype_exclude = { "terminal" }, -- bufname_exclude = { "config.lua" },

-- show_trailing_blankline_indent = false, -- show_first_indent_level = false, -- -- use_treesitter = false, -- }

-- require("indent_blankline").setup(opts) -- end -- },

-- { -- "karb94/neoscroll.nvim", -- event = "WinScrolled", -- config = function() -- require('neoscroll').setup({ -- -- All these keys will be mapped to their corresponding default scrolling animation -- mappings = { '', '', '', '', -- '', '', 'zt', 'zz', 'zb' }, -- hide_cursor = true, -- Hide cursor while scrolling -- stop_eof = true, -- Stop at when scrolling downwards -- use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope -- respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file -- cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further -- easing_function = nil, -- Default easing function -- pre_hook = nil, -- Function to run before the scrolling animation starts -- post_hook = nil, -- Function to run after the scrolling animation ends -- }) -- end -- },

-- { -- "ethanholz/nvim-lastplace", -- event = "BufRead", -- config = function() -- require("nvim-lastplace").setup({ -- lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, -- lastplace_ignore_filetype = { -- "gitcommit", "gitrebase", "svn", "hgcommit", -- }, -- lastplace_open_folds = true, -- }) -- end, -- },

-- { -- "folke/todo-comments.nvim", -- event = "BufRead", -- config = function() -- require("todo-comments").setup() -- end, -- },

-- { -- "itchyny/vim-cursorword", -- event = { "BufEnter", "BufNewFile" }, -- config = function() -- vim.api.nvim_command("augroup user_plugin_cursorword") -- vim.api.nvim_command("autocmd!") -- vim.api.nvim_command("autocmd FileType NvimTree,lspsagafinder,dashboard,vista let b:cursorword = 0") -- vim.api.nvim_command("autocmd WinEnter if &diff || &pvw | let b:cursorword = 0 | endif") -- vim.api.nvim_command("autocmd InsertEnter let b:cursorword = 0") -- vim.api.nvim_command("autocmd InsertLeave * let b:cursorword = 1") -- vim.api.nvim_command("augroup END") -- end -- },

-- { -- "felipec/vim-sanegx", -- event = "BufRead", -- },

-- { -- "turbio/bracey.vim", -- cmd = { "Bracey", "BracyStop", "BraceyReload", "BraceyEval" }, -- run = "npm install --prefix server", -- },

-- { -- "ThePrimeagen/harpoon", -- -- config = function() -- -- vim.api.nvim_set_keymap("h", "m", ":lua require('harpoon.mark').add_file()", { silent = true }) -- -- vim.api.nvim_set_keymap("h", "s", ":lua require('harpoon.ui').toggle_quick_menu()", { silent = true }) -- -- vim.api.nvim_set_keymap("h", "p", ":lua require('harpoon.ui').nav_prev()", { silent = true }) -- -- vim.api.nvim_set_keymap("h", "n", ":lua require('harpoon.ui').nav_next()", { silent = true }) -- -- end -- } -- }

-- lvim.builtin.which_key.mappings["h"] = { -- name = "+Harpoon", -- m = { ":lua require('harpoon.mark').add_file()", "Mark" }, -- s = { ":lua require('harpoon.ui').toggle_quick_menu()", "Show" }, -- p = { ":lua require('harpoon.ui').nav_prev()", "Next" }, -- n = { ":lua require('harpoon.ui').nav_next()", "Next" }, -- }

-- lvim.builtin.which_key.mappings["t"] = { -- name = "+Test", -- t = { ":TestNearest", "Test Nearest" }, -- T = { ":TestFile", "Test File" }, -- a = { ":TestSuite", "Test Suite" }, -- l = { ":TestLast", "Test Last" }, -- g = { ":TestVisit", "Test Visit" }, -- }

-- -- Autocommands (https://neovim.io/doc/user/autocmd.html) -- -- vim.api.nvim_create_autocmd("BufWritePre", { -- -- pattern = { ".tsx", ".ts", ".jsx", ".js" }, -- -- command = "EslintFixAll", -- -- }) -- -- vim.api.nvim_create_autocmd("FileType", { -- -- pattern = "zsh", -- -- callback = function() -- -- -- let treesitter use bash highlight for zsh files as well -- -- require("nvim-treesitter.highlight").attach(0, "bash") -- -- end, -- -- })

-- lvim.builtin.treesitter.rainbow.enable = true -- lvim.builtin.bufferline.options.mode = "tabs" -- vim.wo.relativenumber = true -- -- lvim.format_on_save = true

-- -- -- Specify the path to coverage.json file relative to your current working directory. -- -- lvim.plugins.coverage_json_report_path = 'coverage/coverage-final.json'

-- -- -- Define the symbol display for covered lines -- -- lvim.plugins.coverage_sign_covered = '⦿'

-- -- -- Define the interval time of updating the coverage lines -- -- lvim.plugins.coverage_interval = 5000

-- -- -- Do not display signs on covered lines -- -- lvim.plugins.coverage_show_covered = 0

-- -- -- Display signs on uncovered lines -- -- lvim.plugins.coverage_show_uncovered = 1

-- local on_attach = function(client, bufnr) -- if client.name == "tsserver" then -- client.server_capabilities.documentFormattingProvider = false -- 0.8 and later -- end -- if client.name == "eslint" then -- client.server_capabilities.documentFormattingProvider = false -- 0.8 and later -- end -- -- rest of the initialization -- end

-- -- local lsp_formatting = function(bufnr) -- -- vim.lsp.buf.format({ -- -- filter = function(client) -- -- -- apply whatever logic you want (in this example, we'll only use null-ls) -- -- return client.name == "null-ls" -- -- end, -- -- bufnr = bufnr, -- -- }) -- -- end

-- -- -- if you want to set up formatting on save, you can use this as a callback -- -- local augroup = vim.api.nvim_create_augroup("LspFormatting", {})

-- -- -- add to your shared on_attach callback -- -- local on_attach = function(client, bufnr) -- -- if client.supports_method("textDocument/formatting") then -- -- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) -- -- vim.api.nvim_create_autocmd("BufWritePre", { -- -- group = augroup, -- -- buffer = bufnr, -- -- callback = function() -- -- lsp_formatting(bufnr) -- -- end, -- -- }) -- -- end -- -- end

--[[ lvim is the global options object

Linters should be filled in as strings with either a global executable or a path to an executable ]] -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT

-- general lvim.log.level = "warn" lvim.format_on_save = true lvim.colorscheme = "zellner" -- to disable icons and use a minimalist setup, uncomment the following -- lvim.use_icons = false

-- keymappings [view all the defaults by pressing Lk] lvim.leader = "space" -- add your own keymapping lvim.keys.normal_mode[""] = ":w" -- lvim.keys.normal_mode[""] = ":BufferLineCycleNext" -- lvim.keys.normal_mode[""] = ":BufferLineCyclePrev" -- unmap a default keymapping -- vim.keymap.del("n", "") -- override a default keymapping -- lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" )

-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. -- local _, actions = pcall(require, "telescope.actions") -- lvim.builtin.telescope.defaults.mappings = { -- -- for input mode -- i = { -- [""] = actions.move_selection_next, -- [""] = actions.move_selection_previous, -- [""] = actions.cycle_history_next, -- [""] = actions.cycle_history_prev, -- }, -- -- for normal mode -- n = { -- [""] = actions.move_selection_next, -- [""] = actions.move_selection_previous, -- }, -- }

-- Use which-key to add extra bindings with the leader-key prefix -- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } lvim.builtin.which_key.mappings["t"] = { name = "+Trouble", r = { "Trouble lsp_references", "References" }, f = { "Trouble lsp_definitions", "Definitions" }, d = { "Trouble document_diagnostics", "Diagnostics" }, q = { "Trouble quickfix", "QuickFix" }, l = { "Trouble loclist", "LocationList" }, w = { "Trouble workspace_diagnostics", "Workspace Diagnostics" }, }

-- TODO: User Config for predefined plugins -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile lvim.builtin.alpha.active = true lvim.builtin.alpha.mode = "dashboard" lvim.builtin.notify.active = true lvim.builtin.terminal.active = true lvim.builtin.nvimtree.setup.view.side = "left" lvim.builtin.nvimtree.setup.renderer.icons.show.git = false

-- if you don't want all the parsers change this to a table of the ones you want lvim.builtin.treesitter.ensure_installed = { "bash", "c", "javascript", "json", "lua", "python", "typescript", "tsx", "css", "rust", "java", "yaml", }

lvim.builtin.treesitter.ignore_install = { "haskell" } lvim.builtin.treesitter.highlight.enabled = true

-- generic LSP settings

-- -- make sure server will always be installed even if the server is in skipped_servers list -- lvim.lsp.installer.setup.ensure_installed = { -- "sumeko_lua", -- "jsonls", -- } -- -- change UI setting of LspInstallInfo -- -- see https://github.com/williamboman/nvim-lsp-installer#default-configuration -- lvim.lsp.installer.setup.ui.check_outdated_servers_on_open = false -- lvim.lsp.installer.setup.ui.border = "rounded" -- lvim.lsp.installer.setup.ui.keymaps = { -- uninstall_server = "d", -- toggle_server_expand = "o", -- }

-- ---@usage disable automatic installation of servers -- lvim.lsp.installer.setup.automatic_installation = false

-- ---configure a server manually. !!Requires :LvimCacheReset to take effect!! -- ---see the full default list :lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers)) -- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) -- local opts = {} -- check the lspconfig documentation for a list of all possible options -- require("lvim.lsp.manager").setup("pyright", opts)

-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires :LvimCacheReset to take effect!! -- ---:LvimInfo lists which server(s) are skipped for the current filetype lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) return server ~= "eslint" end, lvim.lsp.automatic_configuration.skipped_servers)

-- -- you can set a custom on_attach function that will be used for all the language servers -- -- See https://github.com/neovim/nvim-lspconfig#keybindings-and-completion -- lvim.lsp.on_attach_callback = function(client, bufnr) -- local function buf_set_option(...) -- vim.api.nvim_buf_set_option(bufnr, ...) -- end -- --Enable completion triggered by -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") -- end

-- -- set a formatter, this will override the language server formatting capabilities (if it exists) local formatters = require "lvim.lsp.null-ls.formatters" formatters.setup { { command = "black", filetypes = { "python" } }, { command = "isort", filetypes = { "python" } }, -- { -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration -- command = "prettier", -- ---@usage arguments to pass to the formatter -- -- these cannot contain whitespaces, options such as --line-width 80 become either {'--line-width', '80'} or {'--line-width=80'} -- -- extra_args = { "--print-with", "100" }, -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. -- filetypes = { "typescript", "typescriptreact" }, -- }, { command = "eslint", filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact" } }, }

-- -- set additional linters local linters = require "lvim.lsp.null-ls.linters" linters.setup { { command = "flake8", filetypes = { "python" } }, { -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration command = "shellcheck", ---@usage arguments to pass to the formatter -- these cannot contain whitespaces, options such as --line-width 80 become either {'--line-width', '80'} or {'--line-width=80'} extra_args = { "--severity", "warning" }, }, { command = "codespell", ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. filetypes = { "javascript", "python" }, }, }

-- Additional Plugins lvim.plugins = {

{ "ruanyl/coverage.vim" },

{ "vim-test/vim-test" },

-- { -- "phaazon/hop.nvim", -- event = "BufRead", -- config = function() -- require("hop").setup() -- vim.api.nvim_set_keymap("n", "s", ":HopChar2", { silent = true }) -- vim.api.nvim_set_keymap("n", "S", ":HopWord", { silent = true }) -- end, -- },

{ "nacro90/numb.nvim", event = "BufRead", config = function() require("numb").setup { show_numbers = true, -- Enable 'number' for the window while peeking show_cursorline = true, -- Enable 'cursorline' for the window while peeking } end, },

{ "p00f/nvim-ts-rainbow", },

{ "kevinhwang91/nvim-bqf", event = { "BufRead", "BufNew" }, config = function() require("bqf").setup({ auto_enable = true, preview = { win_height = 12, win_vheight = 12, delay_syntax = 80, border_chars = { "┃", "┃", "━", "━", "┏", "┓", "┗", "┛", "█" }, }, func_map = { vsplit = "", ptogglemode = "z,", stoggleup = "", }, filter = { fzf = { action_for = { ["ctrl-s"] = "split" }, extra_opts = { "--bind", "ctrl-o:toggle-all", "--prompt", "> " }, }, }, }) end, },

{ "windwp/nvim-spectre", event = "BufRead", config = function() require("spectre").setup() end, }, { "andymass/vim-matchup", event = "CursorMoved", config = function() vim.g.matchup_matchparen_offscreen = { method = "popup" } end, },

{ "tpope/vim-fugitive", cmd = { "G", "Git", "Gdiffsplit", "Gread", "Gwrite", "Ggrep", "GMove", "GDelete", "GBrowse", "GRemove", "GRename", "Glgrep", "Gedit" }, ft = { "fugitive" } },

{ "windwp/nvim-ts-autotag", config = function() require("nvim-ts-autotag").setup() end, },

{ "pwntester/octo.nvim", event = "BufRead", },

{ "romgrk/nvim-treesitter-context", config = function() require("treesitter-context").setup { enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) throttle = true, -- Throttles plugin updates (may improve performance) max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. -- For all filetypes -- Note that setting an entry here replaces all other patterns for this entry. -- By setting the 'default' entry below, you can control which nodes you want to -- appear in the context window. default = { 'class', 'function', 'method', }, }, } end },

{ "folke/lsp-colors.nvim", event = "BufRead", },

{ "rktjmp/lush.nvim", },

{ "norcalli/nvim-colorizer.lua", config = function() require("colorizer").setup({ "css", "scss", "html", "javascript", "typescript", "javascriptreact", "typescriptreact" }, { RGB = true, -- #RGB hex codes RRGGBB = true, -- #RRGGBB hex codes RRGGBBAA = true, -- #RRGGBBAA hex codes rgb_fn = true, -- CSS rgb() and rgba() functions hsl_fn = true, -- CSS hsl() and hsla() functions css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB css_fn = true, -- Enable all CSS functions: rgb_fn, hsl_fn }) end, },

{ "tzachar/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp", event = "InsertEnter", }, { "rmagatti/goto-preview", config = function() require('goto-preview').setup { width = 120; -- Width of the floating window height = 25; -- Height of the floating window default_mappings = false; -- Bind default mappings debug = false; -- Print debug information opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent. post_open_hook = nil -- A function taking two arguments, a buffer and a window to be ran as a hook. -- You can use "default_mappings = true" setup option -- Or explicitly set keybindings -- vim.cmd("nnoremap gpd lua require('goto-preview').goto_preview_definition()") -- vim.cmd("nnoremap gpi lua require('goto-preview').goto_preview_implementation()") -- vim.cmd("nnoremap gP lua require('goto-preview').close_all_win()") } end }, { "ahmedkhalf/lsp-rooter.nvim", event = "BufRead", config = function() require("lsp-rooter").setup() end, }, { "ray-x/lsp_signature.nvim", event = "BufRead", config = function() require "lsp_signature".on_attach() end, }, { "simrat39/symbols-outline.nvim", config = function() require('symbols-outline').setup() end }, { "folke/trouble.nvim", cmd = "TroubleToggle", },

{ "lukas-reineke/indent-blankline.nvim", event = "BufRead", config = function() local opts = { -- char = "▏", filetype_exclude = { "alpha", "help", "terminal", "dashboard", "lspinfo", "lsp-installer", "mason", }, buftype_exclude = { "terminal" }, bufname_exclude = { "config.lua" },

    show_trailing_blankline_indent = false,
    show_first_indent_level = false,
    -- use_treesitter = false,
  }

  require("indent_blankline").setup(opts)
end

},

{ "karb94/neoscroll.nvim", event = "WinScrolled", config = function() require('neoscroll').setup({ -- All these keys will be mapped to their corresponding default scrolling animation mappings = { '', '', '', '', '', '', 'zt', 'zz', 'zb' }, hide_cursor = true, -- Hide cursor while scrolling stop_eof = true, -- Stop at when scrolling downwards use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further easing_function = nil, -- Default easing function pre_hook = nil, -- Function to run before the scrolling animation starts post_hook = nil, -- Function to run after the scrolling animation ends }) end },

{ "ethanholz/nvim-lastplace", event = "BufRead", config = function() require("nvim-lastplace").setup({ lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit", }, lastplace_open_folds = true, }) end, },

{ "folke/todo-comments.nvim", event = "BufRead", config = function() require("todo-comments").setup() end, },

{ "itchyny/vim-cursorword", event = { "BufEnter", "BufNewFile" }, config = function() vim.api.nvim_command("augroup user_plugin_cursorword") vim.api.nvim_command("autocmd!") vim.api.nvim_command("autocmd FileType NvimTree,lspsagafinder,dashboard,vista let b:cursorword = 0") vim.api.nvim_command("autocmd WinEnter if &diff || &pvw | let b:cursorword = 0 | endif") vim.api.nvim_command("autocmd InsertEnter let b:cursorword = 0") vim.api.nvim_command("autocmd InsertLeave * let b:cursorword = 1") vim.api.nvim_command("augroup END") end },

{ "felipec/vim-sanegx", event = "BufRead", },

{ "turbio/bracey.vim", cmd = { "Bracey", "BracyStop", "BraceyReload", "BraceyEval" }, run = "npm install --prefix server", },

{ "ThePrimeagen/harpoon", -- config = function() -- vim.api.nvim_set_keymap("h", "m", ":lua require('harpoon.mark').add_file()", { silent = true }) -- vim.api.nvim_set_keymap("h", "s", ":lua require('harpoon.ui').toggle_quick_menu()", { silent = true }) -- vim.api.nvim_set_keymap("h", "p", ":lua require('harpoon.ui').nav_prev()", { silent = true }) -- vim.api.nvim_set_keymap("h", "n", ":lua require('harpoon.ui').nav_next()", { silent = true }) -- end } }

lvim.builtin.which_key.mappings["h"] = { name = "+Harpoon", m = { ":lua require('harpoon.mark').add_file()", "Mark" }, s = { ":lua require('harpoon.ui').toggle_quick_menu()", "Show" }, p = { ":lua require('harpoon.ui').nav_prev()", "Next" }, n = { ":lua require('harpoon.ui').nav_next()", "Next" }, }

lvim.builtin.which_key.mappings["t"] = { name = "+Test", t = { ":TestNearest", "Test Nearest" }, T = { ":TestFile", "Test File" }, a = { ":TestSuite", "Test Suite" }, l = { ":TestLast", "Test Last" }, g = { ":TestVisit", "Test Visit" }, }

-- Autocommands (https://neovim.io/doc/user/autocmd.html) vim.api.nvim_create_autocmd("BufWritePre", { pattern = { ".tsx", ".ts", ".jsx", ".js" }, command = "EslintFixAll", }) -- vim.api.nvim_create_autocmd("FileType", { -- pattern = "zsh", -- callback = function() -- -- let treesitter use bash highlight for zsh files as well -- require("nvim-treesitter.highlight").attach(0, "bash") -- end, -- })

lvim.builtin.treesitter.rainbow.enable = true lvim.builtin.bufferline.options.mode = "tabs" lvim.builtin.bufferline.options.enforce_regular_tabs = true vim.wo.relativenumber = true lvim.format_on_save = true

-- -- Specify the path to coverage.json file relative to your current working directory. -- lvim.plugins.coverage_json_report_path = 'coverage/coverage-final.json'

-- -- Define the symbol display for covered lines -- lvim.plugins.coverage_sign_covered = '⦿'

-- -- Define the interval time of updating the coverage lines -- lvim.plugins.coverage_interval = 5000

-- -- Do not display signs on covered lines -- lvim.plugins.coverage_show_covered = 0

-- -- Display signs on uncovered lines -- lvim.plugins.coverage_show_uncovered = 1`

Additional Information

Here is the output from :checkhealth in lunarvim.

` mason: require("mason.health").check()

mason.nvim report

null-ls: require("null-ls.health").check()

nvim: health#nvim#check

Configuration

Performance

Remote Plugins

terminal

tmux

nvim-treesitter: require("nvim-treesitter.health").check()

Installation

Parser/Features H L F I J

provider: health#provider#check

Clipboard (optional)

Python 3 provider (optional)

Python virtualenv

Ruby provider (optional)

Node.js provider (optional)

Perl provider (optional)

telescope: require("telescope.health").check()

Checking for required plugins

Checking external dependencies

===== Installed extensions =====

Telescope Extension: fzf

Telescope Extension: notify

Telescope Extension: projects

vim.lsp: require("vim.lsp.health").check()

vim.treesitter: require("vim.treesitter.health").check()

which_key: health#which_key#check

commit

No response

akinsho commented 2 years ago

@sampiecz sorry but this issue as it stands is not valid, I don't use lunarvim or know what it is doing or how it works, when opening any issues for nvim plugins it is very very helpful to only use the plugin free of any other configuration. If you are having issues, you will need to create a minimal init.lua without any configuration framework that clearly reproduces this issue in as few lines of code as possible free of unrelated code.

I will close this out as is, but please feel free to re-open this issue with a minmal init.lua that I can use to reproduce this issue.

sampiecz commented 2 years ago

Thank you @akinsho ! Totally get that, apologies for adding to the amount of spam you need to sift through.

Appreciate all the work you put into maintaining an open source project :)

sampiecz commented 2 years ago

When I get a chance I'll try out vanilla neovim and let you know if I can reproduce this :bow:

NoamMuallem commented 1 year ago

Hi, did you solved it then?

kohane27 commented 1 year ago

Please format your issue properly