Skip to content

Instantly share code, notes, and snippets.

@International
Created December 9, 2019 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save International/4a94c418888b71a1fdc214943ea7771c to your computer and use it in GitHub Desktop.
Save International/4a94c418888b71a1fdc214943ea7771c to your computer and use it in GitHub Desktop.
set nocompatible
set exrc
set showbreak=>\ \ \
" set rtp+=~/.vim/bundle/Vundle.vim/
set rtp+=/usr/local/opt/fzf
call plug#begin('~/.vim/plugged')
" call vundle#begin()
" set shell=/bin/bash
set shell=/bin/zsh
" let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\'
" Plugin 'Valloric/YouCompleteMe'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'skywind3000/asyncrun.vim'
Plug 'VundleVim/Vundle.vim'
Plug 'airblade/vim-rooter'
Plug 'lambdalisue/fila.vim'
" Plugin 'zxqfl/tabnine-vim'
Plug 'vim-airline/vim-airline'
Plug 'rhysd/vim-crystal'
Plug 'nsf/gocode'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Plug 'zchee/deoplete-go', { 'do': ':UpdateRemotePlugins' }
Plug 'slashmili/alchemist.vim'
Plug 'junegunn/fzf.vim'
Plug 'elixir-editors/vim-elixir'
Plug 'editorconfig/editorconfig-vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'fatih/vim-go'
Plug 'majutsushi/tagbar'
Plug 'L9'
Plug 'FuzzyFinder'
" Plugin 'ack.vim'
Plug 'jremmen/vim-ripgrep'
Plug 'ngmy/vim-rubocop'
Plug 'douglasjacobsen/vim-bufexplorer'
" Plugin 'kien/ctrlp.vim'
Plug 'godlygeek/tabular'
Plug 'vim-scripts/ruby-matchit'
Plug 'tomtom/tcomment_vim'
Plug 'tpope/vim-bundler'
" Plugin 'kchmck/vim-coffee-script'
Plug 'flazz/vim-colorschemes'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-haml'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rvm'
Plug 'pangloss/vim-javascript'
Plug 'elzr/vim-json'
Plug 'jwhitley/vim-matchit'
Plug 'sickill/vim-pasta'
Plug 'vim-ruby/vim-ruby'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'kana/vim-textobj-user'
Plug 'nelstrom/vim-textobj-rubyblock'
Plug 'thoughtbot/vim-rspec'
Plug 'tpope/vim-fugitive'
Plug 'jgdavey/tslime.vim'
Plug 'jgdavey/vim-turbux'
Plug 'scrooloose/nerdtree'
" Plugin 'Xuyuanp/nerdtree-git-plugin'
Plug 'molokai'
Plug 'jnwhiteh/vim-golang'
" Plugin 'tomtom/quickfixsigns_vim'
Plug 'ervandew/screen'
Plug 'jmcantrell/vim-diffchanges'
Plug 'Lokaltog/vim-easymotion'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'thinca/vim-quickrun'
Plug 'terryma/vim-expand-region'
call plug#end()
" call vundle#end()
set noet
set number
syntax on
filetype on
filetype indent on
filetype plugin on
set tabstop=2
set shiftwidth=2
set expandtab
set background=dark
set backspace=indent,eol,start
set hlsearch
set showmatch
set nowrap
set wildmenu
set wildmode=list:longest,full
set hidden
set autochdir
set shortmess=at
let g:EasyMotion_leader_key = '<Leader>'
set laststatus=2
" noremap / /\v
set listchars=tab:>-,trail:-
set list
set colorcolumn=80
set diffopt=filler,horizontal
map <F2> :NERDTreeToggle<CR>
map <F3> :NERDTreeFind<CR>
" nnoremap gr :Rg <cword> *<CR>
nnoremap gr :Ack <cword> *<CR>
nnoremap ct :!ctags --sort=foldcase --recurse . `bundle show --paths`<CR>
" nmap <c-a> ^
" nmap <c-e> $
imap <C-e> <esc>$a
imap <C-a> <esc>$I
nnoremap <C-e> <C-w>
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
map <Leader>l :NERDTreeFind<CR>
map <Leader>r :History<CR>
map <Leader>b :FufBuffer<CR>
map <Leader>t :FufTag<CR>
map <Leader>m :TagbarToggle<CR>
" map <C-m> :TagbarToggle<CR>
" map <Leader>p :Files<CR>
" map <Leader>p :Files <CR>
map <Leader>p :call fzf#run({'source': 'git ls-files', 'sink': 'e'})<CR>
let g:vimrubocop_keymap = 0
nmap <Leader>x :RuboCop<CR>
nmap <Leader>y :!rubocop --safe-auto-correct %<CR>
nmap <Leader>c :!bundle exec srb tc %<CR>
" map <C-p> :Files <CR>
" map <C-p> :call fzf#run({'source': 'git ls-files', 'sink': 'e'})<CR>
noremap <C-p> :ProjectFiles<CR>
" map <Leader>t :CtrlPBufTag<CR>
map <Leader>d :Gdiff<CR>
map <Leader>s :Gstatus<CR>
map <C-s> :call RunNearestSpec()<CR>
map <C-x> :call RunCurrentSpecFile()<CR>
" map <Leader>c :call RunAllSpecs()<CR>
nmap // :BufExplorer<CR>
set encoding=utf-8
" set statusline ="%4*\ %<%F%* %{rvm#statusline()}" "full path
set ruler
set rulerformat=%l,%v
set incsearch
map <S-s> :silent w<CR>
set shortmess+=W
imap \\ <Esc>
color solarized
syntax on
set cursorline
:hi CursorLine cterm=NONE ctermbg=darkblue ctermfg=white guibg=darkred guifg=white
set number
set list! " Display unprintable characters
" set listchars=tab:▸\ ,trail:•,extends:»,precedes:«
colorscheme molokai
color brogrammer
color monokai-chris
color Atelier_DuneDark
if $TERM =~ '256color'
set t_Co=256
" colorscheme molokai
elseif $TERM =~ '^xterm$'
set t_Co=256
" colorscheme molokai
endif
" if has("gui_running")
" colorscheme eclipse
" endif
let g:Powerline_symbols = 'unicode'
let g:ScreenImpl = 'Tmux'
let g:ScreenShellTmuxInitArgs = '-2'
let g:ScreenShellInitialFocus = 'shell'
let g:ScreenShellQuitOnVimExit = 0
let g:rg_derive_root = 1
let g:deoplete#enable_at_startup = 1
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
" Default fzf layout
" - down / up / left / right
function! s:fzf_statusline()
" Override statusline as you like
highlight fzf1 ctermfg=161 ctermbg=251
highlight fzf2 ctermfg=23 ctermbg=251
highlight fzf3 ctermfg=237 ctermbg=251
setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
endfunction
autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
autocmd! User FzfStatusLine call <SID>fzf_statusline()
" In Neovim, you can set up fzf window using a Vim command
let g:fzf_layout = { 'down': '~40%' }
let g:fzf_layout = { 'window': 'enew' }
let g:fzf_layout = { 'window': '-tabnew' }
let g:fzf_layout = { 'window': '10split enew' }
set splitbelow
" Customize fzf colors to match your color scheme
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
" Enable per-command history.
" CTRL-N and CTRL-P will be automatically bound to next-history and
" previous-history instead of down and up. If you don't like the change,
" explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS.
let g:fzf_history_dir = '~/.local/share/fzf-history'
" Command for git grep
" - fzf#vim#grep(command, with_column, [options], [fullscreen])
command! -bang -nargs=* GGrep
\ call fzf#vim#grep('git grep --line-number '.shellescape(<q-args>), 0, <bang>0)
" Augmenting Ag command using fzf#vim#with_preview function
" * fzf#vim#with_preview([[options], preview window, [toggle keys...]])
" * For syntax-highlighting, Ruby and any of the following tools are required:
" - Highlight: http://www.andre-simon.de/doku/highlight/en/highlight.php
" - CodeRay: http://coderay.rubychan.de/
" - Rouge: https://github.com/jneen/rouge
"
" :Ag - Start fzf with hidden preview window that can be enabled with "?" key
" :Ag! - Start fzf in fullscreen and display the preview window above
command! -bang -nargs=* Ag
\ call fzf#vim#ag(<q-args>,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
" Likewise, Files command with preview window
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview('right:30%'), <bang>0)
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0)
function! s:find_git_root()
return system('git rev-parse --show-toplevel 2> /dev/null')[:-2]
endfunction
command! ProjectFiles execute 'Files' s:find_git_root()
map <C-\> :ScreenShellVertical<CR>
command -nargs=? -complete=shellcmd W :w | :call ScreenShellSend("load '".@%."';")
set nobackup
set nowritebackup
set noswapfile
set t_ut=
if has("autocmd")
autocmd FileType ruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby let g:rubycomplete_buffer_loading=1
autocmd FileType ruby let g:rubycomplete_classes_in_global=1
autocmd FileType ruby let g:rubycomplete_rails = 1
autocmd FileType go map <S-b> :GoBuild<CR>
autocmd FileType go map <S-t> :GoTest<CR>
endif
if has('nvim')
tnoremap <M-/> <c-\><c-n><c-w>h
tnoremap <C-/> <c-\><c-n><c-w>h
end
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = -25
" augroup ProjectDrawer
" autocmd!
" autocmd VimEnter * :Vexplore
" augroup END
" augroup END
autocmd BufRead,BufNewFile *.go setlocal filetype=go
autocmd BufWinEnter * if line2byte(line("$") + 1) > 1000000 | syntax clear | endif
noremap <Leader>f :Rg <cword><cr>
noremap <C-g> :Rg
noremap <Leader>o :on <cr>
noremap <F4> :Rg <cword><cr>
noremap <Leader>g :Gbl <cr>
noremap <Leader>1 :nohl <cr>
noremap <Leader>2 :CocRestart <cr>
nnoremap /x :Rg <cword><cr>
autocmd BufEnter * :Rooter
nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
" set shormess=a
set cmdheight=2
" nnoremap <leader>. :CtrlPTag<cr>
nnoremap <leader>q :Vex<cr>
map <silent> <Leader>rt :!bundle list --paths=true \| xargs ctags --extra=+f --exclude='*.js' --exclude=.git --exclude=log -R *<CR><CR>
color railscasts
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment