:w !sudo tee % > /dev/null
Tag Archives: vim
vim copy all text to clipboard
gg”*yG
vim fold/unfold all
set foldmethod=indent
use zo and zc to fold and unfold in normal mode
use zR and zM to fold and unfold all folds
zo Open one fold under the cursor. When a count is given, that
many folds deep will be opened. In Visual mode one level of
folds is opened for all lines in the selected area.
zc
zc Close one fold under the cursor. When a count is given, that
many folds deep are closed. In Visual mode one level of folds
is closed for all lines in the selected area.
‘foldenable’ will be set.
vim molokai theme, tagbar, nerdtree
vim ~/.vimrc
colorscheme molokai
cd ~/.vim/bundle
git clone https://github.com/majutsushi/tagbar.git
vim ~/.vimrc
nmap
git clone https://github.com/scrooloose/nerdtree.git
vim ~/.vimrc
map
vim install vim-go
cd ~/.vim/bundle
git clone https://github.com/fatih/vim-go.git
vim ~/.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
let g:go_disable_autoinstall = 0
vim fix backspace
set backspace=indent,eol,start
for Ubuntu vi fix:
vi /root/.vimrc
set nocp
set bs=2
vim show/hide line numbers
:nmap
set vim fast shortcuts
nnoremap th :tabfirst
nnoremap tj :tabnext
nnoremap tk :tabprev
nnoremap tl :tablast
nnoremap tt :tabedit
nnoremap tn :tabnext
nnoremap tm :tabm
nnoremap td :tabclose
Also can use cabbrev.
vim create new tab
:tabnew
nnoremap th :tabmew
pymode red line
vim ~/.vimrc
autocmd BufRead *.py setlocal colorcolumn=0
also:
let g:pymode_options_colorcolumn = 0
to change color:
ColorColumn ctermbg=8