246 lines
7.1 KiB
VimL
246 lines
7.1 KiB
VimL
set spell spelllang=de,en
|
||
let g:airline_powerline_fonts = 1
|
||
let g:airline_skip_empty_sections = 1
|
||
let g:airline#extensions#tabline#enabled = 1
|
||
let g:airline#extensions#nvimlsp#enabled = 0
|
||
let g:tex_flavor = 'latex'
|
||
|
||
nmap <space>e :CocCommand explorer --no-toggle<CR>
|
||
|
||
set foldcolumn=1
|
||
set background=light
|
||
set autoindent
|
||
set nosmartindent
|
||
set listchars=tab:»\ ,trail:.,extends:#
|
||
set list
|
||
set ts=3
|
||
set number
|
||
set scrolloff=5
|
||
set sidescrolloff=5
|
||
set laststatus=2
|
||
set incsearch
|
||
set mouse=
|
||
set showcmd
|
||
set title
|
||
|
||
" Set this here so that nothing get’s overriden later
|
||
filetype plugin indent on
|
||
syntax on
|
||
|
||
set undodir=~/.vimhist/
|
||
set undofile
|
||
set undolevels=100
|
||
set undoreload=1000
|
||
|
||
augroup focus
|
||
au!
|
||
au TabLeave * silent! wall
|
||
au FocusLost * silent! wall
|
||
au BufLeave * silent! wall
|
||
augroup END
|
||
|
||
nnoremap <silent><cr> :nohlsearch<CR>
|
||
vnoremap < <gv
|
||
vnoremap > >gv
|
||
nnoremap <c-down> <c-w><c-j>
|
||
nnoremap <c-up> <c-w><c-k>
|
||
nnoremap <c-right> <c-w><c-l>
|
||
nnoremap <c-left> <c-w><c-h>
|
||
let mapleader=","
|
||
|
||
|
||
set winaltkeys=no
|
||
set noai
|
||
set cursorline
|
||
set cursorcolumn
|
||
set si
|
||
set expandtab
|
||
set sw=3
|
||
set pt=<F4>
|
||
set ignorecase
|
||
set wildmenu
|
||
set hlsearch
|
||
|
||
noremap <buffer> <silent> <Up> gk
|
||
noremap <buffer> <silent> <Down> gj
|
||
noremap <buffer> <silent> <Home> g<Home>
|
||
noremap <buffer> <silent> <End> g<End>
|
||
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
|
||
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
||
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
||
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
||
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
||
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
||
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
||
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
||
|
||
let g:formatdef_my_cabal = '"cabal-fmt"'
|
||
let g:formatters_cabal = ['my_cabal']
|
||
let g:formatdef_my_nix = '"nixfmt"'
|
||
let g:formatters_nix = ['my_nix']
|
||
let g:formatdef_my_dhall = '"dhall format"'
|
||
let g:formatters_dhall = ['my_dhall']
|
||
|
||
let g:autoformat_autoindent = 0
|
||
let g:autoformat_retab = 0
|
||
|
||
colorscheme PaperColor
|
||
|
||
" if hidden is not set, TextEdit might fail.
|
||
set hidden
|
||
|
||
" Some servers have issues with backup files, see #649
|
||
set nobackup
|
||
set nowritebackup
|
||
|
||
" You will have bad experience for diagnostic messages when it's default 4000.
|
||
set updatetime=300
|
||
|
||
" don't give |ins-completion-menu| messages.
|
||
set shortmess+=c
|
||
|
||
" always show signcolumns
|
||
set signcolumn=yes
|
||
|
||
" Use tab for trigger completion with characters ahead and navigate.
|
||
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
|
||
inoremap <silent><expr> <TAB>
|
||
\ pumvisible() ? "\<C-n>" :
|
||
\ <SID>check_back_space() ? "\<TAB>" :
|
||
\ coc#refresh()
|
||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||
|
||
function! s:check_back_space() abort
|
||
let col = col('.') - 1
|
||
return !col || getline('.')[col - 1] =~# '\s'
|
||
endfunction
|
||
|
||
" Use <c-space> to trigger completion.
|
||
inoremap <silent><expr> <c-space> coc#refresh()
|
||
|
||
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||
" Coc only does snippet and additional edit on confirm.
|
||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||
|
||
nmap <silent> gp <Plug>(coc-diagnostic-prev)
|
||
nmap <silent> gn <Plug>(coc-diagnostic-next)
|
||
|
||
" Remap keys for gotos
|
||
nmap <silent> gd <Plug>(coc-definition)
|
||
nmap <silent> gy <Plug>(coc-type-definition)
|
||
nmap <silent> gr <Plug>(coc-references)
|
||
|
||
nmap <silent> gs :Gstatus<CR>
|
||
nmap <silent> gu :CocCommand git.chunkUndo<CR>
|
||
nmap <silent> gi :CocCommand git.chunkInfo<CR>
|
||
nmap <silent> ga :CocCommand git.chunkStage<CR>
|
||
nmap <silent> gb :CocCommand git.showCommit<CR>
|
||
nmap <silent> gc :Gcommit<CR>
|
||
|
||
function! s:show_documentation()
|
||
if (index(['vim','help'], &filetype) >= 0)
|
||
elseif (coc#rpc#ready())
|
||
call CocActionAsync('doHover')
|
||
else
|
||
execute '!' . &keywordprg . " " . expand('<cword>')
|
||
endif
|
||
endfunction
|
||
|
||
nmap <silent> <space>i :call <SID>show_documentation()<CR>
|
||
|
||
" Remap for rename current word
|
||
nmap <space>r <Plug>(coc-rename)
|
||
|
||
" Remap for format selected region
|
||
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
|
||
|
||
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
|
||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||
nmap <silent> <space>f :Format<CR>
|
||
nmap <space>l <Plug>(coc-codelens-action)
|
||
|
||
" Create mappings for function text object, requires document symbols feature of languageserver.
|
||
|
||
xmap if <Plug>(coc-funcobj-i)
|
||
xmap af <Plug>(coc-funcobj-a)
|
||
omap if <Plug>(coc-funcobj-i)
|
||
omap af <Plug>(coc-funcobj-a)
|
||
|
||
" FZF ctrl-p style search
|
||
nmap <space>p :Files<CR>
|
||
nmap <space>g :Rg<CR>
|
||
nmap <space>h :History<CR>
|
||
nmap <space>b :Buffers<CR>
|
||
nmap <space>k :qa<CR>
|
||
nmap <space>q :q<CR>
|
||
nmap <space>s :w<CR>
|
||
|
||
nnoremap <a-left> :bp<CR>
|
||
nnoremap <a-right> :bn<CR>
|
||
inoremap <a-left> <ESC>:bp<CR>
|
||
inoremap <a-right> <ESC>:bn<CR>
|
||
|
||
let $FZF_DEFAULT_OPTS .= '--border --layout=reverse'
|
||
function! FloatingFZF()
|
||
let width = float2nr(&columns * 0.9)
|
||
let height = float2nr(&lines * 0.6)
|
||
let opts = { 'relative': 'editor',
|
||
\ 'row': (&lines - height) / 2,
|
||
\ 'col': (&columns - width) / 2,
|
||
\ 'width': width,
|
||
\ 'height': height,
|
||
\ 'style': 'minimal'
|
||
\}
|
||
|
||
let win = nvim_open_win(nvim_create_buf(v:false, v:true), v:true, opts)
|
||
call setwinvar(win, '&winhighlight', 'NormalFloat:TabLine')
|
||
endfunction
|
||
|
||
let g:fzf_layout = { 'window': 'call FloatingFZF()' }
|
||
|
||
" Use <tab> for select selections ranges, needs server support, like: coc-tsserver, coc-python
|
||
nmap <silent> <TAB> <Plug>(coc-range-select)
|
||
xmap <silent> <TAB> <Plug>(coc-range-select)
|
||
xmap <silent> <S-TAB> <Plug>(coc-range-select-backword)
|
||
|
||
" Use `:Format` to format current buffer
|
||
command! -nargs=0 Format :call CocAction('format')
|
||
|
||
" Use `:Fold` to fold current buffer
|
||
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||
|
||
" use `:OR` for organize import of current buffer
|
||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
||
|
||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||
|
||
imap <ESC>[1~ <HOME>
|
||
imap <ESC>[4~ <End>
|
||
" Using CocList
|
||
" Show all diagnostics
|
||
nnoremap <silent> <space>d :<C-u>CocFzfList diagnostics<cr>
|
||
" Show commands
|
||
nnoremap <silent> <space>c :<C-u>CocFzfList commands<cr>
|
||
" Find symbol of current document
|
||
nnoremap <silent> <space>o :<C-u>CocFzfList outline<cr>
|
||
" Find symbol of current document
|
||
nnoremap <silent> <space>a :<C-u>CocFzfList actions<cr>
|
||
" Do default action for next item.
|
||
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||
" Do default action for previous item.
|
||
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||
|
||
imap <Enter> <CR>
|
||
|
||
" Load this after theme
|
||
hi Normal ctermbg=NONE
|