Questions tagged [init.lua]
The init.lua tag has no usage guidance.
17
questions
1
vote
2
answers
72
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 "...
0
votes
1
answer
15
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,...
2
votes
1
answer
76
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 ...
2
votes
2
answers
78
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'...
1
vote
1
answer
73
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(&...
0
votes
1
answer
154
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 ...
0
votes
0
answers
17
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", {
...
2
votes
2
answers
102
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....
0
votes
1
answer
600
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 ...
0
votes
1
answer
152
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?
0
votes
1
answer
1k
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.
0
votes
1
answer
410
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 ...
1
vote
2
answers
234
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 ...
5
votes
1
answer
4k
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 ...
1
vote
1
answer
1k
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 * ...
1
vote
0
answers
268
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.
...
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 ...