Skip to content

Instantly share code, notes, and snippets.

@LemonPi
Last active September 9, 2020 21:47
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 LemonPi/3ab4a3d2a0cd4208915a to your computer and use it in GitHub Desktop.
Save LemonPi/3ab4a3d2a0cd4208915a to your computer and use it in GitHub Desktop.
vimrc
" Remember to install Vundle with git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" 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()
" let Vundle manage Vundle, required
" Plugin 'gmarik/Vundle.vim'
" Plugin 'itchyny/vim-haskell-indent'
" more Plugin commands
" all Plugins must be added before the following line
" call vundle#end() " required
" filetype plugin indent on " required
" Remember to install plugins with :PluginInstall inside vim
syntax enable " Syntax highlighting, yes please
set number " Shows line numbers, use :# to jump to line #
set scrolloff=5 " Maintain >5 lines from top and bot of terminal for readability
set history=400 " Command history so you can undo your doodoo
set sw=4 ts=4 " Shift width and tabstop to 4 spaces to make nesting easier on the eyes
set hidden " Hides instead of closes your buffers when opening new files so you can go back to a previous buffer
set hlsearch " Highlights all search matches (search for something impossible to find to make highlighting go away ex. /laskdj.wqrj)
set expandtab " Tabs become spaces :D
set smarttab
set smartindent
set autoindent
set copyindent " Next line starts at same indent level
set shiftround " Shifting by > and < uses sw rather than ts
set nobackup noswapfile " No backup and swap for me please... (really annoying and only marginally useful)
set ignorecase smartcase " Ignores case during search only when the search term is all lowercase (ex. apple matches AppLE and APPLE while Apple matches only Apple)
set incsearch " Incremental search - searches as you type the search term to match earlier substrings
set nowrap
vmap <C-y> :w! ~/.vbuf<CR> " ctrl-y to copy visual selection (shift-v) into temp file
nmap <C-y> :.w! ~/.vbuf<CR> " Same deal but in normal mode
nmap <C-p> :r ~/.vbuf<CR> " Paste from the temporary file
nmap <C-h> :bp<CR> " buffer maneouvering
nmap <C-l> :bn<CR>
nmap <C-a> :ls<CR>
"moving lines up and down
nmap <C-j> :m+<CR>==
nmap <C-k> :m-2<CR>==
imap <C-j> <Esc>:m .+1<CR>==gi
imap <C-k> <Esc>:m .-2<CR>==gi
vmap <C-j> :m '>+1<CR>gv=gv
vmap <C-k> :m '<-2<CR>gv=gv
set pastetoggle=<F3> " allow copy pasting without spacing issues toggle while in insert mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment