Add to ~/.vimrc:
:syntax enable
Tested on Ubuntu.
echo :colorscheme desert >> /etc/vim/vimrc.local
Tested on Ubuntu.
echo :set ls=2 >> /etc/vim/vimrc.local
SourceThe UNIX and Linux Forums - Continuously display the file name in vim
To UNIX:
:set ff=unix
To DOS:
:set ff=dos
Source: stack overflow - Convert DOS line endings to Linux line endings in vim
Type:
:s/Ctrl+VCtrl+M/\r/g
The replace will then look like this:
:s/^M/\r/g
Source:Tech Recipes - Remove ^M characters at end of lines in vi
To replace from the current line to the end (,$):
:,$s/[Ctrl+vu201cCtrl+vu201d]/"/g
Ctrl+vu201c means: hit Ctrl+V, enter u201c.
So that it looks like:
:,$s/[“”]/"/g
Source:stack overflow - In Vim how do I efficiently search and replace “ and ” with normal double quotes "
:sort
Sort case-insensitive:
:sort i
Source: Stack Exchange - How to sort case-insensitive?
Sort and keep unique values:
:sort u
The cf.vim with syntax highlighting supplied with Vim (on OpenBSD) does not highlight cfscript files.
To update, replace the highlighting with the cf-utils.vim from GitHub.
mkdir ~/.vim/ && cp -R cf-utils.vim-15088cfad92f0e01d8d6c62e8804828f5adf8bd6/* ~/.vim/
Tested on Debian 9 with VIM 8.0 with included patches: 1-197, 322, 377-378, 550.
Disable mouse support so you can copy and paste the way I'm used to by commenting the “if has ('mouse')” statement in /usr/share/vim/vim80/defaults.vim.
Unified diff patch to do this:
--- /usr/share/vim/vim80/defaults.vim.original 2017-04-23 14:10:29.000000000 +0200 +++ /usr/share/vim/vim80/defaults.vim 2017-07-25 09:57:42.009742204 +0200 @@ -66,9 +66,9 @@ " In many terminal emulators the mouse works just fine. By enabling it you " can position the cursor, Visually select and scroll with the mouse. -if has('mouse') - set mouse=a -endif +"if has('mouse') +" set mouse=a +"endif " Switch syntax highlighting on when the terminal has colors or when using the " GUI (which always has colors).
Source: Stack Exchange - Unix & Linux - vim cut&paste not working in Stretch / Debian 9
Or just do the following which is simpler and less invasive:
echo :set mouse= >> ~/.vimrc
Start recording:
q+LETTER
End recording:
q
To disable recording add the following to .vimrc:
map q <Nop>
Source:stackoverflow - What is Vim recording and how can it be disabled?