Compare commits
3 Commits
2dcd24a5ef
...
2d146ff779
Author | SHA1 | Date | |
---|---|---|---|
2d146ff779 | |||
0249e9cb61 | |||
e60919f6a7 |
@ -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;
|
||||||
|
@ -16,11 +16,14 @@ 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
|
||||||
if file_exists('data/tpl/header-' .. filetype .. '.tpl') then
|
local current_file_fullpath = debug.getinfo(1, "S").source:sub(2)
|
||||||
local lines = get_lines_from('data/tpl/header-' .. filetype .. '.tpl')
|
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)
|
||||||
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")
|
print("Pas de fichier pour ce filetype (" .. tpl_path .. ")")
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -20,7 +20,7 @@ EOF
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
command! Greet lua require'greetings'.greet()
|
command! Greet lua require'greetings'.greet()
|
||||||
command! Tpl lua require'tpl'.header()
|
command! Header lua require'tpl'.header()
|
||||||
|
|
||||||
augroup ReloadingGroup
|
augroup ReloadingGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user