modif in vimrc

This commit is contained in:
hugogogo
2022-12-23 16:01:30 +01:00
parent df74f167e8
commit a9899156ce

View File

@@ -82,12 +82,11 @@ let g:netrw_liststyle = 3
"---------------------------------------------------------------
" to use the syntax highlight of .hpp on .tpp files
" to use the syntax highlight of .ext on .ext2 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
au BufRead *.tpp set syntax=cpp
au BufRead *.svelte set syntax=html
@@ -149,6 +148,7 @@ inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
"---------------------------------------------------------------
" put swap files in a special directory
"---------------------------------------------------------------
@@ -168,6 +168,36 @@ set directory=~/.vim/swapfiles//
"---------------------------------------------------------------
" put swap files in a special directory
"---------------------------------------------------------------
" https://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim#answer-67151825
" " version 1 :
" autocmd FileType c,cpp,java,scala let b:comment_leader = '//'
" autocmd FileType sh,ruby,python let b:comment_leader = '#'
" autocmd FileType conf,fstab let b:comment_leader = '#'
" autocmd FileType tex let b:comment_leader = '%'
" autocmd FileType mail let b:comment_leader = '>'
" autocmd FileType vim let b:comment_leader = '"'
" function! CommentToggle()
" execute ':silent! s/\([^ ]\)/' . escape(b:comment_leader,'\/') . ' \1/'
" execute ':silent! s/^\( *\)' . escape(b:comment_leader,'\/') . ' \?' . escape(b:comment_leader,'\/') . ' \?/\1/'
" endfunction
" map <F7> :call CommentToggle()<CR>
"
" " version 2
" function CommentUncomment()
" let line = getline('.')
" if line[:1] == '//'
" norm ^2x
" else
" norm I//
" endif
" endfunction
" nnoremap <Space><Space> :call CommentUncomment()<CR>
"---------------------------------------------------------------
" to autofill new files
"---------------------------------------------------------------