From d65417ea080fce9c7e7383d4a3971f489022d9f5 Mon Sep 17 00:00:00 2001 From: Remo Mattei Date: Sun, 23 Dec 2018 19:45:05 -0800 Subject: [PATCH 1/5] Adding the following: undo folder syntastic for asciidoctor sets function collumnlimit for filetype scala,java,asciidoc,yaml sets rainbow mode sets relative number function installs bracket pairs --- vimrc | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index ddb49fac..10bfaef3 100644 --- a/vimrc +++ b/vimrc @@ -1,9 +1,26 @@ " don't bother with vi compatibility set nocompatible +set undodir=~/.vim/.undo/ " enable syntax highlighting syntax enable + +" asciidoctor +let g:syntastic_asciidoc_asciidoc_exec = "asciidoctor" + +" limit to 79 +augroup collumnLimit + autocmd! + autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml highlight CollumnLimit ctermbg=DarkGrey guibg=DarkGrey + let collumnLimit = 79 " feel free to customize + let pattern = + \ '\%<' . (collumnLimit+1) . 'v.\%>' . collumnLimit . 'v' + autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml + \ let w:m1=matchadd('CollumnLimit', pattern, -1) +augroup END + + " configure Vundle filetype on " without this vim emits a zero exit status, later, because of :ft off filetype off @@ -34,7 +51,7 @@ set incsearch " search as you typ set laststatus=2 " always show statusline set list " show trailing whitespace set listchars=tab:▸\ ,trail:▫ -set number " show line numbers +" set number " show line numbers set ruler " show where you are set scrolloff=3 " show context above/below cursorline set shiftwidth=2 " normal mode indentation commands use 2 spaces @@ -77,6 +94,31 @@ cnoremap w!! %!sudo tee > /dev/null % let g:ctrlp_match_window = 'order:ttb,max:20' let g:NERDSpaceDelims=1 let g:gitgutter_enabled = 0 +let g:vim_asciidoc_initial_foldlevel=1 +let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle +let g:rainbow_conf = { + \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], + \ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], + \ 'operators': '_,_', + \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'], + \ 'separately': { + \ '*': {}, + \ 'tex': { + \ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'], + \ }, + \ 'lisp': { + \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'], + \ }, + \ 'vim': { + \ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'], + \ }, + \ 'html': { + \ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold'], + \ }, + \ 'css': 0, + \ } + \} + " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher if executable('ag') @@ -91,7 +133,11 @@ endif autocmd BufRead,BufNewFile *.fdoc set filetype=yaml " md is markdown autocmd BufRead,BufNewFile *.md set filetype=markdown + +" adoc is asciidoctor or asciidoc +autocmd BufRead,BufNewfile *.adoc set filetype=asciidoc spell autocmd BufRead,BufNewFile *.md set spell +" " extra rails.vim help autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb autocmd User Rails silent! Rnavcommand observer app/observers -glob=**/* -suffix=_observer.rb @@ -127,3 +173,17 @@ if filereadable(expand("~/.vimrc.local")) " noremap! jj source ~/.vimrc.local endif + +"" Line Numbers {{{2 +function! NumberToggle() + if(&relativenumber == 1) + set nornu + set number + else + set relativenumber + endif +endfunc +" nnoremap :call NumberToggle() +call NumberToggle() + +Plugin 'auto-pairs-gentle' From b1e71ef1a00b97131901cd2099a7af6a16eb5210 Mon Sep 17 00:00:00 2001 From: Remo Mattei Date: Sun, 23 Dec 2018 19:57:18 -0800 Subject: [PATCH 2/5] Adding plugin files --- vim/autoload/rainbow.vim | 93 +++++++++++++++++++++++++++++++++ vim/autoload/rainbow_main.vim | 97 +++++++++++++++++++++++++++++++++++ vim/plugin/rainbow_main.vim | 10 ++++ 3 files changed, 200 insertions(+) create mode 100644 vim/autoload/rainbow.vim create mode 100644 vim/autoload/rainbow_main.vim create mode 100644 vim/plugin/rainbow_main.vim diff --git a/vim/autoload/rainbow.vim b/vim/autoload/rainbow.vim new file mode 100644 index 00000000..70cab980 --- /dev/null +++ b/vim/autoload/rainbow.vim @@ -0,0 +1,93 @@ +if exists('s:loaded') | finish | endif | let s:loaded = 1 + +fun s:resolve_parenthesis(p) + let ls = split(a:p, '\v%(%(start|step|end)\=(.)%(\1@!.)*\1[^ ]*|\w+%(\=[^ ]*)?) ?\zs', 0) + let [paren, containedin, contains, op] = ['', '', 'TOP', ''] + for s in ls + let [k, v] = [matchstr(s, '^[^=]\+\ze='), matchstr(s, '^[^=]\+=\zs.*')] + if k == 'step' + let op = v + elseif k == 'contains' + let contains = v + elseif k == 'containedin' + let containedin = v + else + let paren .= s + endif + endfor + return [paren, containedin, contains, op] +endfun + +fun rainbow#syn(config) + let conf = a:config + let prefix = conf.syn_name_prefix + let maxlvl = has('gui_running')? len(conf.guifgs) : len(conf.ctermfgs) + for i in range(len(conf.parentheses)) + let p = conf.parentheses[i] + if type(p) == type([]) + let op = len(p)==3? p[1] : has_key(conf, 'operators')? conf.operators : '' + let conf.parentheses[i] = op != ''? printf('start=#%s# step=%s end=#%s#', p[0], op, p[-1]) : printf('start=#%s# end=#%s#', p[0], p[-1]) + endif + endfor + let def_rg = 'syn region %s matchgroup=%s containedin=%s contains=%s %s' + let def_op = 'syn match %s %s containedin=%s contained' + + let b:rainbow_loaded = maxlvl + for parenthesis_args in conf.parentheses + let [paren, containedin, contains, op] = s:resolve_parenthesis(parenthesis_args) + if op == '' |let op = conf.operators |endif + for lvl in range(maxlvl) + if op != '' |exe printf(def_op, prefix.'_o'.lvl, op, prefix.'_r'.lvl) |endif + if lvl == 0 + if containedin == '' + exe printf(def_rg, prefix.'_r0', prefix.'_p0', prefix.'_r'.(maxlvl - 1), contains, paren) + endif + else + exe printf(def_rg, prefix.'_r'.lvl, prefix.'_p'.lvl.(' contained'), prefix.'_r'.((lvl + maxlvl - 1) % maxlvl), contains, paren) + endif + endfor + if containedin != '' + exe printf(def_rg, prefix.'_r0', prefix.'_p0 contained', containedin.','.prefix.'_r'.(maxlvl - 1), contains, paren) + endif + endfor + exe 'syn cluster '.prefix.'Regions contains='.join(map(range(maxlvl), '"'.prefix.'_r".v:val'),',') + exe 'syn cluster '.prefix.'Parentheses contains='.join(map(range(maxlvl), '"'.prefix.'_p".v:val'),',') + exe 'syn cluster '.prefix.'Operators contains='.join(map(range(maxlvl), '"'.prefix.'_o".v:val'),',') + if has_key(conf, 'after') | for cmd in conf.after | exe cmd | endfor | endif +endfun + +fun rainbow#syn_clear(config) + let conf = a:config + let prefix = conf.syn_name_prefix + let maxlvl = has('gui_running')? len(conf.guifgs) : len(conf.ctermfgs) + + for id in range(maxlvl) + exe 'syn clear '.prefix.'_r'.id + exe 'syn clear '.prefix.'_o'.id + endfor +endfun + +fun rainbow#hi(config) + let conf = a:config + let prefix = conf.syn_name_prefix + let maxlvl = has('gui_running')? len(conf.guifgs) : len(conf.ctermfgs) + + for id in range(maxlvl) + let ctermfg = conf.ctermfgs[id % len(conf.ctermfgs)] + let guifg = conf.guifgs[id % len(conf.guifgs)] + exe 'hi '.prefix.'_p'.id.' ctermfg='.ctermfg.' guifg='.guifg + exe 'hi '.prefix.'_o'.id.' ctermfg='.ctermfg.' guifg='.guifg + endfor +endfun + +fun rainbow#hi_clear(config) + let conf = a:config + let prefix = conf.syn_name_prefix + let maxlvl = has('gui_running')? len(conf.guifgs) : len(conf.ctermfgs) + + for id in range(maxlvl) + exe 'hi clear '.prefix.'_p'.id + exe 'hi clear '.prefix.'_o'.id + endfor +endfun + diff --git a/vim/autoload/rainbow_main.vim b/vim/autoload/rainbow_main.vim new file mode 100644 index 00000000..c55a9cb2 --- /dev/null +++ b/vim/autoload/rainbow_main.vim @@ -0,0 +1,97 @@ +let s:rainbow_conf = { +\ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], +\ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], +\ 'operators': '_,_', +\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'], +\ 'separately': { +\ '*': {}, +\ 'lisp': { +\ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'], +\ }, +\ 'haskell': { +\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/\v\{\ze[^-]/ end=/}/ fold'], +\ }, +\ 'tex': { +\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'], +\ }, +\ 'vim': { +\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'], +\ }, +\ 'xml': { +\ 'syn_name_prefix': 'xmlRainbow', +\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=## fold'], +\ }, +\ 'xhtml': { +\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=## fold'], +\ }, +\ 'html': { +\ 'parentheses': ['start=/\v\<((script|style|area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold'], +\ }, +\ 'perl': { +\ 'syn_name_prefix': 'perlBlockFoldRainbow', +\ }, +\ 'php': { +\ 'syn_name_prefix': 'phpBlockRainbow', +\ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold', 'start=/(/ end=/)/ containedin=@htmlPreproc contains=@phpClTop', 'start=/\[/ end=/\]/ containedin=@htmlPreproc contains=@phpClTop', 'start=/{/ end=/}/ containedin=@htmlPreproc contains=@phpClTop'], +\ }, +\ 'stylus': { +\ 'parentheses': ['start=/{/ end=/}/ fold contains=@colorableGroup'], +\ }, +\ 'css': 0, +\ 'sh': 0, +\ } +\} + +fun s:eq(x, y) + return type(a:x) == type(a:y) && a:x == a:y +endfun + +fun rainbow_main#gen_config(ft) + let g = exists('g:rainbow_conf')? g:rainbow_conf : {} + "echom 'g:rainbow_conf:' string(g) + let s = get(g, 'separately', {}) + "echom 'g:rainbow_conf.separately:' string(s) + let dft_conf = extend(copy(s:rainbow_conf), g) | unlet dft_conf.separately + "echom 'default config options:' string(dft_conf) + let dx_conf = s:rainbow_conf.separately['*'] + "echom 'default star config:' string(dx_conf) + let ds_conf = get(s:rainbow_conf.separately, a:ft, dx_conf) + "echom 'default separately config:' string(ds_conf) + let ux_conf = get(s, '*', ds_conf) + "echom 'user star config:' string(ux_conf) + let us_conf = get(s, a:ft, ux_conf) + "echom 'user separately config:' string(us_conf) + let conf = (s:eq(us_conf, 'default') ? ds_conf : us_conf) + "echom 'almost finally config:' string(conf) + return s:eq(conf, 0) ? 0 : extend(extend({'syn_name_prefix': substitute(a:ft, '\v\A+(\a)', '\u\1', 'g').'Rainbow'}, dft_conf), conf) +endfun + +fun rainbow_main#gen_configs(ft) + return filter(map(split(a:ft, '\v\.'), 'rainbow_main#gen_config(v:val)'), 'type(v:val) == type({})') +endfun + +fun rainbow_main#load() + let b:rainbow_confs = rainbow_main#gen_configs(&ft) + for conf in b:rainbow_confs + call rainbow#syn(conf) + call rainbow#hi(conf) + endfor +endfun + +fun rainbow_main#clear() + if !exists('b:rainbow_confs') | return | endif + for conf in b:rainbow_confs + call rainbow#hi_clear(conf) + call rainbow#syn_clear(conf) + endfor + unlet b:rainbow_confs +endfun + +fun rainbow_main#toggle() + if exists('b:rainbow_confs') + call rainbow_main#clear() + else + call rainbow_main#load() + endif +endfun + diff --git a/vim/plugin/rainbow_main.vim b/vim/plugin/rainbow_main.vim new file mode 100644 index 00000000..af34568c --- /dev/null +++ b/vim/plugin/rainbow_main.vim @@ -0,0 +1,10 @@ +if exists('s:loaded') || !(exists('g:rainbow_active') || exists('g:rainbow_conf')) | finish | endif | let s:loaded = 1 + +command! RainbowToggle call rainbow_main#toggle() +command! RainbowToggleOn call rainbow_main#load() +command! RainbowToggleOff call rainbow_main#clear() + +if (exists('g:rainbow_active') && g:rainbow_active) + auto syntax * call rainbow_main#load() + auto colorscheme * call rainbow_main#load() +endif From 9ce8f9b915b1315e900ee792fd1887cddb18ad14 Mon Sep 17 00:00:00 2001 From: Remo Mattei Date: Mon, 24 Dec 2018 16:38:02 -0800 Subject: [PATCH 3/5] Fixing undo option Fixing folding options adding additional plugins: * lepture/vim-jinja * glench/vim-jinja2-syntax * auto-pairs-gentle * hashivim/vim-terraform * maralla/completor.vim * tpope/vim-sensible * xuyuanp/nerdtree-git-plugin --- vim/autoload/rainbow.vim | 1 - vimrc | 76 +++++++++++++++++++++++----------------- vimrc.bundles | 7 ++++ vimrc.local | 1 - 4 files changed, 50 insertions(+), 35 deletions(-) diff --git a/vim/autoload/rainbow.vim b/vim/autoload/rainbow.vim index 70cab980..adf84b3e 100644 --- a/vim/autoload/rainbow.vim +++ b/vim/autoload/rainbow.vim @@ -1,5 +1,4 @@ if exists('s:loaded') | finish | endif | let s:loaded = 1 - fun s:resolve_parenthesis(p) let ls = split(a:p, '\v%(%(start|step|end)\=(.)%(\1@!.)*\1[^ ]*|\w+%(\=[^ ]*)?) ?\zs', 0) let [paren, containedin, contains, op] = ['', '', 'TOP', ''] diff --git a/vimrc b/vimrc index 10bfaef3..d760f315 100644 --- a/vimrc +++ b/vimrc @@ -1,30 +1,42 @@ " don't bother with vi compatibility set nocompatible -set undodir=~/.vim/.undo/ +set undofile +set undodir=~/.maximum-awesome/.undo/ + +set copyindent + +" Folding + set foldmethod=indent + set foldnestmax=10 + set nofoldenable + set foldlevel=2 + set foldcolumn=3 " enable syntax highlighting syntax enable +" Tmux & Clipboard +set clipboard=unnamed -" asciidoctor -let g:syntastic_asciidoc_asciidoc_exec = "asciidoctor" " limit to 79 -augroup collumnLimit +" Autocmds + augroup collumnLimit autocmd! - autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml highlight CollumnLimit ctermbg=DarkGrey guibg=DarkGrey + autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml + \ highlight CollumnLimit ctermbg=DarkGrey guibg=DarkGrey let collumnLimit = 79 " feel free to customize let pattern = - \ '\%<' . (collumnLimit+1) . 'v.\%>' . collumnLimit . 'v' + \ '\%<' . (collumnLimit+1) . 'v.\%>' . collumnLimit . 'v' autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml - \ let w:m1=matchadd('CollumnLimit', pattern, -1) -augroup END + \ let w:m1=matchadd('CollumnLimit', pattern, -1) + augroup END " configure Vundle -filetype on " without this vim emits a zero exit status, later, because of :ft off -filetype off -set rtp+=~/.vim/bundle/Vundle.vim + filetype on " without this vim emits a zero exit status, later, because of :ft off + filetype off + set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " install Vundle bundles @@ -32,7 +44,6 @@ if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles source ~/.vimrc.bundles.local endif - call vundle#end() " ensure ftdetect et al work by including this after the Vundle stuff @@ -50,8 +61,7 @@ set ignorecase " case-insensitive set incsearch " search as you type set laststatus=2 " always show statusline set list " show trailing whitespace -set listchars=tab:▸\ ,trail:▫ -" set number " show line numbers +set listchars=tab:▸\ ,trail:·,eol:¬ set ruler " show where you are set scrolloff=3 " show context above/below cursorline set shiftwidth=2 " normal mode indentation commands use 2 spaces @@ -90,13 +100,15 @@ noremap V :source ~/.vimrc:filetype detect:exe ":echo ' " in case you forgot to sudo cnoremap w!! %!sudo tee > /dev/null % -" plugin settings -let g:ctrlp_match_window = 'order:ttb,max:20' -let g:NERDSpaceDelims=1 -let g:gitgutter_enabled = 0 -let g:vim_asciidoc_initial_foldlevel=1 -let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle -let g:rainbow_conf = { +" plugin settings asciidoct/asciidoctor + let g:ctrlp_match_window = 'order:ttb,max:20' + let g:NERDSpaceDelims=1 + let g:gitgutter_enabled = 0 + let g:vim_asciidoc_initial_foldlevel=1 + " asciidoctor + let g:syntastic_asciidoc_asciidoc_exec = "asciidoctor" + let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle + let g:rainbow_conf = { \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], \ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], \ 'operators': '_,_', @@ -118,8 +130,6 @@ let g:rainbow_conf = { \ 'css': 0, \ } \} - - " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher if executable('ag') " Use Ag over Grep @@ -129,14 +139,16 @@ if executable('ag') let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' endif -" fdoc is yaml -autocmd BufRead,BufNewFile *.fdoc set filetype=yaml -" md is markdown -autocmd BufRead,BufNewFile *.md set filetype=markdown +"Spelling and file settings + " fdoc is yaml + autocmd BufRead,BufNewFile *.fdoc set filetype=yaml spell + " md is markdown + autocmd BufRead,BufNewFile *.md set filetype=markdown spell + " mdoc is asciidoctor or asciidoc + autocmd BufRead,BufNewfile *.adoc set filetype=asciidoc spell + "Jinja 2 + autocmd BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm set ft=jinja spell -" adoc is asciidoctor or asciidoc -autocmd BufRead,BufNewfile *.adoc set filetype=asciidoc spell -autocmd BufRead,BufNewFile *.md set spell " " extra rails.vim help autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb @@ -182,8 +194,6 @@ function! NumberToggle() else set relativenumber endif -endfunc + endfunc " nnoremap :call NumberToggle() call NumberToggle() - -Plugin 'auto-pairs-gentle' diff --git a/vimrc.bundles b/vimrc.bundles index f776fa31..6875bac4 100644 --- a/vimrc.bundles +++ b/vimrc.bundles @@ -41,3 +41,10 @@ Plugin 'vim-ruby/vim-ruby' Plugin 'vim-scripts/Align' Plugin 'vim-scripts/greplace.vim' Plugin 'vim-scripts/matchit.zip' +Plugin 'lepture/vim-jinja' +Plugin 'glench/vim-jinja2-syntax' +Plugin 'auto-pairs-gentle' +Plugin 'hashivim/vim-terraform' +Plugin 'maralla/completor.vim' +Plugin 'tpope/vim-sensible' +Plugin 'xuyuanp/nerdtree-git-plugin' diff --git a/vimrc.local b/vimrc.local index df938865..e6166de3 100644 --- a/vimrc.local +++ b/vimrc.local @@ -17,7 +17,6 @@ if (&t_Co == 256 || has('gui_running')) endif " Disambiguate ,a & ,t from the Align plugin, making them fast again. -" " This section is here to prevent AlignMaps from adding a bunch of mappings " that interfere with the very-common ,a and ,t mappings. This will get run " at every startup to remove the AlignMaps for the *next* vim startup. From 5c036ea52a1a5a995cd21c5cd480088019efb186 Mon Sep 17 00:00:00 2001 From: Remo Mattei Date: Tue, 25 Dec 2018 16:57:17 -0800 Subject: [PATCH 4/5] * Reworking autocmd to augroup better option * change clipboard option * Disabling mouse for my iTerm2 copy on highlights * Adding folding * Adding spell check color to be red & underlined if miss-spelled * Add highlights if word is does not begin with uppercase --- vimrc | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/vimrc b/vimrc index d760f315..25a62d7c 100644 --- a/vimrc +++ b/vimrc @@ -16,19 +16,18 @@ set copyindent syntax enable " Tmux & Clipboard -set clipboard=unnamed - +set clipboard^=unnamed " limit to 79 " Autocmds augroup collumnLimit autocmd! - autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml + autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml,yml,bash \ highlight CollumnLimit ctermbg=DarkGrey guibg=DarkGrey let collumnLimit = 79 " feel free to customize let pattern = \ '\%<' . (collumnLimit+1) . 'v.\%>' . collumnLimit . 'v' - autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml + autocmd BufEnter,WinEnter,FileType scala,java,asciidoc,yaml,yml,bash \ let w:m1=matchadd('CollumnLimit', pattern, -1) augroup END @@ -69,12 +68,14 @@ set showcmd set smartcase " case-sensitive search if any caps set softtabstop=2 " insert mode tab and backspace use 2 spaces set tabstop=8 " actual tabs occupy 8 characters -set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc +" set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc +set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux set wildmenu " show a navigable menu for tab completion set wildmode=longest,list,full -" Enable basic mouse behavior such as resizing buffers. -set mouse=a +" Enable basic mouse behavior such as resizing buffers. Off for iTerm2 on Mac +" section on preference to copy on select. +" set mouse=a if exists('$TMUX') " Support resizing in tmux set ttymouse=xterm2 endif @@ -93,6 +94,7 @@ nnoremap f :NERDTreeFind nnoremap t :CtrlP nnoremap T :CtrlPClearCache:CtrlP nnoremap ] :TagbarToggle +nnoremap y :call system('nc -U ~/.clipper.sock', @0) nnoremap :call whitespace#strip_trailing() nnoremap g :GitGutterToggle noremap V :source ~/.vimrc:filetype detect:exe ":echo 'vimrc reloaded'" @@ -139,15 +141,30 @@ if executable('ag') let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' endif -"Spelling and file settings - " fdoc is yaml - autocmd BufRead,BufNewFile *.fdoc set filetype=yaml spell - " md is markdown - autocmd BufRead,BufNewFile *.md set filetype=markdown spell - " mdoc is asciidoctor or asciidoc - autocmd BufRead,BufNewfile *.adoc set filetype=asciidoc spell +" setting bad words to underline instead of highlighed +hi clear SpellBad +hi SpellBad cterm=underline +hi SpellBad ctermfg=red guifg=red + +"Spelling and file types + augroup markdownSpell + autocmd! + autocmd FileType markdown setlocal spell + autocmd BufRead,BufNewFile *.md setlocal spell + augroup END + + augroup AsciidocSpell + autocmd! + autocmd FileType asciidoc setlocal spell + autocmd BufRead,BufNewFile *.adoc setlocal spell + augroup END + + "Jinja 2 autocmd BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm set ft=jinja spell + " yaml,yml,bash spelling + autocmd Filetype yaml setlocal spell + autocmd BufNewFile,BufRead *.bash,*.sh set ft=bash spell " " extra rails.vim help @@ -169,6 +186,7 @@ else let &t_EI = "\]50;CursorShape=0\x7" endif + " Don't copy the contents of an overwritten selection. vnoremap p "_dP @@ -186,7 +204,7 @@ if filereadable(expand("~/.vimrc.local")) source ~/.vimrc.local endif -"" Line Numbers {{{2 +" Line Numbers function! NumberToggle() if(&relativenumber == 1) set nornu From 9dcabfc40754c0e7dd2a840eda35fd3586aa84f5 Mon Sep 17 00:00:00 2001 From: Remo Mattei Date: Wed, 26 Dec 2018 18:26:01 -0800 Subject: [PATCH 5/5] Moving the set group top * Chainging syntax from enable to on * Adding soem variables into vimrc.yaml.local * Removing rails - noting using * Adding Plugins: terraform, gruvbox and vim-over * Adding comments to change fg and bg colors --- vimrc | 69 ++++++++++++++++++++++++--------------------------- vimrc.bundles | 3 +++ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/vimrc b/vimrc index 25a62d7c..f150153d 100644 --- a/vimrc +++ b/vimrc @@ -1,7 +1,36 @@ -" don't bother with vi compatibility +" Setting options set nocompatible set undofile set undodir=~/.maximum-awesome/.undo/ +set history=5000 +set autoindent +set autoread " reload files when changed on disk, i.e. via `git checkout` +set backspace=2 " Fix broken backspace in some setups +set backupcopy=yes " see :help crontab +set clipboard=unnamed " yank and paste with the system clipboard +set directory-=. " don't store swapfiles in the current directory +set noswapfile " do not set swapfiles +set encoding=utf-8 +set expandtab " expand tabs to spaces +set ignorecase " case-insensitive search +set incsearch " search as you type +set laststatus=2 " always show statusline +set list " show trailing whitespace +set listchars=tab:▸\ ,trail:·,eol:¬ +set ruler " show where you are +set scrolloff=3 " show context above/below cursorline +set shiftwidth=2 " normal mode indentation commands use 2 spaces +set showcmd +set smartcase " case-sensitive search if any caps +set softtabstop=2 " insert mode tab and backspace use 2 spaces +set tabstop=8 " actual tabs occupy 8 characters +set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux +set wildmenu " show a navigable menu for tab completion +set wildmode=longest,list,full +"Options to set diffent colors +"let &t_8f = "\[38;5;%1u;%2u;%1um" +"let &t_8b = "\[33;2;%lu;%lu;%lum" +"set termguicolors set copyindent @@ -13,7 +42,8 @@ set copyindent set foldcolumn=3 " enable syntax highlighting -syntax enable +syntax on +"syntax enable " Tmux & Clipboard set clipboard^=unnamed @@ -42,36 +72,13 @@ call vundle#begin() if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles source ~/.vimrc.bundles.local + source ~/.vimrc.yaml.local endif call vundle#end() " ensure ftdetect et al work by including this after the Vundle stuff filetype plugin indent on -set autoindent -set autoread " reload files when changed on disk, i.e. via `git checkout` -set backspace=2 " Fix broken backspace in some setups -set backupcopy=yes " see :help crontab -set clipboard=unnamed " yank and paste with the system clipboard -set directory-=. " don't store swapfiles in the current directory -set encoding=utf-8 -set expandtab " expand tabs to spaces -set ignorecase " case-insensitive search -set incsearch " search as you type -set laststatus=2 " always show statusline -set list " show trailing whitespace -set listchars=tab:▸\ ,trail:·,eol:¬ -set ruler " show where you are -set scrolloff=3 " show context above/below cursorline -set shiftwidth=2 " normal mode indentation commands use 2 spaces -set showcmd -set smartcase " case-sensitive search if any caps -set softtabstop=2 " insert mode tab and backspace use 2 spaces -set tabstop=8 " actual tabs occupy 8 characters -" set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc -set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux -set wildmenu " show a navigable menu for tab completion -set wildmode=longest,list,full " Enable basic mouse behavior such as resizing buffers. Off for iTerm2 on Mac " section on preference to copy on select. @@ -167,16 +174,6 @@ hi SpellBad ctermfg=red guifg=red autocmd BufNewFile,BufRead *.bash,*.sh set ft=bash spell " -" extra rails.vim help -autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb -autocmd User Rails silent! Rnavcommand observer app/observers -glob=**/* -suffix=_observer.rb -autocmd User Rails silent! Rnavcommand feature features -glob=**/* -suffix=.feature -autocmd User Rails silent! Rnavcommand job app/jobs -glob=**/* -suffix=_job.rb -autocmd User Rails silent! Rnavcommand mediator app/mediators -glob=**/* -suffix=_mediator.rb -autocmd User Rails silent! Rnavcommand stepdefinition features/step_definitions -glob=**/* -suffix=_steps.rb -" automatically rebalance windows on vim resize -autocmd VimResized * :wincmd = - " Fix Cursor in TMUX if exists('$TMUX') let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" diff --git a/vimrc.bundles b/vimrc.bundles index 6875bac4..8961b152 100644 --- a/vimrc.bundles +++ b/vimrc.bundles @@ -48,3 +48,6 @@ Plugin 'hashivim/vim-terraform' Plugin 'maralla/completor.vim' Plugin 'tpope/vim-sensible' Plugin 'xuyuanp/nerdtree-git-plugin' +Plugin 'avakhov/vim-yaml' +Plugin 'morhetz/gruvbox' +Plugin 'osyo-manga/vim-over'