Skip to content

Instantly share code, notes, and snippets.

@snide
Last active December 20, 2022 23:22
Show Gist options
  • Save snide/7db6cd7e7d485c1906967c0f14ff8dfd to your computer and use it in GitHub Desktop.
Save snide/7db6cd7e7d485c1906967c0f14ff8dfd to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
set shell=fish
set noerrorbells " No beeps
set confirm " Ask to save changed buffers
set number " Show line numbers
set backspace=indent,eol,start " Makes backspace key more powerful.
set showcmd " Show me what I'm typing
set showmode " Show current mode.
set noswapfile " Don't use swapfile
set nobackup " Don't create annoying backup files
set splitright " Split vertical windows right to the current windows
set splitbelow " Split horizontal windows below to the current windows
set encoding=utf-8 " Set default encoding to UTF-8
set autowrite " Automatically save before :next, :make etc.
set autoread " Automatically reread changed files without asking me anything
au FocusGained * :checktime " This is needed for the above to work as well
set laststatus=2
set fileformats=unix,dos,mac " Prefer Unix over Windows over OS 9 formats
set showmatch " Do not show matching brackets by flickering
set incsearch " Shows the match while typing
set hlsearch " Highlight found searches
set ignorecase " Search case insensitive...
set smartcase " ... but not when search pattern contains upper case characters
set cmdheight=1 " Make the command prompt larger
set tabstop=2 " Use 2 spaces for tabs
set shiftwidth=2 " Shift by 2 spaces
set softtabstop=2 " Use 2 spaces for tabs
set expandtab " Use tabs for spaces
set nowrap " Don't word wrap
set autoindent " Try and figure out indedentation when possible
set foldmethod=indent
set foldlevelstart=20
set clipboard=unnamedplus " Allow system clipboard
set mouse=a " Mouse
set sessionoptions+=tabpages,globals " Remember tab names
set guioptions-=e " tab styling
set hidden " if hidden is not set, TextEdit might fail.
set nobackup " Some servers have issues with backup files, see #649
set nowritebackup
set updatetime=300 " You will have bad experience for diagnostic messages when it's default 4000.
set breakindent " Allows indentation to maintain when wrapping of long text happens.
set signcolumn=yes " always show signcolumns
set textwidth=0 " Fix for some goyo stuff
set undofile " Allows for persistant undo, even when closed
let mapleader = "\<Space>" " Leader as space
nnoremap x d
xnoremap x d
nnoremap xx dd
nnoremap X D
nnoremap <BS> :bprev<CR>
nnoremap <F12> :bnext<CR>
map <S-Tab> <C-W>
noremap <D-PageDown> :tabnext<CR>
noremap <D-PageUp> :tabprev<CR>
map <S-D-Right> vg_
map! <S-D-Right> <esc>vg_
map <S-D-Left> v^
map! <S-D-Left> <esc>v^
map <leader>f za
noremap <leader>w :bd<CR>
noremap <leader>q :qa<CR>
noremap <leader>q :qa<CR>
nnoremap <esc><esc> :noh<cr>
nnoremap <leader>pwd :let @+=expand("%:h")<CR>
nnoremap <up> <C-w><up>
nnoremap <down> <C-w><down>
nnoremap <left> <C-w><left>
nnoremap <right> <C-w><right>
nnoremap j gj
nnoremap k gk
nnoremap <A-j> 10j
nnoremap <A-k> 10k
vnoremap . :norm.<CR>
nnoremap <F11> >>
nnoremap <F10> <<
vnoremap <F11> >gv
vnoremap <F10> <gv
nnoremap U <C-r>
nnoremap <C-a> ggVG
syntax enable
set background=dark
highlight clear SignColumn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment