Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [init.lua]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
73 views

Error when adding new string to errorformat in init.lua?

In Neovim I want to jump through Python traceback in the quickfix list. To do that, I set the following option :set errorformat+=%.%#File\ \"%f\"\\,\ line\ %l%.%# and this works well. What ...
Fabz's user avatar
  • 1
1 vote
2 answers
94 views

init.lua - Remove default mapping recursively

I want to use the i_CTRL-G mapping to abort the current cmp selection, but i_CTRL-G is already used by neovim. I tried to delete the mapping with this: vim.keymap.del('i', '<C-g>') But it just ...
Bog's user avatar
  • 479
1 vote
1 answer
126 views

Insert Mode Arrow Keys

I really like Neovim to take notes but there are a lot of friction points when you stay a long time in insert mode.. Anyway, the current problem is that I can't jump lines like in normal mode... I ...
TuberKk Coolio's user avatar
1 vote
1 answer
73 views

Exit Nterm and term quick

Is there a proper way to exit nterm ? My current solution is to enter from nterm to the terminal with i and then c-d.
TuberKk Coolio's user avatar
1 vote
2 answers
108 views

Backspace mapping not working

Can tell me someone why in nvim backspace don't get triggered in insert mode when setting this keymap: vim.api.nvim_set_keymap("i", "<bs>", "<bs><c-g>u",...
TuberKk Coolio's user avatar
2 votes
1 answer
189 views

Conceal features in init.lua

The Neovim user guide says to issue these commands to show the concealed characters in the user guide: :set conceallevel=0 :hi link HelpBar Normal :hi link HelpStar Normal What would be the ...
robertspierre's user avatar
1 vote
1 answer
169 views

How can we set abbreviations in Lua for Neovim?

I am using Neovim and I asked this question from Google Bard and it was answered with this code: vim.g.abbreviations = { ["btw"] = "by the way", ["imo"] = "in my ...
mohamadi_arch's user avatar
1 vote
2 answers
628 views

How to replace a space after a word with a line break (new line)?

In Neovim, I used the J command to join lines, and now I'm looking for a keybinding in normal mode that can do the opposite: replace the space after a word with a line break. I've tried a few "...
pwanker's user avatar
  • 11
0 votes
1 answer
20 views

Conversion in Lua: How to display multiple changed files on disk in Vim?

Related to this post How to display multiple changed files on disk in Vim?, I want to implement this feature in Lua. Some help would be appreciated. set autoread autocmd FocusGained,BufEnter,...
Mega Bang's user avatar
  • 309
2 votes
1 answer
364 views

Neovim: Converting Vimscript Terminal Functions to Lua

Author: @mizlan Source: https://github.com/mizlan/vim-and-cp/blob/master/cp.vim#L16 This code adds charm to neovim integrated terminal. For cpp programs, I have these: F9 compile, F10 run, F12 ...
Mega Bang's user avatar
  • 309
3 votes
2 answers
190 views

Lua Conversion: Disable highlight after search when a motion is triggered or when entering insert mode

Author: @purpleP Source: Turn off highlight on CursorMoved and InsertEnter without remapping (doesn't break search operator pending mode) noremap <expr> <Plug>(StopHL) execute('nohlsearch'...
Mega Bang's user avatar
  • 309
1 vote
1 answer
485 views

Conversion in Lua: Detect OS in Vimscript

Related to this post, Detect OS in Vimscript This configuration detects and sets the operating system in Vim. It uses conditional statements to determine if the OS is Windows or Unix-like. if !exists(&...
Mega Bang's user avatar
  • 309
0 votes
1 answer
220 views

I need help updating config code from vimscript to lua

About three years ago, I had gathered chunks of code from the net and made my init.vim config file. Now, with Lua released, I am unable to convert it. And it's down to you folks whether you can help ...
Mega Bang's user avatar
  • 309
0 votes
0 answers
21 views

switch to terminal opened from autocomand

I am trying to create autocommand to run current python file in a terminal, when it is saved. It is working with the following autocommand: vim.api.nvim_create_autocmd("BufWritePost", { ...
user48990's user avatar
2 votes
2 answers
510 views

How to exclude filetype in autocmd using Neovim's Lua API?

Translating this excellent Vimscript answer for creating an autocmd that applies certain options only to the focused window into Lua, I have the following: local focused_window_group = vim.api....
Jethro Cao's user avatar
0 votes
1 answer
2k views

How to debug-print when writing NeoVim Lua?

While writing/debugging my nvim lua, I would like to have a running log file that I can monitor with tail -f in a side terminal. I couldn't find a good answer to this question via Google. Adding what ...
Myles Prather's user avatar
0 votes
1 answer
189 views

Functions from init.vim to init.lua

How does autocmd FocusLost * call feedkeys("\<esc>") (back to normal mode, if focus is lost) translate to lua in init.lua?
Alois Pichler's user avatar
0 votes
1 answer
2k views

Is there a popular config for Neovim? [closed]

I found a lot of repositories in Github about init.vim like amix vimrc but I couldn't find anything about init.lua. Do you know some repository? I think many of people still using Vim.
mohamadi_arch's user avatar
0 votes
1 answer
600 views

init.lua does not run, silent failure

Trying to set up a new VM, I copied over my dotfiles and they weren't working. I've reduced my init.lua to something very simple. All it has is, vim.opt.tabstop = 2 Yet, when I start up vim, nothing ...
Evan Carroll's user avatar
  • 1,384
1 vote
2 answers
273 views

How to create config to be used by vim init.lua?

I am going to write my nvim config in lua. I want to use this config on several computers. And vim configuration on these computers should be slightly different. For example, on some installations I ...
lesnik's user avatar
  • 471
8 votes
1 answer
6k views

How to configure pylsp when using mason and mason-lspconfig in Neovim?

I want to configure my Python language server (pylsp) in Neovim in a Lua config (init.lua). I just transitioned from a Vimscript to a Lua config with basically zero Lua knowledge and this is causing ...
Nie Dzwiedz's user avatar
1 vote
1 answer
2k views

Neovim augroup and autocommand in lua (relative line numbering)

I'm converting my init.vim into a set of lua config files, called from init.lua I'm trying to convert this from init.vim augroup numbertoggle autocmd! autocmd BufEnter,FocusGained,InsertLeave * ...
Demus's user avatar
  • 11
1 vote
0 answers
351 views

Help setting up init.lua in Neovim, I'm a new user and don't understand the structure for plugins

First of all, I'm not a programmer, but a musician. I just happen to (kind of) know how to use the terminal, and I use a music notation/engraving program called LilyPond that works in the terminal. ...
Kai Vinter's user avatar
1 vote
1 answer
2k views

On Linux system, init.lua and/or init.vim are not sourced automatically

On a VoidLinux system my init.lua (or init.vim) are not being read. nvim foo # init.lua not read nvim -u ~/.config/nvim/init.lua foo # init.lua is read fine The files are in the correct place: ❯ tree ...
erwin's user avatar
  • 281