78 lines
1.7 KiB
VimL
78 lines
1.7 KiB
VimL
" Specify a directory for plugins
|
|
" - For Neovim: stdpath('data') . '/plugged'
|
|
" - Avoid using standard Vim directory names like 'plugin'
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
" Make sure you use single quotes
|
|
|
|
Plug 'vim-airline/vim-airline'
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
Plug 'sickill/vim-monokai'
|
|
Plug 'airblade/vim-gitgutter'
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
Plug 'junegunn/fzf.vim'
|
|
Plug 'udalov/kotlin-vim'
|
|
Plug 'rust-lang/rust.vim'
|
|
Plug 'zivyangll/git-blame.vim'
|
|
|
|
" Initialize plugin system
|
|
call plug#end()
|
|
|
|
" Coloring
|
|
syntax enable
|
|
colorscheme monokai
|
|
|
|
" Airline
|
|
let g:airline#extensions#tabline#enabled = 1
|
|
|
|
" -- Buffer/Window Workflow
|
|
" Allow hidden buffers
|
|
set hidden
|
|
|
|
" Line numbers
|
|
set number
|
|
|
|
" Marker line at col 80
|
|
set cc=80
|
|
|
|
" Stop mouse from selecting numbers
|
|
set mouse=a
|
|
|
|
" Show tab characters
|
|
set list
|
|
set listchars=tab:>-
|
|
|
|
" Space-indentiation please
|
|
set expandtab
|
|
set shiftwidth=4
|
|
set tabstop=4
|
|
|
|
" Smartcase search
|
|
set ignorecase
|
|
set smartcase
|
|
|
|
" Ripgrep FZF
|
|
function! RipgrepFzf(query, fullscreen)
|
|
let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true'
|
|
let initial_command = printf(command_fmt, shellescape(a:query))
|
|
let reload_command = printf(command_fmt, '{q}')
|
|
let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]}
|
|
call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen)
|
|
endfunction
|
|
|
|
command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)
|
|
|
|
" FZF
|
|
nnoremap <C-p> :Files<Cr>
|
|
nnoremap <M-p> :Buffers<Cr>
|
|
|
|
" Tabs
|
|
nnoremap <Tab> :tabnext<CR>
|
|
nnoremap <S-Tab> :tabprevious<CR>
|
|
|
|
" Rust
|
|
let g:rustfmt_autosave = 1
|
|
|
|
" Git Blame
|
|
nnoremap <C-b> :<C-u>call gitblame#echo()<CR>
|