Compare commits
No commits in common. "2d146ff7791aed2e649924bfad45c9bc6aec739d" and "2dcd24a5efa7327a130da0acdcb6fd21207c522e" have entirely different histories.
2d146ff779
...
2dcd24a5ef
@ -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;
|
||||
padding: 0;
|
||||
|
@ -16,14 +16,11 @@ end
|
||||
local function header()
|
||||
local filetype = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||
if filetype ~= "" then
|
||||
local current_file_fullpath = debug.getinfo(1, "S").source:sub(2)
|
||||
local current_file_path = current_file_fullpath:match("(.*/)")
|
||||
local tpl_path = current_file_path .. '../../data/tpl/header-' .. filetype .. '.tpl'
|
||||
if file_exists(tpl_path) then
|
||||
local lines = get_lines_from(tpl_path)
|
||||
if file_exists('data/tpl/header-' .. filetype .. '.tpl') then
|
||||
local lines = get_lines_from('data/tpl/header-' .. filetype .. '.tpl')
|
||||
vim.api.nvim_put(lines, "l", false, true)
|
||||
else
|
||||
print("Pas de fichier pour ce filetype (" .. tpl_path .. ")")
|
||||
print("Pas de fichier pour ce filetype")
|
||||
end
|
||||
|
||||
else
|
||||
|
@ -20,7 +20,7 @@ EOF
|
||||
endfunction
|
||||
|
||||
command! Greet lua require'greetings'.greet()
|
||||
command! Header lua require'tpl'.header()
|
||||
command! Tpl lua require'tpl'.header()
|
||||
|
||||
augroup ReloadingGroup
|
||||
autocmd!
|
||||
|
Loading…
x
Reference in New Issue
Block a user