1
0
Fork 0

nvim: remace command! with Lua function

This commit is contained in:
tastytea 2022-08-15 23:50:44 +02:00
parent 6da883ab59
commit 8ef5508e21
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 7 additions and 3 deletions

View File

@ -18,6 +18,7 @@ vim.api.nvim_create_autocmd(
}
)
-- Insert or update a modeline at the bottom of the buffer
function M.insert_modeline()
local comment_string = vim.o.commentstring
local space_maybe = ''
@ -55,7 +56,7 @@ function M.insert_modeline()
print('modeline inserted')
end
end
vim.cmd([[command! ModelineInsert lua M.insert_modeline()]])
vim.api.nvim_create_user_command('ModelineInsert', M.insert_modeline, {})
-- set colorcolumn to textwidth after buffer is displayed or option is changed
function M.set_colorcolumn()

View File

@ -20,9 +20,12 @@ vim.o.pumheight = 10 -- maximum entries in popup menu
vim.o.smartindent = true -- indent after { and so on
vim.o.statusline = '%<%f %h%m%r%=%-16.(%l,%c%V (%P)%)%y'
vim.o.formatoptions = vim.o.formatoptions .. 'n'
vim.o.splitright = true -- split vertical window right
vim.cmd([[command! -narg=1 -complete=help Hv vert help <args>]])
vim.cmd([[command! -narg=1 -complete=help Ht tab help <args>]])
vim.api.nvim_create_user_command('Hv', 'vertical help', {
nargs = 1, complete = 'help' })
vim.api.nvim_create_user_command('Ht', 'tab help', {
nargs = 1, complete = 'help' })
-- theme
vim.o.termguicolors = true -- 24 bit colours