aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-11-04 07:01:14 +0000
committerAkshay <[email protected]>2020-11-04 07:01:14 +0000
commita228e5935abe268692ef5ac3fce006ebfbe1d542 (patch)
tree979b60313abd5b7d888fb3d5f1229c56cf7744f1
parent637ff790d30768f03274e2fef7310f8983338810 (diff)
fix fzf previews, add more haskell config
-rw-r--r--nvim/.config/nvim/coc-settings.json15
-rw-r--r--nvim/.config/nvim/ftplugin/scheme.vim1
-rw-r--r--nvim/.config/nvim/init.vim39
-rw-r--r--nvim/.config/nvim/plugin/statusline.vim30
4 files changed, 46 insertions, 39 deletions
diff --git a/nvim/.config/nvim/coc-settings.json b/nvim/.config/nvim/coc-settings.json
index 8515224..c5a12f1 100644
--- a/nvim/.config/nvim/coc-settings.json
+++ b/nvim/.config/nvim/coc-settings.json
@@ -37,12 +37,15 @@
37 } 37 }
38 }, 38 },
39 "haskell": { 39 "haskell": {
40 "command": "hie", 40 "command": "haskell-language-server-wrapper",
41 "args": ["--lsp"], 41 "args": ["--lsp"],
42 "rootPatterns": [ 42 "rootPatterns": [
43 "*.cabal",
43 "stack.yaml", 44 "stack.yaml",
44 "cabal.config", 45 "cabal.project",
45 "package.yaml" 46 "cabal.project.local",
47 "package.yaml",
48 "hie.yaml"
46 ], 49 ],
47 "filetypes": [ 50 "filetypes": [
48 "hs", 51 "hs",
@@ -51,9 +54,13 @@
51 ], 54 ],
52 "initializationOptions": { 55 "initializationOptions": {
53 "languageServerHaskell": { 56 "languageServerHaskell": {
54 "hlintOn": true 57 "hlintOn": true
55 } 58 }
56 } 59 }
60 },
61 "lua": {
62 "command": "lua-lsp",
63 "filetypes": ["lua"]
57 } 64 }
58 }, 65 },
59 "diagnostic": { 66 "diagnostic": {
diff --git a/nvim/.config/nvim/ftplugin/scheme.vim b/nvim/.config/nvim/ftplugin/scheme.vim
index ac0ba6e..2b6c296 100644
--- a/nvim/.config/nvim/ftplugin/scheme.vim
+++ b/nvim/.config/nvim/ftplugin/scheme.vim
@@ -7,4 +7,3 @@ setlocal smarttab
7setlocal formatoptions=croql 7setlocal formatoptions=croql
8 8
9CocDisable 9CocDisable
10let b:AutoPairs = {"(": ")", "[": "]", "{": "}", '"': '"' }
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim
index d46bf88..d748fa6 100644
--- a/nvim/.config/nvim/init.vim
+++ b/nvim/.config/nvim/init.vim
@@ -4,9 +4,7 @@ let &t_ZM = "\e[3m"
4call plug#begin('~/.local/share/nvim/plugged') 4call plug#begin('~/.local/share/nvim/plugged')
5 5
6Plug 'airblade/vim-gitgutter' 6Plug 'airblade/vim-gitgutter'
7Plug 'andymass/vim-matchup'
8Plug 'godlygeek/tabular' 7Plug 'godlygeek/tabular'
9Plug 'jiangmiao/auto-pairs'
10Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } 8Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
11Plug 'junegunn/fzf.vim' 9Plug 'junegunn/fzf.vim'
12Plug 'mattn/emmet-vim', {'for': ['javascript.jsx', 'html', 'css']} 10Plug 'mattn/emmet-vim', {'for': ['javascript.jsx', 'html', 'css']}
@@ -24,14 +22,11 @@ Plug 'tpope/vim-fugitive'
24" syntax and friends 22" syntax and friends
25Plug 'rust-lang/rust.vim', {'for': 'rust'} 23Plug 'rust-lang/rust.vim', {'for': 'rust'}
26Plug 'lervag/vimtex', {'for': 'tex'} 24Plug 'lervag/vimtex', {'for': 'tex'}
27Plug 'neovimhaskell/haskell-vim', {'for': 'haskell'} 25Plug 'neovimhaskell/haskell-vim', {'for': ['haskell', 'cabal']}
28Plug 'elmcast/elm-vim' 26Plug 'elmcast/elm-vim'
29Plug 'LnL7/vim-nix' 27Plug 'LnL7/vim-nix'
30 28
31" colorschemes 29Plug '[email protected]:vim/vim-colors-plain'
32Plug 'nerdypepper/agila.vim'
33Plug 'nerdypepper/chestnut.vim'
34Plug 'nerdypepper/vim-colors-plain', { 'branch': 'duotone' }
35 30
36call plug#end() 31call plug#end()
37 32
@@ -55,6 +50,20 @@ augroup restorecursor
55 \ endif 50 \ endif
56augroup END 51augroup END
57 52
53augroup vimrc-incsearch-highlight
54 autocmd!
55 autocmd CmdlineEnter /,\? :set hlsearch
56 autocmd CmdlineLeave /,\? :set nohlsearch
57augroup END
58
59augroup fzfstatus
60 if has('nvim') && !exists('g:fzf_layout')
61 autocmd! FileType fzf
62 autocmd FileType fzf set laststatus=0 noshowmode noruler
63 \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
64 endif
65augroup END
66
58" general settings 67" general settings
59set nobackup 68set nobackup
60set nowritebackup 69set nowritebackup
@@ -72,12 +81,11 @@ set laststatus=2
72set nowrap 81set nowrap
73set noshowmode 82set noshowmode
74set listchars=tab:┊\ ,nbsp:␣,trail:·,extends:>,precedes:< 83set listchars=tab:┊\ ,nbsp:␣,trail:·,extends:>,precedes:<
75set fillchars=vert:\│ 84set fillchars=vert:\│,stl:\ ,stlnc:\
76set ignorecase 85set ignorecase
77set smartcase 86set smartcase
78set sidescroll=40 87set sidescroll=40
79set incsearch 88set incsearch
80set hlsearch
81set undofile 89set undofile
82set undodir=~/tmp 90set undodir=~/tmp
83set path+=** 91set path+=**
@@ -89,7 +97,6 @@ set complete=.,w,b,i,u,t,
89set background=dark 97set background=dark
90set mouse=a 98set mouse=a
91set conceallevel=0 99set conceallevel=0
92set nocursorline
93set nonumber 100set nonumber
94set grepprg=rg\ --vimgrep\ --no-heading 101set grepprg=rg\ --vimgrep\ --no-heading
95set grepformat=%f:%l:%c:%m,%f:%l:%m 102set grepformat=%f:%l:%c:%m,%f:%l:%m
@@ -98,6 +105,7 @@ set shortmess+=c
98set updatetime=300 105set updatetime=300
99set signcolumn=yes 106set signcolumn=yes
100set inccommand=split 107set inccommand=split
108set showmatch
101 109
102let g:netrw_browsex_viewer= "xdg-open" 110let g:netrw_browsex_viewer= "xdg-open"
103 111
@@ -118,6 +126,7 @@ endfunction
118:command! WQ wq 126:command! WQ wq
119:command! Wq wq 127:command! Wq wq
120:command! Wqa wqa 128:command! Wqa wqa
129:command! WQa wqa
121:command! W w 130:command! W w
122:command! Q q 131:command! Q q
123 132
@@ -165,10 +174,8 @@ let g:fzf_colors =
165 \ 'marker': ['fg', 'Keyword'], 174 \ 'marker': ['fg', 'Keyword'],
166 \ 'spinner': ['fg', 'Label'], 175 \ 'spinner': ['fg', 'Label'],
167 \ 'header': ['fg', 'Comment'] } 176 \ 'header': ['fg', 'Comment'] }
168 177let g:fzf_layout = { 'down': '40%' }
169" indentLine 178let g:fzf_preview_window = []
170let g:indentLine_setColors = 0
171let g:indentLine_char = '┆'
172 179
173let g:latex_view_general_viewer = 'zathura' 180let g:latex_view_general_viewer = 'zathura'
174let g:vimtex_view_method = "zathura" 181let g:vimtex_view_method = "zathura"
@@ -176,10 +183,6 @@ let g:vimtex_view_method = "zathura"
176" man pages 183" man pages
177let g:ft_man_open_mode = 'tab' 184let g:ft_man_open_mode = 'tab'
178 185
179" vim-matchup
180let g:matchup_matchparen_deferred = 1
181let g:matchup_matchparen_hi_surround_always = 1
182
183" coc-nvim 186" coc-nvim
184hi CocHintSign ctermfg=6 187hi CocHintSign ctermfg=6
185hi CocErrorSign ctermfg=1 188hi CocErrorSign ctermfg=1
diff --git a/nvim/.config/nvim/plugin/statusline.vim b/nvim/.config/nvim/plugin/statusline.vim
index a25fb6d..3241fc2 100644
--- a/nvim/.config/nvim/plugin/statusline.vim
+++ b/nvim/.config/nvim/plugin/statusline.vim
@@ -25,17 +25,17 @@ let g:currentmode={
25 25
26hi PrimaryBlock ctermfg=00 ctermbg=6 26hi PrimaryBlock ctermfg=00 ctermbg=6
27hi SecondaryBlock ctermfg=07 ctermbg=10 27hi SecondaryBlock ctermfg=07 ctermbg=10
28hi Blanks ctermfg=11 ctermbg=0 28hi Blanks ctermfg=08 ctermbg=0
29 29
30hi User1 ctermfg=01 ctermbg=0 30hi User1 ctermfg=01 ctermbg=0
31hi User2 ctermfg=02 ctermbg=0 31hi User2 ctermfg=02 ctermbg=0
32hi User3 ctermfg=03 ctermbg=0 32hi User3 ctermfg=03 ctermbg=0
33hi User4 ctermfg=04 ctermbg=0 33hi User4 ctermfg=12 ctermbg=0
34hi User5 ctermfg=05 ctermbg=0 34hi User5 ctermfg=05 ctermbg=0
35hi User6 ctermfg=06 ctermbg=0 35hi User6 ctermfg=06 ctermbg=0
36hi User7 ctermfg=07 ctermbg=0 36hi User7 ctermfg=07 ctermbg=0
37hi User8 ctermfg=08 ctermbg=0 37hi User8 ctermfg=08 ctermbg=0
38hi User9 ctermfg=09 ctermbg=0 38hi User9 ctermfg=00 ctermbg=0
39 39
40highlight EndOfBuffer ctermfg=black ctermbg=black 40highlight EndOfBuffer ctermfg=black ctermbg=black
41 41
@@ -45,7 +45,7 @@ endfunction
45 45
46function! StatuslineGit() 46function! StatuslineGit()
47 let l:branchname = GitBranch() 47 let l:branchname = GitBranch()
48 return strlen(l:branchname) > 0?' '.l:branchname.' ':'' 48 return strlen(l:branchname) > 0?l:branchname.' ':''
49endfunction 49endfunction
50 50
51function! ReadOnly() abort 51function! ReadOnly() abort
@@ -68,11 +68,11 @@ function! Filepath() abort
68 \ '' : substitute(l:basename . '/', '\C^' . $HOME, '~', '') 68 \ '' : substitute(l:basename . '/', '\C^' . $HOME, '~', '')
69 69
70 if empty(l:prefix) && empty(l:filename) 70 if empty(l:prefix) && empty(l:filename)
71 return printf('%%8*%%f%%*%s %%m%%*', '%8*') 71 return printf('%%4*%%f%%*%s %%m%%*', '%4*')
72 elseif empty(l:prefix) 72 elseif empty(l:prefix)
73 return printf('%%8*%%f%%*%s %%m%%*', '%6*') 73 return printf('%%4*%%f%%*%s %%m%%*', '%6*')
74 else 74 else
75 return printf('%%8*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%8*', l:filename) 75 return printf('%%4*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%4*', l:filename)
76 endif 76 endif
77endfunction 77endfunction
78 78
@@ -81,12 +81,12 @@ function! LinterStatus() abort
81 if empty(info) | return '' | endif 81 if empty(info) | return '' | endif
82 let msgs = [] 82 let msgs = []
83 if get(info, 'error', 0) 83 if get(info, 'error', 0)
84 call add(msgs, printf('%%5*%s×%%*', info['error'])) 84 call add(msgs, printf('%%5*%s×%%* ', info['error']))
85 endif 85 endif
86 if get(info, 'warning', 0) 86 if get(info, 'warning', 0)
87 call add(msgs, printf('%%3*%s!%%*', info['warning'])) 87 call add(msgs, printf('%%3*%s!%%* ', info['warning']))
88 endif 88 endif
89 return join(msgs, ' ') 89 return join(msgs, '')
90endfunction 90endfunction
91 91
92function! StatusLine(mode) abort 92function! StatusLine(mode) abort
@@ -100,6 +100,7 @@ function! StatusLine(mode) abort
100 100
101 " active 101 " active
102 if a:mode ==# 'active' 102 if a:mode ==# 'active'
103 let l:line.='%6*·%*' . ' '
103 let l:line.='%7*%{StatuslineGit()}' 104 let l:line.='%7*%{StatuslineGit()}'
104 let l:line.='%<' 105 let l:line.='%<'
105 let l:line.=Filepath() 106 let l:line.=Filepath()
@@ -108,15 +109,13 @@ function! StatusLine(mode) abort
108 let l:line.=' %{ReadOnly()} %w%*' 109 let l:line.=' %{ReadOnly()} %w%*'
109 let l:line.='%9* %=%*' 110 let l:line.='%9* %=%*'
110 111
111 let l:line.='%7* %l,%c %*' 112 let l:line.=' ' . '%7*%l,%c%*' . ' '
112 let l:line.='%8* %{g:currentmode[mode()]}%*'
113 let l:line.=' '
114 let l:line.=LinterStatus() 113 let l:line.=LinterStatus()
115 let l:line.=' ' 114 let l:line.='%4*'. &filetype
116 let l:line.='%8*'. &filetype
117 115
118 else 116 else
119 " inactive 117 " inactive
118 let l:line.='%5*·%*' . ' '
120 let l:line.='%#Blanks#' 119 let l:line.='%#Blanks#'
121 let l:line.='%f %5*%m%*' 120 let l:line.='%f %5*%m%*'
122 let l:line.='%#Blanks# %=%*' 121 let l:line.='%#Blanks# %=%*'
@@ -133,4 +132,3 @@ augroup MyStatusLine
133 autocmd WinEnter * setl statusline=%!StatusLine('active') 132 autocmd WinEnter * setl statusline=%!StatusLine('active')
134 autocmd WinLeave * setl statusline=%!StatusLine('inactive') 133 autocmd WinLeave * setl statusline=%!StatusLine('inactive')
135augroup END 134augroup END
136