Compare commits

..

No commits in common. "2d146ff7791aed2e649924bfad45c9bc6aec739d" and "2dcd24a5efa7327a130da0acdcb6fd21207c522e" have entirely different histories.

3 changed files with 5 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* Reset (Source: https://css-tricks.com/notes-on-josh-comeaus-custom-css-reset/) */ # Reset (Source: https://css-tricks.com/notes-on-josh-comeaus-custom-css-reset/)
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;

View File

@ -16,14 +16,11 @@ end
local function header() local function header()
local filetype = vim.api.nvim_buf_get_option(0, 'filetype') local filetype = vim.api.nvim_buf_get_option(0, 'filetype')
if filetype ~= "" then if filetype ~= "" then
local current_file_fullpath = debug.getinfo(1, "S").source:sub(2) if file_exists('data/tpl/header-' .. filetype .. '.tpl') then
local current_file_path = current_file_fullpath:match("(.*/)") local lines = get_lines_from('data/tpl/header-' .. filetype .. '.tpl')
local tpl_path = current_file_path .. '../../data/tpl/header-' .. filetype .. '.tpl'
if file_exists(tpl_path) then
local lines = get_lines_from(tpl_path)
vim.api.nvim_put(lines, "l", false, true) vim.api.nvim_put(lines, "l", false, true)
else else
print("Pas de fichier pour ce filetype (" .. tpl_path .. ")") print("Pas de fichier pour ce filetype")
end end
else else

View File

@ -20,7 +20,7 @@ EOF
endfunction endfunction
command! Greet lua require'greetings'.greet() command! Greet lua require'greetings'.greet()
command! Header lua require'tpl'.header() command! Tpl lua require'tpl'.header()
augroup ReloadingGroup augroup ReloadingGroup
autocmd! autocmd!