Skip to content

Instantly share code, notes, and snippets.

@alehlopeh
Created August 4, 2014 21:04
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 alehlopeh/6b7a1ed400020ecb99fe to your computer and use it in GitHub Desktop.
Save alehlopeh/6b7a1ed400020ecb99fe to your computer and use it in GitHub Desktop.
vimrc
"
"plugins -
"
"pathogen
"airline - https://github.com/bling/vim-airline.git
"nerdtree - https://github.com/scrooloose/nerdtree.git
"nerdtreetabs - https://github.com/jistr/vim-nerdtree-tabs
"CtrlP - https://github.com/kien/ctrlp.vim.git
"Undotree - https://github.com/mbbill/undotree.git
"Gist-vim - https://github.com/mattn/gist-vim.git
"NerdCommenter - https://github.com/scrooloose/nerdcommenter.git
"vim-javascript - https://github.com/pangloss/vim-javascript.git
"Vim fugitive - https://github.com/tpope/vim-fugitive.git
"vim colors -https://github.com/flazz/vim-colorschemes.git
"Supertab https://github.com/ervandew/superta
"Vim Indent guides git://github.com/nathanaelkane/vim-indent-guides.git
execute pathogen#infect()
"PLUGIN STUFF
"nerdtree
map <C-e> :NERDTreeTabsToggle<CR>
map <leader>e :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr','\.DS_Store']
let NERDTreeChDirMode=0
let NERDTreeQuitOnOpen=1
let NERDTreeMouseMode=2
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1
let g:nerdtree_tabs_open_on_gui_startup=0
nnoremap <C-x> :UndotreeToggle<cr>
let g:airline_powerline_fonts = 0
let g:airline#extensions#tabline#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" old vim-powerline symbols
let g:airline_left_sep = '⮀'
let g:airline_left_alt_sep = '⮁'
let g:airline_right_sep = '⮂'
let g:airline_right_alt_sep = '⮃'
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.readonly = '⭤'
let g:airline_symbols.linenr = '⭡'
let g:ctrlp_working_path_mode = 'ra'
let g:gitgutter_enabled = 1
let g:gitgutter_signs = 1
let g:gitgutter_highlight_lines = 1
let g:gitgutter_sign_column_always = 1
let g:indent_guides_exclude_filetypes = ['help', 'nerdtree', 'undotree', 'ctrlp']
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_guide_size = 2
let g:indent_guides_auto_colors = 0
"set ts=4 sw=4 et
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=black ctermbg=black
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=darkgrey ctermbg=darkgrey
map <D-/> <plug>NERDCommenterToggle<CR>
imap <D-/> <Esc><plug>NERDCommenterToggle<CR>i
highlight link GitGutterAdd DiffAdd
highlight link GitGutterChange DiffChange
highlight link GitGutterDelete DiffDelete
highlight link GitGutterChangeDelete DiffChange
"END PLUGIN STUFF
let mapleader = ','
if has('gui_macvim')
set guioptions+=e "supposed to enable GUI tabs but it aint working in macvim
" Remove scrollbars
set guioptions-=L
set guioptions-=r
set guifont=Fira\ Mono\ for\ Powerline:h14
" Command-/ to toggle comments
map <D-/> <plug>NERDCommenterToggle<CR>
imap <D-/> <Esc><plug>NERDCommenterToggle<CR>i
let g:gist_clip_command = 'pbcopy' " Gist command
autocmd GUIEnter * :hi LineNr gui=NONE " Remove line number underlines in gui mode
set visualbell " Don't beep
endif
set t_Co=256
syntax on " Syntax highlighting
set mouse=a " Automatically enable mouse usage
set mousehide " Hide the mouse cursor while typing
scriptencoding utf-8
set virtualedit=onemore " Allow for cursor beyond last character
set history=1000 " Store a ton of history (default is 20)
set hidden " Allow buffer switching without saving
set tabpagemax=15 " Only show 15 tabs
set showmode " Display the current mode
set cursorline " Highlight current line
highlight clear LineNr " Current line number row will have same background color in relative mode
set backspace=indent,eol,start " Backspace for dummies
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
set relativenumber
set showmatch " Show matching brackets/parenthesis
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set winminheight=0 " Windows can be 0 line high
set ignorecase " Case insensitive search
set smartcase " Case sensitive when uc present
set wildmenu " Show list instead of just completing
set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all.
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
set autoindent " Indent at the same level of the previous line
set shiftwidth=2 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set tabstop=2 " An indentation every four columns
set softtabstop=2 " Let backspace delete indent
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set splitright " Puts new vsplit windows to the right of the current
set splitbelow " Puts new split windows to the bottom of the current
set pastetoggle=<F10> " pastetoggle (sane indentation on pastes)i
set omnifunc=syntaxcomplete#Complete
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
endif
if has("persistent_undo")
set undodir='~/.undodir/'
set undofile
endif
set showcmd
set laststatus=2
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" Color of line numbers and dividers?
highlight clear SignColumn
highlight SignColumn guibg=Black term=standout ctermfg=White ctermbg=Black guifg=White
"Relative line numbers in escape mode, absolute line numbers in insert mode
autocmd InsertEnter * :setlocal norelativenumber
autocmd InsertLeave * :setlocal relativenumber
" Opens a new tab with the current buffer's path
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
"set viminfo^=%
set nobackup
set nowb
set noswapfile
" Use spaces instead of tabs
set expandtab
" COLORSCHEME
colorscheme skittles_dark
"colorscheme darkrobot
"colorscheme danger
"colorscheme lucario
"colorscheme obsidian2
set background=dark
filetype plugin indent on " Automatically detect file types.
" Be smart when using tabs ;)
set smarttab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment