feat: nvim cpp header, remove dirdiff

This commit is contained in:
AngeD 2023-01-31 23:50:03 +01:00
parent f4b25fe6d5
commit 9cad16c286
9 changed files with 35 additions and 15 deletions

24
.config/nvim/cpp.vim Normal file
View File

@ -0,0 +1,24 @@
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()
function! EpitechHeader(ft=&filetype)
let com_arr = {
\ 'c': {'top': '/*', 'mid': '**', 'bot': '*/'},
\ 'cpp': {'top': '/*', 'mid': '**', 'bot': '*/'},
@ -6,14 +6,14 @@ function! EpitechHeader()
\ 'haskell': {'top': '{-', 'mid': '--', 'bot': '-}'},
\ }
if (!has_key(com_arr, &filetype))
echoerr "Unsupported filetype: " . &filetype
if (!has_key(com_arr, a:ft))
echoerr "Unsupported filetype: " . a:ft
return
endif
let top = com_arr[&filetype]['top']
let mid = com_arr[&filetype]['mid']
let bot = com_arr[&filetype]['bot']
let top = com_arr[a:ft]['top']
let mid = com_arr[a:ft]['mid']
let bot = com_arr[a:ft]['bot']
let dir_name = fnamemodify(getcwd(), ':t')
let file_name = expand('%:t:r')

View File

@ -48,13 +48,13 @@ vim.cmd("packadd plenary")
require"theme"
require"pack-dirdiff"
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")
-----------------------
----- keybindings -----

@ -1 +0,0 @@
Subproject commit 84bc8999fde4b3c2d8b228b560278ab30c7ea4c9

@ -1 +1 @@
Subproject commit d228bcf7cd94611929482a09e114a42c41fe81a8
Subproject commit 902d6aa31450d26e11bedcbef8af5b6fe2e1ffe8

@ -1 +1 @@
Subproject commit 1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826
Subproject commit 9a0d3bf7b832818c042aaf30f692b081ddd58bd9

@ -1 +1 @@
Subproject commit 2f32775405f6706348b71d0bb8a15a22852a61e4
Subproject commit 203bf5609137600d73e8ed82703d6b0e320a5f36

@ -1 +1 @@
Subproject commit c9615952e71397cec4cf89a9a0db0fb9c491a5e1
Subproject commit 7ba61ca7f5fe48c95afa03a8298788b67207fd6d

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule ".config/nvim/pack/plugins/opt/dirdiff"]
path = .config/nvim/pack/plugins/opt/dirdiff
url = https://github.com/will133/vim-dirdiff.git
[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