2022-08-24 08:07:33 +00:00
|
|
|
" Make backspace behave in a sane manner.
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
2022-10-05 04:28:29 +00:00
|
|
|
" 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
|
|
|
|
|
2023-08-04 22:47:21 +00:00
|
|
|
" Highlight cursor line
|
|
|
|
set cursorline
|
|
|
|
|
2022-08-24 08:07:33 +00:00
|
|
|
" Allow hidden buffers, don't limit to one file per window/split
|
|
|
|
set hidden
|
|
|
|
|
2023-05-17 06:17:02 +00:00
|
|
|
" 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
|
|
|
|
|
2023-05-17 06:17:02 +00:00
|
|
|
" Indentation for Python - throws error, needs fixing
|
2023-07-13 13:51:20 +00:00
|
|
|
au BufNewFile,BufRead *.py
|
|
|
|
\ set tabstop=4 |
|
|
|
|
\ set softtabstop=4 |
|
|
|
|
\ set shiftwidth=4 |
|
|
|
|
\ set textwidth=79 |
|
|
|
|
\ set expandtab |
|
|
|
|
\ set autoindent |
|
|
|
|
\ set fileformat=unix
|
2023-05-17 06:17:02 +00:00
|
|
|
|
|
|
|
" Flag extraneous whitespace - throws error, needs fixing
|
2023-07-13 13:51:20 +00:00
|
|
|
highlight BadWhitespace ctermbg=red guibg=darkred
|
|
|
|
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
|
|
|
|
|
|
|
|
set encoding=utf-8
|
2023-05-17 06:17:02 +00:00
|
|
|
|
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 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
|
|
Plug 'junegunn/fzf.vim'
|
2023-08-04 22:47:21 +00:00
|
|
|
Plug 'tpope/vim-fugitive'
|
2022-08-24 08:07:33 +00:00
|
|
|
Plug 'dense-analysis/ale'
|
2024-12-08 22:47:54 +00:00
|
|
|
" Disabling YCM as it's a little broken at the moment
|
|
|
|
" Plug 'Valloric/YouCompleteMe'
|
2022-08-24 08:07:33 +00:00
|
|
|
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
|
|
|
|
Plug 'pangloss/vim-javascript'
|
|
|
|
Plug 'MaxMEllon/vim-jsx-pretty'
|
|
|
|
Plug 'leafgarland/typescript-vim'
|
|
|
|
Plug 'rust-lang/rust.vim'
|
|
|
|
Plug 'neovimhaskell/haskell-vim'
|
2023-05-17 06:17:02 +00:00
|
|
|
Plug 'vim-scripts/indentpython.vim'
|
2023-07-13 13:51:20 +00:00
|
|
|
Plug 'dracula/vim', { 'as': 'dracula' }
|
2022-08-24 08:07:33 +00:00
|
|
|
Plug 'tpope/vim-surround'
|
2023-05-17 06:17:02 +00:00
|
|
|
Plug 'mattn/emmet-vim'
|
2023-08-04 22:47:21 +00:00
|
|
|
Plug 'kovisoft/slimv'
|
2022-08-24 08:07:33 +00:00
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
" Airline
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
let g:airline#extensions#tmuxline#enabled = 0
|
2023-08-04 22:47:21 +00:00
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
2022-08-24 08:07:33 +00:00
|
|
|
|
|
|
|
" ALE
|
2023-07-13 13:51:20 +00:00
|
|
|
let g:ale_linters = {
|
|
|
|
\ 'haskell': ['hlint', 'hdevtools'],
|
|
|
|
\}
|
|
|
|
|
2023-09-02 17:06:00 +00:00
|
|
|
nnoremap <F7> :ALEFindReferences<CR>
|
2022-08-24 08:07:33 +00:00
|
|
|
|
|
|
|
" YouCompleteMe
|
2023-09-02 17:06:00 +00:00
|
|
|
nnoremap <F8> :YcmCompleter GoTo<CR>
|
2022-08-24 08:07:33 +00:00
|
|
|
|
|
|
|
" 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
|
2023-07-13 13:51:20 +00:00
|
|
|
set background=dark
|
|
|
|
colorscheme dracula
|
2022-08-24 08:07:33 +00:00
|
|
|
|
|
|
|
" Temporary file locations
|
|
|
|
set backupdir=.backup/,~/.backup/,/tmp//
|
|
|
|
set directory=.swp/,~/.swp/,/tmp//
|
|
|
|
set undodir=.undo/,~/.undo/,/tmp//
|