Skip to content

Commit 4879a6e

Browse files
author
Vladimir Ciobanu
committed
update
1 parent c13ac65 commit 4879a6e

File tree

3 files changed

+255
-48
lines changed

3 files changed

+255
-48
lines changed

.config/nvim/coc-settings.json

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
{
22
"languageserver": {
3-
"haskell": {
4-
"command": "hie-wrapper",
5-
"rootPatterns": [
6-
".stack.yaml",
7-
"cabal.config",
8-
"package.yaml"
9-
],
10-
"filetypes": [
11-
"hs",
12-
"lhs",
13-
"haskell"
14-
],
15-
"initializationOptions": {
16-
"languageServerHaskell": {
17-
"hlintOn": true,
18-
"maxNumberOfProblems": 10,
19-
"completionSnippetsOn": true
3+
"purescript": {
4+
"command": "npx",
5+
"args": ["purescript-language-server", "--stdio"],
6+
"rootPatterns": [
7+
"bower.json",
8+
"psc-package.json",
9+
"spago.dhall",
10+
],
11+
"filetypes": [ "purescript" ],
12+
"settings": {
13+
"purescript": {
14+
"addSpagoSources": true,
15+
"addNpmPath": true,
16+
"buildCommand": "spago build --purs-args --json-errors",
17+
"editorMode": true
18+
},
19+
},
20+
},
21+
"dhall": {
22+
"command": "dhall-lsp-server",
23+
"filetypes":
24+
[ "dhall"
25+
],
26+
},
27+
"haskell": {
28+
"command": "ghcide",
29+
"args": ["--lsp"],
30+
"rootPatterns": [
31+
"stack.yaml",
32+
".stack.yaml",
33+
".hie-bios",
34+
"BUILD.bazel",
35+
"cabal.config",
36+
"package.yaml"
37+
],
38+
"filetypes": [
39+
"hs",
40+
"lhs",
41+
"haskell"
42+
],
2043
}
2144
},
22-
}
23-
}
2445
}

.config/nvim/init.vim

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
22
" Plugins
3-
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
44
" This uses the `vim-plug` manager:
55
" https://github.com/junegunn/vim-plug
66
"
@@ -26,6 +26,12 @@ Plug 'junegunn/fzf', {
2626
Plug 'junegunn/fzf.vim'
2727
" Multiple cursor edit. Select word, use <C-n> then c or something.
2828
Plug 'terryma/vim-multiple-cursors'
29+
" Which-key
30+
Plug 'liuchengxu/vim-which-key'
31+
" Buffer delete
32+
Plug 'moll/vim-bbye'
33+
" Highlight yanked text for a bit
34+
Plug 'machakann/vim-highlightedyank'
2935

3036
""" Generic coding helpers
3137
" gc / gcc for commenting stuff
@@ -38,13 +44,15 @@ Plug 'tpope/vim-surround'
3844
Plug 'luochen1990/rainbow'
3945
" Indentation guides
4046
Plug 'nathanaelkane/vim-indent-guides'
47+
" %S stuff
48+
Plug 'tpope/vim-abolish'
4149

4250
""" Git
4351
" Basic git plugin, g? for help in gstatus
4452
Plug 'tpope/vim-fugitive'
4553
" Additional plugin for github (pretty much for :Gbrowse I think)
4654
Plug 'tpope/vim-rhubarb'
47-
" Git gutter, must read more
55+
" Git gutter, must read more
4856
Plug 'airblade/vim-gitgutter'
4957
" Try out: https://github.com/jreybert/vimagit
5058

@@ -56,14 +64,14 @@ Plug 'tpope/vim-markdown'
5664

5765
""" Haskell
5866
" Indentation and syntax highlighting
59-
Plug 'neovimhaskell/haskell-vim'
67+
Plug 'vladciobanu/haskell-vim'
6068
Plug 'nbouscal/vim-stylish-haskell'
6169
" <C-y> to insert function above, [[ and ]] to navigate
6270
Plug 'edkolev/curry.vim'
6371
"Plug 'enomsg/vim-haskellConcealPlus'
6472

6573
""" PureScript
66-
"Plug 'purescript-contrib/purescript-vim'
74+
Plug 'purescript-contrib/purescript-vim'
6775
"Plug 'FrigoEU/psc-ide-vim'
6876

6977
""" Rust
@@ -85,16 +93,31 @@ Plug 'vim-syntastic/syntastic'
8593
""" Agda
8694
Plug 'derekelkins/agda-vim'
8795

96+
""" Dhall
97+
Plug 'vmchale/dhall-vim'
98+
8899
""" Colorschemes
89100
Plug 'fatih/molokai'
90101
Plug 'lifepillar/vim-solarized8'
91102

103+
""" Testing
104+
Plug 'xuyuanp/nerdtree-git-plugin'
105+
Plug 'mbbill/undotree'
106+
Plug 'kshenoy/vim-signature'
107+
Plug 'plasticboy/vim-markdown'
108+
Plug 'bronson/vim-trailing-whitespace'
109+
Plug 'vimwiki/vimwiki'
110+
111+
Plug 'justinmk/vim-sneak'
92112
" Initialize plugin system
93113
call plug#end()
94114

95115
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
96116
" Generic vim setup
97117
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
118+
" vimwiki
119+
set nocompatible
120+
98121
" Leader setup
99122
let mapleader = ' '
100123
let maplocalleader = ','
@@ -120,7 +143,7 @@ set incsearch
120143
set hlsearch
121144
set smartcase
122145
" Not sure what these are
123-
au InsertEnter * set nocursorline
146+
" au InsertEnter * set nocursorline
124147
au InsertLeave * set cursorline
125148
set cursorline
126149
set cursorcolumn
@@ -129,6 +152,12 @@ set ruler
129152
set scrolloff=3
130153
" Disable folding, what does this do?
131154
set nofoldenable
155+
" Basic setup for text files
156+
" autocmd FileType md setlocal textwidth=80 spell
157+
" autocmd FileType txt setlocal textwidth=80 spell
158+
" autocmd FileType tex setlocal textwidth=80 spell
159+
" Show substitutions as you type them
160+
set inccommand=nosplit
132161

133162
""" Plugin-specific
134163
" for vim-devicons
@@ -158,6 +187,15 @@ let g:haskell_conceal = 0
158187
let g:haskell_conceal_wide = 0
159188
let g:haskell_coneal_enumerations = 0
160189
let g:haskell_hsp = 0
190+
" haskell-vim
191+
let g:haskell_indent_if = 4
192+
let g:haskell_indent_case = 4
193+
let g:haskell_indent_let = 4
194+
let g:haskell_indent_where = 2
195+
let g_haskell_indent_before_where = 2
196+
let g_haskell_indent_after_bare_where = 2
197+
let g_haskell_indent_do = 4
198+
let g_haskell_indent_in = 2
161199

162200
" Idris
163201
let g:idris_conceal = 1
@@ -166,40 +204,41 @@ let g:idris_conceal = 1
166204
" TODO: there's a bug with 'S'
167205
let hscoptions="STEMsrl↱w-tBQZNDC"
168206

169-
" CoC setup
170-
let g:LanguageClient_rootMarkers = ['*.cabal', 'stack.yaml']
171-
let g:LanguageClient_serverCommands = {
172-
\ 'haskell': ['ghcide', '--lsp'],
173-
\ }
207+
" coc.nvim
208+
set hidden
209+
set nobackup
210+
set nowritebackup
211+
set shortmess+=c
212+
set signcolumn=yes
174213

175214
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
176215
" Keyboard customization
177216
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
217+
" Which-key
218+
nnoremap <silent> <leader> :<c-u>WhichKeyVisual '<Space>'<CR>
219+
nnoremap <silent> <localleader> :<c-u>WhichKeyVisual ','<CR>
220+
178221
" Light/dark theme
179222
map <Leader>cl :set background=light<cr>:colorscheme solarized8<cr>
180223
map <Leader>cd :set background=dark<cr>:colorscheme molokai<cr>
181224
182225
" NERDTree
183226
map <Leader>nt :NERDTreeToggle<CR>
184227
228+
map <Leader>ar :Tabularize /
229+
185230
" fzf - find - f
186-
map <Leader><Space> :Files<CR>
231+
map <Leader><Space> :call fzf#run(fzf#wrap({'source': 'git ls-files --exclude-standard --others --cached'}))<CR>
187232
map <Leader>fg :GFiles?<CR>
188233
map <Leader>fb :Buffers<CR>
234+
map <Leader>cr :Rg<CR>
189235
map <Leader>bb :Buffers<CR>
190236
map <Leader>ft :tag <C-r><C-w><CR>
191237
map <Leader>fc :Commits<CR>
192238
193239
" window - w
194-
map <Leader>ws :vsplit<CR>
195-
map <Leader>we :split<CR>
196-
197-
map <Leader>ww <C-w><C-w>
198-
199-
map <Leader>wl <C-w><C-l>
200-
map <Leader>wh <C-w><C-h>
201-
map <Leader>wj <C-w><C-j>
202-
map <Leader>wk <C-w><C-k>
240+
map <Leader>ss :vsplit<CR>
241+
map <Leader>se :split<CR>
203242
204243
map <Leader>wr <C-w>r
205244
@@ -210,11 +249,12 @@ map <Leader>th :split<CR>:term<CR>
210249
tnoremap <Esc> <C-\><C-n>
211250
212251
" buffer - b
213-
map <Leader>bd :bd<Cr>
252+
map <Leader>bd :Bd<Cr>
214253
215254
" git stuff - g
216255
map <Leader>gg :Gstatus<CR>
217256
map <Leader>gs :Gstatus<CR>
257+
map <Leader>gp :Gpush<CR>
218258
map <Leader>gd :Gvdiff<CR>
219259
map <Leader>gsd :Gdivv<CR>
220260
map <Leader>dh :diffget //2<CR>:diffupdate<CR>
@@ -249,8 +289,6 @@ nmap <silent> gy <Plug>(coc-type-definition)
249289
nmap <silent> gi <Plug>(coc-implementation)
250290
nmap <silent> gr <Plug>(coc-references)
251291
252-
253-
254292
" Use K to show documentation in preview window
255293
nnoremap <silent> K :call <SID>show_documentation()<CR>
256294
@@ -265,15 +303,14 @@ endfunction
265303
" Highlight symbol under cursor on CursorHold ?? this doesnt seem to work
266304
autocmd CursorHold * silent call CocActionAsync('highlight')
267305

268-
" Remap for rename current word -- doesn't seem to work yet
306+
" Remap for rename current word
269307
nmap <leader>rn <Plug>(coc-rename)
270308
271-
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
272-
xmap <leader>a <Plug>(coc-codeaction-selected)
273-
nmap <leader>a <Plug>(coc-codeaction-selected)
274-
275309
" Remap for do codeAction of current line
276310
nmap <leader>ac <Plug>(coc-codeaction)
277311
" Fix autofix problem of current line
278312
nmap <leader>qf <Plug>(coc-fix-current)
279313
314+
""" Under test
315+
nnoremap <leader>ut :UndotreeToggle<cr>
316+

0 commit comments

Comments
 (0)