diff options
-rw-r--r-- | vim/grep.vim | 17 | ||||
-rw-r--r-- | vimrc-bare | 54 |
2 files changed, 71 insertions, 0 deletions
diff --git a/vim/grep.vim b/vim/grep.vim new file mode 100644 index 0000000..93f52fb --- /dev/null +++ b/vim/grep.vim @@ -0,0 +1,17 @@ +set grepprg=ag\ --vimgrep + +function! Grep(...) + return system(join([&grepprg] + [expandcmd(join(a:000, ' '))], ' ')) +endfunction + +command! -nargs=+ -complete=file_in_path -bar Grep cgetexpr Grep(<f-args>) +command! -nargs=+ -complete=file_in_path -bar LGrep lgetexpr Grep(<f-args>) + +cnoreabbrev <expr> grep (getcmdtype() ==# ':' && getcmdline() ==# 'grep') ? 'Grep' : 'grep' +cnoreabbrev <expr> lgrep (getcmdtype() ==# ':' && getcmdline() ==# 'lgrep') ? 'LGrep' : 'lgrep' + +augroup quickfix + autocmd! + autocmd QuickFixCmdPost cgetexpr cwindow + autocmd QuickFixCmdPost lgetexpr lwindow +augroup END diff --git a/vimrc-bare b/vimrc-bare new file mode 100644 index 0000000..87d1222 --- /dev/null +++ b/vimrc-bare @@ -0,0 +1,54 @@ +filetype plugin on +filetype plugin indent on + +source ~/.vim/grep.vim + +set autoread +set autowrite +set backspace=indent,eol,start +"set colorcolumn=80 +"set cursorline +set completeopt=menuone,longest +set display=truncate +set equalalways +set fileformat=unix +set hidden +set history=500 +set ignorecase +set incsearch +set infercase +set laststatus=2 +"set list +set listchars=nbsp:%,tab:▸\ ,trail:_,eol:¬,precedes:←,extends:→ +set matchtime=8 +set nobackup +set nocompatible +set nohlsearch +set nojoinspaces +set nomodeline +set noshelltemp +set noswapfile +set noundofile +set nowritebackup +set path+=** +set report=0 +set ruler +set scrolloff=1 +set scrolloff=5 +set shell=bash +set showcmd +set showmatch +set showmode +set splitright +set tabstop=4 softtabstop=4 shiftwidth=4 expandtab +set ttimeout +set ttimeoutlen=100 +set viminfo= +set wildmenu +set wildmode=full +set wrap +syntax enable + +set background=light +colorscheme delek + |