formatting and tidy up

This commit is contained in:
ManjaroOne666 2018-02-22 18:12:33 +00:00
parent 51fd40269e
commit 95d7ba9dfb
2 changed files with 132 additions and 142 deletions

View File

@ -11,8 +11,10 @@ set fillchars=stl:\ ,stlnc:\ ,vert:\|
let colors_name = 'customred256'
""""""""""""""
" colours
" #colours
""""""""""""""
" interface
@ -118,9 +120,12 @@ hi CRCssSelectorBright ctermfg=158 guifg=#abffd5
hi CRCssSelector ctermfg=85 guifg=#5fffaf
hi CRCssSelectorDark ctermfg=72 guifg=#2dac6d
"""""""""""""""""""
" definitions
" #definitions
""""""""""""""""""""
if has('gui_running')
hi Normal ctermfg=246 guifg=#949494 ctermbg=none guibg=#000000
else
@ -134,7 +139,7 @@ hi Search ctermfg=255 guifg=#ffffff ctermbg=none guibg=NONE gui=underline
hi! def link IncSearch Search
" general definitions
" #general definitions
hi Underlined cterm=underline term=underline gui=underline
hi Ignore ctermfg=232 guifg=NONE
hi! def link Error CRError
@ -163,12 +168,12 @@ hi! def link Conditional CRNoise
hi! def link Delimiter CRNoise
hi! def link Operator Conditional
" Comment definitions
" #comment definitions
hi! def link Comment CRComment
hi! def link SpecialComment CRCommentBright
hi! def link preProc CRCommentBright
" interface definitions
" #interface definitions
hi!def link SpecialKey InterfaceSpecial
hi! def link Directory InterfaceSpecial
hi! def link WarningMsg InterfaceWarningMsg
@ -232,7 +237,7 @@ hi! def link qfLineNr InterfaceH2
hi MatchParen ctermfg=255 guifg=#eeeeee ctermbg=241 guibg=#606060
" Vim definitions
" #vim definitions
hi! def link VimGroup Type
hi! def link VimHiGroup TypeBright
hi! def link VimContinue CRNoise
@ -242,7 +247,7 @@ hi! def link vimMapModKey CRSpecial
hi! def link vimHiKeyList CRNoise
hi! def link vimHiBang CRNoise
" SCSS definitions
" #scss definitions
hi! def link scssParamaters CRNoise
hi! def link scssVariableAssignment CRNoise
hi! def link scssVariableValue CRNoise
@ -271,7 +276,7 @@ hi! def link scssIf CRScssMediaKeyword
hi! def link scssElse CRScssMediaKeyword
hi! def link scssCondition CRCssAlt
" CSS definitions
" #css definitions
hi! def link cssNoise CRNoise
hi! def link cssBraces CssNoise
hi! def link cssAttrComma CssNoise
@ -304,7 +309,7 @@ hi! def link cssFunctionName scssFunctionName
hi! def link cssUnitDecorators CRNoise
" HTML definitions
" #html definitions
hi! def link htmlNormal CRHtmlNormal
hi! def link htmlTitle CRHtmlAltBright
hi! def link htmlTag CRNoise
@ -330,23 +335,21 @@ hi! def link htmlDataValue CRHtmlString
hi! def link htmlHrefArg htmlArg
hi! def link htmlHrefValue CRHtmlBaseBright
" HTML CSS definitions
" #html css definitions
hi! def link cssClassName scssSelectorName
hi! def link cssClassNameDot scssSelectorName
hi! def link cssIdentifier CRCssSelectorBright
hi! def link cssClassAttr CRNoise
hi! def link cssIdentifierAttr CRNoise
" PHP definitions
" #php definitions
hi! def link phpRegion Normal
hi! def link phpComparison Operator
hi! def link phpVarSelector IdentifierDark
hi! def link wpFunction IdentifierBright
" JavaScript definitions
" #javaScript definitions
hi! def link jsFunction CRIdentifierDark
hi! def link jsFuncName CRIdentifier
hi! def link jsFunctionKey CRSpecialBright
@ -373,7 +376,7 @@ hi! def link jsConditional CRIdentifierDark
hi! def link jsParenRepeat CRIdentifierBright
hi! def link jsArrowFunction CRNoiseBright
" vue definitions
" #vue definitions
hi! def link vueDirective CRStatementBright
hi! def link vueEvent CRIdentifier
hi! def link vueConditional CRSpecialBright
@ -386,12 +389,18 @@ hi! def link vueConditionalValue vueDirectiveValue
hi! def link vueForValue vueConditionalValue
hi! def link vueRefValue CRSpecial
" json definitions
" #json definitions
hi! def link jsonKeyword Identifier
hi! def link jsonValue String
hi! def link jsonQuote CRNoise
" VimWiki highlighting
"""""""""""""""
" #highlighting
"""""""""""""""
" #vimwiki highlighting
hi VimwikiLink ctermfg=252 guifg=#d0d0d0 ctermbg=234 guibg=#1c1c1c
hi! def link VimwikiHeaderChar CRNoiseDark
hi VimwikiHeader1 ctermbg=242 guibg=#666666 ctermfg=255 guifg=#eeeeee
@ -402,7 +411,7 @@ hi VimwikiHeader5 ctermbg=236 guibg=#303030 guibg=#303030 cter
hi VimwikiHeader6 ctermbg=236 guibg=#303030 guibg=#303030 ctermfg=244 guifg=#808080
hi VimwikiListTodo ctermbg=233 guibg=#121212 ctermfg=255 guifg=#eeeeee
" shell
" #shell highlighting
" TODO do properly
hi! def link shConditional shLoop
hi! def link shFunctionTwo CRIdentifierBright
@ -418,10 +427,11 @@ hi! def link shEscape CRNoise
hi! def link shTestOpr CRNoise
hi! def link shSnglCase CRNoise
" config
" #config highlighting
hi! def link confComment CRCommentDark
" BufExplorer Highlighting
" #bufexplorer highlighting
hi! def link bufExplorerBufNbr InterfaceH1
hi! def link bufExplorerMapping InterfaceHelpBright
hi! def link bufExplorerHelp InterfaceHelp
@ -443,7 +453,7 @@ hi! def link bufExplorerUnlBuf InterfaceNormalDark
hi! def link bufExplorerInactBuf InterfaceNormal
" Tagbar highlighting
" #tagbar highlighting
" TagbarHighlight defined in vimrc as it gets overridden
" by plugin when defined in here
hi! def link TagbarFoldIcon InterfaceNormal
@ -475,12 +485,11 @@ hi! TagbarHighlight ctermfg=255 guifg=#eeeeee ctermbg=240 guibg
"
" This must go before all other syntax
" definitions in that file.
" TODO see if its possible to extend that plugin
" rather than placing code in the plugin's file.
" TODO see if i can put this somewhere else - after dir?
hi! def link TagbarNormal InterfaceNormalBright
" Netrw highlighting
" #netrw highlighting
hi! def link netrwVersion InterfaceNormalBright
hi! def link netrwClassify InterfaceNormal
hi! def link netrwTreebar InterfaceNormalDark
@ -490,7 +499,7 @@ hi! def link netrwQuickHelp netrwCmdNote
hi! def link netrwList InterfaceH3
" NERDtree highlighting
" #nerdtree highlighting
hi! def link NERDTreeDir InterfaceNormalBright
hi! def link NERDTreeFile InterfaceNormal
hi! def link NERDTreeOpenable InterfaceNormal
@ -536,6 +545,6 @@ hi! def link NERDTreeGitStatusDirClean InterfaceNormalDark
" TODO: use diff color
hi! def link NERDTreeGitStatusIgnored InterfaceNormal
" ALE highlighting
" #ale highlighting
hi! def link ALEErrorSign InterfaceErrorSign
hi! def link ALEWarningSign InterfaceWarningSign

213
vimrc
View File

@ -1,20 +1,12 @@
" set nocompatible " be iMproved, required
filetype off " required
set ttyfast
" set the runtime path to include Vundle and initialize
" #plugins
set runtimepath+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" Nerdtree and nerdtree-git
" Plugin 'scrooloose/nerdtree.git'
" Plugin 'Xuyuanp/nerdtree-git-plugin'
"css3-syntax
Plugin 'hail2u/vim-css3-syntax.git'
"scss-syntax
@ -27,8 +19,6 @@ Plugin 'majutsushi/tagbar'
Plugin 'tpope/vim-surround'
"undotree
Plugin 'mbbill/undotree'
" gutentag
"Plugin 'ludovicchabant/vim-gutentags'
" vim-project-tags
"dependancy needed:
"https://github.com/still-dreaming-1/vim-project-tags
@ -81,9 +71,6 @@ Plugin 'mattn/emmet-vim'
" vimwiki
" https://github.com/vimwiki/vimwiki
Plugin 'vimwiki/vimwiki'
" vim-slash
" https://github.com/junegunn/vim-slash
Plugin 'junegunn/vim-slash'
" youcompleteme
" https://github.com/Valloric/YouCompleteMe
Plugin 'Valloric/YouCompleteMe'
@ -91,53 +78,77 @@ Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" #settings
" set t_Sf=<Esc>[3%p1%dm " foreground colour
if &term == 'xterm-256color'
set termguicolors
endif
syntax on
colorscheme customred256
set guioptions-=mTrLb
set guioptions+=c
colorscheme customred256
" set t_Sb=<Esc>[4%p1%dm " background coloru
set updatetime=30000
set backupdir=~/.vimtmp
set directory=~/.vimtmp
" persisitent undo file
set undodir=/home/ray/.vim/undodir
set undofile
set clipboard=unnamedplus
" ignore case when searching
set ignorecase
" unless search contains uppercase
set smartcase
set wildmenu
set wildmode=longest:full,full
" allow hidden buffers
set hidden
set background=dark
" set number
set number relativenumber
set hlsearch " highlight searches
set hlsearch
set foldcolumn=1
set iskeyword+=-
set scrolloff=10
set showcmd
set incsearch
" key mappings
set laststatus=2
set foldmethod=manual
set showmode
set autoindent
set breakindent
set showbreak=
set mouse=a
set listchars=eol,tab:->,trail:~,extends:>,precedes:<,space
set textwidth=180
set formatoptions=cq
set wrapmargin=0
" key #mappings
let g:mapleader = "\<space>"
" replace current word with last yanked/deleted text
@ -145,7 +156,6 @@ nnoremap <leader>rr "_diwP
" replace current word with last yanked text
nnoremap <leader>ry diw"0P
" jk acts as escape in insert
inoremap jk <esc>
nnoremap <leader>co :!clear;
@ -217,18 +227,17 @@ nnoremap <leader>hl :nohlsearch<CR>
" devdocs mapping
nnoremap <leader>dd :DD<CR>
" abbreviations
" #abbreviations
iabbrev adn and
iabbrev waht what
iabbrev tehn then
set iskeyword+=-
set scrolloff=10 " scroll offset
set showcmd " show command in bottom bar
set incsearch
" statusline format
" #statusline format
set statusline=%#LineNr#
set statusline+=\ \ \
set statusline+=%#StatusLineFile#
@ -239,7 +248,6 @@ set statusline+=%*
set statusline+=%#StatusLineDir#
set statusline+=\ %{expand('%:p:h:t')}/ " directory tail
set statusline+=%#StatusLineFile#
" set statusline+=%t\ \
set statusline+=%{expand('%:t:r')}
set statusline+=%#StatusLineDot#
set statusline+=.
@ -262,8 +270,6 @@ set statusline+=\
set statusline+=%*
set statusline+=\ %{&spelllang}\
set statusline+=%#StatusLineNC#
" set statusline+=\
" set statusline+=%*
set statusline+=%= " left/right separator
@ -283,32 +289,9 @@ set statusline+=%#InterfaceNormalDark#
set statusline+=\ %P\ " percentage through file
set statusline+=%*
set laststatus=2
set foldmethod=manual
set autoindent
set breakindent
set showbreak=
syntax on
set mouse=a
set listchars=eol,tab:->,trail:~,extends:>,precedes:<,space
" rewrapping set to 80
set textwidth=180
" disable automatic wrapping
set formatoptions=cq
" disable wrapping based on terminal size
set wrapmargin=0
set t_Sf=<Esc>[3%p1%dm " foreground colour
set t_Sb=<Esc>[4%p1%dm " background coloru
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
" #autocommands
" persistent folds
augroup AutoSaveFolds
@ -337,8 +320,6 @@ augroup whitespaceerrors
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL
augroup END
" autocommands
" automatically reload if color scheme file written
augroup coloreload
au!
@ -364,9 +345,54 @@ augroup myvimrc
augroup END
" persisitent undo file
set undodir=/home/ray/.vim/undodir
set undofile
" #functions
" get name of syntax item
function! SyntaxItem()
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
endfunction
nnoremap <leader>p :echom SyntaxItem()<CR>
" devdocs DD
" https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim
function! s:Get_env() abort
if has('win64') || has('win32') || has('win16')
return 'WINDOWS'
else
return toupper(substitute(system('uname'), '\n', '', ''))
endif
endfunction
" What command to use on what system
let s:cmds = {"DARWIN": "open", "LINUX": "qutebrowser", "WINDOWS": "start"}
" Build the URL stub
let s:stub = s:cmds[<SID>Get_env()] . " 'http://devdocs.io/?q="
command! -nargs=* DD silent! call system(len(split(<q-args>, ' ')) == 0 ?
\ s:stub . &ft . ' ' . expand('<cword>') . "'" : len(split(<q-args>, ' ')) == 1 ?
\ s:stub . &ft . ' ' . <q-args> . "'" : s:stub . <q-args> . "'")
" use ranger as file manager
if !exists('*RangerExplorer')
function RangerExplorer()
exec 'silent !ranger --choosefile=/tmp/vim_ranger_current_file ' . expand('%:p:h')
if filereadable('/tmp/vim_ranger_current_file')
exec 'edit ' . system('cat /tmp/vim_ranger_current_file')
call system('rm /tmp/vim_ranger_current_file')
endif
redraw!
endfun
map <Leader>ra :call RangerExplorer()<CR>
endif
" #plugin settings
" Use the silver searcher ag command instead of grep
if executable('ag')
@ -380,19 +406,6 @@ if executable('ag')
let g:ctrlp_use_caching = 0
endif
" Functions
" get name of syntax item
function! SyntaxItem()
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
endfunction
nnoremap <leader>p :echom SyntaxItem()<CR>
" plugin stuff
" youcompleteme
let g:ycm_collect_identifiers_from_tags_files = 1
@ -533,38 +546,6 @@ let g:tagbar_type_vue = {
\ }
if !exists('*RangerExplorer')
function RangerExplorer()
exec 'silent !ranger --choosefile=/tmp/vim_ranger_current_file ' . expand('%:p:h')
if filereadable('/tmp/vim_ranger_current_file')
exec 'edit ' . system('cat /tmp/vim_ranger_current_file')
call system('rm /tmp/vim_ranger_current_file')
endif
redraw!
endfun
map <Leader>ra :call RangerExplorer()<CR>
endif
" devdocs DD
" https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim
function! s:Get_env() abort
if has('win64') || has('win32') || has('win16')
return 'WINDOWS'
else
return toupper(substitute(system('uname'), '\n', '', ''))
endif
endfunction
" What command to use on what system
let s:cmds = {"DARWIN": "open", "LINUX": "qutebrowser", "WINDOWS": "start"}
" Build the URL stub
let s:stub = s:cmds[<SID>Get_env()] . " 'http://devdocs.io/?q="
command! -nargs=* DD silent! call system(len(split(<q-args>, ' ')) == 0 ?
\ s:stub . &ft . ' ' . expand('<cword>') . "'" : len(split(<q-args>, ' ')) == 1 ?
\ s:stub . &ft . ' ' . <q-args> . "'" : s:stub . <q-args> . "'")
" ze end