dotfiles/vim/.vimrc

129 lines
3.2 KiB
VimL
Raw Normal View History

2022-08-24 08:07:33 +00:00
" Make backspace behave in a sane manner.
set backspace=indent,eol,start
" Configure the clipboard to access the \"+ and \"* registers
" (not sure why I need this now and didn't before)
set clipboard=unnamedplus,unnamed
2022-08-24 08:07:33 +00:00
" Spaces indentation
set expandtab
set tabstop=2
" set softtabstop=2
set shiftwidth=2
" Consider installing the Smart Tabs plugin
" Show whitespace
set listchars=eol,tab:>-,trail:~,extends:>,precedes:<,space
" Show line numbers
set number
" Default: split right
set splitright
" Allow hidden buffers, don't limit to one file per window/split
set hidden
" Enable folding
set foldmethod=indent
set foldlevel=99
2022-08-24 08:07:33 +00:00
" Sane vim split naviagation (via Gaslight blog)
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" Disable filetype detection
filetype off
" Adjust cursor style to mode
" Normal: block; Insert: beam; Replace: underscore
" all blinking
let &t_EI = "\<Esc>[1 q"
let &t_SI = "\<Esc>[5 q"
let &t_SR = "\<Esc>[3 q"
" reset the cursor on start
augroup CursorReset
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
augroup END
" Indentation for Python - throws error, needs fixing
" au BufNewFile,BufRead *.py
" \ set tabstop=4
" \ set softtabstop=4
" \ set shiftwidth=4
" \ set textwidth=79
" \ set expandtab
" \ set autoindent
" \ set fileformat=unix
" Flag extraneous whitespace - throws error, needs fixing
" au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
2022-08-24 08:07:33 +00:00
" vim-plug
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
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'edkolev/tmuxline.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'dense-analysis/ale'
Plug 'Valloric/YouCompleteMe'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'pangloss/vim-javascript'
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'leafgarland/typescript-vim'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'Quramy/tsuquyomi'
Plug 'rust-lang/rust.vim'
Plug 'neovimhaskell/haskell-vim'
Plug 'vim-scripts/indentpython.vim'
2022-08-24 08:07:33 +00:00
Plug 'severij/vadelma'
Plug 'tpope/vim-surround'
Plug 'mattn/emmet-vim'
2022-08-24 08:07:33 +00:00
call plug#end()
" Tsuquyomi
autocmd filetype typescript nmap <buffer> <Leader>t : <C-u>echo tsuquyomi#hint()<CR>
" Airline
let g:airline_powerline_fonts = 1
let g:airline_theme = 'light'
let g:airline#extensions#tmuxline#enabled = 0
" ALE
let g:ale_linters = {'haskell': ['hlint', 'hdevtools'], 'python': ['flake8']}
2022-08-24 08:07:33 +00:00
" YouCompleteMe
noremap <F8> :YcmCompleter GoTo<CR>
" YouCompleteMe <> TypeScript
if !exists("g:ycm_semantic_triggers")
let g:ycm_semantic_triggers = {}
endif
let g:ycm_semantic_triggers['typescript'] = ['.']
" Enable file type detection and do language-dependent indenting
filetype plugin indent on
" Switch syntax highlighting on
syntax enable
" Set color scheme
set background=light
colorscheme vadelma
" Temporary file locations
set backupdir=.backup/,~/.backup/,/tmp//
set directory=.swp/,~/.swp/,/tmp//
set undodir=.undo/,~/.undo/,/tmp//