nvim: remace command! with Lua function
This commit is contained in:
parent
6da883ab59
commit
8ef5508e21
|
@ -18,6 +18,7 @@ vim.api.nvim_create_autocmd(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- Insert or update a modeline at the bottom of the buffer
|
||||||
function M.insert_modeline()
|
function M.insert_modeline()
|
||||||
local comment_string = vim.o.commentstring
|
local comment_string = vim.o.commentstring
|
||||||
local space_maybe = ''
|
local space_maybe = ''
|
||||||
|
@ -55,7 +56,7 @@ function M.insert_modeline()
|
||||||
print('modeline inserted')
|
print('modeline inserted')
|
||||||
end
|
end
|
||||||
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
|
-- set colorcolumn to textwidth after buffer is displayed or option is changed
|
||||||
function M.set_colorcolumn()
|
function M.set_colorcolumn()
|
||||||
|
|
|
@ -20,9 +20,12 @@ vim.o.pumheight = 10 -- maximum entries in popup menu
|
||||||
vim.o.smartindent = true -- indent after { and so on
|
vim.o.smartindent = true -- indent after { and so on
|
||||||
vim.o.statusline = '%<%f %h%m%r%=%-16.(%l,%c%V (%P)%)%y'
|
vim.o.statusline = '%<%f %h%m%r%=%-16.(%l,%c%V (%P)%)%y'
|
||||||
vim.o.formatoptions = vim.o.formatoptions .. 'n'
|
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.api.nvim_create_user_command('Hv', 'vertical help', {
|
||||||
vim.cmd([[command! -narg=1 -complete=help Ht tab help <args>]])
|
nargs = 1, complete = 'help' })
|
||||||
|
vim.api.nvim_create_user_command('Ht', 'tab help', {
|
||||||
|
nargs = 1, complete = 'help' })
|
||||||
|
|
||||||
-- theme
|
-- theme
|
||||||
vim.o.termguicolors = true -- 24 bit colours
|
vim.o.termguicolors = true -- 24 bit colours
|
||||||
|
|
Loading…
Reference in New Issue
Block a user