vim/vimrc

210 lines
5.5 KiB
VimL
Raw Permalink Normal View History

2023-08-13 14:01:46 -04:00
" Set up plug-vim
"let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
"if empty(glob(data_dir . '/autoload/plug.vim'))
" silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
"endif
set nocompatible " be iMproved, required
"set rtp+=~/.vim/bundle/Vundle.vim
"call vundle#begin()
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
" ==== plugin manager
"Plugin 'VundleVim/Vundle.vim'
" ==== helpers
"Plug 'vim-scripts/L9'
" ==== File tree
"Plug 'scrooloose/nerdtree'
" ==== Completion
"Plug 'Valloric/YouCompleteMe'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
"Plug '~/src/vim/asyncomplete-muttgoobook.vim'
" ==== muttgoobook
Plug 'https://git.eldon.me/trey/asyncomplete-muttgoobook.vim'
" ==== Git
"Plug 'airblade/vim-gitgutter'
"Plug 'tpope/vim-fugitive'
" ==== syntax helpers
"Plug 'scrooloose/syntastic'
"Plug 'tpope/vim-surround'
"Plug 'cakebaker/scss-syntax.vim'
"Plug 'othree/yajs.vim'
"Plug 'mitsuhiko/vim-jinja'
"Plug 'octol/vim-cpp-enhanced-highlight'
"Plug 'ap/vim-css-color'
"Plug 'Vimjas/vim-python-pep8-indent'
"Plug 'python-rope/rope'
"Plug 'python-rope/ropemode'
"Plug 'python-rope/ropevim'
"Plug 'klen/pylama'
" ==== moving / searching
"Plug 'easymotion/vim-easymotion'
"Plug 'kien/ctrlp.vim'
"Plug 'ervandew/supertab'
"Plug 'terryma/vim-multiple-cursors'
"
" ==== snippets
"Plug 'SirVer/ultisnips'
"Plug 'thomasfaingnaert/vim-lsp-ultisnips'
" Status bar on bottom
Plug 'vim-airline/vim-airline'
" ==== PLUGIN THEMES
Plug 'morhetz/gruvbox'
"call vundle#end()
call plug#end()
"filetype plugin indent on
" ==== Colors and other basic settings
"filetype off " required
set exrc
"
" goobook stuff
"source ~/src/vim/asyncomplete-muttgoobook.vim/autoload/asyncomplete/sources/muttgoobook.vim
let g:asyncomplete_log_file = expand('~/bugs/asyncomplete.log')
let g:goobookrc='~/.goobookrc'
autocmd User asyncomplete_setup call asyncomplete#register_source({
\ 'name': 'muttgoobook',
\ 'allowlist': ['mail'],
\ 'completor': function('asyncomplete#sources#muttgoobook#completor'),
\ })
set encoding=UTF-8
" lsp asyncomplete
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
colorscheme gruvbox
set guifont=Monospace\ 10
set fillchars+=vert:\$
"syntax enable
set background=dark
set ruler
set hidden
set number
set laststatus=1
set smartindent
"hset st=4 sw=4 et
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
let &colorcolumn="80"
" ==== NERDTREE
"let NERDTreeIgnore = ['__pycache__', '\.pyc$', '\.o$', '\.so$', '\.a$', '\.swp', '*\.swp', '\.swo', '\.swn', '\.swh', '\.swm', '\.swl', '\.swk', '\.sw*$', '[a-zA-Z]*egg[a-zA-Z]*', '.DS_Store']
"let NERDTreeShowHidden=1
"let g:NERDTreeWinPos="left"
"let g:NERDTreeDirArrows=0
"map <C-t> :NERDTreeToggle<CR>
" ==== Syntastic
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:syntastic_javascript_checkers = ['eslint']
"let g:syntastic_javascript_mri_args = "--config=$HOME/.jshintrc"
"let g:syntastic_python_checkers = [ 'pylint', 'flake8', 'pep8', 'python']
"let g:syntastic_yaml_checkers = ['jsyaml']
"let g:syntastic_html_tidy_exec = 'tidy5'
"
" === flake8
"let g:flake8_show_in_file=1
" ==== snippets
" If you want :UltiSnipsEdit to split your window.
"let g:UltiSnipsEditSplit="vertical"
" make YCM compatible with UltiSnips (using supertab)
"let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
"let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
"let g:SuperTabDefaultCompletionType = '<C-n>'
" better key bindings for UltiSnipsExpandTrigger
"let g:UltiSnipsExpandTrigger = "<tab>"
"let g:UltiSnipsJumpForwardTrigger = "<tab>"
"let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
" ==== Easymotion
"let g:EasyMotion_do_mapping = 0
"let g:EasyMotion_smartcase = 1
"nmap f <Plug>(easymotion-s)
" ==== moving around
"nmap <silent> <A-Up> :wincmd k<CR>
"nmap <silent> <A-Down> :wincmd j<CR>
"nmap <silent> <A-Left> :wincmd h<CR>
"nmap <silent> <A-Right> :wincmd l<CR>
" ==== disable mouse
set mouse=c
" ==== disable swap file warning
"set shortmess+=A
" ==== custom commands
command JsonPretty execute ":%!jq ."
set secure
set hlsearch
imap  <End>
imap  <Home>
nmap Y y$
nmap C c$
inoremap jj <Esc>
inoremap kk <Esc>
inoremap hh <Esc>
inoremap lll <Esc>
inoremap :wq <Esc>:wq
inoremap :w <Esc>:w
inoremap :q! <Esc>:q!
inoremap :q <Esc>:q
inoremap yy <Esc>yy
inoremap ddd <Esc>dd
" Force me to stop using arrow keys
noremap <Left> <Nop>
noremap <Right> <Nop>
noremap <Up> <Nop>
noremap <Down> <Nop>
" clear search
nmap <silent> <C-l> :noh<CR>
" Fix Home/End/Delete
set backspace=indent,eol,start
set clipboard=unnamedplus
" Change cursor from block to vertical pipe when in insert mode
if &term =~ "tmux-256color"
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[0 q"
endif
" search history stuff
autocmd BufReadPost * silent! normal! g`"zv
"autocmd BufRead,BufNewFile ~/Private/academic/certs/lf/LFS211/2017-12-16_study_materials/*.txt source ~/.muttvimrc