Setting up VIM

    vi ~/.vimrc
    #vi /etc/skel/.vimrc
    #vi /usr/share/vim/vimrc

set mouse=
set paste
syn on

filetype plugin indent on
autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab

we don’t use those as the chars get included while copy/pasting

#git clone https://github.com/Yggdroot/indentLine.git ~/.vim/pack/vendor/start/indentLine
#vim -u NONE -c "helptags  ~/.vim/pack/vendor/start/indentLine/doc" -c "q"

"autocmd FileType yaml,yml let g:indentLine_char = '⦙'

additional defaults we want on slackware

set nobackup
set noundofile

also for slackbuilds' README

"set colorcolumn=72
"set textwidth=72

markdown syntax highlighting

on Ubuntu, just make sure you’ve got vim-nox package installed, it’s enabled by default.

on other systems,

vi ~/.vimrc

autocmd BufNewFile,BufFilePre,BufRead *.md set filetype=markdown

additional notes

no syntax highlighting

syn off

don’t want no mouse

set paste
set pastetoggle=<F3>

either disable swap files –OR– eventually setup a defined folder for those

set noswapfile
"set directory=~/.vim/swp//

same for backupdir

"set backupdir=~/.vim/backup//

Resources

backup file

Oh, and man… never ever let Vim write a backup file! https://news.ycombinator.com/item?id=1688068

swapfile

https://engineering.purdue.edu/ece264/16au/resources/vim_swap_warnings

https://cs.longwood.edu/VimSwap.html

https://stackoverflow.com/questions/821902/disabling-swap-files-creation-in-vim

undofile

https://vi.stackexchange.com/questions/6/how-can-i-use-the-undofile

https://stackoverflow.com/questions/15660669/what-is-a-un-file-or-or-why-does-vim-in-the-terminal-make-the-un-file

https://medium.com/@Aenon/vim-swap-backup-undo-git-2bf353caa02f

mouse

https://vi.stackexchange.com/questions/13566/fully-disable-mouse-in-console-vim

usage yank/paste blocks

https://stackoverflow.com/questions/7694633/copy-lines-in-visual-mode-in-vim

stuck in insert mode

Vim Stuck In Insert Mode https://superuser.com/questions/129900/vim-stuck-in-insert-mode

misc

https://stackoverflow.com/questions/2032747/how-to-comment-in-vims-config-files-vimrc

sbo

https://vi.stackexchange.com/questions/574/keeping-lines-to-less-than-80-characters

https://stackoverflow.com/questions/2032747/how-to-comment-in-vims-config-files-vimrc


https://stackoverflow.com/questions/42655098/how-do-i-jump-to-the-beginning-of-line-in-vim

https://linuxhandbook.com/beginning-end-file-vim/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun