-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
128 lines (98 loc) · 2.7 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
set ts=2
set expandtab
set sw=2
set splitright
set splitbelow
let mapleader = ","
" faster tab navigation
nnoremap <silent> <C-p> :tabprev<CR>
nnoremap <silent> <C-n> :tabnext<CR>
" bind enter to save in normal mode for non-special buffers
nnoremap <expr> <cr> &buftype=="" ? ":w<cr>" : "<cr>"
call plug#begin()
Plug 'LnL7/vim-nix'
Plug 'hashivim/vim-terraform'
Plug 'godlygeek/tabular'
Plug 'tpope/vim-fugitive'
Plug 'jacoborus/tender.vim'
Plug 'embark-theme/vim', { 'as': 'embark', 'branch': 'main' }
Plug 'bluz71/vim-nightfly-guicolors'
Plug 'vim-airline/vim-airline'
Plug 'dense-analysis/ale'
Plug 'kana/vim-arpeggio'
Plug 'sdiehl/vim-ormolu'
Plug 'sbdchd/neoformat'
call plug#end()
call arpeggio#load()
" Do we really need arpeggio for this?
Arpeggio inoremap jk <esc>
if (has("termguicolors"))
set termguicolors
endif
set bg=dark
syntax enable
colorscheme tender
hi Comment guifg=#8381a0
" TODO put this into an ftplugin
let g:ale_fixers = {
\ 'haskell': [
\ 'trim_whitespace',
\ 'remove_trailing_lines',
\ ],
\}
let g:ale_linters_ignore = {
\ 'haskell':
\ [ 'cabal_ghc',
\ 'stack_ghc',
\ 'stack_build',
\ 'ghc'
\ ]
\}
"let g:ale_haskell_hls_executable = "haskell-language-server -dl /tmp/hls.out"
let g:ale_list_window_size = 8
let g:ale_completion_enabled = 1
"let g:ale_haskell_hls_executable = "/home/clintonford/gt/btnl_master/frob"
let g:ale_haskell_hls_args = ["-dl", "/tmp/hls.out"]
let g:ale_haskell_hls_config = {
\ 'haskell':
\ { 'checkProject': 'false',
\ 'formattingProvider': 'fourmolu',
\ }
\ }
set omnifunc=ale#completion#OmniFunc
nnoremap <silent> <C-k> <Plug>(ale_previous_wrap)
nnoremap <silent> <C-j> <Plug>(ale_next_wrap)
set hlsearch
augroup haskell_save | au!
autocmd BufWritePre *.hs ALEFix
augroup end
let g:ormolu_command="fourmolu"
let g:ormolu_suppress_stderr=1
let g:ale_floating_preview=1
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰']
nnoremap <F1> :ALEHover<cr>
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" Don't lose selection when in/outdenting
vnoremap < <gv
vnoremap > >gv
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <expr> <tab> InsertTabWrapper()
inoremap <s-tab> <c-n>
cnoremap <expr> %% expand('%:p:h') . '/'
nnoremap <F12> :nohlsearch<cr>
let g:terraform_fmt_on_save=1
set incsearch
augroup fmt
autocmd!
autocmd BufWritePre * undojoin | Neoformat
augroup end