" Basic configurations set clipboard=unnamedplus set nocompatible syntax on set encoding=utf-8 set number set textwidth=100 set novisualbell let mapleader ="," set guicursor=v-c-sm:block,n-i-ci-ve:ver25,r-cr-o:hor20 " Spell-check set to o, 'o' for 'orthography': map o :setlocal spell! spelllang=en_us " Splits open at the bottom and right, which is non-retarded, unlike vim defaults. set splitbelow splitright " Enable autocompletion: set wildmode=longest,list,full " Disables automatic commenting on newline: autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Indentations " set smartindent " set smarttab set softtabstop=2 set shiftwidth=2 set expandtab filetype plugin indent on " Search and Replace set ignorecase set smartcase set nohlsearch " set hlsearch set incsearch " Splits open at the bottom and right, which is non-retarded, unlike vim defaults. set splitbelow splitright nnoremap :bprevious nnoremap :bnext nnoremap b :Buffer " Toggle line numbers nmap :set invnumber " Other remaps nnoremap F :Files imap jj set backspace=indent,eol,start nnoremap S :%s///g noremap noremap noremap noremap " Edit .j2 as yaml files au BufNewFile,BufReadPost *.yaml.j2 set filetype=yaml " Remove trailing whitespace autocmd BufWritePre * %s/\s\+$//e " Whitespace as shown as dots set list set listchars=lead:·,trail:·,tab:»\ ,extends:»,precedes:«,nbsp:· " Plugins call plug#begin() Plug 'junegunn/goyo.vim' Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'marklcrns/vim-smartq' call plug#end() " Smartq let g:smartq_default_mappings = 0 nnoremap ZZ :w:SmartQ nnoremap ZQ (smartq_this) " Goyo autocmd vimenter * Goyo 100 function! s:goyo_enter() set linebreak set wrap let b:quitting = 0 let b:quitting_bang = 0 autocmd QuitPre let b:quitting = 1 cabbrev q! let b:quitting_bang = 1 q! endfunction function! s:goyo_leave() " Quit Vim if this is the only remaining buffer if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 if b:quitting_bang qa! else qa endif endif endfunction autocmd! User GoyoEnter call goyo_enter() autocmd! User GoyoLeave call goyo_leave() " Colours highlight NonText ctermfg=DarkGrey highlight SpecialKey ctermfg=DarkGrey highlight StatusLine ctermbg=White ctermfg=DarkGrey highlight LineNr ctermfg=DarkGrey