fix: nvim tek header, rm grammalecte

This commit is contained in:
AngeD 2023-03-06 13:01:15 +01:00
parent dbf9c6a329
commit e92b11db9e
7 changed files with 29 additions and 37 deletions

View File

@ -1,24 +0,0 @@
function! CppHeader()
let file_name = expand('%:t:r')
call EpitechHeader('cpp')
call append(7, '#include "' .. file_name .. '.hpp"')
endfunction
function! HppHeader()
let file_name = expand('%:t:r')
call EpitechHeader('cpp')
call append(7, '#pragma once')
call append(8, '')
call append(9, 'class ' .. file_name .. ' {')
call append(10, ' public:')
call append(11, ' ' .. file_name .. '(void);')
call append(12, ' ~' .. file_name .. '(void);')
call append(13, '')
call append(14, ' protected:')
call append(15, '};')
endfunction
au BufNewFile *.cpp call CppHeader()
au BufNewFile *.hpp call HppHeader()

View File

@ -1,4 +1,4 @@
function! EpitechHeader(ft=&filetype)
function! TekHeader(ft=&filetype)
let com_arr = {
\ 'c': {'top': '/*', 'mid': '**', 'bot': '*/'},
\ 'cpp': {'top': '/*', 'mid': '**', 'bot': '*/'},
@ -25,4 +25,29 @@ function! EpitechHeader(ft=&filetype)
call append(5, bot)
endfunction
command Header call EpitechHeader()
function! TekHHeader()
call TekHeader('c')
call append(6, '')
call append(7, '#pragma once')
call append(8, '')
endfunction
function! TekHppHeader()
let file_name = expand('%:t:r')
call TekHHeader()
call append(9, 'class ' .. file_name .. ' {')
call append(10, ' public:')
call append(11, ' ' .. file_name .. '(void);')
call append(12, ' ~' .. file_name .. '(void);')
call append(13, '')
call append(14, ' protected:')
call append(15, '};')
endfunction
au BufNewFile *.c call TekHeader()
au BufNewFile *.cpp call TekHeader()
au BufNewFile *.h call TekHHeader()
au BufNewFile *.hpp call TekHppHeader()
command Header call TekHeader()

View File

@ -50,12 +50,10 @@ vim.cmd("packadd plenary")
require"theme"
require"pack-easy-align"
require"pack-grammalecte"
require"pack-lspconfig"
require"pack-telescope"
require"pack-treesitter"
vim.cmd("source ~/.config/nvim/epitech_header.vim")
vim.cmd("source ~/.config/nvim/cpp.vim")
vim.cmd("source ~/.config/nvim/epitech.vim")
-----------------------
----- keybindings -----

View File

@ -1,3 +0,0 @@
vim.cmd("packadd grammalecte")
vim.g.grammalecte_cli_py = "/usr/bin/grammalecte-cli"

@ -1 +0,0 @@
Subproject commit a0ce51a77e56151f62ddbfd10e7dec46000f2848

@ -1 +1 @@
Subproject commit 3b669aa9c5d26d691c9cf30ac8be3b9c271f4af5
Subproject commit ce3a18ebe95e8aa03f0edfefcb2a37e6c46bb9f4

3
.gitmodules vendored
View File

@ -1,9 +1,6 @@
[submodule ".config/nvim/pack/plugins/opt/easy-align"]
path = .config/nvim/pack/plugins/opt/easy-align
url = https://github.com/junegunn/vim-easy-align.git
[submodule ".config/nvim/pack/plugins/opt/grammalecte"]
path = .config/nvim/pack/plugins/opt/grammalecte
url = https://github.com/dpelle/vim-Grammalecte.git
[submodule ".config/nvim/pack/plugins/opt/impatient"]
path = .config/nvim/pack/plugins/opt/impatient
url = https://github.com/lewis6991/impatient.nvim.git