From a9aacafc1ea74054cbf821114430569732925943 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Tue, 3 Mar 2020 12:46:21 +0100 Subject: [PATCH] vimrc tweaks --- vim/init.vim | 45 ++++++++++++++++++++++----------------------- zsh/zshrc | 9 ++++++++- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/vim/init.vim b/vim/init.vim index a8bf370..1056c4e 100644 --- a/vim/init.vim +++ b/vim/init.vim @@ -1,3 +1,18 @@ +call plug#begin('~/.config/vim-plugins') +Plug 'fatih/molokai' +Plug 'junegunn/fzf' +Plug 'junegunn/fzf.vim' +Plug 'rodjek/vim-puppet' +Plug 'junegunn/goyo.vim' +Plug 'tpope/vim-fugitive' +Plug 'edkolev/tmuxline.vim' +Plug 'itchyny/lightline.vim' +Plug 'airblade/vim-gitgutter' +Plug 'junegunn/limelight.vim' +Plug 'hashivim/vim-terraform' +Plug 'bitc/vim-bad-whitespace' +call plug#end() + set title set number set gdefault @@ -18,7 +33,6 @@ set cursorcolumn set nojoinspaces set nowritebackup set termguicolors -"set relativenumber set bs=2 set tabstop=2 @@ -33,7 +47,7 @@ set matchpairs+=(:),{:},[:],<:>,':',":" nmap w nmap :wq! -nmap :Files +nmap :Files ~ nmap :term nmap :tabnew nmap :tabclose @@ -48,23 +62,7 @@ map g :Gstatus map gc :Gcommit map gp :Gpush map f :Goyo - -filetype plugin indent on - -call plug#begin('~/.config/vim-plugins') -Plug 'fatih/molokai' -Plug 'junegunn/fzf' -Plug 'junegunn/fzf.vim' -Plug 'rodjek/vim-puppet' -Plug 'tpope/vim-fugitive' -Plug 'edkolev/tmuxline.vim' -Plug 'itchyny/lightline.vim' -Plug 'airblade/vim-gitgutter' -Plug 'hashivim/vim-terraform' -Plug 'bitc/vim-bad-whitespace' -Plug 'junegunn/goyo.vim' -Plug 'junegunn/limelight.vim' -call plug#end() +map t :NERDTreeToggle syntax on colorscheme molokai @@ -77,10 +75,14 @@ if has("gui") set guioptions-=L set guifont=Hack\ NF:h14 endif +filetype plugin indent on +autocmd! User GoyoEnter Limelight +autocmd! User GoyoLeave Limelight! command! -bang -nargs=? -complete=dir Files - \ call fzf#vim#files(, {'options': ['-e', '--layout=reverse', '--height=80%', '--preview', 'bat --color=always --tabs=2 --style=plain --theme="Monokai Extended" {}']}, 0) + \ call fzf#vim#files(, {'options': ['-e', '--layout=reverse', '--height=20%', '--preview', 'bat --color=always --tabs=2 --style=plain --theme="Monokai Extended" {}']}, 0) +let g:terraform_fmt_on_save=1 let g:lightline = { \ 'colorscheme': 'powerlineish', \ 'active': { @@ -98,6 +100,3 @@ let g:lightline = { function! LightLineReadonly() return &readonly && &filetype !=# 'help' ? 'RO' : '' endfunction - -autocmd! User GoyoEnter Limelight -autocmd! User GoyoLeave Limelight! diff --git a/zsh/zshrc b/zsh/zshrc index 88cca19..40a48c4 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -15,6 +15,13 @@ source ~/.zsh/themes/powerlevel10k/powerlevel10k.zsh-theme [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh export FZF_DEFAULT_COMMAND='git ls-files --cached --others --exclude-standard 2>/dev/null|fd -H' export FZF_CTRL_T_COMMAND='git ls-files --cached --others --exclude-standard 2>/dev/null|fd -H' -export FZF_DEFAULT_OPTS="-e --layout=reverse --height=40% --preview='bat --color=always --tabs=2 --style=plain --theme=\"Monokai Extended\" {}'" +export FZF_DEFAULT_OPTS="--cycle -e --layout=reverse --height=40% --preview='bat --color=always --tabs=2 --style=plain --theme=\"Monokai Extended\" {}'" +export FZF_CTRL_R_OPTS="--cycle -e --layout=reverse --height=40% --preview=''" +_fzf_compgen_path() { + fd -H . "$1" +} +_fzf_compgen_dir() { + fd -H --type d . "$1" +} [ -e ~/.zshrc.local ] && source ~/.zshrc.local