From eedea21a52293dffec33a23603580c5596b5c4e0 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Thu, 28 Oct 2021 12:05:10 +0200 Subject: improve/fix init.vim --- vim-new/init.vim | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'vim-new/init.vim') diff --git a/vim-new/init.vim b/vim-new/init.vim index 2b7c6da..084f85b 100644 --- a/vim-new/init.vim +++ b/vim-new/init.vim @@ -1,5 +1,5 @@ " Miguel's Fresh Neovim Config -" 29th Apr 2021 - ... +" 29th Apr 2021 - now " " link from ~/.config/nvim/init.vim " 1. install vim-plug @@ -8,6 +8,9 @@ " TODO " explore nvim 0.5+ native lsp-client +" explore tree-sitter parser generator +" watch youtube: ThePrimeagen / GregHurrell +" consider nvim-telescope/telescope plugin " {{{ vim-plug call plug#begin('~/.vim/plugged') @@ -37,8 +40,9 @@ Plug 'vim-airline/vim-airline-themes' Plug 'christoomey/vim-tmux-navigator' " Plug 'rafi/awesome-vim-colorschemes' -Plug 'jnurmine/Zenburn' -" try community gruvbox? +Plug 'jnurmine/Zenburn' " try gruvbox-community/gruvbox? + +Plug 'mbbill/undotree' " haskell related Plug 'neovimhaskell/haskell-vim' @@ -62,12 +66,20 @@ set cursorline set foldmethod=marker set nowrap set showcmd -set number relativenumber +set number +set relativenumber set hidden -set colorcolumn=73 +set colorcolumn=80 set backspace=2 " }}} +set noswapfile +set nobackup +set undofile +set undodir=~/.vim/undodir + +set guicursor= +set noerrorbells " disable preview window on autocompletion set completeopt-=preview @@ -135,8 +147,8 @@ let g:haskell_backpack = 1 " to enable highlighting of backpack k set listchars=tab:>.,trail:~ set list set tabstop=8 -set expandtab set softtabstop=4 +set expandtab set shiftwidth=4 set shiftround " }}} @@ -152,6 +164,7 @@ set incsearch set ignorecase set smartcase " }}} +set scrolloff=8 " {{{ match brackets set showmatch @@ -195,13 +208,14 @@ nnoremap h :nohlsearch " show list if multiple ctrl-] matches nnoremap g + augroup filetype_haskell autocmd! - autocmd Filetype haskell nnoremap :call LanguageClient#textDocument_definition() - autocmd Filetype haskell nnoremap i :call LanguageClient#textDocument_hover() - autocmd Filetype haskell nnoremap x :call LanguageClient#explainErrorAtPoint() - autocmd Filetype haskell set softtabstop=2 - autocmd Filetype haskell set shiftwidth=2 + autocmd Filetype haskell nnoremap :call LanguageClient#textDocument_definition() + autocmd Filetype haskell nnoremap i :call LanguageClient#textDocument_hover() + autocmd Filetype haskell nnoremap x :call LanguageClient#explainErrorAtPoint() + autocmd Filetype haskell setlocal softtabstop=2 + autocmd Filetype haskell setlocal shiftwidth=2 augroup END " ctrl-space auto complete in insert mode @@ -215,9 +229,12 @@ nmap a :Rg | " fuzzy find text in the working directory nmap c :Commands| " fuzzy find Vim commands (like Ctrl-Shift-P in Sublime/Atom/VSC) nmap t :Tags| " fuzzy find tags -nmap q :call setqflist(filter(getqflist(),"v:val['type'] == 'E'")) +nmap q :call setqflist(filter(getqflist(),"v:val['type'] == 'E'")) " }}} +" write current file as superuser +cmap w!! w !sudo tee % > /dev/null + let g:fzf_layout = { 'down': '~40%' } let g:tagbar_type_haskell = { -- cgit v1.2.3