restructure .vimrc : clear english sections, dead code and unused commands removed
Generated by Mistral Vibe.
This commit is contained in:
+45
-122
@@ -1,12 +1,9 @@
|
|||||||
"#hugogogo#
|
"#hugogogo#
|
||||||
|
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" base settings
|
" base settings
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
set background=light
|
|
||||||
colorscheme default
|
|
||||||
|
|
||||||
" Show (partial) command in status line.
|
" Show (partial) command in status line.
|
||||||
"set showcmd
|
"set showcmd
|
||||||
@@ -36,12 +33,16 @@ set hidden
|
|||||||
"set mouse=a
|
"set mouse=a
|
||||||
set mouse=
|
set mouse=
|
||||||
|
|
||||||
" allow copy in the clipboard
|
|
||||||
vnoremap <leader>y :w !wl-copy<CR><CR>
|
|
||||||
|
|
||||||
" turns on syntax hilighting
|
" turns on syntax hilighting
|
||||||
syntax on
|
syntax on
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" colors
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
set background=light
|
||||||
|
colorscheme default
|
||||||
|
|
||||||
" use coloration 'torte' or other
|
" use coloration 'torte' or other
|
||||||
" and specify no coloration in the background
|
" and specify no coloration in the background
|
||||||
"colo elflord
|
"colo elflord
|
||||||
@@ -50,6 +51,17 @@ colo ron
|
|||||||
highlight Normal ctermbg=NONE
|
highlight Normal ctermbg=NONE
|
||||||
highlight nonText ctermbg=NONE
|
highlight nonText ctermbg=NONE
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" copy to clipboard
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
" allow copy in the clipboard
|
||||||
|
vnoremap <leader>y :w !wl-copy<CR><CR>
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" indentation
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" show existing tab with x spaces width
|
" show existing tab with x spaces width
|
||||||
set tabstop=2
|
set tabstop=2
|
||||||
|
|
||||||
@@ -59,6 +71,10 @@ set shiftwidth=2
|
|||||||
" indent new line like the previous one
|
" indent new line like the previous one
|
||||||
set autoindent
|
set autoindent
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" display
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" show line number
|
" show line number
|
||||||
set number
|
set number
|
||||||
|
|
||||||
@@ -74,6 +90,10 @@ set nowrap
|
|||||||
set display=lastline
|
set display=lastline
|
||||||
set lbr
|
set lbr
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" file explorer (netrw)
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" using alternate buffer with Explore, ':b#'
|
" using alternate buffer with Explore, ':b#'
|
||||||
" =0 ot go back to explore buffer
|
" =0 ot go back to explore buffer
|
||||||
" =1 ot go back to last edited file
|
" =1 ot go back to last edited file
|
||||||
@@ -90,27 +110,23 @@ set lbr
|
|||||||
" =3 is tree style
|
" =3 is tree style
|
||||||
let g:netrw_liststyle = 3
|
let g:netrw_liststyle = 3
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
"---------------------------------------------------------------
|
|
||||||
" to use the syntax highlight of .ext on .ext2 files
|
" to use the syntax highlight of .ext on .ext2 files
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
au BufRead *.tpp set syntax=cpp
|
au BufRead *.tpp set syntax=cpp
|
||||||
au BufRead *.svelte set syntax=html
|
au BufRead *.svelte set syntax=html
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" norminette
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
" pour pouvoir utiliser la norminette partout
|
" pour pouvoir utiliser la norminette partout
|
||||||
"---------------------------------------------------------------
|
|
||||||
|
|
||||||
let g:norminette_exec = '~/.local/bin/norminette'
|
let g:norminette_exec = '~/.local/bin/norminette'
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
" to move lines with Ctrl + arrow
|
" to move lines with Ctrl + arrow
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
nnoremap <C-Down> :m+<CR>
|
nnoremap <C-Down> :m+<CR>
|
||||||
nnoremap <C-Up> :m-2<CR>
|
nnoremap <C-Up> :m-2<CR>
|
||||||
@@ -148,11 +164,9 @@ vnoremap <C-h> <<CR>gv
|
|||||||
vnoremap <C-S-Left> <Esc>`<<Left>i_<Esc>mz"_xgvx`zPgv<Left>o<Left>o
|
vnoremap <C-S-Left> <Esc>`<<Left>i_<Esc>mz"_xgvx`zPgv<Left>o<Left>o
|
||||||
vnoremap <C-S-Right> <Esc>`><Right>gvxpgv<Right>o<Right>o
|
vnoremap <C-S-Right> <Esc>`><Right>gvxpgv<Right>o<Right>o
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
" to move cursor inside wrapping
|
" to move cursor inside wrapping
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping
|
" https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping
|
||||||
|
|
||||||
nnoremap <Down> gj
|
nnoremap <Down> gj
|
||||||
@@ -162,11 +176,9 @@ vnoremap <Up> gk
|
|||||||
inoremap <Down> <C-o>gj
|
inoremap <Down> <C-o>gj
|
||||||
inoremap <Up> <C-o>gk
|
inoremap <Up> <C-o>gk
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
" put swap files in a special directory
|
" put swap files in a special directory
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" first create the needed directory
|
" first create the needed directory
|
||||||
" https://stackoverflow.com/questions/1549263/how-can-i-create-a-folder-if-it-doesnt-exist-from-vimrc
|
" https://stackoverflow.com/questions/1549263/how-can-i-create-a-folder-if-it-doesnt-exist-from-vimrc
|
||||||
@@ -181,41 +193,9 @@ silent !mkdir -p ~/.vim/swapfiles
|
|||||||
|
|
||||||
set directory=~/.vim/swapfiles//
|
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
|
" to autofill new files
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" to autofill a new Class.hpp file
|
" to autofill a new Class.hpp file
|
||||||
function! HPPFile()
|
function! HPPFile()
|
||||||
@@ -252,11 +232,9 @@ autocmd BufNewFile Makefile call MAKEFile()
|
|||||||
autocmd BufNewFile colors.h call COLORFile()
|
autocmd BufNewFile colors.h call COLORFile()
|
||||||
autocmd BufNewFile tests.hpp call TESTSFile()
|
autocmd BufNewFile tests.hpp call TESTSFile()
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
" pour mettre en gras dans des fichiers txt
|
" pour mettre en gras dans des fichiers txt
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" BufEnter s'active quand un buffer est ouvert ou modifie
|
" BufEnter s'active quand un buffer est ouvert ou modifie
|
||||||
" setf = setfiletype defini un filetype text SI n'existe pas
|
" setf = setfiletype defini un filetype text SI n'existe pas
|
||||||
@@ -275,64 +253,9 @@ au filetype text syn match Asterisks contained "\*\*" conceal
|
|||||||
au filetype text syn match EscapedAsterisks contained "\\" conceal
|
au filetype text syn match EscapedAsterisks contained "\\" conceal
|
||||||
au filetype text syn match AsteriskBold "\*\*.*\*\*" contains=Asterisks,EscapedAsterisks
|
au filetype text syn match AsteriskBold "\*\*.*\*\*" contains=Asterisks,EscapedAsterisks
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
"---------------------------------------------------------------
|
|
||||||
" remplis les elements de base d'un fichier html
|
" remplis les elements de base d'un fichier html
|
||||||
"---------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
command! Html 0s/^/<!DOCTYPE html>\r<html lang="en" dir="ltr">\r\t<head>\r\t\t<meta charset="UTF-8">\r\t\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\r\t\t<title><\/title>\r\t\t<meta name="description" content="description du site web">\r\t\t<meta name="keywords" content="truc, bidule, chouette">\r\t\t<link href=".\/style.css" type="text\/css" rel="stylesheet">\r\t\t<script type="text\/javascript" src="script.js" defer><\/script>\r\t<\/head>\r\t<body>\r\r\t<\/body>\r<\/html>
|
command! Html 0s/^/<!DOCTYPE html>\r<html lang="en" dir="ltr">\r\t<head>\r\t\t<meta charset="UTF-8">\r\t\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\r\t\t<title><\/title>\r\t\t<meta name="description" content="description du site web">\r\t\t<meta name="keywords" content="truc, bidule, chouette">\r\t\t<link href=".\/style.css" type="text\/css" rel="stylesheet">\r\t\t<script type="text\/javascript" src="script.js" defer><\/script>\r\t<\/head>\r\t<body>\r\r\t<\/body>\r<\/html>
|
||||||
|
|
||||||
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
" pour transformer un text html et/ou css en version affichable
|
|
||||||
"---------------------------------------------------------------
|
|
||||||
|
|
||||||
"remplace < et > par < et >
|
|
||||||
command! Compare %s/</\</g <bar> %s/>/\>/g
|
|
||||||
"remplir les lignes vides avec des <br>
|
|
||||||
command! Ligne %s/^\n/<br>\r
|
|
||||||
"ajoute <p> et </p> en debut et fin de lignes
|
|
||||||
command! Paragraph %s/^/<p>/g <bar> %s/$/<\/p>/g
|
|
||||||
"remplace les indentations par deux espaces  
|
|
||||||
command! Indenta %s/\t/\ \ \ /g
|
|
||||||
"remplace les < et > autour des commentaires par CS et CE
|
|
||||||
command! Savecomment %s/<!--/CS/g <bar> %s/-->/CE/g
|
|
||||||
"entoure les tag apres < ou </ par <span id="tag"></span>
|
|
||||||
command! Tag %s#<[;/]*\zs[a-z0-9]*\ze#<span id=\"tag\">\0</span>#g
|
|
||||||
"entoure les signes < et > et / et { et } par <span id="sign"></span>
|
|
||||||
command! Sign %s#<\zs/\ze#<span id=\"sign\">\0</span>#g <bar> %s#&[lg]t;#<span id=\"sign\">\0</span>#g <bar> %s#[{}]#<span id=\"sign\">\0</span>#g
|
|
||||||
"entoure les pseudos elements
|
|
||||||
command! Pseudo %s#:\zs[a-z]*\ze.<span id="sign">{#<span id=\"pseudo\">\0</span>#g
|
|
||||||
"entoure les selecteurs css avant les { par <span id="selec"></span>
|
|
||||||
command! Selec %s#<p>\zs[^:{]*\ze.*<span id="sign">{#<span id=\"selec\">\0</span>#g
|
|
||||||
"entoure les actions css avant les : par <span id="action"></span>
|
|
||||||
command! Action %s# \zs[-a-zA-Z0-9]*\ze:#<span id=\"action\">\0</span>#g
|
|
||||||
"entoure toutes les specifications des tags html par <span id="special"><span>
|
|
||||||
command! Special %s#</span>\zs[^>]*\ze<span id="sign">>#<span id=\"special\">\0</span>#g
|
|
||||||
"entoure les commentaires par <span id="comment"></span>
|
|
||||||
command! Comment %s#\(CS\)\(.*\)\(CE\)#<span id=\"comment\">\<!--\2--\></span>#g <bar> %s#/\*.*\*/#<span id=\"comment\">\0</span>#g
|
|
||||||
|
|
||||||
|
|
||||||
function! Editax()
|
|
||||||
Compare
|
|
||||||
Ligne
|
|
||||||
Paragraph
|
|
||||||
Indenta
|
|
||||||
Savecomment
|
|
||||||
Tag
|
|
||||||
Sign
|
|
||||||
Pseudo
|
|
||||||
Selec
|
|
||||||
Action
|
|
||||||
Special
|
|
||||||
Comment
|
|
||||||
Start
|
|
||||||
End
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
"ajoute toutes les lignes du debut
|
|
||||||
command! Start 0s/^/<!DOCTYPE html>\r<html>\r<head>\r<style>\r#cadre {\r position: fixed;\r top: 10vh;\r left: calc(50% - 250px);\r width: 500px;\r max-width: 80vw;\r height: 80vh;\r padding: 10px;\r overflow: hidden;\r border-radius: 10px;\r background-color: rgba(50, 50, 50, 0.9);\r}\r#scroll {\r height: 100%;\r width: calc(100% + 25px);\r box-sizing: border-box;\r padding-right: 10px;\r overflow-y: scroll;\r}\r#scroll p {\r margin: 0;\r padding: 0;\r color: #d3d3d3;\r}\r#tag {\r color: #669999;\r}\r#sign {\r color: white;\r}\r#action {\r color: #cc66cc;\r}\r#selec {\r color: #ff6633;\r}\r#pseudo {\r color: yellow;\r}\r#special {\r color: #8585ad;\r}\r#comment {\r color: #909090;\r}\r<\/style>\r<\/head>\r<body>\r<div id=\"cadre">\r<div id=\"scroll">\r\r<p>\<!DOCTYPE html\><\/p>\r
|
|
||||||
"ajoute toutes les lignes de la fin
|
|
||||||
command! End $s/$/\r\r<\/div>\r<\/div>\r<\/body>\r<\/html>
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user