Hot answers tagged

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, ...


2

Ditch echo -ne, for life. Use printf. The Echo command is a portability nightmare; POSIX does not even specify the -e flag and actually says If the first operand is -n, or if any of the operands contain a <backslash> character, the results are implementation-defined. So when you issue echo without knowing exactly which Echo will be called — and that ...


2

You can open the terminal (or create a map) with :exe 'ter'|se nornu nonu Or create an auto-command in .vimrc: autocmd TerminalOpen * set nonu nornu


1

The highlight group for the default ruler is Normal. If you just want to adjust the opacity for everything, this might work. In vim there is not a built-in way to adjust the standard ruler's colors independently from the regular buffer text. In neovim, there is MsgArea, although that covers more than just the ruler. One workaround is to use your own ruler ...


1

I have found that mapping ESC in /home/.vimrc will open vim with replace command. Instead, I did the exact mapping but in /etc/vim/vimrc file and the mapping is executed successfully without the popping of replace command at startup.


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

To detect :make has executed correctly and to continue with vimscript code, a little bit of programming is required. A few years back I've described on SO how it could be done: https://stackoverflow.com/a/56991040/15934 Note: I use a method that analyses the quickfix content instead of :make execution result as sometimes we may chain make with other ...


1

When you run colorscheme default it resets background to default value which is in your case incorrectly detected to be light. So I think if you change the order of commands to: if g:usercolour == 0 colorscheme default set background=dark ... Then it should work for you.


1

Here are some examples. (Note that your keywordAs already covers the bullet, you just need to highlight it as you want.) When the delimiters are always on the same line, this is probably the simplest way to go: syntax match Important /!!.*!!/ But to be more flexible, allowing delimiters anywhere, use a region: " Don't use Question; it's a `:help ...


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