dotfiles/.vimrc
2018-02-19 18:42:00 +01:00

137 lines
2.8 KiB
VimL

set nocompatible " be iMproved, required
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/vimfiles"
else
let $VIMHOME = $HOME."/.vim"
endif
call plug#begin($VIMHOME.'/plugged')
Plug 'terryma/vim-multiple-cursors'
Plug 'thinca/vim-localrc'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'nightsense/seagrey'
Plug 'lervag/vimtex'
Plug 'eagletmt/neco-ghc'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-surround'
" Plug 'Valloric/YouCompleteMe'
" Plug 'scrooloose/nerdtree'
call plug#end()
set backupdir=$TEMP//
set directory=$TEMP//
set colorcolumn=80,120
"
" My own config
"
let g:ycm_global_ycm_extra_conf = "~\vimfiles\.ycm_extra_conf.py"
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:airline_powerline_fonts = 1
let g:airline_theme = "deus"
let g:airline#extensions#tabline#enabled = 1
set splitbelow
set shellslash
" UTF-8 support
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
set enc=utf-8
set encoding=utf-8
setglobal fileencoding=utf-8
" setglobal bomb
" set fileencodings=ucs-bom,utf-8,latin1
endif
set backspace=2
set autoindent
" tabs
set expandtab
set tabstop=4
set shiftwidth=4
" syntax
syntax on
set number
" disable bells
set noeb vb t_vb=
nmap \\ :CtrlP<CR>
" filetypes
" autocmd FileType c,cpp :compiler cl
au FileType asm :set ft=masm
" one time settings
if !exists("g:running")
" Conemu specific settings
if !has('gui_running') && !has('nvim')
set term=xterm
set t_Co=256
inoremap <Char-0x07F> <BS>
nnoremap <Char-0x07F> <BS>
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
inoremap <Esc>[62~ <C-X><C-E>
inoremap <Esc>[63~ <C-X><C-Y>
nnoremap <Esc>[62~ <C-E>
nnoremap <Esc>[63~ <C-Y>
endif
if has('gui_running')
set guifont=Fira_Code_Medium:h9:cANSI:qDRAFT
set guioptions=
set columns=200
set lines=58
colorscheme seagrey-dark
endif
endif
" latex
let g:vimtex_view_general_viewer = 'SumatraPDF'
let g:vimtex_view_general_options
\ = '-reuse-instance -forward-search @tex @line @pdf'
let g:running = 1
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" open omni completion menu closing previous if open and opening new menu without changing the text
inoremap <expr> <C-Space> (pumvisible() ? (col('.') > 1 ? '<Esc>i<Right>' : '<Esc>i') : '') .
\ '<C-x><C-o><C-r>=pumvisible() ? "\<lt>C-n>\<lt>C-p>\<lt>Down>" : ""<CR>'
" remapings
nnoremap YY :%y+<CR>
nnoremap <space><cr> :nohlsearch<cr>
noremap <space>y "*y
noremap <space>Y "*Y
noremap <space>p "*p
noremap <space>P "*P
nnoremap <c-s-tab> gT
nnoremap <c-tab> gt
nnoremap <space>a ggVG
vnoremap > >gv
vnoremap < <gv