Skip to content

Instantly share code, notes, and snippets.

@bootandy
Last active February 25, 2018 23:31
Show Gist options
  • Save bootandy/d015b0d38ff0218847d28a8adf2c7702 to your computer and use it in GitHub Desktop.
Save bootandy/d015b0d38ff0218847d28a8adf2c7702 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required :PluginInstall
Plugin 'VundleVim/Vundle.vim' "This package manager
Plugin 'tpope/vim-fugitive'
Plugin 'rust-lang/rust.vim' "rust
Plugin 'rizzatti/dash.vim' " dash mac plugin
Plugin 'scrooloose/nerdtree' "file tree
Plugin 'racer-rust/vim-racer' "rust code complete
Plugin 'ctrlpvim/ctrlp.vim' " CTRL-P - fuzzy everything search
Plugin 'mileszs/ack.vim'
Plugin 'vim-airline/vim-airline' "Status bar
Plugin 'vim-airline/vim-airline-themes'
call vundle#end()
filetype plugin indent on
" end vundle
set rtp+=$GOROOT/misc/vim
filetype plugin indent on
syntax on
set number
set relativenumber
"set pastetoggle=<F2>
nnoremap <F2> :set paste!<cr>:set nu!<cr>:set relativenumber!<cr>
nnoremap <C-c> :set paste!<cr>:set nu!<cr>:set relativenumber!<cr>
"sudo super write
cmap w!! w !sudo tee >/dev/null %
"allow backspace to delete stuff:
:set backspace=indent,eol,start
"Make ; act like :
"nnoremap ; :
:command WQ wq
:command Wq wq
:command W w
:command Q q
" Capnp setup
syntax enable
au BufRead,BufNewFile *.capnp set filetype=capnp
" Theme for vim-airline statusbar
let g:airline_theme='dark'
set t_Co=256
" Theme for select bars
"colors: https://clio.1happyplace.com/_images/XTermColorTest.jpg (232=norml
" black)
hi CursorLine cterm=None ctermbg=234
hi CursorColumn cterm=None ctermbg=234
" rust auto complete "
set hidden
let g:racer_cmd = "/Users/bootandy/.cargo/bin/racer"
let g:racer_experimental_completer = 1
"let g:rustfmt_autosave = 1
au FileType rust nmap gd <Plug>(rust-def)
au FileType rust nmap gs <Plug>(rust-def-split)
au FileType rust nmap gx <Plug>(rust-def-vertical)
au FileType rust nmap <leader>gd <Plug>(rust-doc)
"nerd tree
"autocmd vimenter * NERDTree
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR>
" CTRL-N to open. CTRL-W h / CTRL-W l - to select left / right tab
"CTRL-P
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,target " ignore
"leader key:
let mapleader="\<SPACE>"
"buffer forward/back
nnoremap <leader>j :bp<cr>
nnoremap <leader>k :bn<cr>
"switch tabs (used for nerdtree)
nnoremap <leader>h <C-w>h<cr
nnoremap <leader>l <C-w>l<cr>
" for Ack (grep)
nnoremap <leader>a :Ack --ignore-dir target
nnoremap <leader>g :Ack --ignore-dir target
"Delete but do not put in buffer
nnoremap <leader>d "_d
nnoremap <leader>D "_D
"nnoremap <leader>p <C-p> "meant to do CTRLP but doesn't work
"Back one in the buffer hierarcy
nnoremap <leader>b :b#<cr>
" Vim-GitGutter
set updatetime=250
"misc:
set ruler " Show the current row and column
set cursorline " Highlight the currently active line
set cursorcolumn " Highlight the currently active column
filetype plugin on
au BufReadPost *.tera set syntax=html
" for html files, tab 2 spaces
autocmd Filetype html setlocal ts=2 sw=2 expandtab
autocmd Filetype tera setlocal ts=2 sw=2 expandtab
autocmd Filetype html.tera setlocal ts=2 sw=2 expandtab
" attempt to highlight extra whitespace
:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment