Coder Social home page Coder Social logo

problem with shebang about vim-config HOT 5 CLOSED

jlaunay avatar jlaunay commented on June 2, 2024
problem with shebang

from vim-config.

Comments (5)

jlaunay avatar jlaunay commented on June 2, 2024

I have no problem if I disable "neovim/nvim-lspconfig" plugin.
Is it misconfigured?

edit: no problem only if I disable lspconfig

from vim-config.

jlaunay avatar jlaunay commented on June 2, 2024

I finally almost managed to fix the problem.
The problem is with the windo e command.
Someone familiar with Vim will most likely find a better solution but here is the hacky trick I used.

	-- Reload if files were supplied in command-line arguments
	if vim.fn.argc() > 0
		and vim.fn.has('vim_starting')
		and not vim.o.modified
		and vim.fn.line('w$') > 4
	then
		-- triggers the FileType autocmd that starts the servers
		vim.cmd('windo e')
	end

My shebangs are 3 lines long so and vim.fn.line('w$') > 4 make vim reloading all buffer windows from disk only for file with more than 3 lines.

Adding |write to the shebang command is an altenative to auto save file before reloading from disk.

from vim-config.

rafi avatar rafi commented on June 2, 2024

The issue seems to be an error from null-ls plugin which calls shellcheck binary and fails somewhere.

You can disable shellcheck or customize its settings in lua/plugins/null-ls.lua, look for builtins.diagnostics.shellcheck.

from vim-config.

jlaunay avatar jlaunay commented on June 2, 2024

Thanks for your answer.
Could another method than vim.cmd('windo e') be used to start the server?
Maybe vim.cmd('w') ?
This way of launching the server causes strange behavior.
For example, I noticed that the autocommand SwapExists here does not work because of this and raise the following error

[dein] Error occurred while executing hook: nvim-lspconfig
[dein] Vim(lua):E5108: Error executing lua /home/jlaunay/.config/nvim/lua/plugins/lspconfig.lua:192: Vim(edit):E325: A
TTENTION
[dein] stack traceback:
[dein] ^I[C]: in function 'cmd'
[dein] ^I/home/jlaunay/.config/nvim/lua/plugins/lspconfig.lua:192: in function 'setup'
[dein] ^I[string ":lua"]:1: in main chunk

For the moment I'm using vim.cmd('w') but I don't know if it's a suitable solution

In the end, I can't find a solution that works.

from vim-config.

rafi avatar rafi commented on June 2, 2024

Pushed a whole new rewrite of vim-config, please test your issue and re-open if it still happens.

from vim-config.

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.