Skip to content

Instantly share code, notes, and snippets.

@shytikov
Last active November 23, 2018 09:00
Show Gist options
  • Save shytikov/1388470 to your computer and use it in GitHub Desktop.
Save shytikov/1388470 to your computer and use it in GitHub Desktop.
.vimrc config file
set nocompatible
set ruler
set showcmd
set nu
set showmode
set nowrap
set guioptions-=T
set guioptions-=r
set guioptions-=L
"set guioptions-=m
set guioptions-=t
set enc=utf-8
"set guifont=Consolas:h10
set guifont=Iosevka:h10
"au GUIEnter * simalt ~x
if has("gui_running")
language en
language messages en
" GUI is running or is about to start.
" Maximize gvim window.
set lines=999 columns=999
"colorscheme github
"if &diff
" colorscheme github
"else
" colorscheme visualstudio
"endif
else
" This is console Vim.
" if exists("+lines")
" set lines=50
" endif
" if exists("+columns")
" set columns=100
" endif
endif
set foldmethod=indent
set incsearch
set hlsearch
set scrolljump=7
set scrolloff=7
set novisualbell
set t_vb=
set mouse=a
set mousemodel=popup
set termencoding=utf-8
set hidden
set ch=1
set mousehide
set autoindent
syntax on
set backspace=indent,eol,start whichwrap+=<,>,[,]
set showtabline=0
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set statusline=%<%f%h%m%r\ %b\ %{&encoding}\ 0x\ \ %l,%c%V\ %P
set laststatus=2
set smartindent
set fo+=cr
set sessionoptions=curdir,buffers,tabpages
nmap <silent> <Leader>ef :vsplit<bar>wincmd l<bar>exe "norm! Ljz<c-v><cr>"<cr>:set scb<cr>:wincmd h<cr> :set scb<cr>
"nmap <Space> <PageDown>
nmap <C-Z> u
imap <C-Z> <esc>ui
imap <C-F> <C-X><C-O>
vmap <C-C> "+yi
imap <C-V> <esc>"+gpi
map <S-Insert> <MiddleMouse>
imap <C-d> <esc>yypi
nmap ; :%s/\<<c-r>=expand("<cword>")<cr>\>/
nmap <C-S-l> dd
vmap <C-S-l> <esc>dd
imap <C-S-l> <esc>ddi
nmap <C-S> :w<cr>
vmap <C-S> <esc>:w<cr>
imap <C-S> <esc>:w<cr>li
nmap <F2> :w<cr>
vmap <F2> <esc>:w<cr>
imap <F2> <esc>:w<cr>li
nmap <F3> :copen<cr>
vmap <F3> <esc>:copen<cr>
imap <F3> <esc>:copen<cr>
nmap <F5> <Esc>:BufExplorer<cr>
vmap <F5> <esc>:BufExplorer<cr>
imap <F5> <esc><esc>:BufExplorer<cr>
map <F6> :bp<cr>
vmap <F6> <esc>:bp<cr>i
imap <F6> <esc>:bp<cr>i
map <F7> :bn<cr>
vmap <F7> <esc>:bn<cr>i
imap <F7> <esc>:bn<cr>i
map <F8> :MarksBrowser<cr>
vmap <F8> <esc>:MarksBrowser<cr>
imap <F8> <esc>:MarksBrowser<cr>
map <F9> :make<cr>
vmap <F9> <esc>:make<cr>i
imap <F9> <esc>:make<cr>i
map <F10> :bd<cr>
vmap <F10> <esc>:bd<cr>
imap <F10> <esc>:bd<cr>
map <F11> :TlistToggle<cr>
vmap <F11> <esc>:TlistToggle<cr>
imap <F11> <esc>:TlistToggle<cr>
map <F12> :Ex<cr>
vmap <F12> <esc>:Ex<cr>i
imap <F12> <esc>:Ex<cr>i
map <C-S-left> vb
vmap <C-S-left> b
imap <C-S-left> <esc>vb
map <C-S-right> ve
vmap <C-S-right> e
imap <C-S-right> <esc>ve
map <S-left> v<left>
vmap <S-left> <left>
imap <S-left> <esc>v<left>
map <S-right> v<right>
vmap <S-right> <right>
imap <S-right> <esc>v<right>
map <S-up> v<up>
vmap <S-up> <up>
imap <S-up> v<up>
map <S-down> v<down>
vmap <S-down> <down>
imap <S-down> v<down>
map <A-down> ]c
vmap <A-down> ]c
imap <A-down> <esc>]c
map <A-up> [c
vmap <A-up> [c
imap <A-up> <esc>[c
vmap < <gv
vmap > >gv
imap >Ins> <Esc>i
set wildmenu
set wcm=<Tab>
imap {<CR> {<CR>}<Esc>O
map <C-Q> <Esc>:qa<cr>
function InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
imap <tab> <c-r>=InsertTabWrapper()<cr>
set complete=""
set complete+=.
set complete+=k
set complete+=b
set complete+=t
let g:SessionMgr_AutoManage = 0
let g:SessionMgr_DefaultName = "mysession"
let g:Tlist_Show_One_File = 1
set completeopt-=preview
set completeopt+=longest
set mps-=[:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment