Cleaned up .vimrc - removed muautocomplete.

This commit is contained in:
2019-03-05 11:01:11 -05:00
parent ecffd8f264
commit de96b89453

130
.vimrc
View File

@@ -1,3 +1,6 @@
" ----------------------------------------------------------------------------------------------------
" ==> .vimrc
set nocompatible " be iMproved, required set nocompatible " be iMproved, required
set number " turn on line numbers set number " turn on line numbers
set relativenumber " lines are numbered relative to current line set relativenumber " lines are numbered relative to current line
@@ -5,20 +8,19 @@ set scrolloff=8 " number of lines to keep a
set noerrorbells visualbell t_vb= " no sound on errors set noerrorbells visualbell t_vb= " no sound on errors
autocmd! bufwritepost .vimrc source ~/.vimrc " When vimrc is edited, reload it autocmd! bufwritepost .vimrc source ~/.vimrc " When vimrc is edited, reload it
set autoread " set to auto read when a file is changed from the outside set autoread " set to auto read when a file is changed from the outside
set cursorcolumn " highlight current column set cursorcolumn " highlight current column
set cursorline " highlight current row set cursorline " highlight current row
set incsearch " make search act like search in modern browsers set incsearch " make search act like search in modern browsers
set showmatch " show matching brackets when text indicator is over them set showmatch " show matching brackets when text indicator is over them
" ---------------------------------------------------------------------------------------------------- " ----------------------------------------------------------------------------------------------------
" From Vim Zero: https://www.oliversherouse.com/2017/08/21/vim_zero.html " ==> From Vim Zero: https://www.oliversherouse.com/2017/08/21/vim_zero.html
" General " General
let mapleader = ',' let mapleader = ','
set hidden " Allow background buffers without saving set hidden " Allow background buffers without saving
set spell spelllang=en_us
set splitright " Split to right by default set splitright " Split to right by default
" Text Wrapping " Text Wrapping
@@ -39,25 +41,8 @@ set softtabstop=4
set shiftwidth=4 set shiftwidth=4
set expandtab set expandtab
" Mappings " ----------------------------------------------------------------------------------------------------
" <ctrl>-H to move to previous buffer " ==> Plugins
nnoremap <C-H> :bp <enter>
" <ctrl>-L to move to next buffer
nnoremap <C-L> :bn <enter>
" comma-w to save buffer
nnoremap <Leader>w :w <enter>
" comma-q to quit buffer
nnoremap <Leader>q :bd <enter>
" bring up the copy buffer
noremap <Leader>x "+
" With ripgrep and FZF
" <leader> p to open files
map <Leader>p :Files<CR>
" search buffers
nmap ; :Buffers<CR>
" Plugins
"" Installation with VimPlug "" Installation with VimPlug
if has("win32") if has("win32")
@@ -72,7 +57,6 @@ Plug 'sheerun/vim-polyglot'
Plug 'flazz/vim-colorschemes' Plug 'flazz/vim-colorschemes'
""" General Functionality """ General Functionality
Plug 'lifepillar/vim-mucomplete'
Plug 'scrooloose/syntastic' Plug 'scrooloose/syntastic'
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
@@ -87,23 +71,23 @@ Plug 'junegunn/fzf.vim'
call plug#end() call plug#end()
"" Colors " ----------------------------------------------------------------------------------------------------
" ==> Colors
"
"set termguicolors "set termguicolors
colorscheme slate colorscheme slate
"" Autocompletion " ----------------------------------------------------------------------------------------------------
" ==> Autocompletion
let s:python_version=3 let s:python_version=3
echomsg 'Using python'.s:python_version echomsg 'Using python'.s:python_version
set completeopt=menuone,noinsert,noselect set completeopt=menuone,noinsert,noselect
set shortmess+=c " Turn off completion messages set shortmess+=c " Turn off completion messages
inoremap <expr> <c-e> mucomplete#popup_exit("\<c-e>") " ----------------------------------------------------------------------------------------------------
inoremap <expr> <c-y> mucomplete#popup_exit("\<c-y>") " ==> Pandoc
inoremap <expr> <cr> mucomplete#popup_exit("\<cr>")
let g:mucomplete#enable_auto_at_startup = 1
"" Pandoc
augroup pandoc_syntax augroup pandoc_syntax
au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc
au! BufNewFile,BufFilePre,BufRead *.markdown set filetype=markdown.pandoc au! BufNewFile,BufFilePre,BufRead *.markdown set filetype=markdown.pandoc
@@ -111,11 +95,11 @@ augroup END
let g:pandoc#syntax#conceal#use = 0 let g:pandoc#syntax#conceal#use = 0
let g:pandoc#syntax#codeblocks#embeds#langs = ['python', 'vim', 'make', 'bash=sh', 'html', 'css', 'scss', 'javascript'] let g:pandoc#syntax#codeblocks#embeds#langs = ['python', 'vim', 'make', 'bash=sh', 'html', 'css', 'scss', 'javascript']
" ----------------------------------------------------------------------------------------------------
" ---------------------------------------------------------------------------------------------------- " ----------------------------------------------------------------------------------------------------
" => Statusline " => Statusline
" Ideas from http://got-ravings.blogspot.com/2008/08/vim-pr0n-making-statuslines-that-own.html " Ideas from http://got-ravings.blogspot.com/2008/08/vim-pr0n-making-statuslines-that-own.html
set laststatus=2 " always show statusline set laststatus=2 " always show statusline
set statusline= " clear on reload set statusline= " clear on reload
set statusline+=[%n] " buffer number set statusline+=[%n] " buffer number
@@ -128,14 +112,35 @@ set statusline+=%= " left/right separator
set statusline+=l:%l/%L " cursor line/total lines set statusline+=l:%l/%L " cursor line/total lines
set statusline+=\ c:%c, " cursor column set statusline+=\ c:%c, " cursor column
set statusline+=\ %P " percent through file set statusline+=\ %P " percent through file
" ----------------------------------------------------------------------------------------------------
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" => Keymaps: Doing more things at once " => Keymaps: Doing more things at once
" -----------------------------------------------------------------------------------------------------
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" ===> Text bubbling (http://vimcasts.org/episodes/bubbling-text/) " ===> Keymaps: Buffers
" <ctrl>-H to move to previous buffer
nnoremap <C-H> :bp <enter>
" <ctrl>-L to move to next buffer
nnoremap <C-L> :bn <enter>
" comma-w to save buffer
nnoremap <Leader>w :w <enter>
" comma-q to quit buffer
nnoremap <Leader>q :bd <enter>
" bring up the copy buffer
noremap <Leader>x "+
" -----------------------------------------------------------------------------------------------------
" ===> Keymaps: With ripgrep and FZF
" <leader> p to open files
map <Leader>p :Files<CR>
" search buffers
nmap ; :Buffers<CR>
" -----------------------------------------------------------------------------------------------------
" ===> Keymaps: Text bubbling (http://vimcasts.org/episodes/bubbling-text/)
" Bubble single lines " Bubble single lines
nmap <C-k> ddkP nmap <C-k> ddkP
nmap <C-j> ddp nmap <C-j> ddp
@@ -145,27 +150,38 @@ vmap <C-j> xp`[V`]
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" ===> More sane movement keys " ===> Keymaps: More sane movement keys
nnoremap j gj nnoremap j gj
nnoremap k gk nnoremap k gk
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" -----------------------------------------------------------------------------------------------------
" ===> Keymaps: Date and Time stamps
imap <F3> <C-R>=strftime("%Y-%m-%d %a")<CR>
imap <F4> <C-R>=strftime("%H:%M")<CR>
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" ===> Spellcheck " ===> Spellcheck
" Horrible colors! I hate spellchecker's red highlight, so I changed it " Horrible colors! I hate spellchecker's red highlight, so I changed it
" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck) " (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck)
" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax) " Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax)
" -----------------------------------------------------------------------------------------------------
set spell spelllang=en_us
set spellfile=$HOME/Documents/en.utf-8.add
hi clear SpellBad hi clear SpellBad
hi clear SpellCap hi clear SpellCap
hi clear SpellErrors hi clear SpellErrors
hi clear SpellLocal hi clear SpellLocal
hi clear SpellRare hi clear SpellRare
hi SpellBad cterm=underline,bold ctermfg=Red hi SpellBad cterm=underline,bold ctermfg=red
hi SpellCap cterm=underline,bold ctermfg=Red hi SpellCap cterm=underline,bold ctermfg=cyan
hi SpellErrors cterm=underline,bold ctermfg=Red hi SpellErrors cterm=underline,bold ctermfg=cyan
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" ===> Spell check only certain file types https://robots.thoughtbot.com/vim-spell-checking " ===> Spellcheck: only certain file types https://robots.thoughtbot.com/vim-spell-checking
" turn off for files with no extension " turn off for files with no extension
autocmd BufRead,BufNewFile * setlocal nospell autocmd BufRead,BufNewFile * setlocal nospell
" turn off for files with any extension " turn off for files with any extension
@@ -173,16 +189,16 @@ autocmd BufRead,BufNewFile *.* setlocal nospell
" turn on for markdown files " turn on for markdown files
autocmd BufRead,BufNewFile *.md setlocal spell autocmd BufRead,BufNewFile *.md setlocal spell
autocmd BufRead,BufNewFile *.mkd setlocal spell autocmd BufRead,BufNewFile *.mkd setlocal spell
autocmd BufRead,BufNewFile *.markdown setlocal spell
" turn on for text files " turn on for text files
autocmd BufRead,BufNewFile *.txt setlocal spell autocmd BufRead,BufNewFile *.txt setlocal spell
" -----------------------------------------------------------------------------------------------------
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" => Templates " => Templates
" Doing special things with certain filetypes " Doing special things with certain filetypes
" ----------------------------------------------------------------------------------------------------- " -----------------------------------------------------------------------------------------------------
" shell scripts (.sh) ------------------------------------------------ " ==> Templates: shell scripts (.sh)
autocmd BufNewFile *.sh so $HOME/.vim/templates/sh autocmd BufNewFile *.sh so $HOME/.vim/templates/sh
autocmd BufNewFile *.sh %s/FILE:.*/\='FILE: '.expand('%')/e autocmd BufNewFile *.sh %s/FILE:.*/\='FILE: '.expand('%')/e
autocmd BufNewFile *.sh exe "g/AUTHOR:.*/s//AUTHOR: C Hawley" autocmd BufNewFile *.sh exe "g/AUTHOR:.*/s//AUTHOR: C Hawley"
@@ -190,7 +206,10 @@ autocmd BufNewFile *.sh exe "g/CREATED:.*/s//CREATED: " .strftime("%c")
autocmd BufWritePre,filewritepre *.sh execute "normal ma" autocmd BufWritePre,filewritepre *.sh execute "normal ma"
autocmd BufWritePre,filewritepre *.sh exe "g/REVISION:.*/s//REVISION: " .strftime("%c") autocmd BufWritePre,filewritepre *.sh exe "g/REVISION:.*/s//REVISION: " .strftime("%c")
autocmd bufWritePost,filewritepost *.sh execute "normal `a" autocmd bufWritePost,filewritepost *.sh execute "normal `a"
" python scripts (.py) ------------------------------------------------
" -----------------------------------------------------------------------------------------------------
" ==> Templates: python scripts (.py)
autocmd BufNewFile *.py so $HOME/.vim/templates/py autocmd BufNewFile *.py so $HOME/.vim/templates/py
autocmd BufNewFile *.py %s/FILE:.*/\='FILE: '.expand('%')/e autocmd BufNewFile *.py %s/FILE:.*/\='FILE: '.expand('%')/e
autocmd BufNewFile *.py exe "g/AUTHOR:.*/s//AUTHOR: C Hawley" autocmd BufNewFile *.py exe "g/AUTHOR:.*/s//AUTHOR: C Hawley"
@@ -198,16 +217,13 @@ autocmd BufNewFile *.py exe "g/CREATED:.*/s//CREATED: " .strftime("%c")
autocmd BufWritePre,filewritepre *.py execute "normal ma" autocmd BufWritePre,filewritepre *.py execute "normal ma"
autocmd BufWritePre,filewritepre *.py exe "g/REVISION:.*/s//REVISION: " .strftime("%c") autocmd BufWritePre,filewritepre *.py exe "g/REVISION:.*/s//REVISION: " .strftime("%c")
autocmd bufWritePost,filewritepost *.py execute "normal `a" autocmd bufWritePost,filewritepost *.py execute "normal `a"
" markdown documents (.md,*.mkd) -------------------------------------
" -----------------------------------------------------------------------------------------------------
" ==> Templates: markdown documents (.md, .mkd)
autocmd BufNewFile *.md,*.mkd so $HOME/.vim/templates/md autocmd BufNewFile *.md,*.mkd so $HOME/.vim/templates/md
autocmd BufNewFile *.md,*.mkd exe "g/Created:.*/s//Created: " .strftime("%c") autocmd BufNewFile *.md,*.mkd exe "g/Created:.*/s//Created: " .strftime("%c")
autocmd BufWritePre,filewritepre *.md,*.mkd execute "normal ma" autocmd BufWritePre,filewritepre *.md,*.mkd execute "normal ma"
autocmd BufWritePre,filewritepre *.md,*.mkd exe "g/Updated:.*/s//Updated: " .strftime("%c") autocmd BufWritePre,filewritepre *.md,*.mkd exe "g/Updated:.*/s//Updated: " .strftime("%c")
autocmd bufWritePost,filewritepost *.md,*.mkd execute "normal `a" autocmd bufWritePost,filewritepost *.md,*.mkd execute "normal `a"
" markdown documents (.markdown - jekyll blog) -----------------------
autocmd BufNewFile *.markdown so $HOME/.vim/templates/markdown
autocmd BufNewFile *.markdown exe "g/date:.*/s//date: " .strftime("%c")
autocmd BufWritePre,filewritepre *.markdown execute "normal ma"
autocmd BufWritePre,filewritepre *.markdown exe "g/Updated:.*/s//Updated: " .strftime("%c")
autocmd bufWritePost,filewritepost *.markdown execute "normal `a"