rm vim dir

This commit is contained in:
piccihud 2023-05-28 14:15:51 +02:00
parent 0fa1f80eb8
commit c83bf3793e
6 changed files with 14 additions and 160 deletions

View File

@ -122,10 +122,9 @@ pg_dump <database_name> > <file.sql>
### Restore
```bash
Da shell
:w
Da shell:
```bash
psql <database_name> < <file.sql>
```

View File

@ -148,6 +148,7 @@ alias nn="ncdu --color dark"
alias pd="pandoc -f markdown -t pdf --pdf-engine=xelatex -V lang=it -V colorlinks=true -V linkcolor=teal -V urlcolor=teal -V toccolor=gray --template eisvogel --listings -V table-use-row-colors=true"
alias fh="feh"
alias fhm="feh -m"
alias dns="dig go.dnscheck.tools | grep -i server | sed -e 's/#.*$//' -e 's/;;//' -e 's/SERVER/DNS/'"
# RNR

View File

@ -7,16 +7,16 @@
#
#* * * * * user comando
0 21,22 * * * pg_dump cinema > ~/Databases/filmdb.sql
0 9,21,22 * * * pg_dump cinema > ~/Nextcloud/Database/db.sql
#0 9,20 * * * nice -n 19 clamscan -ir $HOME --log=clamavlog.txt --move=$HOME/quarantine/ 2>&1
0 22 * * * /usr/bin/rsync -az --delete --exclude=Nextcloud ~/ /media/davide/Backup/Desktop/ && date >> ~/backup.log
54 9,15,20 * * * rsync -aPz ~/.bashrc ~/Documenti/repos/mywiki/linux/bash/bashrc
54 9,15,20 * * * rsync -aPz ~/.inputrc ~/Documenti/repos/mywiki/linux/bash/inputrc
54 9,15,20 * * * rsync -aPz ~/.config/alacritty/alacritty.yml ~/Documenti/repos/mywiki/linux/alacritty/alacritty.yml
54 9,15,20 * * * rsync -aPz ~/.config/feh/ ~/Documenti/repos/mywiki/linux/feh/
54 9,15,20 * * * rsync -aPz ~/.config/neofetch/ ~/Documenti/repos/mywiki/linux/neofetch/
54 9,15,20 * * * rsync -aPz ~/.config/ranger/ ~/Documenti/repos/mywiki/linux/ranger/
54 9,15,20 * * * rsync -aPz ~/.config/rnr/ ~/Documenti/repos/mywiki/linux/rnr/
54 9,15,20 * * * rsync -aPz ~/.vimrc ~/Documenti/repos/mywiki/linux/vim/vimrc
54 9,15,20 * * * rsync -aPz ~/.xbindkeysrc /home/davide/Documenti/repos/mywiki/linux/xbindkeys/xbindkeysrc
54 9,15,20 * * * crontab -l > ~/Documenti/repos/mywiki/linux/script/crontab
0 9,15,20 * * * rsync -aPz ~/.bashrc ~/Documenti/repos/mywiki/linux/bash/bashrc
0 9,15,20 * * * rsync -aPz ~/.inputrc ~/Documenti/repos/mywiki/linux/bash/inputrc
0 9,15,20 * * * rsync -aPz ~/.config/alacritty/alacritty.yml ~/Documenti/repos/mywiki/linux/alacritty/alacritty.yml
0 9,15,20 * * * rsync -aPz ~/.config/feh/ ~/Documenti/repos/mywiki/linux/feh/
0 9,15,20 * * * rsync -aPz ~/.config/neofetch/ ~/Documenti/repos/mywiki/linux/neofetch/
0 9,15,20 * * * rsync -aPz ~/.config/ranger/ ~/Documenti/repos/mywiki/linux/ranger/
0 9,15,20 * * * rsync -aPz ~/.config/rnr/ ~/Documenti/repos/mywiki/linux/rnr/
0 9,15,20 * * * rsync -aPz ~/.vimrc ~/Documenti/repos/mywiki/linux/vim/vimrc
0 9,15,20 * * * rsync -aPz ~/.xbindkeysrc /home/davide/Documenti/repos/mywiki/linux/xbindkeys/xbindkeysrc
0 9,15,20 * * * crontab -l > ~/Documenti/repos/mywiki/linux/script/crontab

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

View File

@ -1,145 +0,0 @@
# Vim
Vim è un editor di testo molto potente, che può essere ampliato ulteriormente tramite **plugin** vari.
## Plugin Manager
Per poter installare dei plugin è necessario installare prima un plugin-manager.
### Vundle
```bash
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
```
Dopo aver clonato Vundle sulla propria macchina, inserire le seguenti righe di testo nel file `.vimrc`
```vimrc
" PLUGINS ---------------------------------------------------------------- {{{
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"
" All of your Plugins must be added before the following line
"
call vundle#end() " required
" }}}
```
## Installazione plugin
Installare un plugin è molto semplice, basta aggiungerlo nel file `.vimrc`, come da codice sottostante:
```vim
" PLUGINS ---------------------------------------------------------------- {{{
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"
" All of your Plugins must be added before the following line
"
Plugin 'neoclide/coc.nvim', {'branch': 'release'}
Plugin 'itchyny/vim-cursorword'
Plugin 'preservim/nerdtree'
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'alvan/vim-closetag'
Plugin 'mattn/emmet-vim'
Plugin 'jiangmiao/auto-pairs'
Plugin 'ryanoasis/vim-devicons'
Plugin 'frazrepo/vim-rainbow'
Plugin 'mg979/vim-visual-multi', {'branch': 'master'}
Plugin 'itchyny/lightline.vim'
Plugin 'voldikss/vim-floaterm'
Bundle 'https://github.com/prashanthellina/follow-markdown-links'
Plugin 'mracos/mermaid.vim'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'bbrtj/vim-vorg-md'
Plugin 'sheerun/vim-polyglot'
call vundle#end() " required
```
Una volta salvato il file, digitare `:PluginInstall`.
Quando l'installazione è completata, è buona norma cancellare la cache del buffer digitando il comando `:bdelete`.
È possibile ricercare plugin nel Web oppure tramite il comando `:PluginSearch`. Per aggiornare l'elenco locale dei plugin dal sito vimscripts digitare:
`:PluginSearch!`
### Alcuni plugin utili
- [https://github.com/preservim/nerdtree](https://github.com/preservim/nerdtree)
- [https://github.com/VundleVim/Vundle.vim](https://github.com/VundleVim/Vundle.vim)
- [https://github.com/sheerun/vim-polyglot](https://github.com/sheerun/vim-polyglot)
- [https://github.com/alvan/vim-closetag](https://github.com/alvan/vim-closetag)
- [https://github.com/mattn/emmet-vim](https://github.com/mattn/emmet-vim)
- [https://github.com/ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons)
- [https://github.com/nopecha-ai/nopecha-extension](https://github.com/nopecha-ai/nopecha-extension)
- [https://github.com/thameera/vimv](https://github.com/thameera/vimv)
- [https://github.com/voldikss/vim-floaterm#requirements](https://github.com/voldikss/vim-floaterm#requirements)
- [https://github.com/akrawchyk/awesome-vim](https://github.com/akrawchyk/awesome-vim)
- [https://github.com/neoclide/coc.nvim](https://github.com/neoclide/coc.nvim)
- [https://github.com/fannheyward/coc-marketplace](https://github.com/fannheyward/coc-marketplace)
- [https://github.com/OmniSharp/omnisharp-vim](https://github.com/OmniSharp/omnisharp-vim)
- [https://github.com/ncm2/ncm2](https://github.com/ncm2/ncm2)
- [https://github.com/prashanthellina/follow-markdown-links](https://github.com/prashanthellina/follow-markdown-links)
- [https://github.com/itchyny/calendar.vim](https://github.com/itchyny/calendar.vim)
- [https://github.com/mracos/mermaid.vim](https://github.com/mracos/mermaid.vim)
- [https://github.com/bbrtj/vim-vorg-md](https://github.com/bbrtj/vim-vorg-md)
- [https://github.com/rderik/vim-markdown-toc](https://github.com/rderik/vim-markdown-toc)
- [https://github.com/tpope/vim-commentary](https://github.com/tpope/vim-commentary)
- [https://clay-atlas.com/us/blog/2021/07/04/vim-en-you-complete-me-plugin-auto-code/](https://clay-atlas.com/us/blog/2021/07/04/vim-en-you-complete-me-plugin-auto-code/)
- [https://github.com/ycm-core/YouCompleteMe](https://github.com/ycm-core/YouCompleteMe)
- [https://github.com/primitivorm/vim-predictive](https://github.com/primitivorm/vim-predictive)
- [https://github.com/itchyny/vim-cursorword](https://github.com/itchyny/vim-cursorword)
Nel caso di `neoclide`, un plugin che abilita l'autocompletamento, da installare i seguenti moduli:
```vim
CocInstall coc-cmake coc-css coc-cssmodules coc-docker coc-emmet coc-flutter coc-highlight coc-html coc-htmlhint coc-html-css-support coc-json coc-ltex coc-markdown-preview-enhanced coc-markdownlint coc-omnisharp coc-prettier coc-pytho
n coc-sh coc-sql coc-vimlsp coc-xml coc-yaml coc-markdown-preview-enhanced coc-webview
```
Quindi eseguire:
```bash
cd ~/.vim/bundle/coc.nvim && git checkout release && yarn install && yarn build
```
![vim](./asset/vim/vim.png)
## Comandi utili
| Comando | Funzione |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `gx` | Apre il link sotto al cursore nel browser |
| `:m +/-n` | Sposta la riga sopra o sotto di *n* posizioni |
| `"+y` | In Visual Mode, copia il testo selezionato nella clipboard del SO |
| `vimv` | Da terminale, permette di rinominare cartelle e file coi comandi di Vim ([https://github.com/thameera/vimv](https://github.com/thameera/vimv)) |
| `:args` | Seleziona dei file come argomenti. È possibile utilizzare i caratteri jolly |
| `:argdo` | Permette di eseguire un comando su n files |
Ad esempio:
```vim
:argdo %s/stringToBeReplaced/replacementString/g | update
```
`update` serve per salvare le modifiche automaticamente.
## Collegamenti
- [https://irian.to/blogs/how-to-search-and-replace-string-across-multiple-files-in-vim/](https://irian.to/blogs/how-to-search-and-replace-string-across-multiple-files-in-vim/)
- [https://linuxhint.com/vim-copy-text-system-clipboard/](https://linuxhint.com/vim-copy-text-system-clipboard/)
- [https://vim.fandom.com/wiki/Accessing_the_system_clipboard](https://vim.fandom.com/wiki/Accessing_the_system_clipboard)

View File

@ -1 +0,0 @@
/home/davide/.vimrc