Hot answers tagged

3

An alternative solution that works if you're running the commands inside a Vim instance (you're not, but the existing answer is already the best solution for your exact circumstances) is to use :execute to more specifically delimit the arguments to the LspInstall command. Instead of: :LspInstall tsserver | qall You can use: :execute "LspInstall ...


3

I guess the LspInstall user command is configured to take multiple parameters. No matter, you can use multiple -c flags, each with their own command(s). Specifically... You can use up to 10 "+" or "-c" arguments in a Vim command. They are executed in the order given. A "-S" argument counts as a "-c" argument as well. ...


2

There's no default init file in neovim. There's no requirement to create one. If you have such file then it should consist of the same commands you (can) input at (neo)vim command prompt. If you still don't know what you can do with Vim you should learn this, not "how do I setup the tool I can't make use of". The recommended reading for beginners ...


2

:h nvim_win_get_cursor() will return a tuple containing the current cursor position, which you'll have to unpack to use. It takes an argument {window}, and you can use 0 to specify the current window. :h nvim_get_current_line() is the Neovim Lua analog to getline('.'). Here is an example: function check_back_space() -- get row and column local row, ...


1

disable_commands = true was disabling PackerInstall, PackerSync, etc., but not the plugin, so I switched to using packer.sync() inside plugins.lua, and it worked fine.


1

Removing the following lines from my init.lua vim.cmd [[set runtimepath=$VIMRUNTIME]] vim.cmd [[set packpath=~/.local/share/nvim/site]] and placing all my .lua modules (except init.lua) into ~/.config/nvim/lua fixed the issue.


1

Ok, I assume the following according to your post + image: You're using neovim >= 0.5.0 You've already set up the server with (assuming that the following code is in a lua file like ~/.config/nvim/lua/rofl.lua and you're loading it in your ~/.config/nvim/init.vim with lua require('rofl')): local nvim_lsp = require('lspconfig') nvim_lsp.tsserver.setup({})...


1

I kind of solved the problem.(There might be a better way.) Here is what I did as a Rust programmer. I installed rust.vim plugin. I found a pending pull request for the plugin. I added the code manually from that pull request to see how it works. It gave me the indentation.


1

After a bit of research, I found that there are two autocommands I can use that suit my needs au TermClose * lua require('my-plugin').someFunction() or au TermLeave * lua require('my-plugin').someFunction() The first one works better for me because I only want to run my function once the terminal is killed/closed. The second one is for if you want to run ...


1

A far simpler version of what you're trying to accomplish: inoreabrrev <buffer> \cup ∪ To read/write a buffer, you probably want the API at :help text-functions. If you meant register, you can access it directly @a to read/write it. If you need to do "smarter" things, I would look for a snippets plugin.


1

As of nvim 0.5.1, on MacOS and Linux, it appears that the vim.opt.listchars:append in my original question now works, and for some reason setting the map values as in vim.opt.listchars.extends = "e" or vim.opt.listchars.tab = "t" no longer works. vim.opt.listchars:append({ extends = "#" }) print(vim.inspect(vim.opt.listchars:get(...


Only top voted, non community-wiki answers of a minimum length are eligible