formatting and tidy up

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

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