Skip to content

Instantly share code, notes, and snippets.

@heolin
Created February 21, 2018 08:39
Show Gist options
  • Save heolin/ddb8abe86923493c265f563f162d4d63 to your computer and use it in GitHub Desktop.
Save heolin/ddb8abe86923493c265f563f162d4d63 to your computer and use it in GitHub Desktop.
set smartindent " TODO
set tabstop=4
set shiftwidth=4
set expandtab " TODO
set encoding=utf-8
set completeopt=menuone,longest " TODO
set number " Displays line number
set autochdir
set clipboard=unnamedplus
set mouse=a
set list listchars=tab:»·,trail:·
set showmatch " Set show matching parenthesis
set hlsearch " Highlight search terms
set incsearch " Show search matches as you type
set nobackup " Disable backuping
set noswapfile " Disable creating .swp files
map <C-t>n :tabedit<CR>
map <Tab> <C-W>W:cd %:p:h<CR>:<CR>
set pastetoggle=<F10>
nnoremap <S-Left> :tabprevious<CR>
nnoremap <S-Right> :tabnext<CR>
nnoremap <S-h> :tabprevious<CR>
nnoremap <S-l> :tabnext<CR>
nnoremap <S-j> <Nop>
nnoremap <S-k> <Nop>
vmap <Tab> >gv
vmap <S-Tab> <gv
autocmd VimEnter * :if argc() is 0 | source ~/.vim_session | endif " If vim starts without any file, restores last session
autocmd VimLeave * mksession! ~/.vim_session " Save last session on close
" Mouse visual block (ala MS Word)
nmap <C-LeftMouse> <LeftMouse><C-V>
vmap <C-LeftDrag> <LeftDrag>
imap <C-LeftMouse> <LeftMouse><C-O><C-V>
vmap <C-LeftMouse> <Esc><LeftMouse><C-V>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment