Skip to content

Instantly share code, notes, and snippets.

@jakubfiala
Created September 11, 2016 21:18
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 jakubfiala/5b13f7aeec6a7226af1d101a99408235 to your computer and use it in GitHub Desktop.
Save jakubfiala/5b13f7aeec6a7226af1d101a99408235 to your computer and use it in GitHub Desktop.
my vimrc
" Some of these I've taken from spf13
set nocompatible
filetype plugin indent on
set virtualedit=onemore
set history=1000
set number
set cursorline
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'juanedi/predawn.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'mxw/vim-jsx'
Plugin 'tpope/vim-surround'
Plugin 'Nopik/vim-nerdtree-direnter'
Bundle 'jistr/vim-nerdtree-tabs'
Plugin 'vim-airline/vim-airline'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'pangloss/vim-javascript'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" backspace damnit
set backspace=indent,eol,start
" Theme stuff
colorscheme predawn
syntax on
highlight LineNr ctermfg=243 ctermbg=235
let g:airline_theme='luna'
hi treeDir guifg=#96CBFE
" Tree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR>
map <C-e> :NERDTreeTabsToggle<CR>
let g:nerdtree_tabs_open_on_console_startup=1
" Scrolling
set mouse=a
" make Insert mode behave more sensibly
" beginning/end of lines
inoremap <C-e> <Esc>A
inoremap <C-a> <Esc>I
" deleting whole lines
inoremap <C-d> <Esc>D
" selecting all
map <C-a> <esc>ggVG<CR>
" SAVING WITH CTRL-S
" ---------------------------------------------------
" If the current buffer has never been saved, it will have no name,
" call the file browser to save it, otherwise just save it
command -nargs=0 -bar Update if &modified
\| if empty(bufname('%'))
\| browse confirm write
\| else
\| confirm write
\| endif
\|endif
nnoremap <silent> <C-S> :<C-u>Update<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment