This commit is contained in:
Julian Ospald 2022-04-29 21:56:19 +02:00
parent b8e13b4e34
commit d07f8f78e1
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
5 changed files with 295 additions and 122 deletions

View File

@ -0,0 +1,33 @@
if has('nvim')
lua << EOF
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = false,
})
vim.cmd('autocmd CursorHold * lua vim.diagnostic.open_float()')
vim.o.updatetime = 300
-- Show all diagnostics on current line in floating window
--vim.api.nvim_set_keymap(
-- 'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>',
-- { noremap = true, silent = true }
--)
-- Go to next diagnostic (if there are multiple on the same line, only shows
-- one at a time in the floating window)
--vim.api.nvim_set_keymap(
-- 'n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>',
-- { noremap = true, silent = true }
--)
-- Go to prev diagnostic (if there are multiple on the same line, only shows
-- one at a time in the floating window)
--vim.api.nvim_set_keymap(
-- 'n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>',
-- { noremap = true, silent = true }
--)
EOF
endif

View File

@ -1,69 +0,0 @@
" Author: Julian Ospald <hasufell@hasufell.de>
" Description: argon for Haskell files
call ale#Set('haskell_argon_executable', 'argon')
call ale#Set('haskell_argon_options', '')
call ale#Set('haskell_argon_error_level', 12)
call ale#Set('haskell_argon_warn_level', 8)
call ale#Set('haskell_argon_info_level', 4)
function! ale_linters#haskell#argon#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'haskell_argon_executable')
endfunction
function! ale_linters#haskell#argon#GetCommand(buffer) abort
return ale#Escape(ale_linters#haskell#argon#GetExecutable(a:buffer))
\ . ' '
\ . ale#Var(a:buffer, 'haskell_argon_options')
\ . ' -m ' . ale#Var(a:buffer, 'haskell_argon_info_level')
\ . ' -j'
\ . ' %t'
endfunction
function! ale_linters#haskell#argon#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
if !has_key(l:error, 'blocks')
" this cannot be formatted properly into an ALE error
execute 'echom ''[argon] '' l:error.message'
return l:output
endif
for l:block in l:error.blocks
let l:complexity = l:block.complexity
if l:complexity >= ale#Var(a:buffer, 'haskell_argon_error_level')
let l:type = 'E'
let l:max_c = ale#Var(a:buffer, 'haskell_argon_error_level')
elseif l:complexity >= ale#Var(a:buffer, 'haskell_argon_warn_level')
let l:type = 'W'
let l:max_c = ale#Var(a:buffer, 'haskell_argon_warn_level')
else
let l:type = 'I'
let l:max_c = ale#Var(a:buffer, 'haskell_argon_info_level')
endif
call add(l:output, {
\ 'filename': l:error.path,
\ 'lnum': l:block.lineno,
\ 'col': l:block.col,
\ 'text': l:block.name . ': cyclomatic complexity of ' . l:complexity,
\ 'type': l:type,
\})
endfor
endfor
return l:output
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'argon',
\ 'executable_callback': 'ale_linters#haskell#argon#GetExecutable',
\ 'command_callback': 'ale_linters#haskell#argon#GetCommand',
\ 'callback': 'ale_linters#haskell#argon#Handle',
\})

View File

@ -29,6 +29,7 @@ noremap e j
noremap o k noremap o k
noremap n h noremap n h
noremap i l noremap i l
vnoremap i l
noremap k n noremap k n
noremap h e noremap h e
noremap l o noremap l o
@ -323,34 +324,56 @@ nnoremap <silent> <F4> :call ToggleLocList()<CR>
" NERDTree " NERDTree
if !exists('g:vscode')
noremap <C-j> :NERDTreeToggle<CR> noremap <C-j> :NERDTreeToggle<CR>
" noremap <C-B> :TagbarToggle<CR> " noremap <C-B> :TagbarToggle<CR>
inoremap <C-B> <C-O>:TagbarToggle<CR> inoremap <C-B> <C-O>:TagbarToggle<CR>
endif
" vista " vista
nmap <F8> :Vista!!<CR> nmap <F8> :Vista!!<CR>
" NERDComment " NERDComment
if !exists('g:vscode')
nnoremap <silent> <F10> :call NERDComment("n", "Toggle")<cr> nnoremap <silent> <F10> :call NERDComment("n", "Toggle")<cr>
vnoremap <silent> <F10> <ESC>:call NERDComment("v", "Toggle")<cr> vnoremap <silent> <F10> <ESC>:call NERDComment("v", "Toggle")<cr>
endif
" YCM " YCM
if !exists('g:vscode')
nmap <C-F4> :YcmCompleter GoTo<CR>:wincmd o<CR> nmap <C-F4> :YcmCompleter GoTo<CR>:wincmd o<CR>
endif
" vim-clap " vim-clap
if !exists('g:vscode')
if has('nvim')
nnoremap <leader>ag <cmd>lua require('telescope.builtin').live_grep({ default_text = vim.fn.expand("<cword>") })<cr>
nnoremap <silent> <leader>tg <cmd>lua require('telescope.builtin').tags({ default_text = vim.fn.expand("<cword>") })<cr>
nmap <C-f> :call ComIfGit('lua require("telescope.builtin").git_files()', 'lua require("telescope.builtin").find_files()')<CR>
nmap <F1> <cmd>lua require('telescope.builtin').tags()<cr>
nmap <C-b> <cmd>lua require('telescope.builtin').buffers()<cr>
nmap <C-d> <cmd>lua require('telescope.builtin').diagnostics()<cr>
nmap <C-l> <cmd>lua require('telescope.builtin').lsp_document_symbols()<cr>
nnoremap <leader>ls <cmd>lua require('telescope.builtin').lsp_document_symbols({ default_text = vim.fn.expand("<cword>") })<cr>
else
nnoremap <leader>ag :Clap grep ++query=<cword><CR> nnoremap <leader>ag :Clap grep ++query=<cword><CR>
nnoremap <leader>dg :Clap dumb_jump ++query=<cword><CR>
" nnoremap <silent> <leader>tg :Clap proj_tags ++query=<cword><CR> " nnoremap <silent> <leader>tg :Clap proj_tags ++query=<cword><CR>
nmap <C-f> :Clap files<CR> nmap <C-f> :call ComIfGit('Clap gfiles', 'Clap files')<CR>
nmap <F1> :Clap tags<CR> nmap <F1> :Clap tags<CR>
nmap <F2> :Clap proj_tags<CR> nmap <F2> :Clap proj_tags<CR>
nmap <C-b> :Clap buffers<CR> nmap <C-b> :Clap buffers<CR>
nnoremap <silent> <leader>tb :Clap generated_tags ++query=<cword><CR> nnoremap <silent> <leader>tb :Clap proj_tags ++query=<cword><CR>
endif
endif
" tags
nnoremap <silent> <leader>tg :tag <C-R>=expand("<cword>")<CR><CR> nnoremap <silent> <leader>tg :tag <C-R>=expand("<cword>")<CR><CR>
nnoremap <silent> <leader>tp :ptag <C-R>=expand("<cword>")<CR><CR> nnoremap <silent> <leader>tp :ptag <C-R>=expand("<cword>")<CR><CR>
nnoremap <silent> <leader>ts :ts <C-R>=expand("<cword>")<CR><CR> nnoremap <silent> <leader>ts :ts <C-R>=expand("<cword>")<CR><CR>
" gitgutter " gitgutter
if !exists('g:vscode')
nmap <leader>ggt <Esc>:GitGutterToggle<CR> nmap <leader>ggt <Esc>:GitGutterToggle<CR>
nmap <leader>nh <Plug>(GitGutterNextHunk) nmap <leader>nh <Plug>(GitGutterNextHunk)
nmap <leader>bh <Plug>(GitGutterPrevHunk) nmap <leader>bh <Plug>(GitGutterPrevHunk)
@ -376,10 +399,34 @@ omap <leader>ic <Plug>(GitGutterTextObjectInnerPending)
omap <leader>ac <Plug>(GitGutterTextObjectOuterPending) omap <leader>ac <Plug>(GitGutterTextObjectOuterPending)
xmap <leader>ic <Plug>(GitGutterTextObjectInnerVisual) xmap <leader>ic <Plug>(GitGutterTextObjectInnerVisual)
xmap <leader>ac <Plug>(GitGutterTextObjectOuterVisual) xmap <leader>ac <Plug>(GitGutterTextObjectOuterVisual)
endif
" fastfold " fastfold
nmap zuz <Plug>(FastFoldUpdate) nmap zuz <Plug>(FastFoldUpdate)
if exists('g:vscode')
nnoremap <silent> T :call VSCodeNotify('editor.action.showHover')<CR>
nnoremap <silent> gd :call VSCodeNotify('editor.action.revealDefinition')<CR>
else
if has('nvim')
nnoremap <silent> T :lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gd :lua vim.lsp.buf.definition()<CR>
nnoremap <leader>la :lua vim.lsp.buf.code_action()<CR>
nnoremap <leader>rn :lua vim.lsp.buf.rename()<CR>
nnoremap <leader>ln <Plug>(lcn-diagnostics-next)
nnoremap <leader>lp <Plug>(lcn-diagnostics-prev)
" Vim Script
nnoremap <leader>xx <cmd>TroubleToggle<cr>
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
nnoremap <leader>xd <cmd>TroubleToggle document_diagnostics<cr>
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
nnoremap gR <cmd>TroubleToggle lsp_references<cr>
else
"LanguageClient-neovim "LanguageClient-neovim
" Required for operations modifying multiple buffers like rename. " Required for operations modifying multiple buffers like rename.
set hidden set hidden
@ -399,6 +446,7 @@ nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <leader>la :call LanguageClient#textDocument_codeAction()<CR> nnoremap <leader>la :call LanguageClient#textDocument_codeAction()<CR>
nnoremap <leader>rn :call LanguageClient#textDocument_rename()<CR> nnoremap <leader>rn :call LanguageClient#textDocument_rename()<CR>
nnoremap ,g <Plug>(lcn-diagnostics-next) nnoremap <leader>ln <Plug>(lcn-diagnostics-next)
nnoremap .g <Plug>(lcn-diagnostics-prev) nnoremap <leader>lp <Plug>(lcn-diagnostics-prev)
endif
endif

View File

@ -1,7 +1,56 @@
[[plugins]] [[plugins]]
repo = 'purescript-contrib/purescript-vim'
[[plugins]]
repo = 'PProvost/vim-ps1'
[[plugins]]
repo = 'nvim-lua/popup.nvim'
on_if = 'has("nvim")'
[[plugins]]
repo = 'nvim-lua/plenary.nvim'
on_if = 'has("nvim")'
[[plugins]]
repo = 'Twinside/vim-haskellFold'
hook_post_source = '''
call SetHaskellFolding()
'''
on_ft = ['haskell']
[[plugins]]
repo = 'kana/vim-submode'
hook_add = '''
" A message will appear in the message line when you're in a submode
" and stay there until the mode has exited.
let g:submode_always_show_submode = 1
let g:submode_keep_leaving_key = 1
let g:submode_timeout = 0
" We're taking over the default <C-w> setting. Don't worry we'll do
" our best to put back the default functionality.
call submode#enter_with('nav', 'n', '', '<C-ENTER>')
call submode#map('nav', 'n', 's', 'e', ':normal! 6j<cr>')
call submode#map('nav', 'n', 's', 'o', ':normal! 6k<cr>')
call submode#map('nav', 'n', 's', ',', '<Cmd>normal! <C-d><CR>')
call submode#map('nav', 'n', 's', '.', '<Cmd>normal! <C-u><CR>')
call submode#map('nav', 'n', 's', ']', '<Cmd>normal! <C-b><CR>')
call submode#map('nav', 'n', 's', '[', '<Cmd>normal! <C-f><CR>')
call submode#map('nav', 'n', '', 'n', 'B')
call submode#map('nav', 'n', '', 'i', 'W')
call submode#map('nav', 'n', 's', '<ENTER>', ':tabprevious<cr>')
call submode#map('nav', 'n', 's', '=', ':tabnext<cr>')
'''
on_if = '!exists("g:vscode")'
[[plugins]]
repo = 'jparise/vim-graphql'
[[plugins]]
repo = 'mileszs/ack.vim' repo = 'mileszs/ack.vim'
# [[plugins]]
# repo = 'vim-scripts/cmdalias.vim'
[[plugins]] [[plugins]]
repo = 'vim-scripts/cmdalias.vim' repo = 'easymotion/vim-easymotion'
hook_add = '''
'''
[[plugins]] [[plugins]]
repo = 'Raimondi/delimitMate' repo = 'Raimondi/delimitMate'
hook_add = ''' hook_add = '''
@ -12,12 +61,14 @@ hook_add = '''
''' '''
[[plugins]] [[plugins]]
repo = 'vim-scripts/genindent.vim' repo = 'vim-scripts/genindent.vim'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'scrooloose/nerdcommenter' repo = 'scrooloose/nerdcommenter'
hook_add = ''' hook_add = '''
let NERDSpaceDelims=1 let NERDSpaceDelims=1
let NERDCreateDefaultMappings=0 let NERDCreateDefaultMappings=0
''' '''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'scrooloose/nerdtree' repo = 'scrooloose/nerdtree'
on_event = 'NERDTreeToggle' on_event = 'NERDTreeToggle'
@ -31,11 +82,17 @@ hook_add = '''
autocmd StdinReadPre * let s:std_in=1 autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
''' '''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'Xuyuanp/nerdtree-git-plugin' repo = 'Xuyuanp/nerdtree-git-plugin'
on_event = 'NERDTreeToggle' on_event = 'NERDTreeToggle'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'xolox/vim-easytags' repo = 'xolox/vim-easytags'
hook_add = '''
let g:easytags_async = 1
'''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'xolox/vim-misc' repo = 'xolox/vim-misc'
[[plugins]] [[plugins]]
@ -45,9 +102,14 @@ repo = 'Shougo/vimproc.vim'
build = 'make' build = 'make'
[[plugins]] [[plugins]]
repo = 'sjbach/lusty' repo = 'sjbach/lusty'
hook_add = '''
let g:LustyExplorerSuppressRubyWarning = 1
'''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'nixprime/cpsm' repo = 'nixprime/cpsm'
build = 'sh -c "PY3=ON ./install.sh"' build = 'sh -c "PY3=ON ./install.sh"'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'liuchengxu/vista.vim' repo = 'liuchengxu/vista.vim'
hook_add = ''' hook_add = '''
@ -57,11 +119,15 @@ hook_add = '''
\ 'yaml': 'hasktags -x -o - -c', \ 'yaml': 'hasktags -x -o - -c',
\ } \ }
''' '''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'sbdchd/neoformat' repo = 'sbdchd/neoformat'
hook_add = ''' hook_add = '''
let g:neoformat_enabled_haskell = ['brittany'] let g:neoformat_enabled_haskell = ['brittany']
let g:neoformat_enabled_typescript = ['prettier']
let g:neoformat_try_node_exe = 1
''' '''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'AndrewRadev/bufferize.vim' repo = 'AndrewRadev/bufferize.vim'
[[plugins]] [[plugins]]
@ -75,6 +141,7 @@ hook_add = '''
''' '''
[[plugins]] [[plugins]]
repo = 'tpope/vim-scriptease' repo = 'tpope/vim-scriptease'
on_if = '!has("nvim")'
[[plugins]] [[plugins]]
repo = 'Konfekt/FastFold' repo = 'Konfekt/FastFold'
hook_add = ''' hook_add = '''
@ -104,6 +171,7 @@ hook_add = '''
''' '''
[[plugins]] [[plugins]]
repo = 'hasufell/ghcup.vim' repo = 'hasufell/ghcup.vim'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'junegunn/vim-easy-align' repo = 'junegunn/vim-easy-align'
[[plugins]] [[plugins]]
@ -139,12 +207,13 @@ hook_add = '''
let g:clap_layout = {'relative': 'editor', 'width': '95%', 'height': '33%', 'row': '33%', 'col': '5%'} let g:clap_layout = {'relative': 'editor', 'width': '95%', 'height': '33%', 'row': '33%', 'col': '5%'}
let g:clap_use_pure_python = 1 let g:clap_use_pure_python = 1
function! MultiGrep(...) abort function! MultiClap(com, ...) abort
let opts = map(copy(a:000), "printf('++query=%s', v:val)") let opts = map(copy(a:000), "printf('++query=%s', v:val)")
execute 'Clap grep' join(opts, ' ') execute 'Clap ' a:com join(opts, ' ')
endfunction endfunction
command! -nargs=* Rag call MultiGrep(<f-args>) command! -nargs=* Rag call MultiClap('grep', <f-args>)
command! -nargs=* Dag call MultiClap('dumb_jump', <f-args>)
let g:clap_provider_generated_tags = { let g:clap_provider_generated_tags = {
\ 'source': {-> Tags__source()}, \ 'source': {-> Tags__source()},
@ -159,21 +228,30 @@ hook_add = '''
" Let vim handle the tag " Let vim handle the tag
execute 'tag' split(a:line, '\t')[0] execute 'tag' split(a:line, '\t')[0]
endfunc endfunc
cabbrev C Clap
cabbrev c Clap
cabbrev cp Clap proj_tags
''' '''
on_if = '!has("nvim") && !exists("g:vscode")'
# scm # scm
[[plugins]] [[plugins]]
repo = 'tpope/vim-fugitive' repo = 'tpope/vim-fugitive'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'tpope/vim-rhubarb' repo = 'tpope/vim-rhubarb'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'tommcdo/vim-fubitive' repo = 'tommcdo/vim-fubitive'
[[plugins]] [[plugins]]
on_if = '!exists("g:vscode")'
repo = 'airblade/vim-gitgutter' repo = 'airblade/vim-gitgutter'
hook_add = ''' hook_add = '''
" https://github.com/airblade/vim-gitgutter/issues/696 " https://github.com/airblade/vim-gitgutter/issues/696
autocmd ColorScheme * highlight! link SignColumn LineNr autocmd ColorScheme * highlight! link SignColumn LineNr
''' '''
on_if = '!exists("g:vscode")'
# local vimrc # local vimrc
[[plugins]] [[plugins]]
@ -212,7 +290,9 @@ repo = 'LucHermitte/local_vimrc'
repo = 'Shougo/deoplete.nvim' repo = 'Shougo/deoplete.nvim'
hook_add = ''' hook_add = '''
let g:deoplete#enable_at_startup = 0 let g:deoplete#enable_at_startup = 0
autocmd FileType TelescopePrompt call deoplete#custom#buffer_option('auto_complete', v:false)
''' '''
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'roxma/nvim-yarp' repo = 'roxma/nvim-yarp'
on_if = '!has("nvim")' on_if = '!has("nvim")'
@ -224,16 +304,16 @@ on_if = '!has("nvim")'
[[plugins]] [[plugins]]
repo = 'dense-analysis/ale' repo = 'dense-analysis/ale'
# build = 'bash -c "cp -R ~/.vim/ale_linters ."' # build = 'bash -c "cp -R ~/.vim/ale_linters ."'
on_ft = ['sh', 'vim']
hook_add = ''' hook_add = '''
let g:ale_enabled = 1 let g:ale_enabled = 1
let g:ale_haskell_hie_executable = $HOME . '/.ghcup/bin/haskell-language-server-wrapper' " let g:ale_haskell_hie_executable = $HOME . '/.ghcup/bin/haskell-language-server-wrapper'
let g:ale_linters = {'haskell':['hie'], 'c':[]} " let g:ale_linters = {'haskell':['hie'], 'c':[]}
let g:ale_linters_explicit = 1 let g:ale_linters_explicit = 1
let g:ale_haskell_argon_error_level = 14 let g:ale_haskell_argon_error_level = 14
let g:ale_haskell_argon_warn_level = 10 let g:ale_haskell_argon_warn_level = 10
let g:ale_haskell_argon_info_level = 6 let g:ale_haskell_argon_info_level = 6
''' '''
on_if = 'index(["sh", "vim"], &ft) >= 0 && !exists("g:vscode")'
# LSP # LSP
[[plugins]] [[plugins]]
@ -290,10 +370,16 @@ hook_add = '''
let g:LanguageClient_loggingFile = expand('~/LanguageClient.log') let g:LanguageClient_loggingFile = expand('~/LanguageClient.log')
let g:LanguageClient_serverStderr = expand('~/LanguageServer.log') let g:LanguageClient_serverStderr = expand('~/LanguageServer.log')
let g:LanguageClient_rootMarkers = {'haskell': ['cabal.project', '*.cabal', 'stack.yaml'] } let g:LanguageClient_rootMarkers = {
\ 'haskell': ['cabal.project', '*.cabal', 'stack.yaml'],
\ 'elm': ['elm.json']
\ }
let g:LanguageClient_serverCommands = { let g:LanguageClient_serverCommands = {
\ 'haskell': ['haskell-language-server-wrapper', '--lsp', '--logfile', $HOME.'/hls-server.log'], \ 'haskell': ['haskell-language-server-wrapper', '--lsp', '--logfile', $HOME.'/hls-server.log'],
\ 'purescript': ['~/.npm-modules/bin/purescript-language-server', '--stdio'],
\ 'elm': ['elm-language-server'],
\ 'typescript': ['typescript-language-server', '--stdio']
\ } \ }
''' '''
#[[plugins]] #[[plugins]]
@ -337,7 +423,6 @@ hook_add = '''
# multi language # multi language
[[plugins]] [[plugins]]
repo = 'luochen1990/rainbow' repo = 'luochen1990/rainbow'
on_ft = ['clojure', 'haskell', 'python']
hook_add = ''' hook_add = '''
let g:rainbow_conf = { let g:rainbow_conf = {
\ 'guifgs': ['#DC322F', 'royalblue3', 'darkorange3', 'seagreen3'], \ 'guifgs': ['#DC322F', 'royalblue3', 'darkorange3', 'seagreen3'],
@ -345,11 +430,11 @@ hook_add = '''
\} \}
let g:rainbow_active = 1 let g:rainbow_active = 1
''' '''
on_if = 'index(["clojure", "haskell", "python"], &ft) >= 0 && !exists("g:vscode")'
# haskell # haskell
[[plugins]] [[plugins]]
repo = 'neovimhaskell/haskell-vim' repo = 'neovimhaskell/haskell-vim'
on_ft = ['haskell', 'cabal']
hook_add = ''' hook_add = '''
let g:haskell_classic_highlighting = 1 let g:haskell_classic_highlighting = 1
let g:haskell_indent_disable = 1 let g:haskell_indent_disable = 1
@ -369,19 +454,20 @@ hook_add = '''
let g:haskell_indent_guard = 4 let g:haskell_indent_guard = 4
" let g:haskell_disable_TH = 1 " let g:haskell_disable_TH = 1
''' '''
on_if = 'index(["haskell", "cabal"], &ft) >= 0 && !exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'Twinside/vim-hoogle' repo = 'Twinside/vim-hoogle'
on_ft = ['haskell']
hook_source = ''' hook_source = '''
nnoremap <leader>ho :Hoogle<CR> nnoremap <leader>ho :Hoogle<CR>
nnoremap <leader>hc :HoogleClose<CR> nnoremap <leader>hc :HoogleClose<CR>
''' '''
on_if = 'index(["haskell"], &ft) >= 0 && !exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'alx741/vim-stylishask' repo = 'alx741/vim-stylishask'
on_ft = ['haskell']
hook_add = ''' hook_add = '''
let g:stylishask_on_save = 0 let g:stylishask_on_save = 0
''' '''
on_if = 'index(["haskell"], &ft) >= 0 && !exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'fatih/vim-go' repo = 'fatih/vim-go'
@ -393,11 +479,6 @@ hook_post_source = 'GoInstallBinaries'
repo = 'rust-lang/rust.vim' repo = 'rust-lang/rust.vim'
on_ft = ['rust'] on_ft = ['rust']
# javascript
[[plugins]]
repo = 'pangloss/vim-javascript'
on_ft = ['javascript']
# python # python
[[plugins]] [[plugins]]
repo = 'python-mode/python-mode' repo = 'python-mode/python-mode'
@ -413,23 +494,35 @@ repo = 'manicmaniac/coconut.vim'
on_ft = ['python'] on_ft = ['python']
[[plugins]] [[plugins]]
repo = 'alfredodeza/pytest.vim' repo = 'alfredodeza/pytest.vim'
on_ft = ['python'] on_if = 'index(["python"], &ft) >= 0 && !exists("g:vscode")'
[[plugins]] [[plugins]]
repo = 'idanarye/vim-vebugger' repo = 'idanarye/vim-vebugger'
on_ft = ['python'] on_if = 'index(["python"], &ft) >= 0 && !exists("g:vscode")'
# scala # scala
[[plugins]] [[plugins]]
repo = 'derekwyatt/vim-scala' repo = 'derekwyatt/vim-scala'
on_ft = ['scala'] on_if = 'index(["scala"], &ft) >= 0 && !exists("g:vscode")'
# javascript
[[plugins]]
repo = 'pangloss/vim-javascript'
on_ft = ['typescript', 'javascript']
[[plugins]]
repo = 'MaxMEllon/vim-jsx-pretty'
on_ft = ['typescript', 'javascript']
# typescript # typescript
[[plugins]] [[plugins]]
repo = 'leafgarland/typescript-vim' repo = 'leafgarland/typescript-vim'
on_ft = ['typescript'] on_ft = ['typescript', 'javascript']
#[[plugins]]
#repo = 'Quramy/tsuquyomi'
#on_ft = ['typescript', 'javascript']
[[plugins]] [[plugins]]
repo = 'Quramy/tsuquyomi' repo = 'prettier/vim-prettier'
on_ft = ['typescript'] on_ft = ['typescript', 'javascript']
build = 'npm install'
# color and beauty # color and beauty
@ -486,6 +579,7 @@ rtp = 'ScrollColor'
name = 'bufonly' name = 'bufonly'
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'bufonly' rtp = 'bufonly'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
name = 'colorschemedgrade' name = 'colorschemedgrade'
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
@ -503,10 +597,12 @@ on_if = '!has("nvim")'
name = 'fuzzyfinder' name = 'fuzzyfinder'
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'fuzzyfinder' rtp = 'fuzzyfinder'
on_if = '!exists("g:vscode")'
[[plugins]] [[plugins]]
name = 'log' name = 'log'
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'log' rtp = 'log'
on_if = '!exists("g:vscode")'
#[[plugins]] #[[plugins]]
#repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' #repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
#rtp = 'paredit' #rtp = 'paredit'
@ -517,3 +613,40 @@ rtp = 'log'
name = 'txtfmt' name = 'txtfmt'
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git' repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'txtfmt' rtp = 'txtfmt'
on_if = '!exists("g:vscode")'
[[plugins]]
repo = 'neovim/nvim-lspconfig'
hook_add = '''
lua require('lspconfig').hls.setup{}
'''
on_if = 'has("nvim") && !exists("g:vscode")'
lazy = false
[[plugins]]
repo = 'kyazdani42/nvim-web-devicons'
on_if = 'has("nvim") && !exists("g:vscode")'
lazy = false
[[plugins]]
repo = 'folke/trouble.nvim'
hook_add = '''
lua << EOF
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
action_keys = { -- key mappings for actions in the trouble list
jump_close = {"t"}, -- jump to the diagnostic and close the list
}
}
EOF
'''
lazy = false
on_if = 'has("nvim") && !exists("g:vscode")'
[[plugins]]
repo = 'nvim-telescope/telescope.nvim'
lazy = false
on_if = 'has("nvim") && !exists("g:vscode")'

34
vimrc
View File

@ -7,11 +7,15 @@ let g:pymode_python = 'python3'
" plugin stuff " plugin stuff
filetype plugin on filetype plugin on
filetype indent on
set backspace=indent,eol,start " backspace through everything in insert mode set backspace=indent,eol,start " backspace through everything in insert mode
set cmdheight=1 set cmdheight=1
" if has("gui_running")
" autocmd GUIEnter * set vb t_vb=
" endif
set belloff=all
set wildmenu set wildmenu
" set wildmode=longest,list,full " set wildmode=longest,list,full
@ -27,7 +31,7 @@ let s:toml = $HOME . '/.vim/plugins.toml'
" Required: " Required:
if dein#load_state($HOME . '/.cache/dein') if dein#load_state($HOME . '/.cache/dein')
call dein#begin($HOME . '/.cache/dein', [$HOME . '/.vim/vimrc', $HOME . '/.vim/plugins.toml']) call dein#begin($HOME . '/.cache/dein', [$HOME . '/.vim/vimrc', $HOME . '/.vim/plugins.toml'])
call dein#add('wsdjeg/dein-ui.vim')
call dein#load_toml(s:toml) call dein#load_toml(s:toml)
" Let dein manage dein " Let dein manage dein
@ -38,9 +42,11 @@ if dein#load_state($HOME . '/.cache/dein')
call dein#end() call dein#end()
call dein#save_state() call dein#save_state()
endif endif
filetype plugin indent on
" ===== further plugin initialization and default config ===== " ===== further plugin initialization and default config =====
so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
so ~/.vim/autoload/log-autocmds.vim
" lustyexplorer " lustyexplorer
set hidden set hidden
@ -84,7 +90,7 @@ set mouse=a
set autoread set autoread
set number set number
set encoding=utf8 set encoding=utf8
set guifont=Monospace\ 14 set guifont=Hack\ Nerd\ Font\ Mono\ 16
set clipboard=unnamedplus set clipboard=unnamedplus
set textwidth=0 set textwidth=0
set tabstop=4 set tabstop=4
@ -195,6 +201,14 @@ fun! StripTrailingWhitespaces()
call cursor(l, c) call cursor(l, c)
endfun endfun
function! ComIfGit(com1, com2)
silent! !git rev-parse --is-inside-work-tree
if v:shell_error == 0
execute a:com1
else
execute a:com2
endif
endfunction
" =========================== " ===========================
@ -251,4 +265,18 @@ function! ManCurrentWord()
exe '!man 3 ' . word exe '!man 3 ' . word
endfunction endfunction
""""""""""""""""""""""""""""""
" Close preview after typing
""""""""""""""""""""""""""""""
autocmd WinEnter * call ClosePreviewWindow()
function ClosePreviewWindow()
if getwinvar(winnr("#"), "&pvw") == 1
pclose
endif
endfunction
set title
" vim:foldmethod=marker:foldlevel=0 " vim:foldmethod=marker:foldlevel=0