Created
May 19, 2020 19:25
-
-
Save zohaad/44ad8dfbf617fe76d4456dfece677293 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set noerrorbells | |
set tabstop=4 softtabstop=4 " length of tabs and spaces | |
set shiftwidth=4 " shift it over by 4 chars | |
set expandtab " tabs -> spaces | |
set smartindent | |
set nu " set line number | |
set nowrap | |
set smartcase " case sensitive searching | |
set noswapfile " no vim.swap | |
set nobackup | |
set undodir=~/.vim/undodir " where to save the directory | |
set undofile " a file per file in the directory above | |
set incsearch " while searching, get results | |
set colorcolumn=80 | |
highlight ColorColumn ctermbg=0 guibg=lightgrey | |
call plug#begin('~/.vim/plugged') | |
Plug 'morhetz/gruvbox' " theme | |
Plug 'arcticicestudio/nord-vim' " theme | |
Plug 'jremmen/vim-ripgrep' " very fast grep | |
Plug 'tpope/vim-fugitive' " git integration | |
Plug 'leafgarland/typescript-vim' " typescript coloring & indenting | |
Plug 'vim-utils/vim-man' " man pages | |
Plug 'lyuts/vim-rtags' " C++ | |
Plug 'git@github.com:kien/ctrlp.vim.git' " file finding | |
Plug 'git@github.com:Valloric/YouCompleteMe.git' " autocomplete | |
Plug 'mbbill/undotree' " undo history visualizer | |
Plug 'vim-airline/vim-airline' " status bar | |
call plug#end() " now do :PlugInstall | |
" for YCM: go to ~/.vim/plugged/YouCompleteMe | |
" ./install.py --help | |
" I installed with --ts-completer --rust-completer | |
colorscheme gruvbox | |
set background=dark | |
" allows rg (ripgrep) detect root and use .gitignore | |
if executable('rg') | |
let g:rg_derive_root='true' | |
endif | |
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude standard'] | |
let mapleader = " " " leader key -> spacebar | |
let g:netrw_browse_split = 2 " how to open filetree | |
let g:netrw_banner = 0 " no help information | |
let g:netrw_winsize = 25 | |
" no caching for CtrlP, it's fast enough | |
let g:ctrlp_use_caching = 0 | |
" jumping between windows | |
nnoremap <leader>h :wincmd h<CR> " window command | |
nnoremap <leader>j :wincmd j<CR> | |
nnoremap <leader>k :wincmd k<CR> | |
nnoremap <leader>l :wincmd l<CR> | |
nnoremap <leader>u :UndotreeShow<CR> | |
" project-view: opens window, opens file-explorer, resizes it | |
nnoremap <leader>pv :wincmd v<bar> :Ex <bar> :vertical resize 30<CR> | |
" project-search | |
nnoremap <leader>ps :Rg<SPACE> | |
" zoom | |
nnoremap <silent> <Leader>+ :vertical resize +5<CR> | |
nnoremap <silent> <Leader>- :vertical resize -5<CR> | |
" YCM | |
" The best part. | |
" j(g)ump to definiton | |
nnoremap <silent> <Leader>gd :YcmCompleter GoTo<CR> | |
" fix | |
nnoremap <silent> <Leader>gf :YcmCompleter FixIt<CR> | |
" optional... | |
" git commands | |
nmap <leader>gs :G<CR> " git status | |
" to resolve merge conflicts | |
nmap <leader>gf :diffget //2<CR> " right-side | |
nmap <leader>gj :diffget //3<CR> " left-side | |
command! -range=% IX <line1>,<line2>w !curl -F 'f:1=<-' ix.io | tr -d '\n' | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment