Vim setup is now working nicley

This commit is contained in:
Alicia 2021-02-01 13:17:51 -05:00
parent 8413d0f9ac
commit 0b14433014
3 changed files with 111 additions and 145 deletions

View File

@ -1,121 +1,68 @@
scriptencoding utf-8 scriptencoding utf-8
" Copyright 2018-2020 @ kornicameister " © Alicia Sykes <https://aliciasykes.com> 2021 Licensed under MIT
" define the plugins " Initiate Plugins
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
" vim compatibility " Layout and Navigation
if !has('nvim') Plug 'vim-airline/vim-airline'
Plug 'roxma/nvim-yarp' Plug 'preservim/nerdtree'
Plug 'roxma/vim-hug-neovim-rpc' Plug 'andymass/vim-matchup'
endif Plug 'preservim/tagbar'
Plug 'ludovicchabant/vim-gutentags'
" theme
Plug 'dracula/vim', { 'as': 'dracula' }
" fzf
Plug '~/.fzf' Plug '~/.fzf'
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'psliwka/vim-smoothie'
" git plugins Plug 'ryanoasis/vim-devicons'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'octref/rootignore'
Plug 'rhysd/committia.vim'
Plug 'tpope/vim-git'
" ale plugin
Plug 'vim-scripts/dbext.vim', { 'for': ['sql'] }
Plug 'dense-analysis/ale'
Plug 'da-x/depree', { 'do': './rebuild.sh' }
" deoplete
if has('nvim') if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else else
Plug 'Shougo/deoplete.nvim', { 'do': '!pip install --user --upgrade neovim' } Plug 'Shougo/deoplete.nvim', { 'do': '!pip install --user --upgrade neovim' }
endif endif
Plug 'Shougo/neoinclude.vim' " Text Operations
Plug 'Shougo/neco-vim', { 'for': ['vim', 'viminfo'] } Plug 'preservim/nerdcommenter'
Plug 'deoplete-plugins/deoplete-jedi', { 'for': ['python'] } Plug 'dense-analysis/ale'
Plug 'deoplete-plugins/deoplete-tag'
Plug 'deoplete-plugins/deoplete-docker'
Plug 'deoplete-plugins/deoplete-zsh', { 'for': ['zsh'] }
" asynchronous execution library
Plug 'Shougo/vimproc.vim', { 'do' : 'make' }
" general editor related plugins
Plug 'luochen1990/rainbow'
Plug 'ConradIrwin/vim-bracketed-paste'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdcommenter' Plug 'haya14busa/incsearch.vim'
Plug 'psliwka/vim-smoothie' Plug 'mg979/vim-visual-multi'
Plug 'triglav/vim-visual-increment'
Plug 'janko/vim-test'
Plug 'vim-syntastic/syntastic'
" javascript & typescript plugins " Git
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'rhysd/committia.vim'
Plug 'tpope/vim-git'
" Specific File Types
Plug 'pangloss/vim-javascript', { 'for': ['javascript'] } Plug 'pangloss/vim-javascript', { 'for': ['javascript'] }
Plug 'mxw/vim-jsx', { 'for' : ['jsx'] }
Plug 'HerringtonDarkholme/yats.vim', { 'for': ['typescript'] } Plug 'HerringtonDarkholme/yats.vim', { 'for': ['typescript'] }
Plug 'MaxMEllon/vim-jsx-pretty', { 'for': ['jsx', 'tsx'] }
" docker Plug 'ap/vim-css-color', { 'for': ['css', 'scss', 'sass'] }
Plug 'ekalinin/Dockerfile.vim', { 'for': ['dockerfile', 'docker-compose', 'Dockerfile'], 'do': 'make install' } Plug 'mustache/vim-mustache-handlebars', {'for': ['mustache', 'handlebars', 'html']}
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" elm
" per recommendation at: https://github.com/elm-tooling/elm-vim/blob/master/README.md
Plug 'andys8/vim-elm-syntax', {'for': ['elm']}
" python
Plug 'tmhedberg/SimpylFold', {'for': ['python']}
Plug 'lambdalisue/vim-pyenv', {'for': ['python']}
Plug 'vim-scripts/indentpython.vim', {'for': ['python']} Plug 'vim-scripts/indentpython.vim', {'for': ['python']}
Plug 'tmhedberg/SimpylFold', {'for': ['python']}
Plug 'lervag/vimtex', { 'for': ['tex'] }
Plug 'ekalinin/Dockerfile.vim', { 'for': ['dockerfile', 'docker-compose', 'Dockerfile'], 'do': 'make install' }
Plug 'elzr/vim-json', {'for': ['json']}
Plug 'raimon49/requirements.txt.vim', {'for': ['requirements']} Plug 'raimon49/requirements.txt.vim', {'for': ['requirements']}
Plug 'gabrielelana/vim-markdown', {'for': ['markdown']}
Plug 'zinit-zsh/zinit-vim-syntax'
Plug 'chr4/nginx.vim'
if has('nvim') if has('nvim')
Plug 'kalekseev/vim-coverage.py', { 'do': ':UpdateRemotePlugins', 'for': ['python'] } Plug 'numirias/semshi', {'for': ['python'], 'do': ':UpdateRemotePlugins' }
Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
else
Plug 'kalekseev/vim-coverage.py', { 'do': '!pip install --user --upgrade neovim', 'for': ['python']}
endif endif
" go " Themes
Plug 'arp242/gopher.vim', { 'for': ['go'] } Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'deoplete-plugins/deoplete-go', { 'for': ['go'], 'do': 'make' }
" json
Plug 'elzr/vim-json', {'for': ['json']}
" markdown
Plug 'gabrielelana/vim-markdown', {'for': ['markdown']}
Plug 'mzlogin/vim-markdown-toc', {'for': ['markdown']}
" tex
Plug 'lervag/vimtex', { 'for': ['tex'] }
" various
Plug 'wakatime/vim-wakatime' " track what I am doing when using vim
Plug 'ryanoasis/vim-devicons' " cool icons
Plug 'haya14busa/incsearch.vim' " incremental searching
Plug 'ap/vim-css-color' " colors for colors
Plug 'farmergreg/vim-lastplace' " open editor where it was
Plug 'zinit-zsh/zinit-vim-syntax' " zinit power
Plug 'mustache/vim-mustache-handlebars'
Plug 'triglav/vim-visual-increment'
" nginx
Plug 'chr4/nginx.vim'
" tags
Plug 'majutsushi/tagbar' " visiting tags as pro
Plug 'ludovicchabant/vim-gutentags'
" testing made fun
Plug 'janko/vim-test'
call plug#end() call plug#end()
" Plugin Customizations " Plugin Configuration
" ===================== " =====================
augroup vim_test_settings augroup vim_test_settings
@ -123,7 +70,7 @@ augroup vim_test_settings
let g:test#strategy = 'neovim' let g:test#strategy = 'neovim'
let g:test#neovim#term_position = 'vertical' let g:test#neovim#term_position = 'vertical'
" integrate with coverage tool " Integrate with coverage tool
let g:test#python#pytest#options = '--cov-branch --cov-context=test' let g:test#python#pytest#options = '--cov-branch --cov-context=test'
" disable vim-projectionist " disable vim-projectionist
@ -180,8 +127,6 @@ augroup tagbar_plugin_settins
nmap <F8> :TagbarToggle<CR> nmap <F8> :TagbarToggle<CR>
augroup END augroup END
" always color brackets
let g:rainbow_active = 1
if has_key(g:plugs, 'vim-airline') if has_key(g:plugs, 'vim-airline')
augroup airline_plugin_settings augroup airline_plugin_settings
@ -202,13 +147,7 @@ if has_key(g:plugs, 'vim-airline')
augroup END augroup END
endif endif
augroup elm_plugin_settings " Commit Msg
autocmd!
let g:elm_setup_keybindings = 0
let g:elm_format_autosave = 0
augroup END
" commit msg - very nerdy
let g:committia_hooks = {} let g:committia_hooks = {}
function! g:committia_hooks.edit_open(info) function! g:committia_hooks.edit_open(info)
" Scroll the diff window from insert mode " Scroll the diff window from insert mode
@ -217,12 +156,12 @@ function! g:committia_hooks.edit_open(info)
imap <buffer><C-p> <Plug>(committia-scroll-diff-up-half) imap <buffer><C-p> <Plug>(committia-scroll-diff-up-half)
endfunction endfunction
" python " Python
let python_highlight_all = 1 let python_highlight_all = 1
let g:pyenv#auto_create_ctags = 1 let g:pyenv#auto_create_ctags = 1
let g:pyenv#auto_assign_ctags = 1 let g:pyenv#auto_assign_ctags = 1
" gutter " Gutter
augroup gitgutter_options augroup gitgutter_options
autocmd! autocmd!
let g:gitgutter_diff_args = '-w' " ignore whitespace changes let g:gitgutter_diff_args = '-w' " ignore whitespace changes
@ -278,18 +217,6 @@ augroup gutentags_options
\ } \ }
augroup END augroup END
augroup vim_go_options
autocmd!
let g:gopher_highlight = ['string-spell', 'string-fmt']
let g:gometalinter_fast = ''
\ . ' --enable=vet'
\ . ' --enable=errcheck'
\ . ' --enable=ineffassign'
\ . ' --enable=goimports'
\ . ' --enable=misspell'
\ . ' --enable=lll --line-length=120'
let g:ale_go_gometalinter_options = '--disable-all --tests' . g:gometalinter_fast . ' --enable=golint'
augroup END
if has_key(g:plugs, 'fzf.vim') if has_key(g:plugs, 'fzf.vim')
augroup fzf_settings augroup fzf_settings
@ -338,6 +265,16 @@ if has_key(g:plugs, 'fzf.vim')
nmap <F3> <Plug>(ale_hover) nmap <F3> <Plug>(ale_hover)
nmap <F4> <Plug>(ale_go_to_definition) nmap <F4> <Plug>(ale_go_to_definition)
if has('nvim')
autocmd VimEnter *
\ set updatetime=1000 |
\ let g:ale_lint_on_text_changed = 0
autocmd CursorHold * call ale#Queue(0)
autocmd CursorHoldI * call ale#Queue(0)
autocmd InsertEnter * call ale#Queue(0)
autocmd InsertLeave * call ale#Queue(0)
endif
augroup END augroup END
endif endif

View File

@ -12,4 +12,33 @@ if has('persistent_undo')
endif endif
" Remember info about open buffers on close " Remember info about open buffers on close
set viminfo^=% set viminfo^=
" To fix the escape time problem with insert mode.
" Allows for transparent pasting into vim, without ':set paste!'
"
if exists("g:loaded_bracketed_paste")
finish
endif
let g:loaded_bracketed_paste = 1
let &t_ti .= "\<Esc>[?2004h"
let &t_te = "\e[?2004l" . &t_te
function! XTermPasteBegin(ret)
set pastetoggle=<f29>
set paste
return a:ret
endfunction
execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
map <expr> <f28> XTermPasteBegin("i")
imap <expr> <f28> XTermPasteBegin("")
vmap <expr> <f28> XTermPasteBegin("c")
cmap <f28> <nop>
cmap <f29> <nop>
%