First commit
This commit is contained in:
commit
fac5782b20
9
lua/greetings/greetings.lua
Normal file
9
lua/greetings/greetings.lua
Normal file
@ -0,0 +1,9 @@
|
||||
local function greet()
|
||||
print('My lord?')
|
||||
local pos = vim.api.nvim_win_get_cursor(0)[2]
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local nline = line:sub(0, pos) .. 'hello' .. line:sub(pos + 1)
|
||||
vim.api.nvim_set_current_line(nline)
|
||||
end
|
||||
|
||||
return greet
|
5
lua/greetings/init.lua
Normal file
5
lua/greetings/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local greet = require('greetings.greetings')
|
||||
|
||||
return {
|
||||
greet = greet
|
||||
}
|
1
lua/test.lua
Normal file
1
lua/test.lua
Normal file
@ -0,0 +1 @@
|
||||
|
34
plugin/crown.vim
Normal file
34
plugin/crown.vim
Normal file
@ -0,0 +1,34 @@
|
||||
" if exists('g:loaded_crown')
|
||||
" finish
|
||||
" endif
|
||||
|
||||
" ! : Redefini la fonction quand le fichier est relu
|
||||
function! ReloadPlugin()
|
||||
" Les paquets sont en caches, le passer à nil, permet qu'il soit rechargé de
|
||||
" zéro au prochain appel
|
||||
|
||||
" Attention à ne pas mettre d'espace devant lua et EOF
|
||||
lua << EOF
|
||||
for k in pairs(package.loaded) do
|
||||
if k:match("^greetings")
|
||||
then package.loaded[k] = nil
|
||||
end
|
||||
end
|
||||
require("greetings")
|
||||
EOF
|
||||
endfunction
|
||||
|
||||
command! Greet lua require'greetings'.greet()
|
||||
|
||||
augroup ReloadingGroup
|
||||
autocmd!
|
||||
au BufWritePost * :call ReloadPlugin()
|
||||
augroup END
|
||||
|
||||
" command! ColorizerDetachFromBuffer lua require'colorizer'.detach_from_buffer(0)
|
||||
" command! ColorizerReloadAllBuffers lua require'colorizer'.reload_all_buffers()
|
||||
" command! ColorizerToggle lua local c = require'colorizer'
|
||||
" \ if c.is_buffer_attached(0) then c.detach_from_buffer(0) else
|
||||
" \ c.attach_to_buffer(0) end
|
||||
|
||||
" let g:loaded_crown = 1
|
Loading…
x
Reference in New Issue
Block a user