Skip to content

Instantly share code, notes, and snippets.

@SkylerLipthay
Created April 26, 2022 17:54
Show Gist options
  • Save SkylerLipthay/1b8800ec274e1f9d36a21dcbf21451be to your computer and use it in GitHub Desktop.
Save SkylerLipthay/1b8800ec274e1f9d36a21dcbf21451be to your computer and use it in GitHub Desktop.
" Text editing
set encoding=utf-8
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set backspace=indent,eol,start
set fileformat=unix
set fileformats=unix,dos
" Text wrapping
set cc=81
set tw=80
" Interface
set number
set foldmethod=marker
set hlsearch
noh
set incsearch
set ignorecase
set history=1000
set ruler
set showcmd
set showmatch
set spell
set mouse=a
set pastetoggle=<F2>
" Undo history
set undofile
set undodir=$HOME/.vim/undo
set undolevels=1000
set undoreload=10000
" Make sure swap/backup files are on the local hard drive
set directory=$HOME/.vim/swap
set backupdir=$HOME/.vim/backup
set nobackup
set noswapfile
" Default directory
cd $HOME
" Theming
syntax enable
" Window navigation
nnoremap <silent> <S-Left> <C-W><C-H>
nnoremap <silent> <S-Down> <C-W><C-J>
nnoremap <silent> <S-Up> <C-W><C-K>
nnoremap <silent> <S-Right> <C-W><C-L>
" Traditional meta commands
nnoremap <silent> <C-W> :q<cr>
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <ESC>"+pa
map <C-s> :w<CR>
imap <C-s> <Esc>:w<CR>a
map <C-a> ggVG$
imap <C-a> <Esc>ggVG$
map <C-Tab> :BufExplorer<CR><Down><CR>
map <C-t> :tabe<CR>
imap <C-t> <Esc>:tabe
map <S-Tab> :tabn<CR>
imap <S-Tab> <Esc>:tabn<CR>
map <S-C-Tab> :tabp<CR>
imap <S-C-Tab> <Esc>:tabn<CR>
" Disable middle-click pasting
map <MiddleMouse> <Nop>
imap <MiddleMouse> <Nop>
map <2-MiddleMouse> <Nop>
imap <2-MiddleMouse> <Nop>
map <3-MiddleMouse> <Nop>
imap <3-MiddleMouse> <Nop>
map <4-MiddleMouse> <Nop>
imap <4-MiddleMouse> <Nop>
autocmd FileType rust setlocal shiftwidth=4 tabstop=4 cc=101 tw=100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment