From 0685bbe005b140a98cce716e716168388ae09aae Mon Sep 17 00:00:00 2001 From: lenovo Date: Thu, 24 Nov 2022 11:26:16 +0100 Subject: [PATCH 1/4] some addings in computer tuto --- config_files/.vimrc | 4 +-- tutos/computer.txt | 61 ++++++++++++++++++++++++++++++++++++++++++--- tutos/vim.txt | 4 +++ 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/config_files/.vimrc b/config_files/.vimrc index 2952a2a..234b324 100644 --- a/config_files/.vimrc +++ b/config_files/.vimrc @@ -38,10 +38,10 @@ highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE " show existing tab with 4 spaces width -set tabstop=4 +set tabstop=2 " when indenting with '>', use 4 spaces width -set shiftwidth=4 +set shiftwidth=2 " indent new line like the previous one set autoindent diff --git a/tutos/computer.txt b/tutos/computer.txt index f985cc9..4454047 100644 --- a/tutos/computer.txt +++ b/tutos/computer.txt @@ -1,7 +1,8 @@ **touchscreen :** - **sudo xinput --list** list all input + **xinput --list** list all input **xinput disable 12** disable the input 12, touchscreen for Lenovo-FLEX-3-1120 **load to start :** add "xinput disable 12" in application autostart + ADD FORMULA TO FIND 12 **appimage :** **chmod +x .appimage** make it executable @@ -12,6 +13,10 @@ Type=Application **( cd /usr/share/applications && chmod 644 .desktop )** maybe change permissions +**applications :** + **ln -s /path/to/executable /usr/bin** + add /usr/share/applications/.desktop as explained above for appimages + **firefox extension source code :** **right click on install** and select "copy link" **curl -L > /tmp/myextension.xpi** download the extension with curl inside a tmp file @@ -20,8 +25,34 @@ **enable accents on ubuntu :** **compose key = right alt** change in keyboard > layout > compose key + **sudo apt install gnome-tweaks** maybe install tweak to change compose key **r-alt ' e** é **r-alt ` e** è + **alternatively :** https://askubuntu.com/questions/1028957/how-to-set-a-compose-key-in-ubuntu-18-04 + **man xkeyboard-config** look for the compose options (shortcut: enter /compose:). You will find + compose:ralt Right Alt + compose:lwin Left Win + compose:lwin-altgr 3rd level of Left Win + compose:rwin Right Win + compose:rwin-altgr 3rd level of Right Win + compose:menu Menu + compose:menu-altgr 3rd level of Menu + compose:lctrl Left Ctrl + compose:lctrl-altgr 3rd level of Left Ctrl + compose:rctrl Right Ctrl + compose:rctrl-altgr 3rd level of Right Ctrl + compose:caps Caps Lock + compose:caps-altgr 3rd level of Caps Lock + compose:102 + compose:102-altgr 3rd level of + compose:paus Pause + compose:prsc PrtSc + compose:sclk Scroll Lock + **setxkbmap -option compose:paus** let us say you want to pick Pause as the compose key. Just issue + **XKBOPTIONS="terminate:ctrl_alt_bksp,compose:paus"** to make it reboot-persistent, + edit /etc/default/keyboard + if you had other options already, + separate them with commas **connect to planet hoster with ssh :** ssh hugugtzx@world-370.fr.planethoster.net -p 5022 @@ -81,7 +112,31 @@ - format partitions (re list before) : **sudo mkfs -t vfat -n "" /dev/sdb1** to format in fat32 (vfat) (MaKe FileSystem) + **list of automatic settings :** + - install screen, omyzsh, keepassxc, curl, make, firefox, signal, gnome-tweaks + - install or configure to avoid screen blue light + - install nextcloud client (apt ? or appimage ? appimage need fuse : https://github.com/AppImage/AppImageKit/wiki/FUSE), and launch at startup + - install these settings (connection with bitbucket ? ssh ? https ?) + - configure cursor speed, click with touch - change dns - - configure firefox addons - - + - configure firefox : + - default browser + - duckduckgo default search + - addons : + - keepassxc + - i dont care about cookies + - auto tab discard + - settings > barre d'outils action click gauche > desactiver tous les autres onglets + - ublock origin + - deepl/multitranslate + - youtube speed control, by toxblh + - download file + - password settings + - setting ctrl-tab to switch to last used tabs + - configure desktop bar with infos and stats + - configure git global email and name + +**todo !** + - re-add code to move cursor on wrap text in vimrc + - add vimrc, zshrc, and screenrc in default screen windows diff --git a/tutos/vim.txt b/tutos/vim.txt index 705eee4..c4e481b 100644 --- a/tutos/vim.txt +++ b/tutos/vim.txt @@ -1,3 +1,6 @@ +/MODE NORMAL/ +***** search the next occurence of the word under cursor + /MODE INSERTION/ **i** mode insertion avant le curseur **I** mode insertion au debut de la ligne @@ -10,6 +13,7 @@ /COMMANDES/ **:w** enregistrer +**:w !sudo tee %** trick to save a page with sudo **:q** quitter **:wq** ou **ZZ** enregister et quitter **:q!** force a quitter From 501fe211342551cd65f39c521c4702f9e75230af Mon Sep 17 00:00:00 2001 From: lenovo Date: Tue, 29 Nov 2022 15:05:22 +0100 Subject: [PATCH 2/4] added vimrc settings for moving in wraped lines --- config_files/.vimrc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config_files/.vimrc b/config_files/.vimrc index 234b324..61c1de1 100644 --- a/config_files/.vimrc +++ b/config_files/.vimrc @@ -55,6 +55,12 @@ set number " don't allow wrap set nowrap +" in wrap mode, +" show next lines instead of '@' +" break on words +set display=lastline +set lbr + " using alternate buffer with Explore, ':b#' " =0 ot go back to explore buffer " =1 ot go back to last edited file @@ -66,6 +72,7 @@ set nowrap "let g:netrw_altfile = 0 " choose how to print list in :Explore window +" alternatively you can hit 'i' inside Explore window to switch between styles " =0 is default " =3 is tree style let g:netrw_liststyle = 3 @@ -115,6 +122,19 @@ vnoremap `>gvxpgvoo +"--------------------------------------------------------------- +" to move cursor inside wrapping +"--------------------------------------------------------------- +" https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping + +nnoremap gj +nnoremap gk +vnoremap gj +vnoremap gk +inoremap gj +inoremap gk + + "--------------------------------------------------------------- " put swap files in a special directory "--------------------------------------------------------------- From f6e805f1a72c77db6bd006682cc87808ae89bb2d Mon Sep 17 00:00:00 2001 From: lenovo Date: Thu, 15 Dec 2022 19:34:29 +0100 Subject: [PATCH 3/4] merged tutos_shell inside tutos_computer + changed default opened screen windows --- config_files/.screenrc | 17 ++++++-------- config_files/.vimrc | 2 +- tutos/computer.txt | 53 ++++++++++++++++++++++++++++++++++++++++++ tutos/shell.txt | 50 --------------------------------------- 4 files changed, 61 insertions(+), 61 deletions(-) delete mode 100644 tutos/shell.txt diff --git a/config_files/.screenrc b/config_files/.screenrc index 0d80a14..2c2f3d8 100644 --- a/config_files/.screenrc +++ b/config_files/.screenrc @@ -40,17 +40,14 @@ bind F eval "hardstatus alwayslastline" # stuff "vim file.txt^M" chdir $HOME/huhuhu_config screen -chdir $HOME/huhuhu_config/tutos -screen -t tutos_shell vim -n shell.txt -screen -t tutos_git vim -n git.txt -screen -t tutos_screen vim -n screen.txt -#screen -t tutos_node vim -n node.txt -#screen -t tutos_react vim -n react.txt -#screen -t tutos_php vim -n php.txt -screen -t tutos_sites vim -n sites.txt -screen -t tutos_vim vim -n vim.txt -screen -t tutos_computer vim -n computer.txt +screen -t .vimrc vim -n ./config_files/.vimrc +screen -t .screenrc vim -n ./config_files/.screenrc +screen -t tutos_vim vim -n ./tutos/vim.txt +screen -t tutos_screen vim -n ./tutos/screen.txt +screen -t tutos_git vim -n ./tutos/git.txt +screen -t tutos_sites vim -n ./tutos/sites.txt +screen -t tutos_computer vim -n ./tutos/computer.txt chdir $HOME screen diff --git a/config_files/.vimrc b/config_files/.vimrc index 61c1de1..fae677c 100644 --- a/config_files/.vimrc +++ b/config_files/.vimrc @@ -185,7 +185,7 @@ autocmd BufNewFile *.hpp call HPPFile() autocmd BufNewFile *.cpp if @% == 'main.cpp' | call MAINCPPFile() | else | call CPPFile() autocmd BufNewFile Makefile call MAKEFile() autocmd BufNewFile colors.h call COLORFile() -autocmd BufNewFile testss.hpp call TESTSFile() +autocmd BufNewFile tests.hpp call TESTSFile() diff --git a/tutos/computer.txt b/tutos/computer.txt index 4454047..97ec60a 100644 --- a/tutos/computer.txt +++ b/tutos/computer.txt @@ -1,3 +1,56 @@ +**screen size** pour 2*2: 137*38 / pour 1*1: 68*19 (37 et 18 si barre des menus cachee) +**ctrl c** termine l'action en cours du terminal +**ctrl s** bloque l'affichage du terminal +**ctrl q** rétablit la communication avec le terminal +**ctrl z** stop le travail en cours et le met sur pause +**fg** relance le dernier travail mis sur pause +**mkdir file{1..10}** creer 10 dossiers nommés de file1 à file10 +**pwd** print working directory +**xdg-open .** open working directory +**du -sh** directory sizes +**ncdu** (visual version of 'du' command) quick presentation of directories size + +**ssh username@ssh.server.domain -p XXXX** se connecter a un serveur via ssh en precisant un port +**sftp -P XXXX username@ssh.server.domain** se connecter a un server ssh avec le protocol ftp +**vim scp://username@ssh.server.domain:XXXX//home/path/to/file** edit a remote file from local vim + +**pdftotext** transforme un pdf en un fichier texte +**^** designe le debut d'une ligne +* n'importe quel caractere autant de fois que possible +**ls** ** montre tous les dossiers et sous-dossiers recursivement +**chmod 755 fichier** chmod change les droits des fichiers, organisés en : rwxrwxrwx avec pour valeur r=4 w=2 x=1 donc r-w == r + w == 4 + 1 == 5 + +**zsh** + **sudo apt-get install zsh** + **which zsh** donne le chemin d'acces de zsh (/usr/bin/zsh) + **chsh -s /usr/bin/zsh** change shell (chsh) pour zsh + (reboot le systeme pour que les changements prennent effet) + **echo $SHELL** pour voir quel shell est utilisé + (uncomment **line --DISABLE_AUTO_TITLE="true"--** in ~/.zshrc file pour empecher screen de donner un nom automatique aux sessions) + +**sass name.scss name.css** create a css file from a scss file +**sass --watch name.scss:name.css** make the transformations of scss in css file + +**'tree' like :** +find | sort | grep -ve "node_modules/" -e ".git/" | sed 's#[^/]*/#|__ #g;s#__ |# |#g;s#| # #g;s#\(node_modules\|.git[ignore]*\)#\1 ...#;$a\ ' + +**format usb** + **sudo fdisk -l** list all disks - find yours (something like /dev/sdx) + **sudo fdisk /dev/sdx** enter in fdisk program + **p** print the partions + **o** create an empty dos table + **n** add a new partition + **p** primary + **1** partition number 1 + **enter** default first selector + **+1G** for 1Gb size or *enter* for default + **a** toogle the flag *bootable* + **n** again if you want more partitions + **w** write and quit + + + + **touchscreen :** **xinput --list** list all input **xinput disable 12** disable the input 12, touchscreen for Lenovo-FLEX-3-1120 diff --git a/tutos/shell.txt b/tutos/shell.txt deleted file mode 100644 index fd7b678..0000000 --- a/tutos/shell.txt +++ /dev/null @@ -1,50 +0,0 @@ -**screen size** pour 2*2: 137*38 / pour 1*1: 68*19 (37 et 18 si barre des menus cachee) -**ctrl c** termine l'action en cours du terminal -**ctrl s** bloque l'affichage du terminal -**ctrl q** rétablit la communication avec le terminal -**ctrl z** stop le travail en cours et le met sur pause -**fg** relance le dernier travail mis sur pause -**mkdir file{1..10}** creer 10 dossiers nommés de file1 à file10 -**pwd** print working directory -**xdg-open .** open working directory -**du -sh** directory sizes -**ncdu** (visual version of 'du' command) quick presentation of directories size - -**ssh username@ssh.server.domain -p XXXX** se connecter a un serveur via ssh en precisant un port -**sftp -P XXXX username@ssh.server.domain** se connecter a un server ssh avec le protocol ftp -**vim scp://username@ssh.server.domain:XXXX//home/path/to/file** edit a remote file from local vim - -**pdftotext** transforme un pdf en un fichier texte -**^** designe le debut d'une ligne -* n'importe quel caractere autant de fois que possible -**ls** ** montre tous les dossiers et sous-dossiers recursivement -**chmod 755 fichier** chmod change les droits des fichiers, organisés en : rwxrwxrwx avec pour valeur r=4 w=2 x=1 donc r-w == r + w == 4 + 1 == 5 - -**zsh** - **sudo apt-get install zsh** - **which zsh** donne le chemin d'acces de zsh (/usr/bin/zsh) - **chsh -s /usr/bin/zsh** change shell (chsh) pour zsh - (reboot le systeme pour que les changements prennent effet) - **echo $SHELL** pour voir quel shell est utilisé - (uncomment **line --DISABLE_AUTO_TITLE="true"--** in ~/.zshrc file pour empecher screen de donner un nom automatique aux sessions) - -**sass name.scss name.css** create a css file from a scss file -**sass --watch name.scss:name.css** make the transformations of scss in css file - -**'tree' like :** -find | sort | grep -ve "node_modules/" -e ".git/" | sed 's#[^/]*/#|__ #g;s#__ |# |#g;s#| # #g;s#\(node_modules\|.git[ignore]*\)#\1 ...#;$a\ ' - -**format usb** - **sudo fdisk -l** list all disks - find yours (something like /dev/sdx) - **sudo fdisk /dev/sdx** enter in fdisk program - **p** print the partions - **o** create an empty dos table - **n** add a new partition - **p** primary - **1** partition number 1 - **enter** default first selector - **+1G** for 1Gb size or *enter* for default - **a** toogle the flag *bootable* - **n** again if you want more partitions - **w** write and quit - From b3b81cf199b91330c8d7a80409b3cc57b9676413 Mon Sep 17 00:00:00 2001 From: lenovo Date: Thu, 15 Dec 2022 19:40:19 +0100 Subject: [PATCH 4/4] added hjkl to the moving line remap in vim --- config_files/.vimrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config_files/.vimrc b/config_files/.vimrc index fae677c..f6619f4 100644 --- a/config_files/.vimrc +++ b/config_files/.vimrc @@ -105,16 +105,28 @@ nnoremap :m+ nnoremap :m-2 nnoremap >>k nnoremap <<k +nnoremap :m+ +nnoremap :m-2 +nnoremap >>k +nnoremap <<k inoremap :m+gi inoremap :m-2gi inoremap >>gi inoremap <<gi +inoremap :m+gi +inoremap :m-2gi +inoremap >>gi +inoremap <<gi vnoremap :m'>+gv vnoremap :m-2gv vnoremap >gv vnoremap <gv +vnoremap :m'>+gv +vnoremap :m-2gv +vnoremap >gv +vnoremap <gv " move selection inside lines with Ctrl-Shift + left/right vnoremap `<i_mz"_xgvx`zPgvoo