diff --git a/.config/nvim/lua/my/functions.lua b/.config/nvim/lua/my/functions.lua index c05ecb0..c3c5c8f 100644 --- a/.config/nvim/lua/my/functions.lua +++ b/.config/nvim/lua/my/functions.lua @@ -1,5 +1,5 @@ -- remove trailing whitespace -function my_remove_trailing_whitespace() +function MY_remove_trailing_whitespace() local curpos = vim.api.nvim_win_get_cursor(0) vim.cmd([[keeppatterns %s/\s\+$//e]]) vim.api.nvim_win_set_cursor(0, curpos) @@ -14,11 +14,11 @@ vim.api.nvim_create_autocmd( '*.lua', '*.cpp', '*.hpp', '*.conf', '*.cfg', '*.ini' }, - callback = my_remove_trailing_whitespace + callback = MY_remove_trailing_whitespace } ) -function my_insert_modeline() +function MY_insert_modeline() local comment_string = vim.o.commentstring local space_maybe = '' if string.match(comment_string, '%%s(.*)') ~= '' then @@ -55,10 +55,10 @@ function my_insert_modeline() print('modeline inserted') end end -vim.cmd([[command! ModelineInsert lua my_insert_modeline()]]) +vim.cmd([[command! ModelineInsert lua MY_insert_modeline()]]) -- set colorcolumn to textwidth after buffer is displayed or option is changed -function my_set_colorcolumn() +function MY_set_colorcolumn() if vim.o.textwidth > 0 then vim.opt_local.colorcolumn = { vim.o.textwidth } else @@ -70,7 +70,7 @@ vim.api.nvim_create_autocmd( { 'BufEnter' }, { group = 'config_settings', - callback = my_set_colorcolumn + callback = MY_set_colorcolumn } ) vim.api.nvim_create_autocmd( @@ -78,6 +78,6 @@ vim.api.nvim_create_autocmd( { group = 'config_settings', pattern = { 'textwidth' }, - callback = my_set_colorcolumn + callback = MY_set_colorcolumn } )