diff --git a/.config/nvim/lua/my/functions.lua b/.config/nvim/lua/my/functions.lua index 76116cd..b89cb58 100644 --- a/.config/nvim/lua/my/functions.lua +++ b/.config/nvim/lua/my/functions.lua @@ -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() diff --git a/.config/nvim/lua/my/settings.lua b/.config/nvim/lua/my/settings.lua index f000364..c24e599 100644 --- a/.config/nvim/lua/my/settings.lua +++ b/.config/nvim/lua/my/settings.lua @@ -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 ]]) -vim.cmd([[command! -narg=1 -complete=help Ht tab help ]]) +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