cleanup & added clojure

This commit is contained in:
Nicole Dresselhaus 2023-05-12 16:37:43 +02:00
parent 452b09c14d
commit 84f874bd27
2 changed files with 143 additions and 68 deletions

View File

@ -6,5 +6,6 @@
"rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"], "rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"],
"filetypes": ["haskell", "lhaskell"] "filetypes": ["haskell", "lhaskell"]
} }
} },
"coc.source.iced.enable": true
} }

View File

@ -21,26 +21,16 @@ Plug 'frankier/neovim-colors-solarized-truecolor-only'
" rainbow-parentethies " rainbow-parentethies
Plug 'luochen1990/rainbow' Plug 'luochen1990/rainbow'
" search in files/buffers for filenames - replaced by fzf
" Plug 'https://github.com/ctrlpvim/ctrlp.vim.git'
" fuzzy finder " fuzzy finder
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
" show buffers in statusline
" Plug 'bling/vim-bufferline'
" git-gutter (little + - and ~ left) " git-gutter (little + - and ~ left)
Plug 'https://github.com/airblade/vim-gitgutter.git' Plug 'https://github.com/airblade/vim-gitgutter.git'
" apply hlint-suggestions
" Plug 'https://github.com/mpickering/hlint-refactor-vim.git'
" Tabular " Tabular
Plug 'https://github.com/godlygeek/tabular.git' Plug 'https://github.com/godlygeek/tabular.git'
" Shakespearian template-highlighting
" Plug 'https://github.com/pbrisbin/vim-syntax-shakespeare.git'
" Multiline-Comments " Multiline-Comments
Plug 'tomtom/tcomment_vim' Plug 'tomtom/tcomment_vim'
@ -73,26 +63,16 @@ Plug 'xolox/vim-session' | Plug 'xolox/vim-misc'
" CoC " CoC
Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Clojure
Plug 'guns/vim-sexp', {'for': 'clojure'}
Plug 'liquidz/vim-iced', {'for': 'clojure'}
Plug 'liquidz/vim-iced-coc-source', {'for': 'clojure'}
call plug#end() call plug#end()
" SETTINGS " SETTINGS
" recommended by syntastic
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" set statusline+=%{fugitive#statusline()}
"
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" use autocompletion
let g:deoplete#enable_at_startup = 1
" in case of problems with stack..
" g:necoghc_use_stack = 1
" set leader to space " set leader to space
let mapleader= "\<SPACE>" let mapleader= "\<SPACE>"
@ -140,6 +120,8 @@ highlight WinSeperator guibg=None
set hidden set hidden
let g:loaded_perl_provider = 0
" Use <C-L> to clear the highlighting of :set hlsearch. " Use <C-L> to clear the highlighting of :set hlsearch.
if maparg('<C-L>', 'n') ==# '' if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<CR><C-L> nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
@ -175,7 +157,7 @@ inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-P>" : "\<C-H>"
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>" inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"
" use <C-J> to Jump to definition instead of <C-]> (default) " use <C-J> to Jump to definition instead of <C-]> (default)
nnoremap <C-J> <C-]> nmap <C-J> <C-]>
" c-d to delete line in insert-mode " c-d to delete line in insert-mode
inoremap <C-D> <esc>ddi inoremap <C-D> <esc>ddi
@ -184,8 +166,129 @@ inoremap <C-D> <esc>ddi
tnoremap <C-t><C-t> <C-\><C-n> tnoremap <C-t><C-t> <C-\><C-n>
""""""""""""""""""""""""""""""""""""""""""""" Coc Keys
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Highlight the symbol and its references when holding the cursor
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s)
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying code actions to the selected code block
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying code actions at the cursor position
nmap <leader>ac <Plug>(coc-codeaction-cursor)
" Remap keys for apply code actions affect whole buffer
nmap <leader>as <Plug>(coc-codeaction-source)
" Apply the most preferred quickfix action to fix diagnostic on the current line
nmap <leader>qf <Plug>(coc-fix-current)
" Remap keys for applying refactor code actions
nmap <silent> <leader>re <Plug>(coc-codeaction-refactor)
xmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
nmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
" Run the Code Lens action on the current line
nmap <leader>cl <Plug>(coc-codelens-action)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> to scroll float windows/popups
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges
" Requires 'textDocument/selectionRange' support of language server
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer
command! -nargs=0 Format :call CocActionAsync('format')
" Add `:Fold` command to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" autoformat code if possible (read docs on vim-autoformat!) " autoformat code if possible (read docs on vim-autoformat!)
noremap <leader>f :Autoformat<CR> "noremap <leader>f :Autoformat<CR>
noremap <leader>TM :TableModeToggle<CR> noremap <leader>TM :TableModeToggle<CR>
" multi-cursor " multi-cursor
@ -212,9 +315,6 @@ nnoremap <Leader>f :GFiles<CR>
" Open Tag-Search " Open Tag-Search
nnoremap <Leader>t :Tags<CR> nnoremap <Leader>t :Tags<CR>
" Open File-Tree on left side
nmap <C-t> :NERDTreeToggle<CR>
" Expand patterns in Haskell " Expand patterns in Haskell
"nnoremap <Leader>hc :GhcModSplitFunCase<CR> "nnoremap <Leader>hc :GhcModSplitFunCase<CR>
" Expand function signatures in Haskell " Expand function signatures in Haskell
@ -234,12 +334,18 @@ nnoremap <leader>P "+P
vnoremap <leader>p "+p vnoremap <leader>p "+p
vnoremap <leader>P "+P vnoremap <leader>P "+P
" disable syntastic for haskell
let g:syntastic_haskell_checkers=['']
" Clear stuff " Clear stuff
nnoremap <Leader><Leader> :nohlsearch<CR>:cclose<CR> nnoremap <Leader><Leader> :nohlsearch<CR>:cclose<CR>
" Clojure-Bindings
" Enable vim-iced's default key mapping
" This is recommended for newbies
let g:iced_enable_default_key_mappings = v:true
let g:sexp_enable_insert_mode_mappings = 0 " stop inserting brackets
let g:iced_enable_clj_kondo_analysis = v:true " kondo analysis
let g:iced_enable_clj_kondo_local_analysis = v:true " also analyse local.
let g:iced_enable_auto_document = 'any' " automatically open documentation
" THEME-RELATED STUFF " THEME-RELATED STUFF
syntax enable syntax enable
@ -258,7 +364,7 @@ autocmd BufRead,BufNewFile *.md setlocal spell complete+=kspell textwidth=80
autocmd BufRead,BufNewFile *.markdown setlocal spell complete+=kspell textwidth=80 autocmd BufRead,BufNewFile *.markdown setlocal spell complete+=kspell textwidth=80
autocmd BufRead,BufNewFile *.md hi SpellBad guibg=#582828 gui=none autocmd BufRead,BufNewFile *.md hi SpellBad guibg=#582828 gui=none
autocmd BufRead,BufNewFile *.markdown hi SpellBad guibg=#582828 gui=none autocmd BufRead,BufNewFile *.markdown hi SpellBad guibg=#582828 gui=none
autocmd FileType markdown nnoremap <Leader>t :Toc<CR> " autocmd FileType markdown nnoremap <Leader>t :Toc<CR>
" set languages to english and german " set languages to english and german
set spelllang=de_de,en_us set spelllang=de_de,en_us
@ -287,38 +393,6 @@ let g:haskell_indent_do = 3
let g:haskell_indent_in = 1 let g:haskell_indent_in = 1
let g:haskell_indent_guard = 2 let g:haskell_indent_guard = 2
" NERDTREE
map <C-t> :NERDTreeToggle<CR>
autocmd StdinReadPre * let s:std_in=1
let NERDTreeShowHidden=1
let g:NERDTreeWinSize=45
let g:NERDTreeAutoDeleteBuffer=1
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd FileType nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd FileType nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#141e23')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#141e23')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#141e23')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#141e23')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#141e23')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#141e23')
call NERDTreeHighlightFile('ts', 'Blue', 'none', '#6699cc', '#141e23')
call NERDTreeHighlightFile('hs', 'Blue', 'none', '#6699cc', '#141e23')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#141e23')
call NERDTreeHighlightFile('ds_store', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('gitconfig', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('gitignore', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('bashrc', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('bashprofile', 'Gray', 'none', '#686868', '#141e23')
" SNIPPETS " SNIPPETS
@ -349,7 +423,7 @@ call NERDTreeHighlightFile('bashprofile', 'Gray', 'none', '#686868', '#141e23')
" autocmd FileType html,css EmmetInstall " autocmd FileType html,css EmmetInstall
" AIRLINE " AIRLINE
let g:airline#extensions#tabline#ignore_bufadd_pat = 'gundo|undotree|vimfiler|tagbar|nerd_tree|startify|!' let g:airline#extensions#tabline#ignore_bufadd_pat = 'gundo|undotree|vimfiler|tagbar|netrw|startify|!'
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
set hidden set hidden
let g:airline#extensions#tabline#fnamemod = ':t' let g:airline#extensions#tabline#fnamemod = ':t'