Skip to content

Instantly share code, notes, and snippets.

@lightscalar
Last active April 16, 2016 16:45
Show Gist options
  • Save lightscalar/94699f12e5dea7a49740 to your computer and use it in GitHub Desktop.
Save lightscalar/94699f12e5dea7a49740 to your computer and use it in GitHub Desktop.
My current .vimrc file
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()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
Plugin 'ervandew/supertab'
Plugin 'tpope/vim-commentary.git' " simple comment/uncomment plugin
Plugin 'tpope/vim-surround'
Plugin 'Townk/vim-autoclose'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" SET NUMBERING AND TABS DOWN HERE!
set number
set relativenumber
let &colorcolumn=join(range(81,81),",")
highlight ColorColumn ctermbg=254 guibg=#efefef
highlight LineNr ctermbg=254
:syntax enable
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
" Drop into normal mode with double-j press.
inoremap jj <ESC>
vnoremap . :norm.<CR>
" autocmd FileType markdown hi link markdownError NONE
set hls
" Remap the E command to pick up the explore.
command! E Ex
" nnoremap <esc> :noh<return><esc>
set backspace=2
" Stop highlighting italics in markdown.
hi link markdownItalic Normal
" Insert debugging statements (for python).
map <Leader>d Ipdb.set_trace()<esc>
" Get rid of search highlights.
map <Leader>] :noh <CR>
" Easy save!
map <Leader>\ :w <CR>
" Add markdown code
map <Leader>cc a```<ESC>lxa
" Wrap paragraphs quickly!
map <Leader>w vipgq
" Make the vim shell behave like my shell (i.e., source profile on load, etc.)
set shell=bash\ -l
" Copy the relative path of current file into the
nnoremap <leader>cf :let @+=expand("%")<CR>
" absolute path (/something/src/foo.txt)
nnoremap <leader>cF :let @+=expand("%:p")<CR>
" Highlight the cursor line like you like.
set cursorline " cursorcolumn
hi CursorLine term=bold cterm=bold ctermbg=255
" hi CursorColumn ctermbg=255
" Save the current folds in the file.
au BufWinLeave ?* mkview
au BufWinEnter ?* silent loadview
hi Folded ctermbg=230
let g:netrw_list_hide= '.*\.pyc$,.*\.swp$,.*\.swo$'
if exists("+showtabline")
function! MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= ' '
let s .= i . ')'
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let file = bufname(buflist[winnr - 1])
let file = fnamemodify(file, ':p:t')
if file == ''
let file = '[No Name]'
endif
let s .= file
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment