Skip to content

Instantly share code, notes, and snippets.

@ApoorvaJ ApoorvaJ/vimrc
Last active Mar 30, 2017

Embed
What would you like to do?
" ==========================================================
" Vundle
" ==========================================================
set nocompatible
filetype off
if has('win32')
set rtp+=~/vimfiles/Vundle.vim/
call vundle#begin('~/vimfiles/')
else
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
endif
Plugin 'joshdick/onedark.vim'
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-scripts/a.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'Konfekt/FastFold'
Plugin 'octol/vim-cpp-enhanced-highlight'
Plugin 'henrik/vim-indexed-search'
Plugin 'bogado/file-line'
Plugin 'vim-airline/vim-airline'
set laststatus=2 " Always on
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-sleuth'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-unimpaired'
call vundle#end()
filetype plugin indent on
" ==========================================================
" Color scheme
" ==========================================================
syntax enable
if has("gui_running")
set background=dark
colorscheme onedark
endif
" ==========================================================
" Misc
" ==========================================================
set autoindent
set cino+=(0
set backspace=indent,eol,start
set number
set ruler
set colorcolumn=91
set cursorline
set foldmethod=syntax
set nowrap
set ignorecase
set smartcase
set guioptions-=T "Hide toolbar
set guioptions-=m "Hide menubar
set guioptions-=r "Hide right scrollbar
set guioptions-=L "Hide left scrollbar
if has('win32')
set guifont=Consolas:h9.5
endif
" ==========================================================
" Shortcuts
" ==========================================================
" Text editing
" ------------------
imap <C-BS> <C-W>
imap <C-V> <C-R>*
" Misc
"-----
nmap ,q :q<Enter>
nmap ,Q :qa<Enter>
nmap ,w :w<Enter>
nmap ,W :wa<Enter>
nmap ,` :source $MYVIMRC<Enter>
nmap ,~ :tabe $MYVIMRC<Enter>
nmap ,z zMzvzz
nmap G Gzv
nmap <C-f> :set hlsearch!<Enter>
nnoremap <C-[> <C-]>
map q: <Nop>
nnoremap Q <nop>
" Print function name
" -------------------
fun! ShowFuncName()
let lnum = line(".")
let col = col(".")
echohl ModeMsg
echo getline(search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW'))
echohl None
call search("\\%" . lnum . "l" . "\\%" . col . "c")
endfun
map ,f :call ShowFuncName() <CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.