Skip to content

Instantly share code, notes, and snippets.

@nkreeger
Last active December 21, 2021 12:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkreeger/0d5b93f894941d11602c8c9d75349f19 to your computer and use it in GitHub Desktop.
Save nkreeger/0d5b93f894941d11602c8c9d75349f19 to your computer and use it in GitHub Desktop.
syntax enable 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'
" Vundle plugins:
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'mhinz/vim-signify'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'arcticicestudio/nord-vim'
Plugin 'quanganhdo/grb256'
Plugin 'w0ng/vim-hybrid'
Plugin 'morhetz/gruvbox'
Plugin 'rakr/vim-one'
Plugin 'ayu-theme/ayu-vim'
Plugin 'mhartington/oceanic-next'
Plugin 'tomasr/molokai'
Plugin 'sjl/badwolf'
call vundle#end() " required
filetype plugin indent on " required
set autoindent
set autoread " reload files when changed on disk, i.e. via `git checkout`
set backspace=2 " Fix broken backspace in some setups
set backupcopy=yes " see :help crontab
set clipboard=unnamed " yank and paste with the system clipboard
set cursorline
set directory-=. " don't store swapfiles in the current directory
set encoding=utf-8
set expandtab " expand tabs to spaces
set hlsearch
set ignorecase " case-insensitive search
set incsearch " search as you type
set laststatus=2 " always show statusline
set list " show trailing whitespace
set listchars=tab:▸\ ,trail:▫
set number
set ruler " show where you are
set scrolloff=3 " show context above/below cursorline
set shiftwidth=2 " normal mode indentation commands use 2 spaces
set showcmd
set smartcase " case-sensitive search if any caps
set softtabstop=2 " insert mode tab and backspace use 2 spaces
set tabstop=8 " actual tabs occupy 8 characters
set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc
set wildmenu " show a navigable menu for tab completion
set wildmode=longest,list,full
set mouse=a
let g:NERDTreeWinPos = "right"
let mapleader = ','
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
noremap <leader>l :Align
nnoremap <leader>a :Ag<space>
nnoremap <leader>b :CtrlPBuffer<CR>
nnoremap <leader>d :NERDTreeToggle<CR>
nnoremap <leader>f :NERDTreeFind<CR>
nnoremap <leader>t :CtrlP .<CR>
nnoremap <leader>T :CtrlPClearCache<CR>:CtrlP<CR>
nnoremap <leader>] :TagbarToggle<CR>
nnoremap <leader><space> :call whitespace#strip_trailing()<CR>
nnoremap <leader>g :GitGutterToggle<CR>
nnoremap <leader>c <Plug>Kwbd
noremap <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
noremap <leader>g :SignifyToggle<CR>
noremap <leader>G :SignifyToggleHighlight<CR>
noremap <leader>C :call ToggleBackgroundMode()<CR>
augroup makefile_inc_ft
au!
autocmd BufNewFile,BufRead *.inc set syntax=make
augroup END
" colorscheme ir_black
" colorscheme dracula
" colorscheme grb256
" colorscheme one
" let g:airline_theme='one'
" let ayucolor='mirage'
" colorscheme ayu
" colorscheme gruvbox
" let g:gruvbox_contrast_dark = 'hard'
" colorscheme minimalist
" colorscheme deep-space
" colorscheme gotham
" colorscheme molokai
" let g:molokai_original = 1
" colorscheme solarized
set background=dark
hi CursorLine ctermfg=NONE ctermbg=235 cterm=NONE
hi LineNr ctermbg=NONE ctermfg=darkgray
" set background=light
" hi LineNr ctermfg=lightgray
" hi CursorLine ctermfg=NONE ctermbg=255 cterm=NONE
" colorscheme nord
if has('gui_running')
" colorscheme one
" let ayucolor='mirage'
" colorscheme ayu
colorscheme grb256
set gfn=Menlo\ Regular:h13
" set transparency=5
else
" set termguicolors
" let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
" colorscheme gruvbox
" colorscheme grb256
" colorscheme one
" let ayucolor="mirage"
" colorscheme ayu
endif
"" virtual tabstops using spaces
set shiftwidth=2
set softtabstop=2
set expandtab
" allow toggling between local and default mode
function TabToggle()
if &expandtab
set shiftwidth=8
set softtabstop=0
set noexpandtab
else
set shiftwidth=2
set softtabstop=2
set expandtab
endif
endfunction
nmap <F9> mz:execute TabToggle()<CR>'z
function ToggleBackgroundMode()
if &background == "dark"
set background=light
hi LineNr ctermfg=lightgray
hi CursorLine ctermfg=NONE ctermbg=255 cterm=NONE
else
set background=dark
hi CursorLine ctermfg=NONE ctermbg=234 cterm=NONE
hi LineNr ctermbg=NONE ctermfg=darkgray
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment