From a228e5935abe268692ef5ac3fce006ebfbe1d542 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 4 Nov 2020 12:31:14 +0530 Subject: fix fzf previews, add more haskell config --- nvim/.config/nvim/coc-settings.json | 15 +++++++++---- nvim/.config/nvim/ftplugin/scheme.vim | 1 - nvim/.config/nvim/init.vim | 39 ++++++++++++++++++--------------- nvim/.config/nvim/plugin/statusline.vim | 30 ++++++++++++------------- 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 @@ } }, "haskell": { - "command": "hie", + "command": "haskell-language-server-wrapper", "args": ["--lsp"], "rootPatterns": [ + "*.cabal", "stack.yaml", - "cabal.config", - "package.yaml" + "cabal.project", + "cabal.project.local", + "package.yaml", + "hie.yaml" ], "filetypes": [ "hs", @@ -51,9 +54,13 @@ ], "initializationOptions": { "languageServerHaskell": { - "hlintOn": true + "hlintOn": true } } + }, + "lua": { + "command": "lua-lsp", + "filetypes": ["lua"] } }, "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 setlocal formatoptions=croql CocDisable -let 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" call plug#begin('~/.local/share/nvim/plugged') Plug 'airblade/vim-gitgutter' -Plug 'andymass/vim-matchup' Plug 'godlygeek/tabular' -Plug 'jiangmiao/auto-pairs' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'mattn/emmet-vim', {'for': ['javascript.jsx', 'html', 'css']} @@ -24,14 +22,11 @@ Plug 'tpope/vim-fugitive' " syntax and friends Plug 'rust-lang/rust.vim', {'for': 'rust'} Plug 'lervag/vimtex', {'for': 'tex'} -Plug 'neovimhaskell/haskell-vim', {'for': 'haskell'} +Plug 'neovimhaskell/haskell-vim', {'for': ['haskell', 'cabal']} Plug 'elmcast/elm-vim' Plug 'LnL7/vim-nix' -" colorschemes -Plug 'nerdypepper/agila.vim' -Plug 'nerdypepper/chestnut.vim' -Plug 'nerdypepper/vim-colors-plain', { 'branch': 'duotone' } +Plug 'git@ferrn:vim/vim-colors-plain' call plug#end() @@ -55,6 +50,20 @@ augroup restorecursor \ endif augroup END +augroup vimrc-incsearch-highlight + autocmd! + autocmd CmdlineEnter /,\? :set hlsearch + autocmd CmdlineLeave /,\? :set nohlsearch +augroup END + +augroup fzfstatus + if has('nvim') && !exists('g:fzf_layout') + autocmd! FileType fzf + autocmd FileType fzf set laststatus=0 noshowmode noruler + \| autocmd BufLeave set laststatus=2 showmode ruler + endif +augroup END + " general settings set nobackup set nowritebackup @@ -72,12 +81,11 @@ set laststatus=2 set nowrap set noshowmode set listchars=tab:┊\ ,nbsp:␣,trail:·,extends:>,precedes:< -set fillchars=vert:\│ +set fillchars=vert:\│,stl:\ ,stlnc:\ set ignorecase set smartcase set sidescroll=40 set incsearch -set hlsearch set undofile set undodir=~/tmp set path+=** @@ -89,7 +97,6 @@ set complete=.,w,b,i,u,t, set background=dark set mouse=a set conceallevel=0 -set nocursorline set nonumber set grepprg=rg\ --vimgrep\ --no-heading set grepformat=%f:%l:%c:%m,%f:%l:%m @@ -98,6 +105,7 @@ set shortmess+=c set updatetime=300 set signcolumn=yes set inccommand=split +set showmatch let g:netrw_browsex_viewer= "xdg-open" @@ -118,6 +126,7 @@ endfunction :command! WQ wq :command! Wq wq :command! Wqa wqa +:command! WQa wqa :command! W w :command! Q q @@ -165,10 +174,8 @@ let g:fzf_colors = \ 'marker': ['fg', 'Keyword'], \ 'spinner': ['fg', 'Label'], \ 'header': ['fg', 'Comment'] } - -" indentLine -let g:indentLine_setColors = 0 -let g:indentLine_char = '┆' +let g:fzf_layout = { 'down': '40%' } +let g:fzf_preview_window = [] let g:latex_view_general_viewer = 'zathura' let g:vimtex_view_method = "zathura" @@ -176,10 +183,6 @@ let g:vimtex_view_method = "zathura" " man pages let g:ft_man_open_mode = 'tab' -" vim-matchup -let g:matchup_matchparen_deferred = 1 -let g:matchup_matchparen_hi_surround_always = 1 - " coc-nvim hi CocHintSign ctermfg=6 hi 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={ hi PrimaryBlock ctermfg=00 ctermbg=6 hi SecondaryBlock ctermfg=07 ctermbg=10 -hi Blanks ctermfg=11 ctermbg=0 +hi Blanks ctermfg=08 ctermbg=0 hi User1 ctermfg=01 ctermbg=0 hi User2 ctermfg=02 ctermbg=0 hi User3 ctermfg=03 ctermbg=0 -hi User4 ctermfg=04 ctermbg=0 +hi User4 ctermfg=12 ctermbg=0 hi User5 ctermfg=05 ctermbg=0 hi User6 ctermfg=06 ctermbg=0 hi User7 ctermfg=07 ctermbg=0 hi User8 ctermfg=08 ctermbg=0 -hi User9 ctermfg=09 ctermbg=0 +hi User9 ctermfg=00 ctermbg=0 highlight EndOfBuffer ctermfg=black ctermbg=black @@ -45,7 +45,7 @@ endfunction function! StatuslineGit() let l:branchname = GitBranch() - return strlen(l:branchname) > 0?' '.l:branchname.' ':'' + return strlen(l:branchname) > 0?l:branchname.' ':'' endfunction function! ReadOnly() abort @@ -68,11 +68,11 @@ function! Filepath() abort \ '' : substitute(l:basename . '/', '\C^' . $HOME, '~', '') if empty(l:prefix) && empty(l:filename) - return printf('%%8*%%f%%*%s %%m%%*', '%8*') + return printf('%%4*%%f%%*%s %%m%%*', '%4*') elseif empty(l:prefix) - return printf('%%8*%%f%%*%s %%m%%*', '%6*') + return printf('%%4*%%f%%*%s %%m%%*', '%6*') else - return printf('%%8*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%8*', l:filename) + return printf('%%4*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%4*', l:filename) endif endfunction @@ -81,12 +81,12 @@ function! LinterStatus() abort if empty(info) | return '' | endif let msgs = [] if get(info, 'error', 0) - call add(msgs, printf('%%5*%s×%%*', info['error'])) + call add(msgs, printf('%%5*%s×%%* ', info['error'])) endif if get(info, 'warning', 0) - call add(msgs, printf('%%3*%s!%%*', info['warning'])) + call add(msgs, printf('%%3*%s!%%* ', info['warning'])) endif - return join(msgs, ' ') + return join(msgs, '') endfunction function! StatusLine(mode) abort @@ -100,6 +100,7 @@ function! StatusLine(mode) abort " active if a:mode ==# 'active' + let l:line.='%6*·%*' . ' ' let l:line.='%7*%{StatuslineGit()}' let l:line.='%<' let l:line.=Filepath() @@ -108,15 +109,13 @@ function! StatusLine(mode) abort let l:line.=' %{ReadOnly()} %w%*' let l:line.='%9* %=%*' - let l:line.='%7* %l,%c %*' - let l:line.='%8* %{g:currentmode[mode()]}%*' - let l:line.=' ' + let l:line.=' ' . '%7*%l,%c%*' . ' ' let l:line.=LinterStatus() - let l:line.=' ' - let l:line.='%8*'. &filetype + let l:line.='%4*'. &filetype else " inactive + let l:line.='%5*·%*' . ' ' let l:line.='%#Blanks#' let l:line.='%f %5*%m%*' let l:line.='%#Blanks# %=%*' @@ -133,4 +132,3 @@ augroup MyStatusLine autocmd WinEnter * setl statusline=%!StatusLine('active') autocmd WinLeave * setl statusline=%!StatusLine('inactive') augroup END - -- cgit v1.2.3