Assuming you want to manipulate VIM’s `backspace` setting, here are useful manipulations:
Get current value
:set backspace?
Set a value
:set backspace=2
Reset to default
:set backspace&
Assuming you want to manipulate VIM’s `backspace` setting, here are useful manipulations:
Get current value
:set backspace?
Set a value
:set backspace=2
Reset to default
:set backspace&
Move cursor over a file and type:
gf
to open this file
Add to your .vimrc file:
function! StartUp() if !exists("s:std_in") && 0 == argc() NERDTree end endfunction autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * call StartUp()
If you should use sudo but didn’t use it for some reason before editing some file, you can still activate sudo from inside the vim after editing (in order to be able to save the file):
:w !sudo tee %
This will do the same as if you’d first run
sudo vim somefile
and then edit the file..
Just a small tip, let’s say you use Sparkup plugin for vim, which allows you to benefit from robust html markup writing, but you created a new file and as filetype is not yet set, it will not work, untill you save your file as *.html, however you can always set filetype manually, like so:
:set ft=html
and Sparkup will be loaded so you can write HTML markup fast even before saving the file
I wonder if there is any better way to accomplish this.
In order to avoid indentation mess when pasting bunch of text, execute following command right before pasting:
:set paste
Here are few techniques that allows to shift selected text more than once:
1)
press ESC
press “v” to enter visual mode
select text
SHIFT plus “>” twice
press “.” to repeat last indent
2)
press ESC
press “v” to enter visual mode
select text
SHIFT plus “>” twice
press “g” then “v” and use any indent you require
In order to automate this method add following to your .vimrc file:
vnoremap < <gv
vnoremap > >gv