Skip to content

Instantly share code, notes, and snippets.

@Hughen
Last active January 4, 2023 01:38
Show Gist options
  • Save Hughen/5076872aa74e9f9cc9c1a4f0e654a8ef to your computer and use it in GitHub Desktop.
Save Hughen/5076872aa74e9f9cc9c1a4f0e654a8ef to your computer and use it in GitHub Desktop.
Hughen vimrc
if has("syntax")
syntax on
colorscheme molokai " colorscheme from https://github.com/flazz/vim-colorschemes
endif
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
set number
set tabstop=4
set hls
set shiftwidth=4
set expandtab
set backspace=indent,eol,start
set incsearch
set colorcolumn=80
set cursorline
set ignorecase
set smartcase
set nocompatible " required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=~/.fzf
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plugin 'junegunn/fzf.vim'
Plugin 'mileszs/ack.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'airblade/vim-gitgutter'
Plugin 'pangloss/vim-javascript'
Plugin 'lfv89/vim-interestingwords'
Plugin 'dhruvasagar/vim-zoom'
call vundle#end() " required
filetype plugin indent on " required
nmap <F5> :NERDTreeToggle<cr>
function s:with_git_root()
let root = systemlist('git rev-parse --show-toplevel')[0]
return v:shell_error ? {} : {'dir': root}
endfunction
let g:fzf_layout = { 'down': '~40%' }
" jump to the last position when reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always --smart-case '.<q-args>, 1,
\ extend(s:with_git_root(), fzf#vim#with_preview('right:50%', '?')),
\ <bang>0)
" vim popup setting
set completeopt=longest,menuone,popup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment