diff --git a/config_files/.vimrc b/config_files/.vimrc index 336d6a6..456f413 100644 --- a/config_files/.vimrc +++ b/config_files/.vimrc @@ -57,6 +57,16 @@ set nowrap +"--------------------------------------------------------------- +" to use the syntax highlight of .hpp on .tpp files +"--------------------------------------------------------------- +"https://beerpla.net/2008/04/02/how-to-add-a-vim-file-extension-to-syntax-highlighting/ + +filetype on +au BufNewFile,BufRead *.tpp set filetype=cpp + + + "--------------------------------------------------------------- " pour pouvoir utiliser la norminette partout "--------------------------------------------------------------- diff --git a/tutos/vim.txt b/tutos/vim.txt index f6db6f5..6ae8795 100644 --- a/tutos/vim.txt +++ b/tutos/vim.txt @@ -1,9 +1,3 @@ -/SYNTAX/ -to create a new syntax file, just copy an existing one : - cp /usr/share/vim/vimXX/syntax/extension.vim ~/.vim/syntax/ -and change the name to match the extension -and change the content to whatever you want - /MODE INSERTION/ **i** mode insertion avant le curseur **I** mode insertion au debut de la ligne @@ -153,4 +147,12 @@ replacement2: **vim old %** va a la toute premiere occurence de 'old' tres important pour que la fonction se réecrive a chaque fois, sinon conflit +/SET SYNTAX FOR A FILE WITH EXTENSION NOT RECOGNIZE/ +/in case the syntax already exist/ +/like .tpp files with same syntax than .hpp, that have same syntax than .cpp/ +/.hpp files are detected but not .tpp files/ +**:set syntax=cpp** say to use cpp syntax +**in .vimrc :** filetype on + au BufNewFile,BufRead *.tpp set filetype=cpp +