Skip to content

Instantly share code, notes, and snippets.

@evenme
Created May 29, 2018 00:37
Show Gist options
  • Save evenme/15e0035aa2cf4949a01e4e1b11bbba20 to your computer and use it in GitHub Desktop.
Save evenme/15e0035aa2cf4949a01e4e1b11bbba20 to your computer and use it in GitHub Desktop.
"Setting Python Path (If you are not using ArchLinux you may don't need this)
let $PYTHONPATH='/usr/lib/python3.6/site-packages'
set nocompatible
" For vundle
filetype off
set rtp+=~/vim/bundle/Vundle.vim
call vundle#begin('~/vim/plugins')
"Snippets
" Track the engine.
"Plugin 'SirVer/ultisnips'
" Snippets are separated from the engine. Add this if you want them:
Plugin 'honza/vim-snippets'
"Code Complete
Plugin 'Shougo/neocomplete.vim'
" Good looking bottom :)
Plugin 'bling/vim-airline'
" Git tools
Plugin 'tpope/vim-fugitive'
" Dependency managment
Plugin 'gmarik/vundle.vim'
" Rails
Plugin 'tpope/vim-rails.git'
" CoffeeScript
Plugin 'kchmck/vim-coffee-script'
" Commenting and uncommenting stuff
Plugin 'tomtom/tcomment_vim'
" " Beutiful solarized theme
Plugin 'altercation/vim-colors-solarized'
" " Molokai theme
Plugin 'tomasr/molokai'
Plugin 'vim-airline/vim-airline-themes'
" " Vim Ruby
Plugin 'vim-ruby/vim-ruby'
" Surround your code :)
Plugin 'tpope/vim-surround'
" Every one should have a pair (Autogenerate pairs for "{[( )
Plugin 'jiangmiao/auto-pairs'
" Fuzzu finder for vim (CTRL+P)
Plugin 'kien/ctrlp.vim'
" Running tests in tmux session
Plugin 'tpope/vim-dispatch'
" Gist - (paste online text)
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'danro/rename.vim'
"Mustache and Handlebars - html views
Plugin 'mustache/vim-mustache-handlebars'
"Terraform syntax
Plugin 'hashivim/vim-terraform'
" JavaScript syntax
Plugin 'pangloss/vim-javascript'
" Json Syntax
Plugin 'elzr/vim-json'
" Dash
Plugin 'rizzatti/dash.vim'
" Vim/Tmux OSX
Plugin 'tmux-plugins/vim-tmux-focus-events'
call vundle#end()
" Map leader key
let mapleader = ","
set grepprg=ack-grep " Set ACK as a default grep
set tags=./tags; " Set tags directory
set autoindent " Auto indention should be on
" Ruby stuff: Thanks Ben :)
" ================
syntax on " Enable syntax highlighting
filetype plugin indent on " Enable filetype-specific indenting and plugins
augroup myfiletypes
" Clear old autocmds in group
autocmd!
" autoindent with two spaces, always expand tabs
autocmd FileType ruby,eruby,yaml,markdown set ai sw=2 sts=2 et
augroup END
" ================
" Syntax highlighting and theme
syntax enable
" Configs to make Molokai look great
set background=dark
let g:molokai_original=1
let g:rehash256=1
set t_Co=256
colorscheme molokai
" Show trailing whitespace and spaces before a tab:
:highlight ExtraWhitespace ctermbg=red guibg=red
:autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\\t/
" Lovely linenumbers
set nu
" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
" Remove highlights with leader + enter
nmap <Leader><CR> :nohlsearch<cr>
" Buffer switching
map <leader>p :bp<CR> " \p previous buffer
map <leader>n :bn<CR> " \n next buffer
map <leader>d :bp<bar>sp<bar>bn<bar>bd<CR> " \d delete buffer but not splits
set confirm
set hidden
" Copy Paste GVim - <leader>c
set clipboard+=unnamed
" Theme Configuration
let g:airline_theme='molokai'
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
set laststatus=2
" Remove arrows
"inoremap <Up> <NOP>
"inoremap <Down> <NOP>
"inoremap <Left> <NOP>
"inoremap <Right> <NOP>
"noremap <Up> <NOP>
"noremap <Down> <NOP>
"noremap <Left> <NOP>
"noremap <Right> <NOP>
" Removing escape
ino jj <esc>
cno jj <c-c>
vno v <esc>
" highlight the current line
set cursorline
" Highlight active column
set cuc cul"
set colorcolumn=80
" Tab completion
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
""""""""""""""""""""""""""""""""""""""""
" BACKUP / TMP FILES
""""""""""""""""""""""""""""""""""""""""
if isdirectory($HOME . '/vim/backup') == 0
:silent !mkdir -p ~/vim/backup >/dev/null 2>&1
endif
set backupdir-=.
set backupdir+=.
set backupdir-=~/
set backupdir^=~/vim/backup/
set backupdir^=./vim-backup/
set backup
" Save your swp files to a less annoying place than the current directory.
" " If you have .vim-swap in the current directory, it'll use that.
" " Otherwise it saves it to ~/vim/swap, ~/tmp or .
if isdirectory($HOME . '/vim/swap') == 0
:silent !mkdir -p ~/vim/swap >/dev/null 2>&1
endif
set directory=./vim-swap//
set directory+=~/vim/swap//
set directory+=~/tmp//
set directory+=.
" viminfo stores the the state of your previous editing session
set viminfo+=n~/vim/viminfo
if exists("+undofile")
" undofile - This allows you to use undos after exiting and restarting
" This, like swap and backups, uses .vim-undo first, then ~/vim/undo
" :help undo-persistence
" This is only present in 7.3+
if isdirectory($HOME . '/vim/undo') == 0
:silent !mkdir -p ~/vim/undo > /dev/null 2>&1
endif
set undodir=./vim-undo//
set undodir+=~/vim/undo//
set undofile
endif
" Ruby hash syntax conversion
" noremap <F12>
noremap <F12> :%s/:\([^ ]*\)\(\s*\)=>/\1:/g<return>
" Increment numbers
nnoremap <A-a> <C-a>
nnoremap <A-x> <C-x>
" Trigger configuration. Do not use <tab> if you use
" https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
"
" " If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" " Use smartcase.
let g:neocomplete#enable_smart_case = 1"
let g:neocomplete#max_list = 10
let g:neocomplete#sources#syntax#min_keyword_length = 3
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Terraform identation
let g:terraform_align=1
" JavaScript Syntax
let g:javascript_plugin_jsdoc = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment