Skip to content

Instantly share code, notes, and snippets.

@inebritov
Last active January 9, 2017 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inebritov/63e67966137ee87d7e12 to your computer and use it in GitHub Desktop.
Save inebritov/63e67966137ee87d7e12 to your computer and use it in GitHub Desktop.
.vimrc
"""""""""""""""""""""""""""""""""""""""""""""""
"" Vim settings
" Terminal settings
filetype plugin indent on
set clipboard=unnamedplus
scriptencoding utf-8
set encoding=utf-8
set esckeys
set ttimeoutlen=1
syntax on
" Vim behavior
set autoread
set expandtab
set history=700
set mouse=a
set showmode
set shiftwidth=4
set showcmd
set tabstop=4
set undolevels=800
set wildmenu
set hlsearch
set ignorecase
set incsearch
set smartcase
set backspace=indent,eol,start
set whichwrap=<,>,[,],h,l
"""""""""""""""""""""""""""""""""""""""""""""""
"" Visual settings
set cursorline
set listchars=tab:>-,trail:·
set list
set hidden
set number
set t_Co=256
hi CursorLine cterm=NONE ctermbg=233 ctermfg=NONE
hi LineNr ctermfg=gray ctermbg=233
"""""""""""""""""""""""""""""""""""""""""""""""
"" Keymap
" Leader
let mapleader="\<Space>"
map <leader>x <esc>:Bclose<CR>
map <leader>h <esc>:noh<CR>
" Fn
set pastetoggle=<F2>
" Meta (alt)
map <M-Right> :bn<CR>
map <M-Left> :bp<CR>
imap <M-Right> <esc>:bn<CR>
imap <M-Left> <esc>:bp<CR>
" Ctrl
imap <C-Space> <C-x><C-o>
imap <C-@> <C-Space>
nmap <C-h> b
nmap <C-k> <C-u>
nmap <C-j> <C-d>
nmap <C-l> w
map <C-s> <esc>:w<CR>
map <C-q> <esc>:q<CR>
imap <C-s> <esc>:w<CR>
imap <C-v> <C-r>*
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
" Shift
nmap <S-Tab> <<
imap <S-Tab> <C-d>
vmap <S-Tab> <gv
nmap <S-k> v<Up>
nmap <S-j> v<Down>
nmap <S-h> v<Left>
nmap <S-l> v<Right>
vmap <S-k> <Up>
vmap <S-j> <Down>
vmap <S-h> <Left>
vmap <S-l> <Right>
map <S-Up> vk
map <S-Down> vj
map <S-Left> vh
map <S-Right> vl
vmap <S-Up> k
vmap <S-Down> j
vmap <S-Left> h
vmap <S-Right> l
imap <S-Up> <esc>vk
imap <S-Down> <esc>vj
imap <S-Left> <esc>vh
imap <S-Right> <esc>vl
" Tab
nmap <Tab> >>
vmap <Tab> >gv
" Other
noremap p P
noremap P gp
nmap <bs> X
vnoremap o :sort<CR>
map + <C-w>>
map - <C-w><
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment