Hot answers tagged

3 votes
Accepted

Which setting allows me to text wrap whole words instead of letters?

You can use :set linebreak which will make Vim (soft-)break the lines on whitespace and other characters. To which characters exactly, can be further customized using the 'breakat' setting. See the ...
user avatar
2 votes

Configure neovim to use means other than color for syntax highlighting

Neovim is a strange beast. It believes it has at least 256 colors available no matter what. But this is not a big deal. Consider the following. The command :hi[ghlight] accepts the following keys: ...
user avatar
  • 15.4k
2 votes
Accepted

Installing Neovim 0.7 on Ubuntu?

This page linked from the NeoVim readme doesn't yet list 0.7. You might want to try a source build.
user avatar
  • 20.5k
2 votes

How to hide terminal buffer without closing it?

Now vim has :term built in, not just in neo vim. So you can use that and then to hide it use CTRL-W :hide I got this from :help terminal (as suggested in the comments above): You can use CTRL-W :hide ...
user avatar
  • 121
2 votes

Wrap :retab! or create a new command that calls it?

I would propose: function! Fixws() retab! %s/\s\+$// endfunction command! Fixws :call Fixws() The command is :Fixws because the custom command starts with an uppercase.
user avatar
1 vote
Accepted

How is this called, and what do I need to do to get it in Neovim?

I actually got it working now, and, because I really wanted this when I was trying to get it working, here is a minimal working init.lua configuration file to get it up and running, for anyone else ...
user avatar
1 vote
Accepted

Wrap lines only after a space

Maybe the following question answer yours How can I soft-wrap a word to a new line? The author proposes you to use option linebreak: set linebreak
user avatar
1 vote
Accepted

How to remove vim trailing white space?

This should do the trick: vim.api.nvim_create_autocmd({ "BufWritePre" }, { pattern = { "*" }, command = [[%s/\s\+$//e]], }) Be sure to read the h:nvim_create_autocmd() for ...
user avatar
1 vote
Accepted

How to comment html in php file in vim?

I believe your file type is php and your commentstring is /*%s*/ which is reasonable for php files. To solve your problem you could temporarily change commentstring to<!--%s-->: set ...
user avatar
1 vote

leader not working in visual mode in lua?

For anyone migrating from vimscript to lua for their config, make sure you are mindful of the mode you set for the vim.keymap.set function. When you use the new (0.7.0) vim.keymap.set function, there ...
user avatar
  • 75
1 vote

How to make an abbreviation that expands without pressing space

In insert mode, you can expand an abbreviation with C-]. See :help i_CTRL-]. There's an example of calling a function from an abbreviation towards the end of :help abbreviations. You might also want ...
user avatar
  • 1,013
1 vote

How to detect whether the current file might contains a long line?

You can just use the search command to search for the beginning of a line followed by a number of characters. If you do /^.\{30} It will search for the beginning of a line followed by 30 characters, ...
user avatar
  • 11

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