From 9a408df9e908970bf5bbbb08cdb9021c2de192ad Mon Sep 17 00:00:00 2001 From: Michael Blaschek <michael.blaschek@univie.ac.at> Date: Wed, 27 Jan 2021 15:35:09 +0100 Subject: [PATCH] Update Editors/Vim.md --- Editors/Vim.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Editors/Vim.md diff --git a/Editors/Vim.md b/Editors/Vim.md new file mode 100644 index 0000000..6d23e9e --- /dev/null +++ b/Editors/Vim.md @@ -0,0 +1,47 @@ +# Vim + +Is a great editor in the console +As a Gui version there is also `gvim` + +# Configs +``` +filetype plugin indent on +" show existing tab with 4 spaces width +set tabstop=4 +" when indenting with '>', use 4 spaces width +set shiftwidth=4 +" On pressing tab, insert 4 spaces +set expandtab +``` + +# Powerline +Need to install powerline with pip + +Config: +``` +" Allow Powerline style +set rtp+=.local/lib/python3.7/site-packages/powerline/bindings/vim/ +" These lines setup the environment to show graphics and colors correctly. +set laststatus=2 +set t_Co=256 + +``` + +# YAML +Maybe use this config: +``` +" Allow YAML tab styling +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab +let g:indentLine_char_list = ['|', '¦', '?', '?'] +``` + +# Wired backspace? + +in vim [backspace] or backwards delete leaves a wired symbol `^?` and does not delete anything? +Add this to your `~/.vimrc`: +``` +" Allow backspace +noremap! <C-?> <C-h> +``` +The source of this error relates to stty and maybe VNC. +[on stackoverflow](https://stackoverflow.com/questions/9701366/vim-backspace-leaves) -- GitLab