Skip to content

Instantly share code, notes, and snippets.

@kyleterry
Created May 2, 2019 18:17
Show Gist options
  • Save kyleterry/55620ac5f1a922aaee65f7a55ed79265 to your computer and use it in GitHub Desktop.
Save kyleterry/55620ac5f1a922aaee65f7a55ed79265 to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
filetype plugin indent on
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'morhetz/gruvbox'
Plugin 'fatih/vim-go'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-sensible'
Plugin 'tpope/vim-commentary'
Plugin 'scrooloose/nerdtree'
Plugin 'jlanzarotta/bufexplorer'
Plugin 'kien/ctrlp.vim'
Plugin 'mileszs/ack.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'maralla/completor.vim'
Plugin 'ferreum/completor-tmux'
Plugin 'majutsushi/tagbar'
Plugin 'PotatoesMaster/i3-vim-syntax'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'vim-syntastic/syntastic'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
" All of your Plugins must be added before the following line
call vundle#end()
let mapleader=','
set encoding=utf-8
syntax on
filetype on
set relativenumber
set number
set numberwidth=1
set title
set confirm
set list
colorscheme gruvbox
" column config
set cursorcolumn
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
set ruler
" searching
set ignorecase
set smartcase
set smarttab
set hlsearch
set incsearch
nnoremap <leader><space> :nohlsearch<cr>
" editing
set matchpairs+=<:>
set scrolloff=3 " Keep 3 context lines above and below the cursor
set backspace=2 " Allow backspacing over autoindent, EOL, and BOL
set showmatch " Briefly jump to a paren once it's balanced
set nowrap " don't wrap text
set linebreak " don't wrap textin the middle of a word
set autoindent " always set autoindenting on
set tabstop=4 " <tab> inserts 4 spaces
set shiftwidth=4 " but an indent level is 2 spaces wide.
set softtabstop=4 " <BS> over an autoindent deletes both spaces.
set expandtab " Use spaces, not tabs, for autoindent/tab key.
set shiftround " rounds indent to a multiple of shiftwidth
set laststatus=2
" remove trailing whitespace
nnoremap <leader>S :%s/\s\+$//<cr>:let @/=''<CR>
" save file with sudo
cmap W! w !sudo tee % >/dev/null
" ctrl-jklm navigates around split windows
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
" tagbar
nmap <leader>tb :TagbarToggle<CR>
nmap <leader>tf :TagbarOpen j<CR>
" nerdTree
map <leader>nt :NERDTreeToggle<CR>
map <leader>nf :NERDTreeFocus<CR>
" ag (ack)
nmap <leader>a <ESC>:Ack!<space>
let g:ackprg = 'ag --nogroup --nocolor --column'
" better selection movement
vnoremap > ><CR>gv
vnoremap < <<CR>gv
" airline
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_theme='gruvbox'
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.paste = '✹'
let g:airline_symbols.whitespace = '¶'
let g:airline_symbols.maxlinenr = '␤'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 1
let g:airline#extensions#tabline#show_tab_type = 0
let g:airline#extensions#tabline#close_symbol = '✖'
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
let g:airline#extensions#tabline#tab_nr_type = 1
" ctrlp
let g:ctrlp_map = '<leader>f'
map <leader>b :CtrlPBuffer<CR>
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|collected_static)$',
\ 'file': '\v\.(exe|so|dll|pyc|swp|swo)$',
\}
" go (golang)
set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
let g:go_fmt_command = "goimports"
let g:go_gocode_propose_builtins = 1
let g:go_gocode_unimported_packages = 1
let g:go_gocode_propose_source = 1
let g:completor_gocode_binary = 'gocode-gomod'
autocmd FileType go let g:ackprg = 'ag --nogroup --nocolor --column --ignore=vendor'
" markdown
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_folding_disabled = 1
autocmd FileType c,json,ruby,eruby,haml,yaml,coffee,js,javascript,html,css,sass,gitconfig setlocal expandtab shiftwidth=2 softtabstop=2 tabstop=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment