dotfiles/dot_vimrc
2023-06-27 15:21:49 -04:00

157 lines
3.7 KiB
Text

" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
set laststatus=2 "lightline requires it?
"Setup Plugins
call plug#begin()
Plug 'junegunn/goyo.vim'
Plug 'francoiscabrol/ranger.vim'
Plug 'rbgrouleff/bclose.vim'
Plug 'airblade/vim-gitgutter' "may cause lag
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }
" Line
Plug 'itchyny/lightline.vim'
Plug 'cespare/vim-toml'
"pywal
if has('wal')
Plug 'dylanaraps/wal.vim'
endif
"Auto add delimiters
Plug 'Raimondi/delimitMate'
"Linting
Plug 'dense-analysis/ale'
" Commenting
Plug 'tpope/vim-commentary'
" c
Plug 'vim-scripts/c.vim', {'for': ['c', 'cpp']}
Plug 'ludwig/split-manpage.vim'
" latex
if has('nvim')
Plug 'lervag/vimtex', {'for': 'latex'}
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abdmg'
endif
" haskell
"" Haskell Bundle
Plug 'eagletmt/neco-ghc', {'for': 'haskell'}
Plug 'dag/vim2hs', {'for': 'haskell'}
Plug 'pbrisbin/vim-syntax-shakespeare', {'for': 'haskell'}
" html
"" HTML Bundle
Plug 'hail2u/vim-css3-syntax', {'for': ['html','css']}
Plug 'gko/vim-coloresque', {'for': ['html','css']}
Plug 'tpope/vim-haml', {'for': 'html'}
Plug 'mattn/emmet-vim', {'for': 'html'}
" python
"" Python Bundle
Plug 'davidhalter/jedi-vim', {'for': 'python' }
Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
" rust
" Vim racer
Plug 'racer-rust/vim-racer', {'for': 'rust'}
" Rust.vim
Plug 'rust-lang/rust.vim', {'for': 'rust'}
" Async.vim
Plug 'prabirshrestha/async.vim'
" Vim lsp
Plug 'prabirshrestha/vim-lsp'
if has('nvim')
" Asyncomplete.vim
Plug 'prabirshrestha/asyncomplete.vim'
" Asyncomplete lsp.vim
Plug 'prabirshrestha/asyncomplete-lsp.vim'
endif
" typescript
Plug 'leafgarland/typescript-vim', {'for': 'typescript'}
Plug 'HerringtonDarkholme/yats.vim', {'for': 'typescript'}
"Git
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb' " required by fugitive to :Gbrowse
"Copy using OSC52
Plug 'ojroques/vim-oscyank', {'branch': 'main'}
call plug#end()
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
if exists('##TextYankPost')
autocmd TextYankPost * if v:event.operator is 'y' && v:event.regname is '' | execute 'OSCYank"' | endif
endif
try
colorscheme wal
catch /^Vim\%((\a\+)\)\=:E185/
try
colorscheme catppuccin
let g:lightline = {'colorscheme': 'catppuccin'}
catch /^Vim\%((\a\+)\)\=:E185/
endtry
endtry
"set notermguicolors
set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax on
set noshowmode "conflicts with airline
set mouse=a "mouse anywhere
set number "line numbers
set relativenumber "relative line numbers
" search
set hlsearch "highlight search
set ignorecase "case insensitive?
set smartcase "only case insensitive for lowercase
set incsearch
set showmatch " show matching brace
set autoindent "auto indent
set smartindent "smart indent
set tabstop=4
set shiftwidth=4
set ruler
set expandtab
" Autocomplete
set wildmode=longest:list:full
set wildmenu
set encoding=utf-8
set ttyfast
" w!! to sudo save
cmap w!! !sudo tee % > /dev/null
" Search mappings: These will make it so that going to the next one in a
" search will center on the line it's found in.
nnoremap n nzzzv
nnoremap N Nzzzv
" status line
set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
if exists("*fugitive#statusline")
set statusline+=%{fugitive#statusline()}
endif
map <leader>g :Goyo \| set linebreak<CR>