" Basic configurations set nocompatible set novisualbell syntax on set encoding=utf-8 set number set clipboard=unnamedplus set textwidth=100 " Set to I-beam cursor " set guicursor=v-c-sm:block,n-i-ci-ve:ver25,r-cr-o:hor20 " , is leader let mapleader ="," """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remaps for Smart Quit nnoremap ZZ :w:SmartQ nnoremap ZQ (smartq_this) " Remaps for buffers nnoremap :bprevious nnoremap :bnext nnoremap b :Buffer " Remaps for line numbers toggle nmap :set invnumber " Other remaps nnoremap F :Files imap jj set backspace=indent,eol,start nnoremap S :%s///g noremap noremap noremap noremap map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#") """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Enable autocompletion: set wildmode=longest,list,full " Spell-check set to o, 'o' for 'orthography': map o :setlocal spell! spelllang=en_us " Disables automatic commenting on newline: autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Indentations set softtabstop=2 set shiftwidth=2 set expandtab filetype plugin indent on " set smartindent " set smarttab """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Splits open at the bottom and right, which is non-retarded, unlike vim defaults. set splitbelow splitright " Search and Replace set ignorecase set smartcase set nohlsearch set incsearch " set hlsearch " Edit .j2 as yaml files au BufNewFile,BufReadPost *.yaml.j2 set filetype=yaml au BufNewFile,BufReadPost *.yml.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 " 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 " Bash highlight shCmdSubRegion ctermfg=Magenta highlight shCmdSub ctermfg=Magenta highlight shCommandSub ctermfg=Magenta highlight shDerefSimple ctermfg=Brown highlight shNumber ctermfg=Cyan highlight shIf ctermfg=Magenta highlight shElse ctermfg=Magenta highlight shElif ctermfg=Magenta highlight shFi ctermfg=Magenta highlight shFor ctermfg=Magenta highlight shWhile ctermfg=Magenta highlight shFunction ctermfg=Magenta highlight shCase ctermfg=Magenta highlight shEsac ctermfg=Magenta highlight shReturn ctermfg=Magenta highlight shVariable ctermfg=Blue highlight shString ctermfg=Green highlight shSpecial ctermfg=Brown highlight shDerefVar ctermfg=Brown highlight PreProc ctermfg=Brown highlight shNumber ctermfg=Cyan highlight shDanger ctermfg=Red " Yaml highlight yamlBlockMappingKey ctermfg=Magenta highlight yamlKeyValueDelimiter ctermfg=Magenta highlight yamlBlock ctermfg=Magenta highlight yamlKey ctermfg=Blue highlight yamlDoubleQuotedString ctermfg=Cyan highlight yamlSingleQuotedString ctermfg=Cyan highlight yamlDocumentHeader ctermfg=Brown highlight yamlTag cterm=italic highlight yamlFlowIndicator ctermfg=White " CSS highlight cssClassName ctermfg=Magenta highlight cssIdSelector ctermfg=Magenta highlight cssAttributeSelector ctermfg=Magenta highlight cssMediaQuery ctermfg=Blue highlight cssKeyframeRule ctermfg=Blue highlight cssAnimationProperty ctermfg=Magenta highlight cssVariable ctermfg=Blue highlight cssVendorProperty ctermfg=Brown highlight cssImportantKeyword ctermfg=Brown highlight cssFontProp ctermfg=Magenta highlight cssFontDescriptorProp ctermfg=Magenta highlight cssAtKeyword ctermfg=Magenta highlight cssFunctionName ctermfg=Magenta highlight cssAtRule ctermfg=Blue highlight cssPseudoClassId ctermfg=Blue highlight cssSelector cterm=italic highlight cssProperty cterm=italic highlight cssValue cterm=italic highlight cssNumber ctermfg=Cyan highlight cssTrue ctermfg=Cyan highlight cssFalse ctermfg=Cyan highlight cssNull ctermfg=Cyan highlight cssCustomProp ctermfg=Magenta highlight cssTextProp ctermfg=DarkYellow " Python highlight pythonFunction cterm=italic highlight pythonClass cterm=italic highlight pythonMethod cterm=italic " JavaScript highlight jsFunction cterm=italic highlight jsClass cterm=italic highlight jsMethod cterm=italic " HTML highlight htmlTag cterm=italic highlight htmlAttribute cterm=italic " Java highlight javaClass cterm=italic highlight javaMethod cterm=italic highlight javaFunction cterm=italic " Vimscript highlight vimParen ctermfg=White highlight vimSep ctermfg=White highlight vimBraces ctermfg=White highlight vimFunc ctermfg=Cyan highlight vimNotation ctermfg=Cyan highlight vimBracket ctermfg=Cyan highlight vimMapModKey ctermfg=Cyan highlight vimSetOption ctermfg=Cyan highlight vimAutoCommand ctermfg=Cyan highlight vimUserCommand ctermfg=Cyan highlight vimCommand ctermfg=Cyan highlight vimFuncSID ctermfg=Cyan highlight vimMapKey ctermfg=Cyan highlight vimOption ctermfg=Blue """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Colours " Use purple for syntax elements highlight Keyword ctermfg=Magenta highlight Statement ctermfg=Magenta " Use blue for variables highlight Identifier ctermfg=Blue highlight Type ctermfg=Blue highlight Function ctermfg=Blue " Use teal for numbers and language constants highlight Number ctermfg=Cyan highlight Boolean ctermfg=Cyan highlight Constant ctermfg=Cyan " Use green for string literals highlight String ctermfg=Green " Use orange for special syntax elements highlight Special ctermfg=Brown " Use red to highlight errors highlight Error ctermfg=White ctermbg=Red highlight Danger ctermfg=White ctermbg=Red " Use grey for comments highlight Comment ctermfg=DarkGrey " Match parentheses highlight MatchParen ctermfg=White " Curly braces, square brackets, parentheses highlight Delimiter ctermfg=White highlight Indicator ctermfg=White highlight SpecialChar ctermfg=White highlight SpecialComment ctermfg=White " Use italics for computation highlight yamlKey cterm=italic highlight yamlValue cterm=italic highlight yamlAnchor cterm=italic highlight NonText ctermfg=DarkGrey highlight SpecialKey ctermfg=DarkGrey highlight StatusLine ctermbg=White ctermfg=DarkGrey highlight LineNr ctermfg=DarkGrey